@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=Public+Sans:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@500&display=swap');

/* =========================
   Tokens
========================= */
:root {
  --navy: #1C3D5A;
  --navy-dark: #142B3F;
  --sage: #5C7A6B;
  --sage-light: #EAF0EC;
  --gold: #D98C2B;
  --gold-dark: #B8721E;
  --bg: #F5F7F9;
  --surface: #FFFFFF;
  --text: #1A2530;
  --muted: #5B6B79;
  --border: #E1E7EB;
  --shadow: 0 6px 20px rgba(28, 61, 90, 0.08);
  --radius: 14px;
  --container: 1180px;

  --font-display: 'Source Serif 4', Georgia, serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; margin: 0 0 0.5em; color: var(--navy-dark); }
p { margin: 0 0 1em; }
a { color: var(--navy); text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.section { padding: 64px 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gold);
  color: #1A1206;
  box-shadow: 0 8px 18px rgba(217, 140, 43, 0.3);
}
.btn-primary:hover { background: var(--gold-dark); transform: translateY(-1px); }

/* =========================
   Header
========================= */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  transition: gap 0.2s ease, padding 0.2s ease;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--navy-dark);
}

.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--navy);
  color: white;
  border-radius: 8px;
  font-size: 1.1rem;
}
.brand {
  height: 55px; /* constrains the logo's box; adjust to taste */
  width: 160px;
}
.brand .logo-img {
  height: 100%;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.logo-img-footer{
     height: 130px;
      width: 200px;
      max-width: 180px;
      object-fit: contain;
      display: block;
}

.main-nav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, padding 0.2s ease, font-size 0.2s ease;
}
.main-nav a:hover { background: var(--sage-light); color: var(--sage); }

.header-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  width: 260px;
  flex-shrink: 0;
  transition: width 0.2s ease, border-color 0.2s ease;
}
.header-search:focus-within { border-color: var(--sage); }
.header-search input {
  border: none; background: transparent; outline: none;
  font: inherit; font-size: 0.88rem; flex: 1; color: var(--text); min-width: 0;
}
.header-search button { background: none; border: none; color: var(--muted); cursor: pointer; display: flex; flex-shrink: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;   /* ← add this line */
}
.nav-toggle span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.mobile-menu {
  display: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  border-top: 1px solid var(--border);
}
.mobile-menu.open { max-height: 400px; }
.mobile-menu ul { list-style: none; margin: 0; padding: 6px 16px; display: flex; flex-direction: column; }
.mobile-menu a {
  display: block;
  padding: 10px 0;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.mobile-menu li:last-child a { border-bottom: none; }

.breadcrumb-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  overflow-x: auto;
}
.breadcrumb-bar ol {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  color: var(--muted);
  flex-wrap: nowrap;
  white-space: nowrap;
}
.breadcrumb-bar li { display: flex; align-items: center; }
.breadcrumb-bar a { color: var(--muted); font-weight: 600; }
.breadcrumb-bar a:hover { color: var(--navy); }
.breadcrumb-sep { margin: 0 8px; opacity: 0.5; }

/* =========================
   Responsive — tiered, gradual
========================= */

/* Tablet: nav shrinks and search narrows before anything disappears */
@media (max-width: 1080px) {
  .header-search { width: 200px; }
  .main-nav a { padding: 8px 10px; font-size: 0.86rem; }
}

/* Small tablet: search finally drops, nav still visible and scrollable */
@media (max-width: 900px) {
  .header-search { display: none; }
}

/* Large phone: nav collapses into hamburger */
@media (max-width: 760px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .mobile-menu { display: block; }

  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .article-grid, .pillar-grid { grid-template-columns: repeat(2, 1fr); }
  .article-body-grid { grid-template-columns: 1fr; }
  .article-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
}

/* Phone */
@media (max-width: 640px) {
  .header-inner { gap: 12px; padding: 12px 0; }
  .brand-name { font-size: 1.02rem; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid, .pillar-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 64px; }
  .footer-grid { grid-template-columns: 1fr; }
  .newsletter-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 380px) {
  .brand-name { display: none; }
}
/* =========================
   Hero
========================= */
.hero {
  /*background: linear-gradient(165deg, var(--navy) 0%, var(--navy-dark) 100%);*/
  padding: 84px 0 96px;
  color: white;
  position: relative;
  overflow: visible;   
  background-image:
    linear-gradient(165deg, rgba(28,61,90,0.88) 0%, rgba(20,43,63,0.92) 100%),
    url('https://clearhomeguides.com/files/uploads/hero-water-damage.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/*.hero::before {*/
/*  content: '';*/
/*  position: absolute;*/
/*  inset: 0;*/
/*  background: radial-gradient(circle at 85% 20%, rgba(217,140,43,0.18), transparent 55%);*/
/*  pointer-events: none;*/
/*}*/
.hero-inner { max-width: 760px; position: relative; z-index: 1; }
.hero .eyebrow { color: #F0C480; }
.hero h1 {
  color: white;
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}
.hero-sub { color: rgba(255,255,255,0.82); font-size: 1.08rem; max-width: 58ch; margin-bottom: 32px; }
.hero-search {
  display: flex;
  gap: 10px;
  background: white;
  padding: 6px;
  border-radius: 12px;
  max-width: 560px;
}
.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.95rem;
  border-radius: 8px;
}

/* =========================
   Category rail (homepage)
========================= */
.section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-header h2 { margin: 0; }
.see-all-link { font-weight: 700; font-size: 0.9rem; color: var(--navy); }

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.category-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--cat-color, var(--navy));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.category-tile:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(28,61,90,0.14); }
.category-tile-icon { font-size: 1.6rem; }
.category-tile-name { font-weight: 700; color: var(--navy-dark); font-size: 0.98rem; }
.category-tile-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }

/* =========================
   Article cards & grid
========================= */
.article-grid, .pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.pillar-grid { grid-template-columns: repeat(3, 1fr); }

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.article-card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(28,61,90,0.12); }
.article-card-thumb { display: block; position: relative; aspect-ratio: 16/10; background: var(--sage-light); overflow: hidden; }
.article-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-card-body { padding: 18px; }
.article-card-eyebrow { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--sage); }
.article-card-body h3 { font-size: 1.05rem; margin: 6px 0 8px; }
.article-card-body h3 a { color: var(--navy-dark); }
.article-card-body p { font-size: 0.88rem; color: var(--muted); margin-bottom: 10px; }
.article-card-meta { font-size: 0.78rem; color: var(--muted); font-family: var(--font-mono); }

/* Content-type tag — signature element, encodes real search-intent category */
.content-type-tag {
  position: absolute;
  top: 12px; left: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 5px 10px;
  border-radius: 999px;
  background: white;
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.tag-pillar { background: var(--navy); color: white; }
.tag-cost { background: var(--gold); color: #1A1206; }
.tag-local { background: var(--sage); color: white; }
.tag-howto { background: white; color: var(--navy); border: 1px solid var(--navy); }

/* Article page uses the tag inline, not absolute */
.article-header .content-type-tag { position: static; display: inline-block; margin-bottom: 14px; }

/* =========================
   Category / Region hero
========================= */
.category-hero {
  background: linear-gradient(160deg, var(--cat-color, var(--navy)) 0%, color-mix(in srgb, var(--cat-color, var(--navy)) 70%, black) 100%);
  color: white;
  padding: 56px 0 60px;
  text-align: center;
}
.category-hero-icon { font-size: 2.2rem; display: block; margin-bottom: 10px; }
.category-hero h1 { color: white; margin-bottom: 12px; }
.category-hero-sub { color: rgba(255,255,255,0.85); max-width: 62ch; margin: 0 auto; }

.region-chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.region-chip {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--navy);
}
.region-chip:hover { border-color: var(--navy); }

/* =========================
   Article page
========================= */
.article-header { max-width: 800px; margin: 0 auto; padding: 48px 0 0; text-align: left; }
.article-header h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.article-dek { font-size: 1.1rem; color: var(--muted); margin-bottom: 20px; }
.article-meta-row { display: flex; align-items: center; gap: 10px; font-size: 0.86rem; color: var(--muted); flex-wrap: wrap; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.article-meta-dot { opacity: 0.5; }
.article-author { display: flex; align-items: center; gap: 8px; color: var(--text); }
.article-author img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.article-author strong { display: block; font-size: 0.86rem; }
.article-author em { font-style: normal; font-size: 0.76rem; color: var(--muted); }

.article-hero-image { max-width: 960px; margin: 32px auto; padding: 0 16px; }
.article-hero-image img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }

.article-body-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  max-width: 1180px;
  align-items: start;
  padding-top: 8px;
}
.article-body { max-width: 720px; font-size: 1.05rem; }
.article-body h2 { margin-top: 1.8em; font-size: 1.5rem; }
.article-body h3 { margin-top: 1.4em; font-size: 1.2rem; }
.article-body ul { padding-left: 1.3em; margin-bottom: 1em; }
.article-body li { margin-bottom: 0.4em; }
.article-figure { margin: 1.6em 0; }
.article-figure img { border-radius: 10px; }
.article-figure figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 8px; text-align: center; }
.article-updated { font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 16px; margin-top: 32px; }
.article-faq { margin-top: 40px; }

.article-sidebar { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 16px; }
.sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.sidebar-card h3 { font-size: 0.95rem; margin-bottom: 12px; }
.author-card-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.author-card-row img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.author-card-row strong { display: block; font-size: 0.92rem; }
.author-card-row span { font-size: 0.78rem; color: var(--muted); }
.sidebar-link { font-weight: 700; font-size: 0.85rem; color: var(--navy); }

.related-section { background: var(--surface); border-top: 1px solid var(--border); }

/* =========================
   FAQ
========================= */
.faq-wrapper { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.faq-item summary { list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 700; font-size: 0.96rem; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--sage); font-weight: 300; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0; padding: 0 20px 18px; color: var(--muted); line-height: 1.7; }
.faq-section { background: var(--surface); border-top: 1px solid var(--border); }

/* =========================
   Author page
========================= */
.author-hero-inner { display: flex; align-items: center; gap: 22px; }
.author-hero-avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-hero-credentials { color: var(--sage); font-weight: 700; font-size: 0.88rem; }
.author-hero-bio { color: var(--muted); max-width: 62ch; }

/* =========================
   Pagination
========================= */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 36px; }
.page-btn { padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; font-weight: 600; font-size: 0.86rem; background: var(--surface); }
.page-btn:hover { border-color: var(--navy); color: var(--navy); }
.page-info { font-size: 0.82rem; color: var(--muted); }

/* =========================
   Newsletter band
========================= */
.newsletter-band { background: var(--sage-light); padding: 48px 0; }
.newsletter-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.newsletter-inner h2 { font-size: 1.4rem; margin: 0; max-width: 480px; }
.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter-form input {
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px;
  font: inherit; font-size: 0.92rem; min-width: 240px; outline: none;
}
.newsletter-form input:focus { border-color: var(--sage); }

/* =========================
   Footer
========================= */
.site-footer { background: var(--navy-dark); color: rgba(255,255,255,0.75); padding: 56px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-brand .brand-name { color: white; }
.footer-brand p { font-size: 0.86rem; margin-top: 12px; color: rgba(255,255,255,0.6); }
.footer-col h3 { color: white; font-size: 0.92rem; margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { color: rgba(255,255,255,0.7); font-size: 0.88rem; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.78rem; color: rgba(255,255,255,0.5); border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; }

/* =========================
   Responsive
========================= */
@media (max-width: 1000px) {
  .main-nav, .header-search { display: none; }
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer;
  }
  .nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text); margin: 0 auto; }
  .mobile-menu { display: block; max-height: 0; overflow: hidden; transition: max-height 0.3s ease; border-top: 1px solid var(--border); }
  .mobile-menu.open { max-height: 400px; }
  .mobile-menu ul { list-style: none; margin: 0; padding: 10px 16px; display: flex; flex-direction: column; }
  .mobile-menu a { display: block; padding: 10px 0; font-weight: 600; }

  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .article-grid, .pillar-grid { grid-template-columns: repeat(2, 1fr); }
  .article-body-grid { grid-template-columns: 1fr; }
  .article-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid, .pillar-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 64px; }
  .footer-grid { grid-template-columns: 1fr; }
  .newsletter-inner { flex-direction: column; align-items: flex-start; }
}
