/* ======================================================
   SageMist - Hairnic DNA Transfer
   Palette: Sage #90BC79 | Forest #1C2900 | Mint #F4F8F1
   ====================================================== */

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

:root {
  --c-primary: #90BC79;
  --c-primary-dark: #6F9E5B;
  --c-primary-pale: #b8d4a8;
  --c-dark: #1C2900;
  --c-dark-mid: #2A3D0E;
  --c-light: #F4F8F1;
  --c-white: #FFFFFF;
  --c-text: #3A4028;
  --c-text-secondary: #6B7360;
  --c-border: #D4DFC9;
  --c-shadow-green: rgba(144,188,121,.22);
  --ff-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ff-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --container: 1120px;
  --gap: 1.5rem;
}

html { scroll-behavior: smooth; }

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

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary-dark); text-decoration: none; transition: .3s; }
a:hover { color: var(--c-dark); }

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

.fw-light { font-weight: 300; color: var(--c-text-secondary); }

/* --- HEADER --- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background .4s, box-shadow .4s;
}
.site-header.scrolled {
  background: var(--c-primary);
  box-shadow: 0 2px 12px var(--c-shadow-green);
}
.header-bar { padding: .9rem 0; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-link { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 36px; }
header .brand-name {
  font-family: var(--ff-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-white);
  letter-spacing: -.02em;
}
.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav .nav-link {
  font-size: .9rem;
  font-weight: 500;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  transition: .3s;
  padding: .2rem 0;
}
.main-nav .nav-link:hover { color: var(--c-white); }
.site-header.scrolled .nav-link { color: var(--c-dark); }
.site-header.scrolled .nav-link:hover { color: var(--c-white); }

.hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 4px;
}
.hamburger-line {
  display: block;
  width: 26px; height: 2px;
  background: var(--c-white);
  transition: .3s;
}
.site-header.scrolled .hamburger-line { background: var(--c-dark); }

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .main-nav {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--c-primary);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s;
    z-index: 200;
  }
  .main-nav.open { opacity: 1; pointer-events: auto; }
  .main-nav .nav-link {
    font-size: 1.25rem;
    color: var(--c-white);
    font-weight: 600;
  }
  .hamburger.active { z-index: 210; position: relative; }
  .hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .hamburger.active .hamburger-line:nth-child(2) { opacity: 0; }
  .hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .hamburger.active .hamburger-line { background: var(--c-white); }
}

/* --- HERO --- */
.hero {
  position: relative;
  background: var(--c-primary);
  padding: 10rem 0 5rem;
  overflow: hidden;
}
.hero-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255,255,255,.08);
  clip-path: polygon(62% 0, 100% 0, 100% 100%, 30% 100%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-text { max-width: 640px; }
.hero-text h1 {
  font-family: var(--ff-heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--c-dark);
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 2rem;
}
.btn-outline {
  display: inline-block;
  padding: .65rem 1.8rem;
  border: 2px solid var(--c-dark);
  color: var(--c-dark);
  font-weight: 500;
  font-size: .9rem;
  border-radius: 0;
  text-decoration: none;
  transition: .3s;
}
.btn-outline:hover {
  background: var(--c-dark);
  color: var(--c-white);
}
.btn-outline--light {
  border-color: rgba(255,255,255,.5);
  color: var(--c-white);
}
.btn-outline--light:hover {
  background: var(--c-white);
  color: var(--c-primary);
  border-color: var(--c-white);
}

/* --- SECTION INTROS --- */
.section-intro {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
}
.section-intro h2 {
  font-family: var(--ff-heading);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1.2;
  margin-bottom: .75rem;
}
.section-intro--light h2 { color: var(--c-white); }

.accent-hr {
  width: 50px;
  height: 3px;
  border: none;
  background: var(--c-primary);
  margin: 0 auto;
}
.accent-hr--light { background: var(--c-dark); }

/* --- TOPICS --- */
.section-topics {
  padding: 5rem 0;
  background: var(--c-white);
}
.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.topic-card {
  border: 1px solid var(--c-border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: .2s;
}
.topic-card:hover {
  border-color: transparent;
  box-shadow: 0 0 35px var(--c-shadow-green);
}
.topic-name {
  font-family: var(--ff-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-dark);
  margin-bottom: .5rem;
}
.topic-hr {
  width: 30px;
  height: 2px;
  border: none;
  background: var(--c-primary);
  margin: 0 auto .75rem;
}
.topic-desc {
  font-size: .92rem;
  color: var(--c-text-secondary);
  line-height: 1.65;
}

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

/* --- LATEST POSTS (primary bg + clip-path) --- */
.section-posts {
  position: relative;
  background: var(--c-primary);
  padding: 5rem 0;
  overflow: hidden;
}
.section-clip-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255,255,255,.08);
  clip-path: polygon(62% 0, 100% 0, 100% 100%, 30% 100%);
  pointer-events: none;
}
.section-posts-inner { position: relative; z-index: 1; }

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.post-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  overflow: hidden;
  transition: .2s;
}
.post-card:hover {
  border-color: transparent;
  box-shadow: 0 0 35px var(--c-shadow-green);
}
.post-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.post-card-body { padding: 1.5rem; }
.post-card-date {
  display: block;
  font-size: .78rem;
  color: var(--c-text-secondary);
  margin-bottom: .5rem;
}
.post-card-title {
  font-family: var(--ff-heading);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: .6rem;
}
.post-card-title a {
  color: var(--c-dark);
  text-decoration: none;
}
.post-card-title a:hover { color: var(--c-primary-dark); }
.post-card-excerpt {
  font-size: .88rem;
  color: var(--c-text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.post-card .btn-outline { font-size: .82rem; padding: .5rem 1.3rem; }
.post-card:hover .btn-outline,
.post-card:hover .btn-outline--light {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: var(--c-white);
}

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

/* --- FAQ --- */
.section-faq {
  padding: 5rem 0;
  background: var(--c-light);
}
.faq-list {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.faq-item {
  border: 1px solid var(--c-border);
  padding: 1.5rem 1.75rem;
  background: var(--c-white);
  transition: .2s;
}
.faq-item:hover {
  border-color: transparent;
  box-shadow: 0 0 35px var(--c-shadow-green);
}
.faq-question {
  font-family: var(--ff-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--c-dark);
  margin-bottom: .5rem;
}
.faq-answer {
  font-size: .92rem;
  color: var(--c-text-secondary);
  line-height: 1.7;
}

/* --- SUB-PAGE HEROES --- */
.page-hero,
.post-hero {
  position: relative;
  background: var(--c-primary);
  padding: 9rem 0 3.5rem;
  overflow: hidden;
}
.page-hero .hero-overlay,
.post-hero .hero-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255,255,255,.08);
  clip-path: polygon(62% 0, 100% 0, 100% 100%, 30% 100%);
  pointer-events: none;
}
.page-hero-inner,
.post-hero-inner { position: relative; z-index: 1; }
.page-hero-inner h1,
.post-hero-inner h1 {
  font-family: var(--ff-heading);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--c-white);
}
.post-date {
  display: inline-block;
  font-size: .85rem;
  color: var(--c-dark);
  margin-bottom: .5rem;
}
.post-excerpt {
  font-size: 1.05rem;
  color: var(--c-dark);
  font-weight: 300;
  margin-top: .75rem;
  max-width: 640px;
  line-height: 1.7;
}

/* --- CONTENT --- */
.page-content,
.post-content { padding: 3.5rem 0 5rem; }
.content-body {
  max-width: 780px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.8;
}
.content-body h2 {
  font-family: var(--ff-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--c-primary);
  margin: 2.5rem 0 .75rem;
}
.content-body h3 {
  font-family: var(--ff-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--c-dark);
  margin: 2rem 0 .5rem;
}
.content-body p { margin-bottom: 1.25rem; }
.content-body ul, .content-body ol { margin: 1rem 0 1.25rem 1.5rem; }
.content-body li { margin-bottom: .4rem; }
.content-body a { color: var(--c-primary-dark); text-decoration: underline; }
.content-body a:hover { color: var(--c-dark); }
.content-body img { margin: 1.5rem 0; }
.content-body blockquote {
  border-left: 3px solid var(--c-primary);
  padding: .75rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--c-text-secondary);
  font-style: italic;
}

/* --- POST COVER --- */
.post-cover { margin-top: -1rem; }
.post-cover img { width: 100%; max-height: 480px; object-fit: cover; }

/* --- BLOG LISTING --- */
.blog-listing { padding: 3.5rem 0 5rem; }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.blog-grid .post-card .btn-outline { font-size: .82rem; padding: .5rem 1.3rem; }
.blog-grid .post-card:hover .btn-outline {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: var(--c-white);
}

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

/* --- PAGINATION --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  margin-top: 3rem;
}
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px; height: 40px;
  padding: 0 .75rem;
  border: 1px solid var(--c-border);
  font-size: .88rem;
  font-weight: 500;
  color: var(--c-text);
  text-decoration: none;
  border-radius: 50px;
  transition: .3s;
}
.pagination a:hover,
.pagination a.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: var(--c-white);
}

/* --- FOOTER --- */
.site-footer {
  background: var(--c-white);
  padding-top: 3.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}
.footer-about .brand-name {
  font-family: var(--ff-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--c-primary);
  display: block;
  margin-bottom: .75rem;
}
.footer-tagline {
  font-size: .9rem;
  color: var(--c-text-secondary);
  line-height: 1.65;
}
.footer-heading {
  font-family: var(--ff-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-dark);
  margin-bottom: 1rem;
}
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: .6rem; }
.footer-links a {
  font-size: .9rem;
  color: var(--c-text);
  text-decoration: none;
  transition: .3s;
}
.footer-links a::before {
  content: "A";
  margin-right: .5rem;
  font-weight: 700;
  color: var(--c-primary);
}
.footer-links a:hover {
  color: var(--c-primary);
  letter-spacing: 1px;
}
.footer-email {
  font-size: .9rem;
  color: var(--c-text);
  text-decoration: none;
  transition: .3s;
}
.footer-email:hover { color: var(--c-primary); }
.footer-bottom {
  margin-top: 2.5rem;
  padding: 1.5rem 0;
  border-top: 3px solid var(--c-light);
  text-align: center;
}
.footer-bottom p {
  font-size: .82rem;
  color: var(--c-text-secondary);
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* --- BACK TO TOP --- */
.back-to-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 44px; height: 44px;
  background: var(--c-primary);
  color: var(--c-white);
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  transition: .3s;
  line-height: 1;
}
.back-to-top:hover { background: var(--c-primary-dark); }
.back-to-top.show { display: flex; }

/* --- FADE-UP --- */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- A11Y --- */
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
*:focus:not(:focus-visible) { outline: none; }
