/* ============================================
   VERDANT CHRONICLE — Theme Stylesheet
   Visual DNA: organic-food-website-template
   ============================================ */

:root {
  /* Color palette — same mood as source: earthy green primary, warm orange-red accent */
  --clr-primary: #3aA812;
  --clr-primary-dark: #2d8a0e;
  --clr-primary-light: #e8f5e0;
  --clr-secondary: #e8590c;
  --clr-secondary-light: #fff3ec;
  --clr-light: #f6f7fb;
  --clr-dark: #131313;
  --clr-text: #444444;
  --clr-text-light: #777777;
  --clr-white: #ffffff;
  --clr-border: rgba(0, 0, 0, 0.08);

  /* Typography — serif headings + sans body, matching source feel */
  --font-heading: Georgia, "Times New Roman", "Palatino Linotype", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Spacing */
  --section-py: 5.5rem;
  --section-py-sm: 3.5rem;
  --container-max: 1180px;
  --radius-pill: 50px;
  --radius-sm: 6px;
  --radius-md: 10px;

  /* Shadows */
  --shadow-card: 0 2px 30px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 8px 40px rgba(0, 0, 0, 0.10);
}

/* ---- 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: 16px;
  line-height: 1.7;
  color: var(--clr-text);
  background: var(--clr-white);
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  color: var(--clr-primary-dark);
}

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

h1 { font-size: 2.6rem; }
h2 { font-size: 2.1rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ---- UTILITY ---- */

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

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

/* ---- SECTION HEADER — double decorative lines (source DNA) ---- */

.section-label {
  position: relative;
  display: inline-block;
  padding-top: 22px;
  margin-bottom: 0.75rem;
}

.section-label::before,
.section-label::after {
  content: "";
  position: absolute;
  left: 0;
  height: 2px;
}

.section-label::before {
  top: 0;
  width: 50px;
  background: var(--clr-primary);
}

.section-label::after {
  top: 9px;
  width: 75px;
  background: var(--clr-secondary);
}

.section-label--center {
  display: block;
  text-align: center;
}

.section-label--center::before,
.section-label--center::after {
  left: 50%;
  transform: translateX(-50%);
}

/* ---- BUTTONS — rounded-pill style (source DNA) ---- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.35s ease;
  text-align: center;
  line-height: 1.4;
}

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

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

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

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

.btn-secondary {
  background: var(--clr-secondary);
  color: var(--clr-white);
  border-color: var(--clr-secondary);
}

.btn-secondary:hover {
  background: #cf4e08;
  border-color: #cf4e08;
  color: var(--clr-white);
}

/* ---- HEADER / NAVBAR ---- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--clr-white);
  transition: box-shadow 0.3s;
}

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

.header-top {
  background: var(--clr-light);
  border-bottom: 1px solid var(--clr-border);
  padding: 0.4rem 0;
  font-size: 0.82rem;
  color: var(--clr-text-light);
}

.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-top a {
  color: var(--clr-text-light);
  transition: color 0.25s;
}

.header-top a:hover {
  color: var(--clr-primary);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  min-height: 64px;
}

.brand {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--clr-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand img {
  height: 36px;
  width: auto;
}

.brand span {
  color: var(--clr-secondary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0;
  align-items: center;
}

.nav-links a {
  display: block;
  padding: 1.2rem 1rem;
  color: var(--clr-text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.25s;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0.8rem;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--clr-primary);
  transform: scaleX(0);
  transition: transform 0.3s;
}

.nav-links a:hover {
  color: var(--clr-dark);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.hamburger-box {
  width: 26px;
  height: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-box span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--clr-dark);
  border-radius: 2px;
  transition: all 0.3s;
}

.hamburger.is-active .hamburger-box span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.hamburger.is-active .hamburger-box span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-active .hamburger-box span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ---- HERO — full-width with left-aligned text overlay (source DNA) ---- */

.hero {
  position: relative;
  background: var(--clr-primary-light);
  padding: calc(var(--section-py) + 4.5rem) 0 var(--section-py);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Dotted pattern — nod to source's bg-icon repeating pattern */
  background-image:
    radial-gradient(circle, rgba(58,168,18,0.07) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

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

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 1.25rem;
  line-height: 1.15;
}

.hero-content .subtitle {
  font-size: 1.1rem;
  color: var(--clr-text-light);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  z-index: 1;
}

.hero-visual .deco-shape {
  position: absolute;
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  background: var(--clr-primary);
  opacity: 0.08;
  border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%;
}

/* ---- TOPICS — cards with soft shadow (source product-item DNA) ---- */

.topics-section {
  padding: var(--section-py) 0;
  background: var(--clr-white);
}

.topics-header {
  max-width: 520px;
  margin-bottom: 3rem;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.topic-card {
  background: var(--clr-white);
  box-shadow: var(--shadow-card);
  padding: 2.25rem 1.75rem;
  transition: box-shadow 0.35s, transform 0.35s;
  position: relative;
  overflow: hidden;
}

.topic-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s;
}

.topic-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

.topic-card:hover::before {
  transform: scaleX(1);
}

.topic-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.topic-card p,
.topic-card div {
  font-size: 0.93rem;
  color: var(--clr-text-light);
  line-height: 1.65;
}

/* ---- LATEST POSTS — prominent blog cards (source blog section DNA) ---- */

.posts-section {
  padding: var(--section-py) 0;
  background: var(--clr-light);
}

.posts-header {
  text-align: center;
  max-width: 520px;
  margin: 0 auto 3rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.post-card {
  background: var(--clr-white);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow 0.35s, transform 0.35s;
}

.post-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

.post-card-img {
  overflow: hidden;
  aspect-ratio: 16/10;
  background: var(--clr-light);
}

.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.post-card:hover .post-card-img img {
  transform: scale(1.08);
}

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

.post-card-date {
  display: block;
  font-size: 0.8rem;
  color: var(--clr-text-light);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post-card-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0.65rem;
  line-height: 1.35;
}

.post-card-body h3 a {
  color: var(--clr-dark);
  transition: color 0.25s;
}

.post-card-body h3 a:hover {
  color: var(--clr-primary);
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--clr-text-light);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  padding: 0 1.5rem 1.5rem;
}

.post-read-more {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--clr-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.post-read-more::after {
  content: "\2192";
  transition: transform 0.25s;
}

.post-read-more:hover::after {
  transform: translateX(4px);
}

.posts-more {
  text-align: center;
  margin-top: 2.5rem;
}

/* ---- FAQ — expandable items (source-inspired, not generic accordion) ---- */

.faq-section {
  padding: var(--section-py) 0;
  background: var(--clr-white);
}

.faq-layout {
  display: grid;
  grid-template-columns: 0.4fr 0.6fr;
  gap: 3rem;
  align-items: start;
}

.faq-intro {
  position: sticky;
  top: 6rem;
}

.faq-intro p {
  color: var(--clr-text-light);
  margin-top: 1rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.faq-item {
  border-bottom: 1px solid var(--clr-border);
}

.faq-item:first-child {
  border-top: 1px solid var(--clr-border);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--clr-dark);
  gap: 1rem;
  transition: color 0.25s;
}

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

.faq-question:focus {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}

.faq-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 2px solid var(--clr-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  position: relative;
}

.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  background: var(--clr-primary);
  transition: transform 0.3s;
}

.faq-icon::before {
  width: 12px;
  height: 2px;
}

.faq-icon::after {
  width: 2px;
  height: 12px;
}

.faq-item.is-open .faq-icon {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
}

.faq-item.is-open .faq-icon::before,
.faq-item.is-open .faq-icon::after {
  background: var(--clr-white);
}

.faq-item.is-open .faq-icon::after {
  transform: rotate(90deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  padding: 0 0 0 0;
}

.faq-answer-inner {
  padding: 0 0 1.25rem;
  font-size: 0.93rem;
  color: var(--clr-text-light);
  line-height: 1.7;
}

.faq-item.is-open .faq-answer {
  max-height: 600px;
}

/* ---- CTA BANNER — primary bg with pattern (source "Firm Visit" DNA) ---- */

.cta-banner {
  padding: var(--section-py) 0;
  background-color: var(--clr-primary);
  /* Dot pattern overlay — source's bg-icon style */
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.08) 1.5px, transparent 1.5px);
  background-size: 20px 20px;
  color: var(--clr-white);
}

.cta-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.cta-banner h2 {
  color: var(--clr-white);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.cta-banner p {
  color: rgba(255,255,255,0.85);
  margin-bottom: 0;
  max-width: 520px;
}

.cta-banner .btn-secondary {
  flex-shrink: 0;
}

/* ---- FOOTER — dark with muted text (source DNA) ---- */

.site-footer {
  background: var(--clr-dark);
  color: #999999;
  padding: 4rem 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--clr-primary);
  display: inline-block;
  margin-bottom: 1rem;
}

.footer-brand span {
  color: var(--clr-secondary);
}

.site-footer p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #999999;
}

.footer-heading {
  color: var(--clr-white);
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-heading);
}

.footer-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-nav a {
  color: #999999;
  font-size: 0.9rem;
  transition: color 0.25s, padding-left 0.25s;
  display: inline-block;
}

.footer-nav a::before {
  content: "\203A";
  margin-right: 0.5rem;
  color: #666666;
}

.footer-nav a:hover {
  color: var(--clr-white);
  padding-left: 4px;
}

.footer-contact a {
  color: #999999;
  transition: color 0.25s;
}

.footer-contact a:hover {
  color: var(--clr-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 1.25rem 0;
  font-size: 0.85rem;
  text-align: center;
  color: #777;
}

/* ---- PAGE / POST — content pages ---- */

.page-hero {
  padding: calc(var(--section-py) + 4rem) 0 3rem;
  background: var(--clr-light);
  position: relative;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(58,168,18,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.page-hero h1 {
  font-size: 2.5rem;
  position: relative;
}

.page-content {
  padding: var(--section-py) 0;
}

.page-content .content-body {
  max-width: 780px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.8;
}

.content-body h2 {
  margin: 2rem 0 1rem;
}

.content-body h3 {
  margin: 1.5rem 0 0.75rem;
}

.content-body ul, .content-body ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.content-body li {
  margin-bottom: 0.4rem;
}

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

.content-body blockquote {
  border-left: 3px solid var(--clr-primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--clr-light);
  font-style: italic;
  color: var(--clr-text-light);
}

/* ---- POST SINGLE ---- */

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--clr-text-light);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

.post-cover {
  margin-bottom: 2rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.post-cover img {
  width: 100%;
  height: auto;
}

.post-excerpt-block {
  font-size: 1.15rem;
  color: var(--clr-text-light);
  border-left: 3px solid var(--clr-primary);
  padding-left: 1.25rem;
  margin-bottom: 2rem;
  line-height: 1.7;
}

/* ---- BLOG INDEX — post listing ---- */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

/* ---- PAGINATION ---- */

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

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  border: 2px solid var(--clr-border);
  color: var(--clr-text);
  transition: all 0.25s;
}

.pagination a:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}

.pagination a.active,
.pagination span.active {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: var(--clr-white);
}

.pagination .prev-next {
  font-weight: 500;
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}

.pagination .prev-next:hover {
  background: var(--clr-primary);
  color: var(--clr-white);
}

/* ---- RESPONSIVE ---- */

@media (max-width: 1024px) {
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.75rem; }
  .hero-content h1 { font-size: 2.5rem; }
  .faq-layout { grid-template-columns: 1fr; }
  .faq-intro { position: static; }
  .cta-banner-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 768px) {
  :root {
    --section-py: 3.5rem;
  }

  .header-top { display: none; }

  .hamburger { display: block; }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--clr-white);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    z-index: 999;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    font-size: 1.15rem;
    padding: 0.9rem 1rem;
  }

  .nav-links a::after { display: none; }

  .hero { padding-top: calc(var(--section-py) + 5rem); }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-visual { display: none; }

  .hero-content h1 { font-size: 2rem; }

  .topics-grid {
    grid-template-columns: 1fr;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .page-hero h1 { font-size: 2rem; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- FOCUS STYLES (a11y) ---- */

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

/* ---- BACK TO TOP ---- */

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--clr-primary);
  color: var(--clr-white);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(58,168,18,0.3);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 90;
}

.back-to-top.visible {
  display: flex;
}

.back-to-top:hover {
  transform: translateY(-3px);
}
