/* madagascardrivers.com — single lightweight stylesheet, no framework.
   Palette: vanilla cream / deep forest green / laterite amber / WhatsApp green */

:root {
  --cream: #faf6ef;
  --ink: #22302b;
  --green: #1e5c49;
  --green-dark: #144536;
  --amber: #c9702d;
  --wa: #1fa855;
  --card: #ffffff;
  --line: #e5ddcd;
  --muted: #6b7a74;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
}

a { color: var(--green); }

/* header */
.site-header {
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
  padding: 0.8rem 5vw;
  background: var(--green-dark); color: #fff;
}
.brand { font-size: 1.25rem; font-weight: 700; color: #fff; text-decoration: none; display: inline-flex; align-items: center; }
.brand span { color: #f2c36b; }
.brand span.tld { color: #9db8ae; font-size: 0.8em; }
.brand .flag { margin-right: 0.5rem; flex-shrink: 0; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.site-header .main-nav { display: flex; gap: 1rem; flex-wrap: wrap; margin-left: auto; }
.site-header nav a { color: #e8f0ec; text-decoration: none; font-weight: 500; }
.site-header nav a:hover { color: #f2c36b; }

/* "Book now" is the action, not a menu item. Measured on Tony's mirrored S21
   2026-08-10: it sat sixth in a wrapped list and looked exactly like FAQ. */
.nav-cta {
  order: 2; margin-left: auto;
  background: #f2c36b; color: var(--green-dark) !important;
  font-weight: 700; text-decoration: none;
  padding: 0.45rem 1rem; border-radius: 999px; white-space: nowrap;
}
.nav-cta:hover, .nav-cta:focus { background: #fff; color: var(--green-dark) !important; }

/* Currency and language belong together — they were at opposite ends of the row
   with a gap between them. */
.header-controls { display: flex; align-items: center; gap: 0.9rem; }

/* Phone: brand and the booking button on the first row, links on the second,
   the switches on the third. Was four rows and a third of the screen before any
   content appeared. */
@media (max-width: 720px) {
  .site-header { gap: 0.7rem 0.6rem; }
  /* Brand and button must share the first row. Measured on the S21: 360 CSS px
     wide, 36 of them padding, leaving 324. At 1.25rem the brand plus the button
     wanted ~368 and the button wrapped to its own line — the fourth row I had
     just promised to remove. Both shrink slightly here; nothing else changes. */
  .brand { order: 1; font-size: 1.05rem; }
  .brand .flag { width: 23px; margin-right: 0.4rem; }
  .nav-cta { order: 2; margin-left: auto; padding: 0.4rem 0.85rem; font-size: 0.95rem; }
  .site-header .main-nav { order: 3; flex-basis: 100%; margin-left: 0; gap: 0.9rem; }
  .header-controls { order: 4; flex-basis: 100%; justify-content: flex-start; }
}
.lang-switch { display: inline-flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.ls-flags { display: inline-flex; gap: 0.4rem; }
.ls-flag {
  display: inline-flex; border-radius: 3px; overflow: hidden; line-height: 0;
  opacity: 0.55; border: 2px solid transparent; transition: opacity .12s;
}
.ls-flag:hover, .ls-flag:focus-visible { opacity: 1; }
.ls-flag.on { opacity: 1; border-color: #f2c36b; }
.ls-flag svg { width: 26px; height: auto; display: block; }
/* touch screens: 40px+ tap targets for the header controls (grader mobile) */
@media (pointer: coarse) {
  .cur-switch button { padding: 0.55rem 0.9rem; font-size: 1rem; }
  .ls-flag { padding: 6px; border-width: 2px; }
  .ls-flag svg { width: 30px; }
  .lang-switch { gap: 0.25rem; }
}

/* currency switch (€ | Ar) — same look as the language switch */
.cur-switch {
  display: inline-flex; border: 1px solid rgba(255,255,255,.5);
  border-radius: 6px; overflow: hidden;
}
.cur-switch button {
  font: inherit; font-weight: 700; font-size: 0.9rem; color: #fff;
  background: transparent; border: 0; padding: 0.15rem 0.55rem; cursor: pointer;
}
html[data-cur="eur"] .cur-switch [data-setcur="eur"],
html[data-cur="mga"] .cur-switch [data-setcur="mga"] {
  background: #f2c36b; color: var(--green-dark);
}

/* dual-currency prices — the toggle decides which currency leads (bold, first) */
.price { display: inline-flex; gap: 0.35em; align-items: baseline; flex-wrap: wrap; }
.price .cur { white-space: nowrap; }
.price .cur-eur { font-weight: 700; color: var(--green-dark); order: 0; }
/* The separator is a real character in the markup (templates.mjs), not
   ::before content. CSS-generated text does not exist in the text layer, and
   Google was reading "€38" and "192 500 Ar" as one number in our own search
   snippet. It only ever needs ordering and colour here. */
.price .cur-sep { order: 1; color: var(--muted); font-weight: 400; }
.price .cur-mga { order: 2; }
html[data-cur="mga"] .price .cur-mga { order: 0; font-weight: 700; color: var(--green-dark); }
html[data-cur="mga"] .price .cur-eur { order: 2; font-weight: 400; color: inherit; }
/* compact spots (route cards): only the chosen currency — and no dangling
   separator, which is why cur-sep hides with whichever currency is dropped. */
.price-solo .cur-mga, .price-solo .cur-sep { display: none; }
html[data-cur="mga"] .price-solo .cur-mga { display: inline; }
html[data-cur="mga"] .price-solo .cur-eur { display: none; }

main { max-width: 1060px; margin: 0 auto; padding: 1.5rem 5vw 3rem; }
.page-title { margin: 1rem 0 1.5rem; color: var(--green-dark); }

/* hero */
.hero { display: grid; gap: 1.5rem; align-items: center; margin: 1rem 0 2rem; }
@media (min-width: 760px) { .hero { grid-template-columns: 1.1fr 1fr; } }
.hero-img { width: 100%; height: auto; border-radius: 14px; box-shadow: 0 6px 24px rgba(20,69,54,.18); }

/* hero carousel */
.hero-carousel {
  position: relative; width: 100%; overflow: hidden;
  border-radius: 14px; box-shadow: 0 6px 24px rgba(20,69,54,.18);
}
.hc-slide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity .8s ease;
}
.hc-slide.on { opacity: 1; }
/* frame height comes from the container's inline aspect-ratio (always set) */
.hc-dots {
  position: absolute; left: 0; right: 0; bottom: 10px;
  display: flex; justify-content: center; gap: 8px; z-index: 2;
}
.hc-dot {
  /* 24px hit area (mobile tap target), 12px visible dot */
  width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 6px;
  background: rgba(255,255,255,.55); background-clip: content-box;
  cursor: pointer; box-shadow: none;
}
.hc-dot.on { background-color: #fff; }
.hc-dot:focus-visible { outline: 2px solid #fff; }
.hero-text h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); color: var(--green-dark); line-height: 1.2; margin-bottom: 0.8rem; }
.hero-text p { margin-bottom: 1rem; }
.hero-ctas { display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.2rem; border-radius: 10px;
  text-decoration: none; font-weight: 600;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { filter: brightness(0.92); }

/* trust badges */
.trust-badges {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem; margin: 0 0 2.5rem;
}
.trust-badges div {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.7rem 1rem; font-weight: 500;
}

/* how it works */
.how-it-works { margin: 0 0 2.5rem; }
.how-it-works h2 { color: var(--green-dark); margin-bottom: 1rem; }
.steps { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem 1.3rem; }
.step-num {
  width: 34px; height: 34px; border-radius: 50%; background: var(--amber); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
  margin-bottom: 0.6rem;
}
.step h3 { color: var(--green-dark); margin-bottom: 0.3rem; font-size: 1.02rem; }
.step p { font-size: 0.95rem; }

/* FAQ */
.faq-list { max-width: 50rem; display: grid; gap: 0.7rem; }
.faq-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.9rem 1.2rem;
}
.faq-item summary { font-weight: 600; cursor: pointer; color: var(--green-dark); }
.faq-item[open] summary { margin-bottom: 0.5rem; }
.faq-item p { font-size: 0.97rem; }

/* home teaser → the finder on /routes/ */
.finder-teaser {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line);
  border-left: 5px solid var(--amber); border-radius: 12px;
  padding: 1rem 1.4rem; margin: 0 0 2.5rem;
}
.finder-teaser p { font-weight: 600; margin: 0; }
@media (max-width: 560px) { .finder-teaser .btn { width: 100%; justify-content: center; } }

/* From/To price finder */
.finder {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.5rem; margin: 0 0 2.5rem;
}
.finder h2 { color: var(--green-dark); }
.finder .sub { color: var(--muted); margin-bottom: 1rem; }
.finder-controls { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); max-width: 34rem; }
.finder-controls label { display: grid; gap: 0.3rem; font-weight: 600; }
.finder-controls select {
  font: inherit; font-weight: 400; padding: 0.6rem 0.7rem;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%;
}
.finder-controls select:focus { outline: 2px solid var(--green); }
#f-result { margin-top: 1rem; }
.finder .small { margin-top: 1rem; }
.f-meta { color: var(--muted); margin-bottom: 0.6rem; }
.price-rows { display: grid; gap: 0.5rem; max-width: 34rem; }
.price-row {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  background: var(--cream); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.6rem 0.9rem;
}
.pr-label { font-weight: 600; min-width: 9.5rem; }
.pr-price { flex: 1; }
.btn-book {
  background: var(--green); color: #fff; padding: 0.5rem 1.1rem;
  border-radius: 8px; font-weight: 600; text-decoration: none;
  min-height: 40px; display: inline-flex; align-items: center;
}
.btn-book:hover { background: var(--green-dark); }
@media (max-width: 480px) {
  .price-row { align-items: stretch; }
  .btn-book { width: 100%; justify-content: center; }
}

/* route sections & cards */
.route-section { margin-bottom: 2.5rem; }
.route-section h2 { color: var(--green-dark); }
.route-section .sub { color: var(--muted); margin-bottom: 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 1rem 1.2rem; text-decoration: none; color: var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(20,69,54,.12); }
.card h3 { color: var(--green); margin-bottom: 0.4rem; font-size: 1.05rem; }
.card .facts { color: var(--muted); font-size: 0.9rem; }
.card .price-from { margin-top: 0.5rem; color: var(--green-dark); }
.card .price-from .cur { font-size: 1.15rem; }
.pp-group { color: var(--muted); font-size: 0.78rem; }
.price-table strong { color: var(--green-dark); }
.price-table .pp { color: var(--muted); font-size: 0.85rem; }
.small { font-size: 0.85rem; }

.custom-banner {
  background: var(--green-dark); color: #fff;
  border-radius: 14px; padding: 2rem; text-align: center;
}
.custom-banner p { max-width: 46rem; margin: 0.6rem auto 1.2rem; color: #dbe8e2; }

/* route mini-guide + 7-day itinerary (Tier A) */
.guide { max-width: 62ch; margin: 1.2rem 0; font-size: 1.02rem; }
.guide-quote {
  max-width: 62ch; margin: 1.4rem 0; padding: 0.6rem 0 0.6rem 1.1rem;
  border-left: 3px solid var(--green-dark); color: var(--green-dark);
  font-size: 1.08rem; line-height: 1.5;
}
.itin-teaser { border-left-color: var(--green); margin-top: 2.5rem; }
.days { display: grid; gap: 0.9rem; max-width: 46rem; margin: 1.5rem 0; }
.day-card {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.1rem 1.2rem;
}
.day-card .step-num { flex-shrink: 0; margin-bottom: 0; }
.day-body h2 { color: var(--green-dark); font-size: 1.05rem; margin: 0.15rem 0 0.3rem; }
.day-body p { font-size: 0.97rem; }
.day-link { margin-top: 0.4rem; font-size: 0.9rem; }
.day-link a { font-weight: 600; }

/* route detail */
.route-detail h1 { color: var(--green-dark); margin: 0.5rem 0 0.3rem; }
.route-line { color: var(--muted); margin-bottom: 1rem; }
.facts-table { border-collapse: collapse; margin: 1.2rem 0; min-width: min(100%, 420px); }
.facts-table th, .facts-table td { text-align: left; padding: 0.5rem 1rem 0.5rem 0; border-bottom: 1px solid var(--line); }
.facts-table th { color: var(--muted); font-weight: 600; padding-right: 2rem; }
.route-detail h2 { color: var(--green-dark); margin: 1.4rem 0 0.5rem; }
.route-detail ul { padding-left: 1.3rem; margin-bottom: 1rem; }
.note {
  background: #fdf3e4; border-left: 4px solid var(--amber);
  padding: 0.6rem 1rem; border-radius: 0 8px 8px 0; margin: 0.8rem 0; font-size: 0.95rem;
}
/* The second price is an ALTERNATIVE, not a warning: green rather than the
   amber caution note, so a customer reads "here is another option" instead of
   "careful". The flexible-dates line is the actual sales pitch — it turns the
   price gap into a reason to talk to us. */
.area-note { background: #eef6ef; border-left-color: var(--green-dark); }
.area-note .flex { display: block; margin-top: 0.35rem; color: var(--green-dark); font-weight: 600; }
.route-detail .hero-ctas { margin-top: 1.5rem; }

/* about */
.about-block { display: grid; gap: 1.5rem; align-items: center; margin-bottom: 2.5rem; }
@media (min-width: 700px) { .about-block { grid-template-columns: 320px 1fr; } }
.about-img { width: 100%; border-radius: 12px; }
.about-block h2 { color: var(--green-dark); margin-bottom: 0.5rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.8rem; margin-top: 1rem; }
.gallery img { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; }

/* contact */
.contact-intro { max-width: 46rem; margin-bottom: 2rem; }
.contact-cols { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.contact-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem;
}
.contact-card h2 { color: var(--green-dark); margin-bottom: 0.5rem; font-size: 1.15rem; }
.contact-card p { margin-bottom: 1rem; }

/* booking form */
.form-card form { display: grid; gap: 0.9rem; }
.form-card label { display: grid; gap: 0.3rem; font-weight: 600; font-size: 0.95rem; }
.form-card input, .form-card select, .form-card textarea {
  font: inherit; font-weight: 400;
  padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); width: 100%;
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  outline: 2px solid var(--green); border-color: var(--green);
}
.form-card button { justify-content: center; }
.form-error {
  background: #fdecea; border-left: 4px solid #c0392b; color: #7b241c;
  padding: 0.6rem 1rem; border-radius: 0 8px 8px 0; margin-bottom: 1rem;
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-cols > div > .contact-card { margin-bottom: 1.2rem; }
.thanks { max-width: 46rem; }

/* partner application + booking terms */
.req-list { padding-left: 1.3rem; display: grid; gap: 0.5rem; }
.terms-list { max-width: 62ch; margin-bottom: 1.5rem; }

/* footer */
/* ---- Footer (rebuilt 2026-08-10) -----------------------------------------
   Was two thin columns, one of which promised a Facebook page that has not
   existed since 15 July. Now four: the brand, then the two link groups a
   reader actually wants, then contact.
   The link columns are not decoration. This footer sits on all 138 pages, so
   it is the cheapest internal linking the site has — and until today it did
   not point at the guide cluster at all. */
.site-footer { background: var(--green-dark); color: #dbe8e2; padding: 2.4rem 5vw 1.6rem; margin-top: 2rem; }
.footer-cols {
  display: grid; gap: 1.6rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  max-width: 1060px; margin: 0 auto 1.6rem;
}
.footer-brand .fb-name {
  display: flex; align-items: center; gap: 0.55rem;
  color: #fff; font-weight: 700; font-size: 1.05rem; margin-bottom: 0.5rem;
}
.footer-brand .fb-name .flag { flex: none; border-radius: 2px; }
.footer-brand p { color: #9db8ae; font-size: 0.92rem; line-height: 1.5; }
.site-footer h3 {
  color: #fff; margin-bottom: 0.6rem; font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.35rem; font-size: 0.95rem; }
.site-footer a { color: #f2c36b; text-decoration: none; }
.site-footer a:hover, .site-footer a:focus { text-decoration: underline; }
/* The trust line closes the footer, so it gets a rule above it rather than
   sitting in the run of text like one more sentence. */
.trust-line {
  text-align: center; font-weight: 600; color: #fff;
  max-width: 1060px; margin: 0 auto; padding-top: 1.3rem;
  border-top: 1px solid rgba(255,255,255,.14);
}
.site-footer .muted, .muted { color: var(--muted); }
.site-footer .muted { color: #9db8ae; text-align: center; font-size: 0.88rem; margin-top: 0.45rem; }

/* floating WhatsApp button */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--wa); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.wa-float svg { width: 28px; height: 28px; }

/* ---- Guide cluster (2026-08-10) -------------------------------------------
   The informational half of the site: a hub at /guides/ and long-form pages.
   Deliberately plain — these pages are read, not scanned, and a reader who
   came from a search for "is it safe to drive at night" is not shopping yet. */
.guide-page { max-width: 44rem; }
.guide-list { list-style: none; padding-left: 0; }
.guide-card {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 0.9rem 1.1rem; margin-bottom: 0.9rem; background: #fff;
}
.guide-card a { text-decoration: none; }
.guide-card strong { color: var(--green-dark); font-size: 1.05rem; }
.guide-card p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.95rem; }
.note.guide-link { background: #eef6ee; border-left-color: var(--green-dark); }
/* Wide fee tables must scroll inside their own box — the page body never
   scrolls sideways on a phone, which is most of our traffic. */
.table-wrap { overflow-x: auto; margin: 1.2rem 0; }
.guide-table { border-collapse: collapse; width: 100%; min-width: 22rem; font-size: 0.95rem; }
.guide-table th, .guide-table td {
  text-align: left; padding: 0.5rem 0.9rem 0.5rem 0;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.guide-table th { color: var(--green-dark); font-weight: 600; white-space: nowrap; }

/* ---- Photographs (2026-08-10) ---------------------------------------------
   Our own pictures only. The caption carries the month it was taken, which no
   competitor does — it is the difference between a photograph and stock. */
.photo { margin: 1.4rem 0; }
.photo img {
  width: 100%; height: auto; display: block;
  border-radius: 10px; background: #eee;
}
.photo figcaption {
  margin-top: 0.45rem; font-size: 0.88rem; color: var(--muted); font-style: italic;
}

/* Tomrese-erbjudande i bokningsformuläret (D29). Guldkanten är samma signal
   som knappen "Book now" i sidhuvudet — kunden ska känna igen att det här är
   ett pris, inte en varning. */
.leg-offer{background:#fdf6e8;border-left:4px solid #f2c36b;border-radius:5px;
  padding:.7rem .9rem;margin:0 0 1rem;line-height:1.5}
.leg-offer strong{display:block;font-size:.9rem;color:#5a4a2a}
.leg-offer .leg-p{display:block;font-size:1.35rem;font-weight:700;color:#173d31;
  margin-top:.15rem;font-variant-numeric:tabular-nums}
.leg-offer .leg-p s{font-size:.6em;font-weight:400;color:#9a958c;margin-left:.35rem}
.leg-offer .leg-t{display:block;font-size:.8rem;color:#5a4a2a;margin-top:.2rem}
.leg-offer.leg-gone{background:#f4f2ee;border-left-color:#a5a099;color:#5a6b64;font-size:.9rem}
