/* =========================
   Bilkompassen - Elegant Classic CSS (Flexbox-only)
   Author: Senior CSS Dev & UI Designer
   Notes:
   - Mobile-first
   - Flexbox only (no grid/columns)
   - Brand-first with classic, refined aesthetic
   - Includes mobile menu + cookie banner
   ========================= */

/* --------- CSS Reset & Normalize --------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; line-height: 1.6; color: #2c2c2c; background-color: #FAF9F7; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0 0 16px 22px; padding: 0; }
h1, h2, h3, h4, h5, h6, p { margin: 0 0 16px; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
:focus { outline: 2px solid #E09F3E; outline-offset: 2px; }

/* --------- Theme Variables (with fallbacks) --------- */
:root {
  --c-primary: #0B2B40;
  --c-secondary: #E09F3E;
  --c-accent: #F4F7FA;
  --c-text: #2c2c2c;
  --c-muted: #6B7280;
  --c-border: #DDD7CF;
  --c-bg: #FAF9F7;
  --radius-s: 6px;
  --radius-m: 10px;
  --shadow-s: 0 2px 6px rgba(0,0,0,0.06);
  --shadow-m: 0 6px 18px rgba(0,0,0,0.10);
  --transition: 180ms ease;
}

/* --------- Typography --------- */
body, .text-section { font-family: Verdana, Geneva, Tahoma, sans-serif; font-size: 16px; color: var(--c-text); }
h1, h2, h3, h4 { font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', Arial, sans-serif; color: var(--c-primary); letter-spacing: 0.2px; }
h1 { font-size: 34px; line-height: 1.2; }
h2 { font-size: 28px; line-height: 1.3; }
h3 { font-size: 20px; line-height: 1.4; color: #152f44; }
p, li { font-size: 16px; }
small, .meta { font-size: 14px; color: var(--c-muted); }
strong { color: #1f2937; }

/* --------- Layout Utilities (Flexbox Everywhere) --------- */
.container { display: flex; flex-direction: column; width: 100%; max-width: 1200px; padding: 0 20px; margin: 0 auto; gap: 16px; align-items: stretch; }
.content-wrapper { display: flex; flex-direction: column; gap: 18px; width: 100%; background: transparent; }
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; display: flex; flex-direction: column; gap: 12px; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-m); padding: 20px; box-shadow: var(--shadow-s); }
.section { margin-bottom: 60px; padding: 40px 20px; display: flex; flex-direction: column; gap: 20px; }
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* --------- Header & Navigation --------- */
header { background: #ffffff; border-bottom: 1px solid var(--c-border); box-shadow: 0 1px 0 rgba(0,0,0,0.03); position: sticky; top: 0; z-index: 1000; }
header .container { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.logo img { height: 34px; width: auto; }

.main-nav { display: none; flex-direction: row; align-items: center; gap: 18px; }
.main-nav a { padding: 10px 8px; color: var(--c-primary); font-weight: 600; opacity: 0.9; border-radius: var(--radius-s); transition: color var(--transition), background-color var(--transition); }
.main-nav a:hover { color: #0a2435; background: var(--c-accent); }
.main-nav a[aria-current="page"] { color: var(--c-secondary); }

.mobile-menu-toggle { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--c-border); background: #fff; color: var(--c-primary); box-shadow: var(--shadow-s); transition: background var(--transition), box-shadow var(--transition), transform var(--transition); }
.mobile-menu-toggle:hover { background: var(--c-accent); box-shadow: var(--shadow-m); transform: translateY(-1px); }

/* Mobile menu overlay */
.mobile-menu { position: fixed; inset: 0; background: rgba(11, 43, 64, 0.96); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 20px; gap: 20px; transform: translateX(100%); transition: transform 260ms ease; z-index: 1400; }
.mobile-menu.open, .mobile-menu.active, .mobile-menu[aria-expanded="true"] { transform: translateX(0); }
.mobile-menu-close { align-self: flex-end; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.35); color: #fff; background: transparent; display: flex; align-items: center; justify-content: center; }
.mobile-menu-close:hover { background: rgba(255,255,255,0.08); }
.mobile-nav { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 520px; }
.mobile-nav a { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: var(--radius-s); background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.18); transition: background var(--transition), transform var(--transition); }
.mobile-nav a:hover { background: rgba(255,255,255,0.16); transform: translateX(2px); }
.mobile-nav a[aria-current="page"] { background: rgba(224,159,62,0.22); border-color: rgba(224,159,62,0.48); }

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

/* --------- Hero Section --------- */
.hero { background: var(--c-accent); border-bottom: 1px solid var(--c-border); }
.hero .container { padding-top: 32px; padding-bottom: 32px; }
.hero h1 { color: var(--c-primary); }
.hero .text-section { max-width: 780px; color: #374151; }

/* --------- Buttons --------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 18px; border-radius: 999px; border: 1px solid transparent; font-weight: 700; text-align: center; transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition), border-color var(--transition); }
.btn-primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); box-shadow: 0 4px 12px rgba(11,43,64,0.18); }
.btn-primary:hover { background: #092335; border-color: #092335; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(11,43,64,0.25); }
.btn-secondary { background: #fff; color: var(--c-primary); border-color: var(--c-secondary); box-shadow: 0 4px 10px rgba(224,159,62,0.15); }
.btn-secondary:hover { background: #FFF7ED; border-color: #d68f2f; color: #0a2537; }
.btn:active { transform: translateY(0); }

.cta-group { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* --------- Lists with icons & details --------- */
.text-section ul li, .text-section ol li { margin-bottom: 8px; }
.text-section ul li img, .text-section p img { width: 18px; height: 18px; margin-right: 10px; display: inline-block; vertical-align: middle; }
.text-section ul { list-style-type: disc; }
.text-section ol { list-style-type: decimal; }

/* details/summary styling */
details { border: 1px solid var(--c-border); border-radius: var(--radius-s); background: #fff; padding: 10px 14px; box-shadow: var(--shadow-s); }
details + details { margin-top: 10px; }
summary { cursor: pointer; font-weight: 700; color: var(--c-primary); }
details[open] { border-color: #cfc7bd; }

/* --------- Trust & Quick links (index hero) --------- */
.trust ul { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; list-style: none; margin: 0; padding: 0; }
.trust li { display: flex; align-items: center; gap: 8px; color: #374151; font-size: 14px; }
.trust img { width: 18px; height: 18px; }

.quick-links nav { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-links a { display: inline-flex; align-items: center; padding: 8px 12px; border: 1px solid var(--c-border); border-radius: 999px; background: #fff; color: var(--c-primary); transition: background var(--transition), border-color var(--transition), transform var(--transition); }
.quick-links a:hover { background: var(--c-accent); border-color: #cfc7bd; transform: translateY(-1px); }

/* --------- Testimonials (high contrast) --------- */
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; background: #ffffff; border: 1px solid var(--c-border); border-radius: var(--radius-m); box-shadow: var(--shadow-s); color: #111827; }
.testimonial-card p { margin: 0; }
.testimonial-card strong { color: #0f172a; }

/* --------- Footer --------- */
footer { background: #ffffff; border-top: 1px solid var(--c-border); margin-top: 40px; }
footer .content-wrapper { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; padding: 24px 0; }
footer .brand { display: flex; flex-direction: column; gap: 12px; max-width: 360px; }
footer .brand img { width: 110px; height: auto; }
.footer-nav { display: flex; flex-direction: column; gap: 8px; min-width: 200px; }
.footer-nav a { color: var(--c-primary); opacity: 0.9; transition: opacity var(--transition), transform var(--transition); }
.footer-nav a:hover { opacity: 1; transform: translateX(2px); }
.footer-nav a[aria-current="page"] { color: var(--c-secondary); }

/* --------- Sections general --------- */
main section { padding: 30px 0; border-bottom: 1px solid rgba(0,0,0,0.04); }
main section:last-of-type { border-bottom: none; }

/* --------- Generic cards & emphasis blocks --------- */
.emphasis { display: flex; flex-direction: column; gap: 12px; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-m); padding: 20px; box-shadow: var(--shadow-s); }

/* --------- Links --------- */
a { color: var(--c-primary); text-underline-offset: 3px; }
a:hover { color: #0a2537; text-decoration: underline; }

/* --------- Tables (if any) --------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--c-border); }
th { color: var(--c-primary); font-weight: 700; }

/* --------- Forms (if any) --------- */
input, select, textarea { width: 100%; border: 1px solid var(--c-border); border-radius: var(--radius-s); padding: 10px 12px; font: inherit; background: #fff; transition: border-color var(--transition), box-shadow var(--transition); }
input:focus, select:focus, textarea:focus { border-color: var(--c-secondary); box-shadow: 0 0 0 3px rgba(224,159,62,0.25); }
label { font-weight: 700; color: #1f2937; margin-bottom: 6px; display: inline-flex; }

/* --------- Mobile-first Responsive adjustments --------- */
@media (min-width: 600px) {
  h1 { font-size: 40px; }
  h2 { font-size: 30px; }
  .hero .container { padding-top: 36px; padding-bottom: 36px; }
}

@media (min-width: 768px) {
  .text-image-section { flex-direction: row; }
  .cta-group { gap: 14px; }
  h1 { font-size: 44px; }
  h2 { font-size: 32px; }
}

@media (max-width: 768px) {
  .text-image-section { flex-direction: column; align-items: center; }
}

@media (min-width: 992px) {
  .container { gap: 20px; }
  .content-wrapper { gap: 22px; }
}

/* --------- Page-specific refinements --------- */
/* Hero across pages */
.hero .btn { margin-top: 4px; }

/* Index highlights */
.hero .trust { margin-top: 6px; }

/* Footer spacing on dense pages */
footer .text-section h3 { margin-bottom: 6px; }

/* --------- Accessibility helpers --------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,1px,1px); white-space: nowrap; border: 0; }

/* --------- Cookie Consent Banner --------- */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 12px; align-items: stretch; background: #ffffff; color: #1f2937; border-top: 1px solid var(--c-border); box-shadow: 0 -6px 18px rgba(0,0,0,0.08); padding: 14px 16px; z-index: 1500; transform: translateY(110%); transition: transform 260ms ease; }
.cookie-banner.show, .cookie-banner.active { transform: translateY(0); }
.cookie-banner .cookie-content { display: flex; flex-direction: column; gap: 10px; }
.cookie-banner .cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cookie-banner .btn { padding: 10px 14px; border-radius: 10px; }
.cookie-accept { background: var(--c-primary); color: #fff; border: 1px solid var(--c-primary); }
.cookie-reject { background: #fff; color: var(--c-primary); border: 1px solid var(--c-primary); }
.cookie-settings { background: #fff; color: #7a4b12; border: 1px solid var(--c-secondary); }
.cookie-settings:hover { background: #FFF7ED; }

/* Cookie Preferences Modal */
.cookie-modal-backdrop { position: fixed; inset: 0; background: rgba(17,24,39,0.6); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 1600; }
.cookie-modal-backdrop.show { display: flex; }
.cookie-modal { display: flex; flex-direction: column; gap: 14px; background: #ffffff; color: #111827; width: 100%; max-width: 680px; border: 1px solid var(--c-border); border-radius: 12px; padding: 18px; box-shadow: var(--shadow-m); }
.cookie-modal header { display: flex; align-items: center; justify-content: space-between; border: none; box-shadow: none; position: static; }
.cookie-modal h3 { margin: 0; font-size: 22px; }
.cookie-categories { display: flex; flex-direction: column; gap: 12px; }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--c-border); border-radius: 10px; padding: 12px; background: #fff; }
.cookie-category .desc { display: flex; flex-direction: column; gap: 2px; max-width: 75%; }
.cookie-modal .modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* Toggle switch */
.switch { position: relative; width: 48px; height: 28px; display: inline-flex; align-items: center; }
.switch input { appearance: none; -webkit-appearance: none; width: 100%; height: 100%; border-radius: 999px; background: #e5e7eb; border: 1px solid #cfd3d9; transition: background var(--transition), border-color var(--transition); }
.switch input:checked { background: rgba(224,159,62,0.55); border-color: var(--c-secondary); }
.switch input::after { content: ""; position: relative; left: 2px; display: block; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-s); transform: translateX(0); transition: transform var(--transition); }
.switch input:checked::after { transform: translateX(18px); }

/* Cookie categories: essential/analytics/marketing labels */
.cookie-category.essential { background: #FAF9F7; }
.cookie-category.analytics { background: #FFFFFF; }
.cookie-category.marketing { background: #FFFFFF; }

/* --------- Print basics --------- */
@media print {
  header, .mobile-menu, .cookie-banner, .cookie-modal-backdrop { display: none !important; }
  a { text-decoration: underline; }
  .btn { border: 1px solid #999; color: #000; background: transparent; }
}

/* --------- Decorative subtle rules (classic vibe) --------- */
h2 { border-left: 4px solid rgba(11,43,64,0.2); padding-left: 12px; }
section .container { border-radius: 0; }

/* --------- Ensure spacing between sibling blocks --------- */
.content-wrapper > * + * { margin-top: 4px; }

/* --------- Alignment Policies per brief --------- */
/* Use center alignment where requested */
.text-image-section, .testimonial-card, .cta-group { align-items: center; }
/* Use flex-start where needed */
.feature-item { align-items: flex-start; }

/* --------- Prevent overlaps with generous spacing --------- */
main .container { gap: 20px; }
main .content-wrapper { gap: 18px; }

/* --------- Accessibility color contrast in testimonial/review areas --------- */
/* Dark text on light background enforced above: no overrides to darker tones here. */

/* --------- Page-specific small touches --------- */
/* aria-current link emphasis already handled; add subtle underline on hover inside content areas */
.content-wrapper a { text-decoration: underline; text-decoration-color: rgba(224,159,62,0.6); }
.content-wrapper a:hover { text-decoration-color: var(--c-secondary); }

/* --------- Ensure all flex containers on layout wrappers --------- */
header, main, footer, nav, section, .brand, .trust, .quick-links, .footer-nav { display: flex; flex-direction: column; }
/* Correct specific ones to rows where appropriate */
header nav.main-nav { flex-direction: row; }
footer .content-wrapper { flex-direction: row; }
.quick-links nav { flex-direction: row; }
.trust ul { flex-direction: row; }

/* --------- End of file --------- */
