/* Modern and bold styling with strong visual hierarchy */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-primary: #1a1a1a;      /* Dark text for headings */
  --color-secondary: #4a4a4a;    /* Gray for secondary text */
  --color-accent: #c75b39;       /* Warm terracotta - links */
  --color-bg: #ffffff;           /* White background */
  --color-bg-alt: #f4e8dc;       /* Warm apricot beige - header/footer/sidebar */
  --color-border: #e5d4c1;       /* Soft warm border */
  --max-width: 1200px;
  --content-width: 800px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-primary);
  background: var(--color-bg);
}

/* Header & Navigation */
header {
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-border);
  padding: 1rem 1rem;
}

/* Homepage Hero */
.hero {
  background: linear-gradient(rgba(244, 232, 220, 0.6), rgba(244, 232, 220, 0.6)), url('/images/hero.jpg') center center / cover no-repeat;
  padding: 4rem 0;
  margin: 0 0 3rem 0;
  text-align: center;
  position: relative;
  min-height: 200px;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-credit {
  position: absolute;
  bottom: 0.5rem;
  right: 1rem;
  font-size: 0.75rem;
  color: rgba(26, 26, 26, 0.6);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

@media (min-width: 600px) {
  .hero {
    padding: 6rem 2rem;
    min-height: 280px;
  }
}

@media (min-width: 900px) {
  .hero {
    min-height: 350px;
  }
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 1rem;
  line-height: 1.2;
}

@media (min-width: 600px) {
  .hero h1 {
    font-size: 3rem;
  }
}

.hero p {
  font-size: 1.1rem;
  color: #4a4a4a;
  line-height: 1.6;
  margin: 0;
}

@media (min-width: 600px) {
  .hero p {
    font-size: 1.3rem;
  }
}

/* Navigation */

@media (min-width: 600px) {
  header {
    padding: 1.5rem 2rem;
  }
}

header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

header nav .logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  margin-right: auto;
}

@media (min-width: 600px) {
  header nav .logo {
    font-size: 2rem;
  }
}

header nav a:not(.logo) {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}

@media (min-width: 600px) {
  header nav a:not(.logo) {
    font-size: 1rem;
  }
}

header nav a:hover {
  color: var(--color-accent);
}

/* Main Content */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.homepage main {
  max-width: none;
  padding: 0;
}

@media (min-width: 600px) {
  main {
    padding: 3rem 2rem;
  }
  
  .homepage main {
    padding: 0;
  }
}

@media (min-width: 900px) {
  body:not(.homepage) main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
  }
}

article {
  max-width: var(--content-width);
}

.homepage article {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

@media (min-width: 600px) {
  .homepage article {
    padding: 3rem 2rem;
  }
}

@media (min-width: 900px) {
  article {
    max-width: none;
  }
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--color-secondary);
  margin-bottom: 1.5rem;
  padding: 0.75rem 0;
}

@media (min-width: 900px) {
  .breadcrumbs {
    grid-column: 1 / -1;
  }
}

/* Typography */
h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

@media (min-width: 600px) {
  h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
  }
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

@media (min-width: 600px) {
  h2 {
    font-size: 2rem;
  }
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

@media (min-width: 600px) {
  h3 {
    font-size: 1.5rem;
  }
}

p {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  color: var(--color-secondary);
}

@media (min-width: 600px) {
  p {
    font-size: 1.125rem;
  }
}

/* Lead paragraph - bold intro (ingress) */
article > header + section > p:first-child,
article > header + p,
article > header + figure + p {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.7;
  color: var(--color-primary);
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 600px) {
  article > header + section > p:first-child,
  article > header + p,
  article > header + figure + p {
    font-size: 1.35rem;
  }
}

/* Links */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.7;
}

/* Time stamps and author */
time {
  font-size: 0.95rem;
  color: var(--color-secondary);
  font-style: italic;
}

article > header time {
  display: block;
  margin-top: 0.5rem;
}

article > header .author {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: var(--color-secondary);
}

/* Lists */
ul {
  list-style: none;
  margin-bottom: 1.5rem;
}

ol {
  margin-bottom: 1.5rem;
}

/* Content lists (ol and ul within article body text) */
article section ol,
article section ul {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
  padding-left: 0;
}

article section ol {
  list-style: decimal;
}

article section ul {
  list-style: disc;
}

article section ol li,
article section ul li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* Homepage and hub article lists - override content list styling */
/* These have higher specificity due to more selectors */
main > article > section ul {
  list-style: none;
  padding: 0;
  margin-left: 0;
}

main > article > section ul li {
  padding: 1rem 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--color-border);
}

main > article > section ul li:last-child {
  border-bottom: none;
}

main > article > section ul li a {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}

main > article > section ul li a:hover {
  color: var(--color-accent);
}

main > article > section ul li p {
  margin-top: 0.5rem;
  margin-bottom: 0;
  color: var(--color-secondary);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  display: block;
  margin-bottom: 0.75rem;
}

/* Topic cluster buttons on homepage */
.topic-clusters ul li {
  display: block;
  margin-bottom: 0.75rem;
}

@media (min-width: 600px) {
  .topic-clusters ul li {
    display: inline-block;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
  }
}

.topic-clusters ul li a {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  background: var(--color-bg-alt);
  border-radius: 8px;
  display: block;
  transition: background 0.2s;
  text-align: center;
}

@media (min-width: 600px) {
  .topic-clusters ul li a {
    font-size: 1.2rem;
    display: inline-block;
  }
}

.topic-clusters ul li a:hover {
  background: var(--color-border);
}

/* Sidebar */
.sidebar-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

aside {
  padding: 1.5rem;
  background: var(--color-bg-alt);
  border-radius: 8px;
}

aside:not(.ad-sidebar):not(.ad-inline) {
  position: sticky;
  top: 1.5rem;
  height: fit-content;
}

aside h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

aside ul li {
  margin-bottom: 0.75rem;
}

aside a {
  font-size: 1rem;
}

/* Footer */
footer {
  background: var(--color-bg-alt);
  border-top: 2px solid var(--color-border);
  padding: 2rem 1rem 1.5rem;
  margin-top: 3rem;
}

@media (min-width: 600px) {
  footer {
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
  }
}

footer nav {
  max-width: var(--max-width);
  margin: 0 auto 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

@media (min-width: 600px) {
  footer nav {
    gap: 1.5rem;
    margin-bottom: 2rem;
  }
}

footer nav a {
  color: var(--color-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

@media (min-width: 600px) {
  footer nav a {
    font-size: 0.95rem;
  }
}

footer nav a:hover {
  color: var(--color-accent);
}

footer p {
  text-align: center;
  color: var(--color-secondary);
  font-size: 0.9rem;
  margin: 0;
}

/* Sections spacing */
section {
  margin-bottom: 2rem;
}

section:last-child {
  margin-bottom: 0;
}

/* Sitemap specific styling - nested lists with visual hierarchy */
.sitemap-section {
  margin-bottom: 3rem;
}

.sitemap-list {
  list-style: none;
  padding-left: 0;
}

.sitemap-list > li {
  margin-bottom: 1.5rem;
}

.sitemap-list > li > a {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary);
  display: block;
  margin-bottom: 0.5rem;
}

.sitemap-list ul {
  list-style: disc;
  padding-left: 2rem;
  margin-top: 0.5rem;
}

.sitemap-list ul li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.sitemap-list ul li a {
  color: var(--color-secondary);
  font-weight: normal;
}

/* Sub-hub links (have nested ul) slightly bolder */
.sitemap-list ul > li > a {
  font-weight: 500;
}

.sitemap-list ul li a:hover {
  color: var(--color-accent);
}

/* Homepage sections get more breathing room */
.homepage article > section {
  margin-bottom: 6rem;
}

.homepage article > section:last-child {
  margin-bottom: 0;
}

section:last-of-type {
  margin-bottom: 0;
}

.breadcrumbs a {
  color: var(--color-secondary);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.breadcrumbs span[aria-hidden] {
  margin: 0 0.5rem;
  color: var(--color-border);
}

.breadcrumbs span[aria-current] {
  color: var(--color-primary);
}

/* Featured Image (articles, hubs, recipes) */
.featured-image {
  margin: 1.5rem 0 2rem;
  background: var(--color-bg-alt);
  overflow: hidden;
}

.featured-image img {
  display: block;
  max-width: 100%;
  height: auto;
}

.featured-image .image-placeholder {
  background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--color-secondary);
  font-size: 1rem;
  font-style: italic;
}

@media (min-width: 600px) {
  .featured-image .image-placeholder {
    padding: 4rem 3rem;
  }
}

.featured-image figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--color-secondary);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

/* Ad Placeholders */
.ad-inline,
.ad-sidebar {
  padding: 1rem;
  background: var(--color-bg-alt);
  border: 2px dashed var(--color-border);
  border-radius: 8px;
  text-align: center;
}

.ad-inline {
  margin: 2rem auto;
  max-width: 728px;
}

.ad-sidebar {
  margin-top: 0;
}

@media (max-width: 768px) {
  .ad-inline .ad-content {
    font-size: 0.85rem;
  }
}

.ad-label {
  font-size: 0.75rem;
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.ad-content {
  color: var(--color-secondary);
  font-size: 0.9rem;
  padding: 2rem 1rem;
  background: #fff;
  border-radius: 4px;
  margin: 0;
}

/* Cookie Consent Banner - Modal with Overlay */
.consent-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.consent-content {
  background: #fff;
  border-radius: 12px;
  padding: 2.5rem;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.consent-content h2 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  color: var(--color-primary);
}

.consent-content p {
  margin: 0 0 1.5rem 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-secondary);
}

.consent-content a {
  color: var(--color-accent);
  text-decoration: underline;
}

.consent-content a:hover {
  color: #a84a2f;
}

.consent-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.consent-btn {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.consent-btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(199, 91, 57, 0.3);
}

.consent-btn-primary:hover {
  background: #a84a2f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(199, 91, 57, 0.4);
}

.consent-btn-secondary {
  background: var(--color-bg-alt);
  color: var(--color-primary);
  border: 2px solid var(--color-border);
}

.consent-btn-secondary:hover {
  background: var(--color-border);
  border-color: var(--color-secondary);
}

@media (max-width: 600px) {
  .consent-content {
    padding: 2rem 1.5rem;
  }

  .consent-content h2 {
    font-size: 1.25rem;
  }

  .consent-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
}
