/* Poetry Heritage — main stylesheet */

:root {
  /* Typography scale (base = 17px at default root) */
  --text-base: 1.0625rem; /* 17px — body, paragraphs, card copy */
  --text-sm: 0.875rem; /* 14px — metadata, uppercase labels (floor) */
  --text-nav: 1.0625rem; /* 17px — header navigation */
  --text-nav-footer: 1rem; /* 16px — footer nav & legal links */
  --text-footer-meta: 1rem; /* 16px — copyright, disclaimer */
  --text-btn: 1.0625rem; /* 17px — buttons (min 16px) */
  --text-heading-card: 1.3125rem; /* 21px — card / list titles */
  --text-heading-section: clamp(1.625rem, 3vw, 2rem); /* section h2 */
  --text-heading-spotlight: 1.5rem; /* spotlight h3 */
  --text-heading-hero: clamp(1.875rem, 5vw, 2.75rem);

  --color-primary: #2c3f2c;
  --color-secondary: #c99b9b;
  --color-bg-light: #f5f5f0;
  --color-bg-warm: #e5e2db;
  --color-footer: #3f4319;
  --color-text: #2a2a26;
  --color-text-muted: #5c5c56;
  --color-text-on-dark: #f5f5f0;
  --color-text-on-dark-muted: #d4d4c8;
  --color-white: #ffffff;
  --font-serif: "Cormorant Garamond", "Georgia", "Times New Roman", serif;
  --font-body: "Source Serif 4", "Georgia", serif;
  --font-sans: "Source Sans 3", system-ui, sans-serif;
  --shadow-soft: 0 4px 24px rgba(44, 63, 44, 0.08);
  --shadow-card: 0 2px 12px rgba(44, 63, 44, 0.06);
  --shadow-header: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: auto;
  --transition: 0.25s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg-light);
  -webkit-font-smoothing: antialiased;
}

/* Body-sized content inherits base unless a heading/label/meta rule applies */
p,
li,
blockquote,
.spotlight-card p:not(.spotlight-meta):not(.poem-title):not(.spotlight-text),
.spotlight-text,
.card-body p,
.section-header p,
.hero-lead,
.footer-column p {
  font-size: var(--text-base);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover,
a:focus-visible {
  color: var(--color-secondary);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-primary);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1rem;
  background: var(--color-primary);
  color: var(--color-text-on-dark);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 1rem;
}

/* ========== Header ========== */
.site-header {
  background: var(--color-bg-light);
  border-bottom: 1px solid rgba(44, 63, 44, 0.12);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header--heritage {
  background:
    linear-gradient(180deg, #fafaf6 0%, var(--color-bg-light) 100%);
  box-shadow: var(--shadow-header), 0 2px 16px rgba(44, 63, 44, 0.04);
}

.header-ornament--top {
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(201, 155, 155, 0.35) 25%,
    var(--color-primary) 50%,
    rgba(201, 155, 155, 0.35) 75%,
    transparent 100%
  );
  opacity: 0.85;
}

.header-brand {
  text-align: center;
  padding: 0 1.25rem 0.5rem;
}

.brand-lockup {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.brand-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.brand-feather {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  color: var(--color-secondary);
  filter: drop-shadow(0 1px 2px rgba(44, 63, 44, 0.1));
}

.brand-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.875rem, 4.5vw, 2.625rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-primary);
}

.brand-tagline {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Navigation */
.nav-toggle {
  display: none;
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(44, 63, 44, 0.2);
  border-radius: var(--radius-sm);
  background: var(--color-bg-warm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  border-top: 1px solid rgba(44, 63, 44, 0.1);
  background: linear-gradient(180deg, var(--color-bg-warm) 0%, #e0ddd5 100%);
}

.nav-list {
  list-style: none;
  margin: 0;
  /*padding: 0.65rem 1rem 0.85rem;*/
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 0.35rem;
  max-width: var(--max-width);
  margin-inline: auto;
}

.nav-list a {
  display: block;
  padding: 0.5rem 0.8rem;
  font-family: var(--font-sans);
  font-size: var(--text-nav);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  border-radius: 2px;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.nav-list a:hover,
.nav-list a:focus-visible {
  background: rgba(255, 255, 255, 0.45);
  border-color: rgba(44, 63, 44, 0.08);
  color: var(--color-primary);
}

.nav-list a[aria-current="page"] {
  background: rgba(44, 63, 44, 0.1);
  border-color: rgba(44, 63, 44, 0.12);
  color: var(--color-primary);
  font-weight: 600;
}

.site-header--heritage .header-search {
  padding-bottom: 0.65rem;
}

.site-header--heritage .header-search-input {
  border-radius: 2px;
  border-color: rgba(44, 63, 44, 0.18);
  background: rgba(255, 255, 255, 0.85);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

.site-header--heritage .header-search-submit {
  border-radius: 2px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: clamp(420px, 65vh, 580px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-bg-warm);
}

.hero-collage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 4px;
  opacity: 0.35;
}

.hero-collage-item {
  overflow: hidden;
  background: var(--color-bg-warm);
}

.hero-collage-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(40%) sepia(15%);
}

.hero-collage-item:nth-child(odd) {
  grid-row: span 2;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(245, 245, 240, 0.92) 0%,
    rgba(44, 63, 44, 0.75) 50%,
    rgba(229, 226, 219, 0.88) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 3rem 1.5rem;
  max-width: 720px;
}

.hero-content h1,
.hero-content h2 {
  margin: 0 0 1rem;
  font-size: var(--text-heading-hero);
  font-weight: 600;
  color: var(--color-primary);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.hero-content .hero-lead {
  margin: 0 0 2rem;
  color: var(--color-text);
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: var(--text-btn);
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-on-dark);
  border-color: var(--color-primary);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #243528;
  color: var(--color-text-on-dark);
  border-color: #243528;
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--color-primary);
  color: var(--color-text-on-dark);
}

/* ========== Sections ========== */
.section {
  padding: 3.5rem 0;
}

.section:nth-child(even) {
  background: var(--color-bg-warm);
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  margin: 0 0 0.5rem;
  font-size: var(--text-heading-section);
}

.section-header p {
  margin: 0;
  color: var(--color-text-muted);
  max-width: 560px;
  margin-inline: auto;
}

.section-link {
  text-align: center;
  margin-top: 2rem;
}

.section-link a {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-base);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Spotlight cards (Poet/Poem of the day) */
.spotlight-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .spotlight-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.spotlight-card {
  background: var(--color-white);
  border: 1px solid rgba(44, 63, 44, 0.1);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.spotlight-card--featured {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .spotlight-card--featured {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 2rem;
    align-items: start;
  }
}

.spotlight-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: fill;
  margin: 0 auto 1.25rem;
  border: 3px solid var(--color-bg-warm);
  box-shadow: var(--shadow-soft);
}

@media (min-width: 768px) {
  .spotlight-card--featured .spotlight-avatar {
    margin: 0;
    width: 140px;
    height: 140px;
  }
}

.spotlight-label {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: 0.5rem;
}

.spotlight-card h3 {
  margin: 0 0 0.35rem;
  font-size: var(--text-heading-spotlight);
}

.spotlight-meta {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.spotlight-excerpt,
.poem-excerpt {
  font-style: italic;
  color: var(--color-text);
  margin: 0 0 1rem;
  border-left: 3px solid var(--color-secondary);
  padding-left: 1rem;
}

.poem-title {
  font-family: var(--font-serif);
  font-size: var(--text-heading-card);
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 0.5rem;
}

/* Card grids */
.card-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.card {
  background: var(--color-white);
  border: 1px solid rgba(44, 63, 44, 0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.card-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg-warm);
}

a.card-image {
  display: block;
  text-decoration: none;
}

.card-body h3 a {
  color: var(--color-primary);
  text-decoration: none;
}

.card-body h3 a:hover {
  color: var(--color-secondary);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-body {
  padding: 1.25rem;
}

.card-body h3 {
  margin: 0 0 0.35rem;
  font-size: var(--text-heading-card);
}

.card-body p {
  margin: 0;
  color: var(--color-text-muted);
}

/* Browse chips */
.browse-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.browse-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  padding: 1.25rem 1rem;
  background: var(--color-white);
  border: 1px solid rgba(44, 63, 44, 0.12);
  border-radius: var(--radius-md);
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
}

.browse-chip:hover,
.browse-chip:focus-visible {
  border-color: var(--color-secondary);
  background: rgba(201, 155, 155, 0.08);
  color: var(--color-primary);
}

.browse-chip strong {
  font-family: var(--font-serif);
  font-size: var(--text-heading-card);
  color: var(--color-primary);
  display: block;
  margin-bottom: 0.25rem;
}

.browse-chip span {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Poem list */
.poem-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .poem-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.poem-list-item {
  background: var(--color-white);
  border: 1px solid rgba(44, 63, 44, 0.1);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  transition: border-color var(--transition);
}

.poem-list-item:hover {
  border-color: rgba(201, 155, 155, 0.5);
}

.poem-list-item a {
  font-family: var(--font-serif);
  font-size: var(--text-heading-card);
  font-weight: 600;
  color: var(--color-primary);
}

.poem-list-item .poem-meta {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 0.35rem;
}

/* ========== Footer ========== */
.site-footer {
  background: var(--color-footer);
  color: var(--color-text-on-dark);
  padding: 3rem 0 1.5rem;
  position: relative;
}

.site-footer--heritage {
  padding-top: 0;
}

.footer-ornament {
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(201, 155, 155, 0.5) 20%,
    rgba(245, 245, 240, 0.4) 50%,
    rgba(201, 155, 155, 0.5) 80%,
    transparent
  );
}

.site-footer--heritage .container {
  padding-top: 2.75rem;
}

.footer-feather {
  display: block;
  margin: 0 auto 0.75rem;
  opacity: 0.85;
  filter: brightness(1.15);
}

.site-footer a {
  color: var(--color-text-on-dark-muted);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--color-secondary);
}

.footer-brand {
  text-align: center;
  margin-bottom: 2.25rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(245, 245, 240, 0.12);
}

.footer-brand .brand-name {
  color: var(--color-text-on-dark);
  font-size: clamp(1.625rem, 3vw, 2rem);
  letter-spacing: 0.05em;
  margin: 0 0 0.35rem;
}

.footer-brand .brand-tagline {
  color: var(--color-text-on-dark-muted);
  letter-spacing: 0.14em;
  font-size: var(--text-sm);
  text-transform: uppercase;
  margin: 0;
}

.footer-nav {
  margin-bottom: 2rem;
}

.footer-nav .nav-list {
  background: transparent;
  padding: 0;
}

.footer-nav .nav-list a {
  color: var(--color-text-on-dark-muted);
  font-size: var(--text-nav-footer);
}

.footer-nav .nav-list a:hover,
.footer-nav .nav-list a:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-on-dark);
}

.footer-columns {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-columns {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    text-align: left;
  }
}

.footer-column h4 {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin: 0 0 1rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  font-family: var(--font-sans);
  font-size: var(--text-nav-footer);
}

.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

@media (min-width: 768px) {
  .social-links {
    justify-content: flex-start;
  }
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(245, 245, 240, 0.25);
  border-radius: 50%;
  color: var(--color-text-on-dark);
  transition: background var(--transition), border-color var(--transition);
}

.social-links a:hover,
.social-links a:focus-visible {
  background: rgba(201, 155, 155, 0.2);
  border-color: var(--color-secondary);
  color: var(--color-text-on-dark);
}

.social-links svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-disclaimer,
.footer-copyright {
  font-family: var(--font-sans);
  font-size: var(--text-footer-meta);
  line-height: 1.65;
  color: var(--color-text-on-dark-muted);
  text-align: center;
  max-width: 42rem;
  margin: 0 auto 1rem;
}

.footer-disclaimer {
  font-size: 0.9375rem;
  padding: 0 0.5rem;
}

.footer-column p {
  font-family: var(--font-sans);
  color: var(--color-text-on-dark-muted);
  line-height: 1.6;
  margin: 0;
}

.footer-column p:not(:last-child) {
  margin-bottom: 0.75rem;
}

.footer-divider {
  border: none;
  border-top: 1px solid rgba(245, 245, 240, 0.15);
  margin: 2rem 0 1.5rem;
}

/* ========== Mobile ========== */
.header-inner {
  position: relative;
}

@media (max-width: 900px) {
  .site-header {
    position: relative;
  }

  .header-inner {
    padding-right: 3.5rem;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    border-top: none;
  }

  .site-nav.is-open {
    display: block;
    border-top: 1px solid rgba(44, 63, 44, 0.1);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1rem 1rem;
  }

  .nav-list a {
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: var(--text-nav);
  }

  .hero-collage {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, 1fr);
  }
}

@media (max-width: 480px) {
  :root {
    --text-nav: 1rem; /* 16px — header nav on small screens */
  }

  .header-brand {
    padding-top: 1.25rem;
  }

  .brand-feather {
    width: 22px;
    height: 22px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}
