/* ===============================
   Dazzle & Hush — Vintage Retro CSS Theme
   Mobile-first • Flexbox-only • Accessible • Brand-aligned
   =============================== */

/* -------------------------------
   CSS RESET & NORMALIZE
   ------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1F2A44; /* ink */
  background-color: #F7F3E3; /* retro paper */
}
img {
  max-width: 100%;
  height: auto;
}
a {
  color: #6C5CE7; /* brand secondary */
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 3px solid #D8A31A; /* mustard focus */
  outline-offset: 2px;
}
ul, ol {
  margin: 0 0 16px 0;
  padding-left: 24px;
}
h1, h2, h3, h4 {
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  margin: 0 0 12px 0;
  line-height: 1.2;
  color: #1F2A44;
}
p {
  margin: 0 0 16px 0;
}

/* -------------------------------
   CSS CUSTOM PROPERTIES (Brand + Retro palette)
   ------------------------------- */
:root {
  --brand-ink: #1F2A44; /* primary */
  --brand-plum: #6C5CE7; /* secondary */
  --brand-accent: #F7F9FC; /* light accent */

  --paper: #F7F3E3; /* warm paper */
  --cream: #F3E9D7; /* alt paper */
  --mustard: #D8A31A;
  --rust: #B3541E;
  --teal: #2E6F6C;
  --forest: #2F4F4F;
  --rose: #C75C5C;
  --ink: #1F2A44;
  --shadow: rgba(31, 42, 68, 0.15);
}

/* -------------------------------
   TYPOGRAPHY SCALE (mobile-first)
   ------------------------------- */
h1 { font-size: 32px; letter-spacing: 0.2px; }
h2 { font-size: 24px; letter-spacing: 0.2px; }
h3 { font-size: 18px; letter-spacing: 0.15px; }
.tagline { font-size: 18px; color: var(--forest); opacity: 0.95; }

@media (min-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }
}
@media (min-width: 1024px) {
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
  h3 { font-size: 24px; }
}

/* -------------------------------
   GLOBAL LAYOUT (Flexbox-only)
   ------------------------------- */
.container {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0 16px;
}
.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1120px;
}

/* Mandatory spacing patterns */
.section { margin-bottom: 60px; padding: 40px 20px; }
section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; display: flex; flex-direction: column; gap: 12px; }
.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; }

/* -------------------------------
   RETRO SURFACE STYLES & PATTERNS
   ------------------------------- */
/* Alternating section backgrounds for a nostalgic rhythm */
main > section:nth-of-type(odd) {
  background-color: var(--paper);
}
main > section:nth-of-type(even) {
  background-color: var(--cream);
}
/* Subtle retro stripe header for the first section (hero) */
main > section:first-of-type {
  position: relative;
  border-top: 6px double var(--ink);
  border-bottom: 2px solid rgba(31,42,68,0.1);
}
main > section:first-of-type::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(216,163,26,0.08) 0, rgba(216,163,26,0.08) 2px, transparent 2px, transparent 8px);
  pointer-events: none;
}

/* -------------------------------
   HEADER & NAVIGATION
   ------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--paper);
  border-bottom: 4px solid var(--rust);
  box-shadow: 0 2px 10px var(--shadow);
}
header .container { padding: 10px 16px; }
header .content-wrapper {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo img { height: 40px; display: block; }

/* Primary nav */
.main-nav {
  display: none; /* hidden on mobile */
  align-items: center;
  gap: 16px;
}
.main-nav a {
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 6px;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.1s ease;
}
.main-nav a:hover {
  background-color: rgba(31,42,68,0.06);
}
.main-nav a:active { transform: translateY(1px); }

/* CTA group (desktop) */
.cta-group {
  display: none; /* hidden on mobile */
  align-items: center;
  gap: 12px;
}

/* CTA buttons shared */
.cta-row, .cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.cta-row a, .cta-group a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background-color: var(--mustard);
  color: #1B1B1B;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 3px 0 #8a6c0f, 0 6px 12px rgba(31,42,68,0.15);
  transition: transform 0.12s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.cta-row a:hover, .cta-group a:hover {
  background-color: #e2b733;
}
.cta-row a:active, .cta-group a:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #8a6c0f, 0 3px 8px rgba(31,42,68,0.18);
}
/* Secondary style for alternate CTAs */
.cta-row a:nth-child(2), .cta-group a:nth-child(2) {
  background-color: var(--brand-plum);
  color: #fff;
  border-color: #2F2A6C;
  box-shadow: 0 3px 0 #392f9c, 0 6px 12px rgba(31,42,68,0.15);
}
.cta-row a:nth-child(2):hover, .cta-group a:nth-child(2):hover { background-color: #5a4be0; }

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 20px;
  background: var(--rust);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 2px 0 #7c3a12;
  cursor: pointer;
}
.mobile-menu-toggle:hover { background: #c1612a; }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 0 0 0 auto; /* anchor right */
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  transform: translateX(100%);
  transition: transform 0.35s ease;
  z-index: 2000;
  border-left: 6px double var(--ink);
}
.mobile-menu::before { /* dim background stripes for retro vibe */
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(-45deg, rgba(44,88,86,0.08) 0, rgba(44,88,86,0.08) 2px, transparent 2px, transparent 10px);
  pointer-events: none;
}
/* JS should toggle one of these classes */
.mobile-menu.open, .mobile-menu.active, .mobile-menu.is-open { transform: translateX(0); }

.mobile-menu-close {
  align-self: flex-end;
  margin: 12px 16px 0 0;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--rose);
  color: #fff; border: 2px solid var(--ink); border-radius: 8px;
  box-shadow: 0 2px 0 #8f3e3e;
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
}
.mobile-nav a {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff;
  border: 2px solid var(--ink);
  color: var(--ink);
  font-weight: 700;
}
.mobile-nav a:hover { background: var(--brand-accent); }

/* Desktop nav visibility */
@media (min-width: 992px) {
  .main-nav { display: flex; }
  .cta-group { display: flex; }
  .mobile-menu-toggle { display: none; }
}

/* -------------------------------
   TEXT BLOCKS & LISTS (retro bullets)
   ------------------------------- */
.text-section { display: flex; flex-direction: column; gap: 12px; }
.text-section ul li, .text-section ol li { margin-bottom: 8px; }
.text-section ul { list-style: none; padding-left: 0; }
.text-section ul li {
  position: relative;
  padding-left: 26px;
}
.text-section ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0 3px, var(--mustard) 3px 100%);
  border: 2px solid var(--ink);
}
.text-section ol { counter-reset: retro; padding-left: 0; }
.text-section ol li {
  list-style: none; position: relative; padding-left: 34px; counter-increment: retro;
}
.text-section ol li::before {
  content: counter(retro) ".";
  position: absolute; left: 0; top: 0;
  font-weight: 700; color: var(--rust);
  background: #fff; border: 2px solid var(--ink); border-radius: 6px;
  width: 26px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
}

/* Inline icons in paragraphs */
p img { display: inline-block; vertical-align: middle; margin-right: 8px; height: 18px; width: 18px; }

/* Links inside text */
.text-section a {
  color: var(--rust);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 rgba(179,84,30,0.3);
  transition: box-shadow 0.2s ease, color 0.2s ease;
}
.text-section a:hover { box-shadow: inset 0 -8px 0 rgba(179,84,30,0.15); }

/* -------------------------------
   TESTIMONIALS (high contrast)
   ------------------------------- */
.testimonial-card {
  background: #fffdf8; /* light paper */
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 8px 20px var(--shadow);
}
.testimonial-card p { margin: 0; }
.testimonial-card p + p { margin-top: 8px; color: var(--forest); }
.testimonial-card::before {
  content: "\201C";
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 40px;
  color: var(--mustard);
  margin-right: 8px;
}

/* -------------------------------
   FOOTER
   ------------------------------- */
footer {
  background: var(--brand-ink);
  color: #fff;
  border-top: 6px double #0f1626;
}
footer .content-wrapper { padding: 20px 0; }
footer .text-section h3 { color: #fff; }
footer a { color: #F7F9FC; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-nav a {
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
}
.footer-nav a:hover { background: rgba(255,255,255,0.18); }

/* -------------------------------
   CARDS & UTILITIES
   ------------------------------- */
.card {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 20px var(--shadow);
}
.card--retro::after { /* decorative corner fold */
  content: ""; position: absolute; right: 10px; top: 10px; width: 14px; height: 14px;
  background: linear-gradient(135deg, transparent 50%, rgba(31,42,68,0.2) 50%);
}

/* Any grouped layouts */
.card-container { align-items: stretch; }
.content-grid > * { flex: 1 1 260px; }
.text-image-section { align-items: center; }
.text-image-section > * { flex: 1 1 300px; }

/* -------------------------------
   RESPONSIVE CONTROLS
   ------------------------------- */
/* Mobile defaults already columnar; enhance on wider screens */
@media (min-width: 768px) {
  .cta-row { flex-direction: row; }
}
@media (max-width: 768px) {
  .text-image-section { flex-direction: column; }
  .cta-row a, .cta-group a { width: 100%; }
}

/* -------------------------------
   PAGE-SPECIFIC POLISH
   ------------------------------- */
/* Hero headline styling */
main > section:first-of-type h1 {
  text-transform: none;
  letter-spacing: 0.5px;
}
#resources-preview .text-section ul li::before { background: radial-gradient(circle at 30% 30%, #fff 0 3px, var(--teal) 3px 100%); }

/* -------------------------------
   MOBILE MENU ANIMATIONS (slide)
   ------------------------------- */
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideOutRight { from { transform: translateX(0); } to { transform: translateX(100%); } }
.mobile-menu.open, .mobile-menu.active, .mobile-menu.is-open { animation: slideInRight 0.35s ease both; }

/* -------------------------------
   COOKIE CONSENT BANNER & MODAL
   ------------------------------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #fffdf8;
  color: var(--ink);
  border-top: 4px solid var(--rust);
  box-shadow: 0 -8px 20px var(--shadow);
  z-index: 2500;
  transform: translateY(100%);
  transition: transform 0.35s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-text { display: flex; flex: 1 1 260px; align-items: center; gap: 10px; }
.cookie-actions { display: flex; align-items: center; gap: 10px; }
.cookie-actions .btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 14px; border-radius: 10px; border: 2px solid var(--ink);
  font-weight: 700; cursor: pointer;
}
.btn-accept { background: var(--mustard); color: #1B1B1B; box-shadow: 0 3px 0 #8a6c0f; }
.btn-accept:hover { background: #e2b733; }
.btn-reject { background: #fff; color: var(--ink); box-shadow: 0 3px 0 rgba(31,42,68,0.25); }
.btn-reject:hover { background: var(--brand-accent); }
.btn-settings { background: var(--brand-plum); color: #fff; box-shadow: 0 3px 0 #392f9c; }
.btn-settings:hover { background: #5a4be0; }

/* Cookie modal */
.cookie-modal {
  position: fixed;
  inset: 0;
  display: none; /* hidden by default */
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2600;
}
.cookie-modal.show { display: flex; }
.cookie-modal::before { /* overlay */
  content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0.45);
}
.cookie-dialog {
  position: relative;
  display: flex; flex-direction: column; gap: 16px;
  width: 100%; max-width: 560px;
  background: #fffdf8;
  border: 4px double var(--ink);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  z-index: 1;
}
.cookie-dialog h3 { margin-bottom: 4px; }
.cookie-rows { display: flex; flex-direction: column; gap: 12px; }
.cookie-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: #fff; border: 1px solid rgba(31,42,68,0.15); border-radius: 8px; }
.cookie-row .label { display: flex; flex-direction: column; }
.cookie-actions-modal { display: flex; justify-content: flex-end; gap: 10px; }

/* Toggle switch */
.toggle {
  position: relative; width: 48px; height: 28px; display: inline-flex; align-items: center;
}
.toggle input { appearance: none; -webkit-appearance: none; width: 100%; height: 100%; outline: none; margin: 0; }
.toggle .slider {
  position: absolute; inset: 0; background: #ddd0b4; border: 2px solid var(--ink); border-radius: 18px; transition: background 0.2s ease;
}
.toggle .knob {
  position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--mustard); border: 2px solid var(--ink); transition: transform 0.2s ease;
}
.toggle input:checked + .slider { background: #bfe0db; }
.toggle input:checked ~ .knob { transform: translateX(20px); }
.toggle input:disabled + .slider { background: #f1e9d6; }

/* -------------------------------
   ACCESSIBILITY & MISC UTILITIES
   ------------------------------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* -------------------------------
   FORMATTING OF HEADINGS SECTIONS
   ------------------------------- */
/* Retro underline accent for h2 */
.content-wrapper > h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 4px double var(--ink);
}

/* -------------------------------
   BUTTON-LIKE LINKS IN FLOWS
   ------------------------------- */
/* Ensure CTAs inside text sections look buttony when used */
.text-section .cta, .text-section .button, .text-section p > a[href*="pricing"], .text-section p > a[href*="services"] {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 12px; margin-top: 4px;
  border-radius: 8px; border: 2px solid var(--ink);
  background: #fff;
  font-weight: 700; color: var(--ink);
}
.text-section .cta:hover, .text-section .button:hover, .text-section p > a[href*="pricing"]:hover, .text-section p > a[href*="services"]:hover {
  background: var(--brand-accent);
}

/* -------------------------------
   LINKS IN NAV & FOOTER TOUCH TARGETS
   ------------------------------- */
nav a { min-height: 36px; display: inline-flex; align-items: center; }

/* -------------------------------
   PREVENT OVERLAPS: ensure spacing
   ------------------------------- */
section .testimonial-card + .testimonial-card { margin-top: 16px; }
.content-wrapper > * + * { margin-top: 0; } /* rely on gaps/margins already */

/* -------------------------------
   PRINT FRIENDLY (basic)
   ------------------------------- */
@media print {
  header, .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  a { text-decoration: underline; }
  section { background: #fff !important; }
}
