/* Central stylesheet for 2017 Escape Guide */
:root{
  --brand:#0b63b6;      /* deep blue */
  --brand-2:#0f7ae5;    /* brighter blue */
  --ink:#0f172a;        /* slate-900 */
  --muted:#475569;      /* slate-600 */
  --bg:#ffffff;
  --card:#f8fafc;       /* slate-50 */
  --border:#e2e8f0;     /* slate-200 */
  --ok:#16a34a;
  --warn:#ea580c;
}

*{ box-sizing:border-box }
html,body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Helvetica,Arial,sans-serif;
  line-height:1.5;
}
a{ color:var(--brand); text-decoration:none }
a:hover{ text-decoration:underline }

/* Accessibility: skip link */
.skip{
  position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden
}
.skip:focus{
  left:8px; top:8px; width:auto; height:auto;
  background:#fff; border:2px solid var(--brand);
  padding:.5rem 1rem; border-radius:.5rem; z-index:10000
}

/* Layout helpers */
.wrap{ max-width:1200px; margin:0 auto; padding:0 16px }
.row{ display:flex; align-items:center; justify-content:space-between; gap:12px }

/* Header & Nav */
header{
  position:sticky; top:0; z-index:50;
  background:#fff; border-bottom:1px solid var(--border)
}
.brand{ display:flex; align-items:center; gap:10px; padding:12px 0 }
.logo{
  display:inline-flex; width:40px; height:40px; border-radius:10px;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  align-items:center; justify-content:center
}
.logo svg{ width:26px; height:26px; fill:#fff }
.site-title{ font-weight:800; letter-spacing:.2px }
.tagline{ display:block; font-size:.85rem; color:var(--muted) }

nav{ display:flex; align-items:center; gap:12px }
.nav-links{ display:flex; gap:8px; flex-wrap:wrap }
.nav-links a{ padding:.6rem .8rem; border-radius:.6rem }
.nav-links a:hover{ background:var(--card); text-decoration:none }

/* Mobile menu button */
.burger{
  appearance:none; border:0; background:#fff; border:1px solid var(--border);
  padding:.55rem .7rem; border-radius:.6rem; display:none; align-items:center; gap:8px
}
.burger:focus{ outline:3px solid #bfdbfe }
.burger .bars{
  display:inline-block; width:20px; height:2px; background:var(--ink); position:relative
}
.burger .bars::before,.burger .bars::after{
  content:""; position:absolute; left:0; width:20px; height:2px; background:var(--ink)
}
.burger .bars::before{ top:-6px }
.burger .bars::after{ top:6px }

/* Mobile drawer */
.drawer{ position:fixed; inset:0; display:none }
.drawer.open{ display:block }
.drawer .scrim{ position:absolute; inset:0; background:#0008 }
.drawer .panel{
  position:absolute; right:0; top:0; height:100%;
  width:min(92vw,360px); background:#fff; border-left:1px solid var(--border);
  padding:16px; overflow:auto
}
.drawer .panel h3{ margin:0 0 10px 0 }
.drawer .panel a{ display:block; padding:10px; border-radius:.5rem; color:var(--ink) }
.drawer .panel a:hover{ background:var(--card) }
.drawer .group{ margin:14px 0 }
.drawer .group h4{ margin:.7rem 0 .35rem 0; color:var(--muted); font-size:.9rem }

@media (max-width:1024px){
  .nav-links{ display:none }
  .burger{ display:inline-flex }
}

/* -------------------- HERO -------------------- */
/* Supports two modes:
   1) Rich hero (homepage) — you set background via inline style:
      <section class="hero" style="--hero-image: url('/images/escape-hero.jpg')"> ... </section>
   2) Auto-hero (inner pages) — header.php renders:
      <section class="hero auto-hero" style="--hero-image: url('/images/hero-oil-type.jpg')"></section>
*/
.hero{
  position:relative;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg,#e8f1fb,#ffffff);
}
.hero::before{
  content:"";
  position:absolute; inset:0; z-index:-1; 
  background-image:
    /* linear-gradient(to bottom, rgba(0,0,0,.35), rgba(255,255,255,0) 40%, rgba(255,255,255,.8) 85%), */
    url('https://2017fordescape.com/images/2017-ford-escape.jpg');
  background-size:cover; background-position:center;
}
.hero .wrap{ padding:32px 16px 24px }
.hero-inner{  display:flex; flex-direction:column; justify-content:center }
.hero h1{ font-size:clamp(1.6rem,2.5vw,2.4rem); margin:.2rem 0 .6rem; color:#0b1b2b }
.hero p{   /* max-width:70ch */ color:var(--muted); margin:.5rem 0 1rem }

/* A shallow image-only banner when auto-hero is used */
.auto-hero .hero-spacer{ min-height:220px }

/* The hero container creates its own stacking context */
.hero.hero-img{ 
  position: relative;      /* important */
  z-index: 0;              /* creates a new stacking context */
  overflow: hidden;
}

/* The image fills the section, sits at the back (z:0) */
.hero.hero-img .hero-bg{
  position: absolute;
  inset: 0;                /* same as top:0; right:0; bottom:0; left:0 */
  width: 100%;
  height: auto; /* was 100% but doesn't scale properly */
  object-fit: cover;
  object-position: center;
  z-index: 0;              /* non-negative so it won't disappear */
  display: block;
}

/* Gradient overlay above the image (z:1) */
.hero.hero-img .hero-overlay{
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.35),
    rgba(255,255,255,0) 90%,
    rgba(255,255,255,.8) 100%
  );
}

/* Your content stays naturally above (z:auto > 1 because it's later in DOM).
   If needed, you can force it: */
.hero .wrap,
.hero .hero-inner { position: relative; z-index: 2; }

/* Ensure the section has height */
.hero-spacer{ min-height: 620px; }

/* Buttons */
.cta{ display:flex; gap:10px; flex-wrap:wrap }
.btn{
  display:inline-flex; align-items:center; gap:.6rem;
  background:var(--brand); color:#fff; border:0; border-radius:.7rem;
  padding:.7rem 1rem; font-weight:600
}
.btn.secondary{ background:#fff; color:var(--brand); border:1px solid var(--brand) }

/* Quick tiles */
.tiles{ padding:28px 16px }
.grid{ display:grid; grid-template-columns:repeat(12,1fr); gap:16px }
.card{
  grid-column:span 4; background:var(--card); border:1px solid var(--border);
  border-radius:14px; padding:16px; display:flex; gap:12px; align-items:flex-start
}
.card:hover{ box-shadow:0 6px 24px rgba(2,6,23,.07) }
.card .icon{
  width:42px; height:42px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center;
  background:#fff; border:1px solid var(--border)
}
.card h3{ margin:.2rem 0 .2rem; font-size:1.02rem }
.card p{ margin:0; color:var(--muted); font-size:.95rem }
@media (max-width:900px){ .card{ grid-column:span 6 } }
@media (max-width:600px){ .card{ grid-column:span 12 } }

/* Category lists */
.categories{ border-top:1px solid var(--border); padding:28px 16px }
.columns{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px }
.columns h4{ margin:.2rem 0 .6rem }
.columns ul{ margin:0; padding-left:1.1rem }
.columns li{ margin:.3rem 0 }
@media (max-width:900px){ .columns{ grid-template-columns:1fr } }

/* FAQ accordion */
.faq{ border-top:1px solid var(--border); padding:28px 16px }
details{
  border:1px solid var(--border); background:#fff;
  border-radius:12px; padding:12px 14px; margin:12px 0
}
summary{ cursor:pointer; font-weight:600 }
details[open]{ background:var(--card) }

/* Tools */
.tool{ border:1px solid var(--border); border-radius:12px; padding:14px; background:#fff }
.tool .row{ gap:10px; flex-wrap:wrap }
.tool input{
  width:160px; max-width:100%;
  padding:.55rem .6rem; border:1px solid var(--border); border-radius:.6rem
}
.tool .note{ font-size:.92rem; color:var(--muted) }

/* Footer */
footer{
  border-top:1px solid var(--border); padding:22px 16px;
  color:var(--muted); font-size:.95rem
}
footer .footgrid{
  display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center
}
@media (max-width:700px){ footer .footgrid{ grid-template-columns:1fr } }

/* Utility */
.owner-note{
  background:rgba(255,255,255,.85);
  border:1px solid var(--border);
  padding:.6rem .8rem;
  border-radius:.6rem;
  /* max-width:70ch */
}

/* ---------- Improved Footer ---------- */
.site-footer{
  margin-top:32px;
  background: #fff;
  border-top:1px solid var(--border);
  position:relative;
}
.site-footer .footer-accent{
  height:6px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  opacity:.85;
}
.footer-grid{
  display:grid;
  grid-template-columns: 1.2fr 2fr;
  gap:24px;
  padding:20px 16px 26px;
}
@media (max-width:900px){
  .footer-grid{ grid-template-columns: 1fr; }
}

/* brand card */
.footer-brand{
  display:flex; gap:12px; align-items:center;
  background: linear-gradient(180deg,#f8fbff,#ffffff);
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  box-shadow: 0 3px 14px rgba(2,6,23,.06);
}
.footer-logo{
  width:44px; height:44px; border-radius:12px;
  background: linear-gradient(135deg,var(--brand),var(--brand-2));
  display:inline-flex; align-items:center; justify-content:center;
  box-shadow: 0 2px 10px rgba(2,6,23,.12);
}
.footer-logo svg{ fill:#fff }
.footer-title{ font-weight:800; letter-spacing:.2px }
.footer-tag{ color:var(--muted); font-size:.93rem }

/* links */
.footer-links{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:16px;
}
.footer-links h4{
  margin:.2rem 0 .4rem; font-size:.98rem; color:#0b1b2b;
}
.footer-links a{
  display:block; padding:.28rem 0; color:var(--ink);
  border-radius:.4rem;
}
.footer-links a:hover{
  background:var(--card);
  text-decoration:none;
}
.to-top{ font-weight:600 }

/* meta & disclosure */
.footer-meta{
  grid-column: 1 / -1;
  display:grid; gap:8px;
}
.disclosure{
  display:flex; align-items:center; gap:10px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
}
.disclosure .badge{
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:50%;
  background:var(--brand); color:#fff; font-weight:700;
  box-shadow: 0 2px 8px rgba(2,6,23,.12);
}
.fineprint, .timestamp{ color:var(--muted); font-size:.92rem }

/* small polish */
.site-footer a{ word-break:break-word }
