/*
Theme Name: Build a Granny Flat
Theme URI: https://buildgrannyflat.com/
Author: AMESCORP / Build a Granny Flat
Description: Editorial granny flat guidance theme for educational content and lead-gen.
Version: 1.3.1
Text Domain: buildgrannyflat
*/

:root {
  --bgf-green: #87ad52;
  --bgf-green-dark: #266938;
  --bgf-green-light: #ceff87;
  --bgf-charcoal: #191919;
  --bgf-slate: #5d5d5d;
  --bgf-warm: #fffaf4;
  --bgf-soft-green: #f8fbf3;
  --bgf-white: #ffffff;
  --bgf-line: #dddddd;
  --bgf-shadow: rgba(25, 25, 25, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  font-family: Poppins, Arial, sans-serif;
  background: var(--bgf-white);
  color: var(--bgf-charcoal);
}

a {
  color: var(--bgf-green-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { text-decoration: none; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  background: var(--bgf-white);
  color: var(--bgf-charcoal);
  padding: 14px 0;
  border-bottom: 1px solid var(--bgf-line);
}

.site-header .wrapper,
.site-footer .wrapper,
.hero .wrapper,
.trust-strip .wrapper,
.content-wrapper {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header .wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--bgf-charcoal);
  text-decoration: none;
}

.brand img {
  display: block;
  width: min(330px, 42vw);
  height: auto;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  background: var(--bgf-green);
  border-radius: 50%;
  color: var(--bgf-charcoal);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand strong {
  display: block;
  font-size: 1.12rem;
  line-height: 1.15;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--bgf-slate);
  font-size: 0.68rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--bgf-charcoal);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav .nav-cta,
.footer-cta {
  padding: 0.75rem 1.1rem;
  background: var(--bgf-green);
  border-radius: 6px;
  color: var(--bgf-charcoal);
}

.hero {
  overflow: hidden;
  background: var(--bgf-charcoal);
  color: var(--bgf-white);
  padding: 88px 0 82px;
}

.hero .wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 64px;
  align-items: center;
}

.hero h1 {
  max-width: 760px;
  margin: 0 0 24px;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero p {
  max-width: 700px;
  font-size: 1.06rem;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--bgf-green-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero .eyebrow { color: var(--bgf-green-light); }

.cta-row {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.hero-panel {
  position: relative;
  padding: 34px;
  background: var(--bgf-green);
  border-radius: 8px;
  color: var(--bgf-charcoal);
  box-shadow: 24px 24px 0 var(--bgf-green-dark);
}

.hero-panel h2 {
  margin: 0 0 18px;
  font-size: 1.7rem;
  line-height: 1.2;
}

.hero-panel .eyebrow { color: var(--bgf-green-dark); }

.hero-panel ul {
  margin: 0;
  padding-left: 1.2rem;
}

.hero-panel li {
  margin: 0.7rem 0;
  line-height: 1.5;
}

.button {
  display: inline-block;
  padding: 0.9rem 1.3rem;
  background: var(--bgf-green);
  border: 2px solid var(--bgf-green);
  border-radius: 6px;
  color: var(--bgf-charcoal);
  font-weight: 700;
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  border-color: var(--bgf-white);
  color: var(--bgf-white);
}

.trust-strip {
  padding: 18px 0;
  background: var(--bgf-green);
}

.trust-strip .wrapper {
  display: flex;
  justify-content: center;
  gap: 42px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.trust-strip span + span::before {
  content: "•";
  margin-right: 42px;
}

.authority-intro {
  padding: 54px 0;
  background: var(--bgf-soft-green);
  border-bottom: 1px solid var(--bgf-line);
}

.authority-intro h2 {
  max-width: 780px;
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.authority-intro > .content-wrapper > p:not(.eyebrow) {
  max-width: 850px;
  color: var(--bgf-slate);
  line-height: 1.7;
}

.authority-links {
  display: flex;
  gap: 12px 24px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.authority-links a {
  font-weight: 700;
}

.main-content {
  padding: 72px 0 92px;
  background: var(--bgf-warm);
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-bottom: 34px;
  align-items: end;
}

.section-heading h2 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.section-heading > p {
  margin: 0;
  color: var(--bgf-slate);
  line-height: 1.7;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.post-card {
  overflow: hidden;
  padding: 28px;
  background: var(--bgf-white);
  border: 1px solid var(--bgf-line);
  border-radius: 8px;
  box-shadow: 0 14px 34px var(--bgf-shadow);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.post-card-image {
  display: block;
  margin: -28px -28px 24px;
  background: var(--bgf-charcoal);
}

.post-card-image img,
.article-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-card-image img {
  max-height: 210px;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 44px var(--bgf-shadow);
}

.post-card h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  line-height: 1.35;
}

.post-card h3 a {
  color: var(--bgf-charcoal);
  text-decoration: none;
}

.post-card p {
  color: var(--bgf-slate);
  line-height: 1.7;
}

.post-card .byline,
.article-byline {
  color: var(--bgf-green-dark);
  font-size: 0.76rem;
  font-weight: 600;
}

.article-byline {
  margin: 0.8rem 0 1.8rem;
}

.authority-card {
  display: flex;
  align-items: center;
  gap: 10px 20px;
  margin: 0 0 2rem;
  padding: 14px 18px;
  background: var(--bgf-soft-green);
  border: 1px solid var(--bgf-green);
  border-radius: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
}

.authority-card strong {
  color: var(--bgf-green-dark);
}

.authority-card span {
  color: var(--bgf-slate);
}

.article-image {
  width: 100%;
  max-width: 760px;
  margin: 0 auto 2.4rem;
  overflow: hidden;
  border-radius: 8px;
}

.article-image img {
  max-height: 430px;
}

.article-image figcaption {
  padding: 8px 12px;
  background: var(--bgf-soft-green);
  color: var(--bgf-slate);
  font-size: 0.72rem;
  text-align: right;
}

.entry-content p,
.entry-content li {
  line-height: 1.8;
  font-size: 1.03rem;
}

.entry-content h2,
.entry-content h3 {
  margin-top: 2.2rem;
  line-height: 1.25;
}

.entry-content blockquote {
  margin: 2rem 0;
  padding: 1rem 1.4rem;
  background: var(--bgf-soft-green);
  border-left: 5px solid var(--bgf-green);
}

.single-article {
  max-width: 820px;
  margin: 0 auto;
  background: var(--bgf-white);
  border: 1px solid var(--bgf-line);
  border-radius: 8px;
  padding: 46px 42px;
  box-shadow: 0 14px 34px var(--bgf-shadow);
}

.single-article h1 {
  margin-top: 0;
  font-size: clamp(2.2rem, 5vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.related-guidance {
  margin-top: 3rem;
  padding: 28px;
  background: var(--bgf-soft-green);
  border-top: 4px solid var(--bgf-green);
}

.related-guidance h2 {
  margin-top: 0;
}

.related-guidance li + li {
  margin-top: 0.8rem;
}

.authority-page {
  max-width: 920px;
}

.guide-library > h1 {
  max-width: 850px;
  margin: 0 0 12px;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.guide-library-intro {
  max-width: 780px;
  color: var(--bgf-slate);
  line-height: 1.7;
}

.category-jump {
  display: flex;
  gap: 10px;
  margin: 32px 0 52px;
  flex-wrap: wrap;
}

.category-jump a {
  padding: 8px 12px;
  background: var(--bgf-white);
  border: 1px solid var(--bgf-line);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
}

.guide-category {
  margin-top: 44px;
  scroll-margin-top: 110px;
}

.guide-category-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  border-bottom: 3px solid var(--bgf-green);
}

.guide-category-heading h2 {
  margin: 0 0 10px;
  font-size: 1.7rem;
}

.guide-category-heading span,
.guide-list small {
  color: var(--bgf-slate);
  font-size: 0.75rem;
}

.guide-list {
  display: grid;
  gap: 16px;
}

.guide-list article {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 18px;
  background: var(--bgf-white);
  border: 1px solid var(--bgf-line);
  border-radius: 8px;
}

.guide-list-image {
  overflow: hidden;
  background: var(--bgf-charcoal);
  border-radius: 6px;
}

.guide-list-image img {
  display: block;
  width: 100%;
  height: 135px;
  object-fit: cover;
}

.guide-list h3 {
  margin: 2px 0 8px;
}

.guide-list h3 a {
  color: var(--bgf-charcoal);
  text-decoration: none;
}

.guide-list p {
  margin: 0 0 10px;
  color: var(--bgf-slate);
  line-height: 1.6;
}

.site-footer {
  background: var(--bgf-charcoal);
  color: var(--bgf-white);
  padding: 42px 0;
}

.site-footer .wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.site-footer p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--bgf-line);
  font-size: 0.82rem;
}

.footer-logo {
  display: block;
  width: min(330px, 70vw);
  height: auto;
}

.footer-links {
  display: flex;
  gap: 8px 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--bgf-green-light);
  font-size: 0.78rem;
}

.footer-cta {
  color: var(--bgf-charcoal);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 768px) {
  .site-header {
    position: static;
  }

  .site-header .wrapper,
  .site-footer .wrapper,
  .hero .wrapper,
  .section-heading {
    display: block;
  }

  .site-nav {
    margin-top: 16px;
  }

  .brand img {
    width: min(320px, 82vw);
  }

  .hero {
    padding: 62px 0 68px;
  }

  .hero-panel {
    margin-top: 42px;
    box-shadow: 12px 12px 0 var(--bgf-green-dark);
  }

  .trust-strip .wrapper {
    display: grid;
    gap: 8px;
  }

  .trust-strip span + span::before {
    content: none;
  }

  .section-heading > p {
    margin-top: 20px;
  }

  .single-article {
    padding: 30px 22px;
  }

  .article-image {
    max-width: 100%;
  }

  .authority-card {
    display: grid;
  }

  .guide-list article {
    grid-template-columns: 1fr;
  }

  .guide-list-image img {
    height: auto;
    max-height: 220px;
  }

  .footer-cta {
    display: inline-block;
    margin-top: 22px;
  }

  @media (min-width: 769px) and (max-width: 1080px) {
    .site-header .wrapper {
      align-items: flex-start;
    }

    .site-nav {
      justify-content: flex-end;
    }

    .brand img {
      width: 270px;
    }
  }
}
