/* =========================================================
   Ember Legacy Expeditions — Vintage Retro UI (Flex-only)
   Author: Senior CSS Developer & UI Designer
   Notes:
   - Mobile-first, retro/vintage styling
   - Brand fonts: Trebuchet MS (display), Verdana (body)
   - Brand colors: primary #5E2D23, secondary #2E5E4E, accent #F6EFE7
   - CRITICAL: Flexbox only. No CSS Grid or Columns.
   - Includes: mobile menu + cookie consent banner/modal
   ========================================================= */

/* ---------- CSS Reset & Normalize ---------- */
* { box-sizing: border-box; }
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video { margin: 0; padding: 0; border: 0; font: inherit; vertical-align: baseline; }
html { line-height: 1.15; -webkit-text-size-adjust: 100%; }
body { line-height: 1.6; }
article, aside, footer, header, nav, section { display: block; }
ol, ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { background-color: transparent; text-decoration: none; color: inherit; }
button { font: inherit; background: none; border: 0; cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 3px dashed #5E2D23; outline-offset: 3px; }

/* ---------- Design Tokens (with fallbacks) ---------- */
:root {
  --clay-900: #5E2D23; /* primary */
  --gumleaf-700: #2E5E4E; /* secondary */
  --parchment: #F6EFE7; /* accent / background */
  --ink-900: #2B1E1A; /* dark text */
  --ink-700: #3A2A26;
  --rust-700: #8C4A35;
  --gold-500: #C7A36A;
  --bone: #FFF9F2;
  --paper: #FCF7F0;
  --shadow: rgba(46, 32, 28, 0.12);
}

/* ---------- Base Typography ---------- */
body {
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  color: var(--ink-900);
  background-color: var(--paper);
  font-size: 16px;
}

h1, h2, h3, h4 { font-family: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", Arial, sans-serif; color: var(--clay-900); line-height: 1.2; }

h1 { font-size: 40px; letter-spacing: 0.5px; }
h2 { font-size: 28px; margin-top: 8px; }
h3 { font-size: 20px; }

p, li { font-size: 16px; color: var(--ink-800, #3A2A26); }
strong { font-weight: 700; color: var(--ink-900); }

small { font-size: 14px; }

/* Type scale bump on larger screens */
@media (min-width: 768px) {
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
  h3 { font-size: 22px; }
  p, li { font-size: 18px; }
}

/* ---------- Layout Primitives (Flex-only) ---------- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex; /* flex container per requirement */
  flex-direction: column;
  align-items: stretch;
}

.content-wrapper {
  display: flex; /* flex container per requirement */
  flex-direction: column;
  align-items: flex-start;
  gap: 24px; /* consistent spacing rhythm */
}

/* Mandatory spacing & alignment patterns */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; }
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Enforce mobile column layout for text-image blocks */
@media (max-width: 768px) {
  .text-image-section { flex-direction: column; }
}

/* ---------- Vintage Surfaces & Card Aesthetic ---------- */
.surface-cream { background: var(--parchment); }
.surface-bone { background: var(--bone); }

.card,
.text-section,
.testimonial-card {
  background: var(--bone);
  border: 3px double var(--clay-900);
  border-radius: 10px;
  box-shadow: 6px 6px 0 0 var(--gold-500), 0 2px 12px var(--shadow);
}

.text-section { padding: 20px; }

/* ---------- Header & Navigation ---------- */
header {
  background: var(--parchment);
  border-bottom: 4px double var(--clay-900);
}

header .content-wrapper {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.logo { display: flex; align-items: center; }
.logo img { height: 40px; width: auto; }

.main-nav { display: none; }
.main-nav, .footer-nav { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

.main-nav a {
  color: var(--clay-900);
  padding: 10px 12px;
  border: 2px solid transparent;
  border-radius: 8px;
  transition: color 180ms ease, background-color 180ms ease, transform 120ms ease, border-color 180ms ease;
  font-weight: 600;
}

.main-nav a:hover { background: var(--bone); border-color: var(--gold-500); transform: translateY(-1px); }
.main-nav a:active { transform: translateY(0); }

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border: 2px solid var(--clay-900);
  border-radius: 8px;
  color: var(--clay-900);
  background: var(--bone);
  box-shadow: 3px 3px 0 0 var(--gold-500);
  transition: transform 150ms ease, background-color 150ms ease;
}
.mobile-menu-toggle:hover { background: #fff; transform: translateY(-1px); }
.mobile-menu-toggle:active { transform: translateY(0); }

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(46, 32, 28, 0.92);
  display: flex; /* flex container */
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: 20px;
  transform: translateX(100%);
  transition: transform 260ms ease-out;
  z-index: 1000;
}
.mobile-menu .mobile-nav { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.mobile-menu .mobile-nav a {
  color: #fff; background: transparent;
  padding: 14px 12px; border-radius: 8px; border: 2px solid rgba(246, 239, 231, 0.25);
  font-weight: 700; letter-spacing: 0.3px;
}
.mobile-menu .mobile-nav a:hover { background: rgba(246, 239, 231, 0.08); border-color: var(--gold-500); }

/* Close button */
.mobile-menu-close {
  align-self: flex-end;
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; border: 2px solid #fff; border-radius: 8px;
}
.mobile-menu-close:hover { background: rgba(255,255,255,0.1); }

/* States supported for JS toggling */
.mobile-menu.open,
.mobile-menu.active,
.mobile-menu.is-open { transform: translateX(0); }

/* Show desktop nav on larger screens */
@media (min-width: 992px) {
  .main-nav { display: flex; }
  .mobile-menu-toggle { display: none; }
}

/* ---------- Hero Section ---------- */
.hero {
  background: var(--parchment);
  border-bottom: 4px double var(--clay-900);
}
.hero .content-wrapper { padding: 40px 0; }
.hero h1 {
  text-transform: none;
  text-shadow: 0 2px 0 #fff, 0 4px 0 var(--gold-500);
}
.hero p { max-width: 800px; }

/* Breadcrumbs */
.hero nav[aria-label="Breadcrumb"] { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-700); }
.hero nav[aria-label="Breadcrumb"] a { color: var(--gumleaf-700); border-bottom: 1px dotted var(--gumleaf-700); }
.hero nav[aria-label="Breadcrumb"] a:hover { color: var(--clay-900); border-bottom-color: var(--clay-900); }

/* Trust row */
.trust-row { color: var(--ink-700); letter-spacing: 0.6px; font-variant: small-caps; }

/* ---------- Links & Buttons ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.cta-row a,
.content-wrapper a[href^="mailto:"],
.content-wrapper a[href$=".html"]:not(.main-nav a) {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 18px;
  background: var(--clay-900);
  color: #fff;
  border-radius: 10px;
  border: 3px solid var(--ink-900);
  box-shadow: 4px 4px 0 0 var(--gold-500);
  transition: transform 120ms ease, background-color 180ms ease, box-shadow 120ms ease;
}

/* Secondary style for inline nav/links in body copy */
.content-wrapper p a:not(.cta-row a) {
  padding: 2px 4px; border-radius: 6px; background: transparent; border: 0; box-shadow: none; color: var(--gumleaf-700);
}
.content-wrapper p a:not(.cta-row a):hover { color: var(--clay-900); text-decoration: underline; }

.cta-row a:hover { transform: translate(-2px, -2px); background: var(--rust-700); }
.cta-row a:active { transform: translate(0, 0); box-shadow: 2px 2px 0 0 var(--gold-500); }

/* ---------- Sections & Lists ---------- */
main section { padding: 40px 0; }

.content-wrapper ul,
.content-wrapper ol { display: flex; flex-direction: column; gap: 10px; padding-left: 20px; }
.content-wrapper ul li { list-style: square; }
.content-wrapper ol li { list-style: decimal; }

/* Inline icon texts */
.text-section p img { width: 20px; height: 20px; margin-right: 8px; display: inline-block; vertical-align: middle; }
.text-section p { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Testimonials (High Contrast Light Cards) ---------- */
/* Ensure dark text on light background for readability */
.testimonial-card { background: #fff; color: var(--ink-900); }
.testimonial-card p { color: var(--ink-900); }

/* ---------- Footer ---------- */
footer { background: var(--parchment); border-top: 4px double var(--clay-900); }
footer .content-wrapper { padding: 30px 0; }
.footer-top { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.footer-nav a {
  color: var(--clay-900);
  padding: 8px 10px; border-radius: 6px; border: 2px solid transparent;
}
.footer-nav a:hover { border-color: var(--gold-500); background: var(--bone); }
footer .logo img { height: 36px; }

/* ---------- Utilities ---------- */
.muted { color: var(--ink-700); }
.center { display: flex; justify-content: center; align-items: center; }
.stack-20 { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }

/* ---------- Responsive Layout Tweaks ---------- */
@media (min-width: 768px) {
  .hero .content-wrapper { padding: 56px 0; }
  .logo img { height: 46px; }
}

@media (min-width: 992px) {
  /* Let multi-text sections breathe in two columns without grid */
  section .content-wrapper { gap: 28px; }
  /* Create flexible inline pairs for .text-section where multiple appear */
  section .content-wrapper { flex-wrap: wrap; }
  section .content-wrapper > h2,
  section .content-wrapper > p,
  section .content-wrapper > nav,
  section .content-wrapper > .cta-row { flex: 1 1 100%; }
  section .content-wrapper > .text-section { flex: 1 1 calc(50% - 12px); }
}

/* ---------- Forms (generic future-proofing) ---------- */
input, select, textarea { font: inherit; padding: 10px 12px; border-radius: 8px; border: 2px solid var(--clay-900); background: #fff; color: var(--ink-900); }
input:focus, select:focus, textarea:focus { border-color: var(--gumleaf-700); box-shadow: 0 0 0 3px rgba(46,94,78,0.15); }

/* ---------- Cookie Consent Banner ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--parchment);
  border-top: 4px double var(--clay-900);
  box-shadow: 0 -6px 0 0 var(--gold-500), 0 -2px 12px var(--shadow);
  padding: 16px 20px;
  display: flex; /* flex container */
  flex-direction: column; gap: 12px; align-items: stretch;
  transform: translateY(110%);
  transition: transform 240ms ease-out;
  z-index: 1100;
}
.cookie-banner.show,
.cookie-banner.active,
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-banner .cookie-text { display: flex; flex-direction: column; gap: 8px; color: var(--ink-900); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cookie-actions .btn { padding: 10px 14px; border-radius: 8px; border: 3px solid var(--ink-900); box-shadow: 3px 3px 0 0 var(--gold-500); font-weight: 700; }
.cookie-accept { background: var(--clay-900); color: #fff; }
.cookie-reject { background: #fff; color: var(--clay-900); }
.cookie-settings { background: var(--bone); color: var(--ink-900); }
.cookie-actions .btn:hover { transform: translate(-1px, -1px); }

/* ---------- Cookie Preferences Modal ---------- */
.cookie-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: none; /* toggled by JS */
  align-items: center; justify-content: center;
  z-index: 1200;
}
.cookie-modal-backdrop.open,
.cookie-modal-backdrop.active { display: flex; }

.cookie-modal {
  background: var(--bone);
  border: 4px double var(--clay-900);
  border-radius: 12px;
  width: 92%; max-width: 640px;
  padding: 20px;
  box-shadow: 8px 8px 0 0 var(--gold-500), 0 6px 24px var(--shadow);
  display: flex; flex-direction: column; gap: 16px;
}
.cookie-modal h3 { margin-bottom: 4px; }
.cookie-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--gold-500); }
.cookie-row:last-child { border-bottom: 0; }

/* Simple toggle style */
.cookie-switch {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
}
.cookie-switch input { appearance: none; width: 44px; height: 24px; border-radius: 24px; border: 2px solid var(--clay-900); background: #fff; position: relative; }
.cookie-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--clay-900); transition: left 160ms ease; }
.cookie-switch input:checked { background: var(--gumleaf-700); border-color: var(--gumleaf-700); }
.cookie-switch input:checked::after { left: 22px; background: #fff; }

.cookie-modal .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.cookie-modal .actions .btn { padding: 10px 14px; border-radius: 8px; border: 3px solid var(--ink-900); box-shadow: 3px 3px 0 0 var(--gold-500); font-weight: 700; }
.cookie-modal .actions .btn.primary { background: var(--clay-900); color: #fff; }
.cookie-modal .actions .btn.secondary { background: #fff; color: var(--clay-900); }

/* ---------- Accessibility & Contrast Enhancements ---------- */
.testimonial-card a, .text-section a { color: var(--gumleaf-700); }
.testimonial-card a:hover, .text-section a:hover { color: var(--clay-900); text-decoration: underline; }

/* ---------- Additional Decorative Accents (retro vibes) ---------- */
hr { border: 0; height: 8px; background: repeating-linear-gradient(90deg, var(--gold-500), var(--gold-500) 8px, transparent 8px, transparent 16px); }

/* ---------- Page-specific micro layouts (using flex only) ---------- */
/* Hero callouts and info rows */
.hero .cta-row { margin-top: 6px; }

/* Contact blocks & inline icon rows */
.text-section .cta-row a { background: var(--gumleaf-700); }
.text-section .cta-row a:hover { background: #244d40; }

/* Rating lines and summaries */
.content-wrapper p:has(strong) { /* safe fallback: non-critical; ignored if unsupported */ }

/* ---------- Ensure no overlap & consistent spacing ---------- */
main .content-wrapper > * { margin: 0; }
main .content-wrapper { gap: 24px; }

/* ---------- Print-friendly tweaks ---------- */
@media print {
  .mobile-menu, .mobile-menu-toggle, .cookie-banner, .cookie-modal-backdrop { display: none !important; }
  a { text-decoration: underline; color: #000; }
  body { background: #fff; box-shadow: none; }
}
