/* ====================================================
   Fuge & Fundament - Professional Corporate Stylesheet
   Mobile-first, flexbox-only, accessible UI
   Brand: Blue/Gray palette, business fonts, formal tone
   ==================================================== */

/* ------------------------------
   CSS Reset / Normalize (compact)
   ------------------------------ */
* { box-sizing: border-box; }
*::before, *::after { box-sizing: inherit; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { padding-left: 1.2rem; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
button { font: inherit; border: none; background: none; cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 3px solid #7aa7ff; outline-offset: 2px; }

/* ------------------------------
   Theme Variables (with fallbacks)
   ------------------------------ */
:root {
  --primary: #1F3A5F;
  --primary-700: #18304f;
  --primary-600: #1c3457;
  --secondary: #9C5A16;
  --secondary-700: #7f4811;
  --accent: #F5F3EE;
  --text: #1B2838;
  --text-muted: #5E6A7A;
  --border: #E1E6EF;
  --bg: #FFFFFF;
  --shadow-1: 0 6px 18px rgba(31, 58, 95, 0.08);
  --shadow-2: 0 10px 30px rgba(31, 58, 95, 0.12);
}

/* ------------------------------
   Base Typography
   ------------------------------ */
body {
  font-family: Verdana, Tahoma, Arial, sans-serif; /* brand body */
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}
h1, h2, h3, h4, h5, h6 { font-family: 'Trebuchet MS', 'Segoe UI', Tahoma, Arial, sans-serif; /* brand display */ }
h1 { font-size: 28px; line-height: 1.2; letter-spacing: 0.2px; color: var(--primary); margin-bottom: 16px; }
h2 { font-size: 24px; line-height: 1.3; color: var(--primary-700); margin-bottom: 16px; }
h3 { font-size: 18px; line-height: 1.4; color: var(--primary-700); margin: 16px 0 8px; }
p { margin-bottom: 14px; }
ul, ol { margin: 12px 0 18px; }
strong { font-weight: 700; }

/* ------------------------------
   Layout Wrappers (Flexbox-only)
   ------------------------------ */
.container { /* centers and constrains content */
  display: flex; justify-content: center; width: 100%; padding: 0 16px; margin: 0 auto;
}
.content-wrapper { /* main row inside container */
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 20px; width: 100%; max-width: 1160px; padding: 20px 0;
}
section { margin-bottom: 60px; padding: 40px 0; }

/* MANDATORY SPACING AND 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; }

/* ------------------------------
   Header & Navigation
   ------------------------------ */
header { background: #ffffff; border-bottom: 1px solid var(--border); position: relative; z-index: 50; }
header .content-wrapper { flex-direction: row; align-items: center; gap: 16px; padding: 14px 0; }
.logo { display: flex; align-items: center; }
.logo img { height: 40px; width: auto; }

.main-nav { display: none; align-items: center; gap: 18px; }
.main-nav a { color: var(--text); padding: 10px 8px; border-radius: 6px; transition: color 0.2s ease, background-color 0.2s ease; }
.main-nav a:hover { color: var(--primary); background-color: #f1f5fb; }
.main-nav a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.header-ctas { display: none; align-items: center; gap: 12px; }
.header-ctas a { padding: 10px 14px; border-radius: 8px; background: var(--primary); color: #fff; box-shadow: var(--shadow-1); transition: background-color 0.2s ease, transform 0.15s ease; }
.header-ctas a:hover { background: var(--primary-600); transform: translateY(-1px); }
.header-ctas a:nth-child(2) { background: #ffffff; color: var(--primary); border: 1px solid var(--primary); box-shadow: none; }
.header-ctas a:nth-child(2):hover { background: #f7fbff; }

.mobile-menu-toggle { margin-left: auto; width: 42px; height: 42px; border-radius: 8px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s ease, transform 0.15s ease; }
.mobile-menu-toggle:hover { background: var(--primary-600); transform: translateY(-1px); }
.mobile-menu-toggle:focus-visible { outline: 3px solid #a8c1ff; }

/* Mobile Menu Overlay */
.mobile-menu { position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; background: #ffffff; transform: translateX(100%); transition: transform 0.35s ease; box-shadow: var(--shadow-2); z-index: 999; }
.mobile-menu-close { align-self: flex-end; margin: 16px; width: 42px; height: 42px; border-radius: 8px; background: #f3f6fb; color: var(--primary); display: flex; align-items: center; justify-content: center; }
.mobile-nav { display: flex; flex-direction: column; gap: 10px; padding: 0 24px 24px; }
.mobile-nav a { padding: 14px 12px; border-radius: 8px; color: var(--text); border: 1px solid transparent; }
.mobile-nav a:hover { background: #f6f9ff; border-color: #e7eef9; color: var(--primary); }
/* Open states supported via several selectors for robustness */
.mobile-menu.open,
.mobile-menu.active,
body.menu-open .mobile-menu,
html.menu-open .mobile-menu { transform: translateX(0); }

/* ------------------------------
   Hero Section
   ------------------------------ */
.hero { background: var(--accent); border-top: 1px solid #eee; border-bottom: 1px solid #eee; }
.hero .content-wrapper { align-items: flex-start; gap: 16px; padding: 32px 0; }
.hero .subheadline { color: var(--text); font-size: 16px; max-width: 58ch; }

/* CTA group (buttons) */
.cta-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.cta-group a,
.footer-cta a,
.header-ctas a,
.cta-inline a { display: inline-flex; align-items: center; justify-content: center; padding: 12px 16px; border-radius: 10px; font-weight: 700; letter-spacing: 0.2px; transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease; border: 1px solid transparent; }
/* Primary (first) */
.cta-group a:first-child, .cta-inline a:first-child { background: var(--primary); color: #fff; box-shadow: var(--shadow-1); }
.cta-group a:first-child:hover, .cta-inline a:first-child:hover { background: var(--primary-600); transform: translateY(-1px); }
/* Secondary (second) */
.cta-group a:nth-child(2), .cta-inline a:nth-child(2) { background: #ffffff; color: var(--primary); border-color: var(--primary); }
.cta-group a:nth-child(2):hover, .cta-inline a:nth-child(2):hover { background: #f7fbff; }

/* Trust badges / USPs */
.trust-badges ul, .usp-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding-left: 0; margin-top: 10px; }
.trust-badges li, .usp-list li { background: #f2f6fb; color: var(--primary-700); border: 1px solid #e1e9f5; padding: 8px 12px; border-radius: 999px; font-size: 14px; }

/* ------------------------------
   Text Sections
   ------------------------------ */
.text-section { display: flex; flex-direction: column; gap: 8px; max-width: 900px; }
.text-section ul, .text-section ol { padding-left: 1.2rem; }
.text-section li { margin-bottom: 8px; }

/* Quotes in references */
.quote { border-left: 4px solid var(--secondary); padding-left: 12px; color: var(--text); font-style: italic; }

/* ------------------------------
   Testimonials (light, high-contrast)
   ------------------------------ */
.testimonial-card { background: #ffffff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-1); color: var(--text); }
.testimonial-card p { margin: 0; }
.testimonial-card p + p { color: var(--text-muted); }

/* ------------------------------
   Cards (generic)
   ------------------------------ */
.card { background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-1); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.card:hover { box-shadow: var(--shadow-2); transition: box-shadow 0.25s ease, transform 0.15s ease; transform: translateY(-2px); }

/* ------------------------------
   Footer
   ------------------------------ */
footer { background: var(--primary); color: #e8effa; }
footer .content-wrapper { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 28px 0; }
.footer-brand { display: flex; flex-direction: column; gap: 12px; max-width: 460px; }
.footer-brand img { height: 42px; width: auto; filter: brightness(0) invert(1); }
.footer-brand p { color: #d7e2f5; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a { color: #e8effa; padding: 6px 0; border-radius: 6px; }
.footer-nav a:hover { color: #ffffff; text-decoration: underline; }
.footer-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.footer-cta a { background: #ffffff; color: var(--primary); border: 1px solid transparent; }
.footer-cta a:hover { background: #f7fbff; }

/* ------------------------------
   Links & Interactive Elements
   ------------------------------ */
a { color: var(--primary); }
a:hover { color: var(--primary-600); }

/* ------------------------------
   Cookie Consent Banner & Modal
   ------------------------------ */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: #ffffff; border-top: 1px solid var(--border); box-shadow: 0 -10px 30px rgba(0,0,0,0.06); padding: 14px 16px; transform: translateY(110%); opacity: 0; pointer-events: none; transition: transform 0.35s ease, opacity 0.3s ease; z-index: 10000; }
.cookie-banner.show, .cookie-banner.is-visible, body.cookie-open .cookie-banner { transform: translateY(0); opacity: 1; pointer-events: auto; }
.cookie-banner .cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.cookie-btn { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--primary); color: var(--primary); background: #fff; transition: all 0.2s ease; }
.cookie-btn:hover { background: #f7fbff; }
.cookie-btn.accept { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: var(--shadow-1); }
.cookie-btn.accept:hover { background: var(--primary-600); }
.cookie-btn.reject { border-color: #c6cfe0; color: #2a3a4e; }
.cookie-btn.settings { border-color: var(--secondary); color: var(--secondary-700); }

/* Cookie Preferences Modal */
.cookie-modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(17, 25, 40, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.3s ease; z-index: 10001; }
.cookie-modal.show, .cookie-modal.is-visible, body.cookie-modal-open .cookie-modal { opacity: 1; pointer-events: auto; }
.cookie-modal-content { background: #ffffff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-2); width: 92%; max-width: 720px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.cookie-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cookie-categories { display: flex; flex-direction: column; gap: 10px; }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fafbfd; }
/* Toggle (checkbox) */
.toggle { position: relative; width: 46px; height: 26px; border-radius: 999px; background: #cfd7e6; transition: background-color 0.2s ease; display: inline-flex; align-items: center; padding: 3px; }
.toggle .knob { width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
input[type="checkbox"].toggle-input { position: absolute; opacity: 0; pointer-events: none; }
input[type="checkbox"].toggle-input:checked + .toggle { background: var(--primary); }
input[type="checkbox"].toggle-input:checked + .toggle .knob { transform: translateX(20px); }

/* ------------------------------
   Utility & Reusable Patterns
   ------------------------------ */
.lead { font-size: 18px; color: var(--text); }
.muted { color: var(--text-muted); }
.divider { height: 1px; width: 100%; background: var(--border); }

/* ------------------------------
   Responsive Rules
   ------------------------------ */
@media (min-width: 480px) {
  h1 { font-size: 32px; }
}
@media (min-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  .hero .content-wrapper { padding: 40px 0; }
  .logo img { height: 46px; }
  .text-image-section { flex-direction: row; }
}
@media (min-width: 992px) {
  /* Show desktop nav */
  .main-nav { display: flex; }
  .header-ctas { display: flex; }
  .mobile-menu-toggle { display: none; }
  header .content-wrapper { gap: 20px; }
  .content-wrapper { flex-direction: row; align-items: flex-start; }
  .hero .content-wrapper { flex-direction: column; align-items: flex-start; max-width: 980px; }
  footer .content-wrapper { flex-wrap: wrap; }
}
@media (min-width: 1200px) {
  h1 { font-size: 48px; }
}

/* ------------------------------
   Accessibility & States
   ------------------------------ */
button:disabled, a[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }

/* ------------------------------
   Specific Page Tweaks
   ------------------------------ */
/* Index: tighten hero spacing */
.hero .cta-group { margin-top: 4px; }

/* Reference articles spacing */
.text-section article { display: flex; flex-direction: column; gap: 6px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.text-section article:last-child { border-bottom: none; }

/* Contact: inline icon text alignment */
.text-section p img { display: inline-block; vertical-align: middle; margin-right: 8px; }
.text-section p a { text-decoration: underline; }

/* ------------------------------
   Ensure adequate spacing between all blocks
   ------------------------------ */
.container + .container { margin-top: 20px; }
.content-wrapper > * + * { margin-top: 0; }

/* ------------------------------
   Print basics
   ------------------------------ */
@media print {
  .mobile-menu, .mobile-menu-toggle, .cookie-banner, .cookie-modal { display: none !important; }
  a { color: #000; text-decoration: underline; }
}
