/* ============================================================================
   Typography Imports
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&display=swap');

/* ============================================================================
   Color Variables
   ============================================================================ */
:root {
  --color-header: #1b4d2e;      /* Rich dark green */
  --color-text: #000000;         /* Black */
  --color-background: #f5f1ed;   /* Eggshell gray */
  --color-border: #d4cfc9;       /* Lighter eggshell for borders */
}

/* ============================================================================
   Reset & Base Styles
   ============================================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Public Sans', sans-serif;
  color: var(--color-text);
  background-color: var(--color-background);
  line-height: 1.6;
  letter-spacing: 0.3px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================================================
   Header & Navigation
   ============================================================================ */
header {
  background-color: var(--color-header);
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar {
  padding: 1.5rem 0;
}

.navbar-container {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
  display: flex;
  align-items: center;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-background);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.site-title:hover {
  opacity: 0.9;
}

.logo-tombcgh {
  font-family: 'PT Serif', serif;
}

.logo-tech {
  font-family: 'Public Sans', sans-serif;
  font-weight: normal; /* Ensure it's not bold */
}

.logo-square {
  font-family: 'Courier New', monospace; /* Monospace font for terminal look */
  font-size: 1.2em; /* Adjust size of the square */
  vertical-align: middle;
  line-height: 0;
  margin-left: 0.1em;
}

.nav-menu {
  display: flex;
  align-items: center; /* Vertically center nav items */
  list-style: none;
  gap: 1.5rem;
  padding-left: 0;
  margin-left: auto; /* Pushes the nav menu to the right */
}

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--color-background);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  font-family: 'Public Sans', sans-serif;
  font-size: 1rem;
  transition: opacity 0.2s ease;
  display: block;
}

.nav-link:hover {
  opacity: 0.8;
}

.nav-trigger {
  border: none;
  background: none;
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--color-background);
  border: 2px solid var(--color-header);
  border-radius: 4px;
  list-style: none;
  min-width: 200px;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
  pointer-events: none;
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--color-text);
  text-decoration: none;
  transition: background-color 0.2s ease;
  text-underline-offset: 0;
}

.dropdown-menu a:hover {
  background-color: var(--color-border);
  opacity: 1;
}

/* ============================================================================
   Blog Styling
   ============================================================================ */
.blog-list {
  margin-top: 3rem;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-item {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.post-item:last-child {
  border-bottom: none;
}

.post-title {
  font-size: 1.5rem;
  font-family: 'PT Serif', serif;
  color: var(--color-header);
  text-decoration: none;
  margin-bottom: 0.5rem;
  display: block;
}

.post-title:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.post-date {
  font-size: 0.95rem;
  color: #666;
  display: block;
  margin-bottom: 0.75rem;
  font-style: italic;
}

.post-excerpt {
  font-size: 1rem;
  color: #333;
  margin: 0.75rem 0 0 0;
  line-height: 1.6;
}

/* ============================================================================
   Listening & Blog List Styles
   ============================================================================ */

.post-list,
.listen-list {
  list-style: none;
  padding: 0;
}

.post-item,
.listen-item {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: box-shadow 0.2s ease;
}

.post-item:hover,
.listen-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.post-title,
.listen-title {
  color: var(--color-header);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.post-title:hover,
.listen-title:hover {
  text-decoration: underline;
}

.post-date,
.listen-date {
  display: block;
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.post-excerpt,
.listen-excerpt {
  color: #333;
  margin: 0.75rem 0;
  line-height: 1.6;
}

.listen-artist,
.listen-type {
  margin: 0.5rem 0;
  font-size: 0.95rem;
  color: #555;
}

.listen-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.listen-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--color-header);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

.listen-link:hover {
  opacity: 0.85;
}

.listen-recommendations {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.listen-recommendations p {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.listen-recommendations ul {
  margin-left: 1.5rem;
  padding: 0;
}

.listen-recommendations li {
  margin-bottom: 0.25rem;
  color: #555;
}

.listen-subtitle {
  font-size: 0.9rem;
  color: #666;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  font-style: italic;
}

/* Mobile navigation adjustments */
@media (max-width: 768px) {
  .nav-menu {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .dropdown-menu {
    position: absolute;
    min-width: 160px;
  }
}

/* ============================================================================
   Headings
   ============================================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: 'PT Serif', serif;
  color: var(--color-header);
  font-weight: 700;
  margin: 1.5rem 0 0.75rem 0;
  line-height: 1.3;
}

h1 {
  font-size: 2.5rem;
  margin-top: 0;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1.1rem;
}

/* ============================================================================
   Container Layout - Centre Third / Max-Width
   ============================================================================ */
main,
article,
.container {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
  flex: 1;
}

/* ============================================================================
   Typography Elements
   ============================================================================ */
p {
  margin-bottom: 1rem;
}

a {
  color: var(--color-header);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

a:hover {
  opacity: 0.8;
}

strong, b {
  font-weight: 600;
}

em, i {
  font-style: italic;
}

code,
pre {
  background-color: #ede9e5;
  font-family: 'Courier New', monospace;
  border-radius: 4px;
}

code {
  padding: 0.2em 0.4em;
  font-size: 0.9em;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

blockquote {
  border-left: 4px solid var(--color-header);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: #555;
  font-style: italic;
}

/* ============================================================================
   Lists
   ============================================================================ */
ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

/* ============================================================================
   Utility Classes
   ============================================================================ */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================================
   Link Preview Card
   ============================================================================ */
.link-preview-card {
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease-in-out;
}

.link-preview-card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.link-preview-card .preview-link {
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  flex-grow: 1;
}

.link-preview-card .preview-content {
  flex-grow: 1;
}

.link-preview-card h4 {
  font-family: 'Public Sans', sans-serif;
  font-size: 1.1rem;
  color: var(--color-header);
  margin: 0;
  text-decoration: none;
}

.link-preview-card .preview-url {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
  word-break: break-all;
}

.link-preview-card {
  max-width: 100%; /* Ensure it doesn't exceed parent width */
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.link-preview-card .preview-image {
  max-width: 120px; /* Set a max width for the image */
  height: auto;
  object-fit: cover;
  border-radius: 4px;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  main,
  article,
  .container {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  main,
  article,
  .container {
    padding: 1rem;
  }
}

/* ============================================================================
   Link Preview Cards
   ============================================================================ */

.link-preview-card {
  display: inline-block;
  width: 100%;
  max-width: 100%;
  margin: 0.75rem 0;
}

.preview-link {
  display: block;
  padding: 1rem;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.preview-link:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--color-header);
}

.preview-content {
  display: flex;
  flex-direction: column;
}

.preview-content h4 {
  color: var(--color-header);
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.preview-url {
  color: #666;
  font-size: 0.85rem;
  word-break: break-word;
  margin: 0;
  font-family: monospace;
}

/* ============================================================================
   Link Preview Card Styles
   ============================================================================ */
.link-preview-card {
  background-color: #f9f9f9;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow 0.2s ease;
}

.link-preview-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.preview-link {
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.preview-link h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: var(--color-header);
}

.preview-link .preview-url {
  font-size: 0.85rem;
  color: #666;
  word-break: break-all;
}

/* ============================================================================
   Responsive Design - Link Preview Card
   ============================================================================ */
@media (max-width: 768px) {
  .link-preview-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .link-preview-card .preview-image {
    max-width: 100%;
    height: auto;
  }

  .link-preview-card .preview-content {
    display: block;
  }

  .link-preview-card h4 {
    font-size: 1.2rem;
  }

  .link-preview-card .preview-url {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .link-preview-card {
    padding: 0.75rem;
  }

  .link-preview-card h4 {
    font-size: 1.1rem;
  }

  .link-preview-card .preview-url {
    font-size: 0.85rem;
  }
}

/* ============================================================================
   Site Logo
   ============================================================================ */
.site-logo {
  height: 3.5rem; /* Adjust as needed */
  width: auto;
  vertical-align: middle;
}

/* ============================================================================
   Forms
   ============================================================================ */
form {
  display: grid;
  gap: 1rem;
  max-width: 500px;
}

.form-group {
  display: grid;
  grid-template-columns: 1fr 3fr;
  align-items: center;
  gap: 1rem;
}

.form-group-stacked {
  grid-template-columns: 1fr;
}

label {
  font-weight: 500;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: inherit;
}

button[type="submit"] {
  padding: 0.75rem 1.5rem;
  background-color: var(--color-header);
  color: var(--color-background);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

button[type="submit"]:hover {
  opacity: 0.9;
}
