/* ==============================================
   THEME: Verdant Folio
   Visual DNA: Tea House template
   Palette: organic greens, warm earth, dark accents
   Typography: serif display + sans body (system stacks)
   ============================================== */

:root {
  --primary: #6E9B3A;
  --primary-light: #88B44E;
  --primary-pale: #F5F8F0;
  --primary-overlay: rgba(110, 155, 58, 0.85);
  --primary-overlay-light: rgba(110, 155, 58, 0.08);
  --secondary: #D4913A;
  --dark: #252C30;
  --dark-soft: #2F3840;
  --light: #F6F8F3;
  --muted: #B0B9AE;
  --body-color: #4A5250;
  --white: #FFFFFF;
  --font-display: Georgia, "Times New Roman", "Noto Serif", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --container: 1140px;
  --container-narrow: 780px;
  --gap: 2rem;
  --radius: 4px;
}

/* ============= RESET & BASE ============= */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--body-color);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--primary); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--dark); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--dark);
  line-height: 1.25;
  font-weight: 700;
}

/* ============= UTILITIES ============= */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: 5rem 0;
}

/* ============= BUTTONS ============= */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.85rem 2.2rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.4s ease;
  text-align: center;
}

.btn-pill {
  border-radius: 50px;
}

.btn-light {
  background: var(--white);
  color: var(--dark);
  border-color: var(--white);
}
.btn-light:hover {
  background: var(--dark);
  color: var(--white);
  border-color: var(--dark);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--dark);
  color: var(--white);
  border-color: var(--dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

/* ============= HEADER / NAVBAR ============= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: box-shadow 0.3s;
}

.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.header-brand {
  display: flex;
  align-items: center;
}

.header-logo {
  max-height: 52px;
  width: auto;
}

.header-brand-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.01em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.main-nav .nav-link {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dark);
  padding: 0.5rem 1rem;
  position: relative;
  transition: color 0.3s;
}

.main-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.25rem;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.main-nav .nav-link:hover { color: var(--primary); }
.main-nav .nav-link:hover::after { transform: scaleX(1); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1010;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--dark);
  transition: all 0.3s;
}

.nav-toggle.active .nav-toggle-bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active .nav-toggle-bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 6rem 2rem 2rem;
    gap: 0;
    box-shadow: -4px 0 30px rgba(0,0,0,0.1);
    transition: right 0.35s ease;
    overflow-y: auto;
  }

  .main-nav.open { right: 0; }

  .main-nav .nav-link {
    padding: 0.75rem 0;
    width: 100%;
    border-bottom: 1px solid var(--light);
  }

  .main-nav .nav-link::after { display: none; }
}

/* ============= SECTION HEADINGS (DNA: decorated title) ============= */

.section-label {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.section-label--light { color: var(--white); }

.section-title {
  font-size: 2rem;
  margin-bottom: 0;
}

.section-title.decorated {
  position: relative;
  padding-bottom: 1.75rem;
  margin-bottom: 2.5rem;
}

.section-title.decorated::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 45%;
  height: 2px;
  background: var(--primary);
}

.section-title.decorated::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  bottom: -6px;
  left: calc(22.5% - 7px);
  background: var(--dark);
  border: 4px solid var(--white);
  border-radius: 50%;
}

.section-title.decorated--center::before {
  left: 27.5%;
}

.section-title.decorated--center::after {
  left: calc(50% - 7px);
}

.section-heading--center {
  text-align: center;
}

@media (max-width: 768px) {
  .section-title { font-size: 1.65rem; }
  .section { padding: 3.5rem 0; }
}

/* ============= HERO ============= */

.hero-section {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 80%, rgba(110,155,58,0.35) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(212,145,58,0.15) 0%, transparent 50%),
    linear-gradient(160deg, var(--primary) 0%, #5C8732 60%, var(--dark) 100%);
  opacity: 0.92;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: 4rem 1.5rem;
  text-align: center;
}

.hero-label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.75rem;
  color: var(--white);
  margin-bottom: 1.25rem;
  line-height: 1.15;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.hero-subtitle p { margin-bottom: 0.5rem; }

@media (max-width: 768px) {
  .hero-section { min-height: 420px; }
  .hero-title { font-size: 2rem; }
  .hero-content { padding: 3rem 1.25rem; }
}

@media (min-width: 1024px) {
  .hero-title { font-size: 3.25rem; }
}

/* ============= PAGE HERO ============= */

.page-hero {
  position: relative;
  padding: 5rem 0 4rem;
  background: var(--primary);
  overflow: hidden;
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--primary) 0%, #5C8732 60%, var(--dark) 100%);
  opacity: 0.9;
}

.page-hero .container {
  position: relative;
  z-index: 2;
}

.page-hero-title {
  font-size: 2.5rem;
  color: var(--white);
  max-width: 700px;
}

.post-hero-date {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  color: rgba(255,255,255,0.7);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .page-hero { padding: 3.5rem 0 3rem; }
  .page-hero-title { font-size: 1.85rem; }
}

/* ============= POSTS GRID ============= */

.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .posts-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .posts-grid .post-card:first-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 0;
  }

  .posts-grid .post-card:first-child .post-card-image {
    height: 100%;
    object-fit: cover;
  }

  .posts-grid .post-card:first-child .post-card-body {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 640px) {
  .blog-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .blog-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ============= POST CARD ============= */

.post-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  transition: box-shadow 0.35s, transform 0.35s;
}

.post-card:hover {
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}

.post-card-image-link {
  display: block;
  overflow: hidden;
}

.post-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .post-card-image {
  transform: scale(1.04);
}

.post-card-body {
  padding: 1.75rem;
}

.post-card-date {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 0.6rem;
}

.post-card-title {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.post-card-title a {
  color: var(--dark);
  transition: color 0.3s;
}

.post-card-title a:hover { color: var(--primary); }

.post-card-excerpt {
  font-size: 0.925rem;
  color: var(--body-color);
  margin-bottom: 1.25rem;
  line-height: 1.65;
}

.post-card-excerpt p { margin-bottom: 0; }

/* ============= TOPICS SECTION (DNA: full-width overlay) ============= */

.section-topics {
  position: relative;
  background: var(--primary);
  color: var(--white);
  overflow: hidden;
}

.section-topics-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(110,155,58,0.95) 0%, rgba(92,135,50,0.9) 50%, rgba(37,44,48,0.85) 100%);
}

.section-topics .container {
  position: relative;
  z-index: 2;
}

.section-topics .section-title {
  color: var(--white);
}

.section-topics .section-title.decorated::after {
  border-color: var(--primary);
  background: var(--white);
}

.topics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .topics-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .topics-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.topic-card {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 2rem;
  transition: background 0.35s, border-color 0.35s;
}

.topic-card:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.3);
}

.topic-card-name {
  font-size: 1.15rem;
  color: var(--white);
  margin-bottom: 0.75rem;
  position: relative;
  padding-bottom: 0.75rem;
}

.topic-card-name::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background: rgba(255,255,255,0.4);
}

.topic-card-desc {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.65;
}

.topic-card-desc p { margin-bottom: 0; }

/* ============= FAQ SECTION (DNA: asymmetric two-column) ============= */

.section-faq {
  background: var(--light);
}

.faq-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .faq-layout {
    grid-template-columns: 5fr 7fr;
    gap: 4rem;
    align-items: start;
  }
}

.faq-intro {
  font-size: 1rem;
  color: var(--body-color);
  line-height: 1.7;
}

.faq-item {
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.faq-item:first-child {
  border-top: 1px solid rgba(0,0,0,0.08);
}

.faq-question {
  display: block;
  padding: 1.25rem 2.5rem 1.25rem 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark);
  cursor: pointer;
  list-style: none;
  position: relative;
  transition: color 0.3s;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-question::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-body);
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--primary);
  transition: transform 0.3s;
}

.faq-item[open] .faq-question::after {
  content: "−";
}

.faq-item[open] .faq-question {
  color: var(--primary);
}

.faq-question:hover { color: var(--primary); }

.faq-answer {
  padding: 0 0 1.5rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--body-color);
}

.faq-answer p { margin-bottom: 0.75rem; }
.faq-answer p:last-child { margin-bottom: 0; }

/* ============= POST COVER (single post with image) ============= */

.post-cover {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.post-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(37,44,48,0.85) 0%, rgba(37,44,48,0.2) 60%, transparent 100%);
  z-index: 1;
}

.post-cover-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 3rem 0;
}

.post-cover-date {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  color: rgba(255,255,255,0.7);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.post-cover-title {
  font-size: 2.5rem;
  color: var(--white);
  max-width: 700px;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .post-cover { min-height: 300px; }
  .post-cover-title { font-size: 1.75rem; }
}

/* ============= PROSE (article content) ============= */

.post-lead {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--dark-soft);
  line-height: 1.7;
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--primary);
  position: relative;
}

.post-lead::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 20%;
  width: 14px;
  height: 14px;
  background: var(--dark);
  border: 4px solid var(--white);
  border-radius: 50%;
}

.post-lead p { margin-bottom: 0.5rem; }
.post-lead p:last-child { margin-bottom: 0; }

.prose h1 { font-size: 2rem; margin: 2.5rem 0 1rem; }
.prose h2 { font-size: 1.6rem; margin: 2.25rem 0 0.85rem; }
.prose h3 { font-size: 1.3rem; margin: 2rem 0 0.75rem; }
.prose h4 { font-size: 1.1rem; margin: 1.75rem 0 0.6rem; }

.prose p { margin-bottom: 1.25rem; }

.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.prose li { margin-bottom: 0.35rem; }

.prose blockquote {
  border-left: 3px solid var(--primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--primary-pale);
  font-style: italic;
  color: var(--dark-soft);
}

.prose img {
  margin: 1.5rem 0;
  border-radius: var(--radius);
}

.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose a:hover { color: var(--dark); }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.925rem;
}

.prose th, .prose td {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0,0,0,0.08);
  text-align: left;
}

.prose th {
  background: var(--light);
  font-weight: 600;
  color: var(--dark);
}

/* ============= PAGINATION ============= */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3.5rem;
  flex-wrap: wrap;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 50px;
  transition: all 0.3s;
}

.pagination-link:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.pagination-link--active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.pagination-prev,
.pagination-next {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 1.25rem;
}

/* ============= FOOTER (DNA: dark bg, muted text, pill links) ============= */

.site-footer {
  background: var(--dark);
  color: var(--muted);
  margin-top: 0;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
  }
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 0.75rem;
}

.footer-tagline {
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 1rem;
  max-width: 380px;
}

.footer-email {
  display: inline-block;
  color: var(--muted);
  font-size: 0.925rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding-bottom: 2px;
  transition: color 0.3s, border-color 0.3s;
}

.footer-email:hover {
  color: var(--white);
  border-color: var(--white);
}

.footer-nav-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 1rem;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-nav-link {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.25rem 0;
  transition: color 0.3s, letter-spacing 0.3s;
}

.footer-nav-link:hover {
  color: var(--white);
  letter-spacing: 0.5px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  background: #222;
}

.footer-bottom-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  font-size: 0.825rem;
  color: var(--muted);
  text-align: center;
}

/* ============= ANIMATIONS ============= */

@media (prefers-reduced-motion: no-preference) {
  .post-card,
  .topic-card,
  .faq-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.5s ease forwards;
  }

  .post-card:nth-child(1) { animation-delay: 0.05s; }
  .post-card:nth-child(2) { animation-delay: 0.12s; }
  .post-card:nth-child(3) { animation-delay: 0.19s; }
  .post-card:nth-child(4) { animation-delay: 0.26s; }
  .post-card:nth-child(5) { animation-delay: 0.33s; }

  .topic-card:nth-child(1) { animation-delay: 0.05s; }
  .topic-card:nth-child(2) { animation-delay: 0.12s; }
  .topic-card:nth-child(3) { animation-delay: 0.19s; }
  .topic-card:nth-child(4) { animation-delay: 0.26s; }
  .topic-card:nth-child(5) { animation-delay: 0.33s; }
  .topic-card:nth-child(6) { animation-delay: 0.40s; }

  .faq-item:nth-child(1) { animation-delay: 0.05s; }
  .faq-item:nth-child(2) { animation-delay: 0.1s; }
  .faq-item:nth-child(3) { animation-delay: 0.15s; }
  .faq-item:nth-child(4) { animation-delay: 0.2s; }
  .faq-item:nth-child(5) { animation-delay: 0.25s; }
  .faq-item:nth-child(6) { animation-delay: 0.3s; }

  .hero-content {
    animation: fadeUp 0.7s ease 0.15s both;
  }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ============= FOCUS STYLES ============= */

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============= SKIP LINK ============= */

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
  border-radius: 0 0 var(--radius) var(--radius);
}

.skip-link:focus { top: 0; }
