/* ========================================
   Koselys Theme CSS — v8
   ======================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---------- CSS Variables (Light theme) ---------- */
:root {
  --bg: #FAF6F0;
  --bg-card: #FFFFFF;
  --bg-card2: #F5EFE6;
  --text: #3D1F0A;
  --text-muted: #8B6040;
  --accent: #C4783A;
  --accent-hover: #A85F28;
  --accent-light: #F0E0C8;
  --nav-bg: #7A4820;
  --nav-text: #F5E6D0;
  --nav-link: rgba(245,230,208,0.85);
  --nav-hover: rgba(255,255,255,0.12);
  --border: #E0CDB8;
  --shadow: 0 2px 12px rgba(80,40,10,0.10);
  --shadow-card: 0 1px 6px rgba(80,40,10,0.08);
  --hero-grad: var(--bg);
  --badge-bg: #7A4820;
  --badge-text: #F5D090;
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --bg: #1A1208;
  --bg-card: #261A0E;
  --bg-card2: #2E2010;
  --text: #F5E6D0;
  --text-muted: #C4A882;
  --accent: #E8A45A;
  --accent-hover: #F5C070;
  --accent-light: #7A4820;
  --nav-bg: #120C04;
  --nav-text: #F5E6D0;
  --nav-link: rgba(245,230,208,0.7);
  --nav-hover: rgba(245,230,208,0.12);
  --border: #3D2810;
  --shadow: 0 2px 12px rgba(0,0,0,0.40);
  --shadow-card: 0 1px 6px rgba(0,0,0,0.3);
  --hero-grad: var(--bg);
  --badge-bg: #4A2C10;
  --badge-text: #F5D090;
}

/* ---------- Body ---------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ======================================================
   NAVBAR — single full-width bar with logo left, links right
   ====================================================== */
nav.navbar {
  background: var(--nav-bg);
  padding: 0 2rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  flex-wrap: nowrap;
}

/* Logo brand link (left side) */
.navbar-brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
  margin-right: 1rem;
}
.navbar-logo-inline {
  height: 42px;
  width: auto;
  display: block;
}

/* Nav links container (right side) */
.navbar-nav {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: nowrap;
  margin-left: auto;
}

/* All navbar links */
.navbar-nav a,
.navbar-nav .navbar-logout-link {
  color: var(--nav-link);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
  display: inline-block;
}
.navbar-nav a:hover,
.navbar-nav .navbar-logout-link:hover {
  background: var(--nav-hover);
  color: var(--nav-text);
}

/* Register button — accent pill */
.navbar-nav a.btn-registrer {
  background: var(--accent) !important;
  color: #fff !important;
  border-radius: 20px !important;
  padding: 0.35rem 1rem !important;
  font-weight: 600;
}
.navbar-nav a.btn-registrer:hover {
  background: var(--accent-hover) !important;
}

/* Theme toggle button */
.theme-toggle {
  background: transparent;
  border: 1.5px solid rgba(245,230,208,0.4);
  color: var(--nav-text);
  border-radius: 20px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  font-size: 0.82rem;
  margin-left: 0.35rem;
  transition: border-color 0.2s, background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--nav-hover);
  border-color: rgba(245,230,208,0.7);
}
.theme-toggle-icon { font-size: 0.9rem; }

/* ======================================================
   HERO — logo left, content right (homepage only)
   ====================================================== */
.hero {
  background: var(--hero-grad);
  padding: 3rem 2rem;
  min-height: 300px;
  display: flex;
  align-items: center;
}
.hero-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.hero-logo { flex-shrink: 0; }
.hero-logo img {
  width: 560px;
  height: auto;
  display: block;
  background: transparent;
}
[data-theme="dark"] .hero-logo img {
  content: url('/images/koselys-logo-dark.svg');
}
.hero-content { flex: 1; }
.hero-content h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}
.hero-content h1 span { color: var(--accent); }
.hero-content p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  max-width: 520px;
}
.hero-steps { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.hero-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.hero-step-num {
  background: var(--accent);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ======================================================
   MAIN CONTENT (homepage template section)
   ====================================================== */
.main-content {
  max-width: 1200px;
  margin: 2.5rem auto;
  padding: 0 2rem;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.section-header h2 { font-size: 1.5rem; color: var(--text); font-weight: 700; }
.section-header a { color: var(--accent); text-decoration: none; font-size: 0.95rem; }
.section-header a:hover { text-decoration: underline; }

/* ======================================================
   PAGE CONTAINER (Maler, Detail pages)
   ====================================================== */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
}
.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 1.8rem; color: var(--text); font-weight: 700; }
.page-header p { color: var(--text-muted); font-size: 1rem; margin-top: 0.3rem; }
.page-header .btn { margin-top: 1.25rem; }

/* ======================================================
   CONTAINER (Template detail, Abonnement)
   ====================================================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
}

/* ======================================================
   CATEGORY TABS
   ====================================================== */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.category-tab {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.9rem;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.category-tab:hover,
.category-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ======================================================
   TEMPLATES GRID
   ====================================================== */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}

/* ======================================================
   TEMPLATE CARD
   ====================================================== */
.template-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.template-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.template-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-card2);
  position: relative;
  display: block;
}
.template-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.template-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-card2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}
.template-card-body { padding: 0.9rem 1rem; flex: 1; }
.template-card-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 0.25rem; }
.template-card-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.template-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.template-card-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card2);
}

/* PRO badge — gull gradient */
.badge-premium {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #D4AF37 0%, #C9A227 50%, #B8941F 100%);
  color: #3D2000;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 3;
  display: block;
  box-shadow: 0 1px 4px rgba(180,140,0,0.35), inset 0 1px 0 rgba(255,240,150,0.3);
  text-shadow: 0 1px 1px rgba(255,255,255,0.15);
}

/* Home template cards (anchor) */
a.template-card { display: flex; flex-direction: column; }
.template-info { padding: 0.9rem 1rem; }
.template-name-row { font-size: 0.95rem; font-weight: 700; color: var(--text); }

/* ======================================================
   BUTTONS
   ====================================================== */
.btn {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.18s, color 0.18s, transform 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.82rem; }
.btn-start {
  background: var(--accent);
  color: #fff;
  padding: 0.65rem 1.8rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
  text-decoration: none;
  display: inline-block;
  margin-top: 1rem;
}
.btn-start:hover { background: var(--accent-hover); transform: translateY(-2px); }

/* ======================================================
   TEMPLATE DETAIL PAGE
   ====================================================== */
.breadcrumb {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.preview-box {
  background: var(--bg-card2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-placeholder { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; color: var(--text-muted); }
.preview-placeholder .icon { font-size: 3rem; }
.detail-info h1 { font-size: 1.8rem; font-weight: 700; color: var(--text); margin-bottom: 0.4rem; }
.detail-info .category { color: var(--accent); font-size: 0.9rem; margin-bottom: 0.5rem; }
.detail-info .description { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.2rem; line-height: 1.6; }
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.meta-item {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}
.meta-item .label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.2rem; }
.meta-item .value { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.fields-list { margin-bottom: 1.5rem; }
.fields-list h2 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 0.75rem; }
.field-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.field-item .field-type {
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ======================================================
   PLANS (Abonnement page) — keep working
   ====================================================== */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.plan-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-card);
}
.plan-card.featured { border-color: var(--accent); }
.plan-name { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.plan-price { font-size: 2rem; font-weight: 700; color: var(--accent); }
.plan-price small { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.plan-features li { font-size: 0.9rem; color: var(--text-muted); padding-left: 1.2rem; position: relative; }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); }

/* ======================================================
   FORMS
   ====================================================== */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.form-control {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.18s;
}
.form-control:focus { outline: none; border-color: var(--accent); }

/* ======================================================
   ALERTS
   ====================================================== */
.alert { padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-success { background: #d4edda; color: #1a5c2a; border: 1px solid #b8ddc4; }
.alert-error   { background: #fde8e8; color: #8b1a1a; border: 1px solid #f5c0c0; }
.alert-info    { background: var(--accent-light); color: var(--text); border: 1px solid var(--border); }

/* ======================================================
   FOOTER
   ====================================================== */
.site-footer {
  background: var(--nav-bg);
  color: var(--nav-link);
  text-align: center;
  padding: 1.5rem 2rem;
  font-size: 0.85rem;
  margin-top: 3rem;
}

/* ======================================================
   EMPTY STATE
   ====================================================== */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.empty-state h2 { font-size: 1.4rem; margin-bottom: 0.5rem; color: var(--text); }

/* ======================================================
   RESPONSIVE
   ====================================================== */
@media (max-width: 768px) {
  .detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  nav.navbar { padding: 0 1rem; height: 56px; }
  .navbar-nav a { padding: 0.3rem 0.5rem; font-size: 0.82rem; }
  .hero { padding: 2rem 1rem 1.5rem; }
  .hero-inner { flex-direction: column; gap: 1.5rem; }
  .hero-logo img { width: 400px; }
  .hero-content h1 { font-size: 1.4rem; }
  .main-content { padding: 0 1rem; margin: 1.5rem auto; }
  .page-container { padding: 1.5rem 1rem 2rem; }
  .container { padding: 1.5rem 1rem 2rem; }
  .templates-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8rem; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
}


/* ==============================================
   MOBIL NAVIGASJON — Hamburger & Slide-in-meny
   ============================================== */

/* Skjul mobil-elementer på desktop */
.navbar-mobile-right {
    display: none;
}

/* ── Hamburger-knapp ─────────────────────────── */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: background 0.2s;
    flex-shrink: 0;
}
.hamburger:hover {
    background: var(--nav-hover);
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--nav-text);
    border-radius: 2px;
    transition: transform 0.28s ease, opacity 0.2s ease, width 0.2s ease;
    transform-origin: center;
}
/* Animert X når åpen */
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Slide-in mobil-meny ─────────────────────── */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(85vw, 320px);
    height: 100dvh;
    background: var(--nav-bg);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0,0,0,0.18);
    overflow-y: auto;
    visibility: hidden;
}
.mobile-menu.open {
    visibility: visible;
}
.mobile-menu.open {
    right: 0;
}

/* Backdrop */
.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1099;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.mobile-menu-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

/* Meny-header */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid rgba(245,230,208,0.15);
}
.mobile-menu-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--nav-text);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.mobile-menu-close {
    background: transparent;
    border: none;
    color: var(--nav-text);
    font-size: 1.2rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    opacity: 0.8;
}
.mobile-menu-close:hover {
    background: var(--nav-hover);
    opacity: 1;
}

/* Navigasjonslenkene i menyen */
.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0;
    flex: 1;
}
.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1.3rem;
    color: var(--nav-link);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mobile-menu-link:hover,
.mobile-menu-link:focus {
    background: var(--nav-hover);
    color: var(--nav-text);
    border-left-color: var(--accent);
}
.mobile-menu-link.mobile-menu-link-cta {
    margin: 0.75rem 1.2rem;
    padding: 0.8rem 1.1rem;
    background: var(--accent);
    color: #fff;
    border-radius: 10px;
    border-left: none;
    font-weight: 600;
    justify-content: center;
}
.mobile-menu-link.mobile-menu-link-cta:hover {
    background: var(--accent-hover, #a05e26);
    border-left: none;
}
.mobile-menu-link.mobile-menu-link-muted {
    opacity: 0.7;
    font-size: 0.9rem;
}
.mobile-menu-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* Mobil temaknapp (liten, uten tekst) */
.theme-toggle-mobile {
    margin-left: 0;
    padding: 0.3rem 0.55rem !important;
    font-size: 1rem;
}
.theme-toggle-mobile #theme-icon-mobile {
    font-size: 1rem;
}

/* ── Media query: vis hamburger under 640px ─── */
@media (max-width: 640px) {
    .navbar-nav {
        display: none !important;
    }
    .navbar-mobile-right {
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }
}


/* =============================================================
   COOKIE CONSENT – Koselys.no
   Versjon: 1.0
   Skandinavisk, rent og ryddig uttrykk.
   Variabler gjør det enkelt å endre farger og spacing.
   ============================================================= */

/* --- Variabler --- */
:root {
  --cc-bg: #ffffff;
  --cc-border: #e8e8e8;
  --cc-text: #1a1a1a;
  --cc-text-muted: #666666;
  --cc-accent: #e05a5a;
  --cc-accent-hover: #c94f4f;
  --cc-btn-outline-border: #c0c0c0;
  --cc-btn-outline-hover: #f0f0f0;
  --cc-toggle-on: #e05a5a;
  --cc-toggle-off: #d0d0d0;
  --cc-toggle-handle: #ffffff;
  --cc-shadow: 0 4px 24px rgba(0,0,0,0.12);
  --cc-radius: 12px;
  --cc-radius-sm: 8px;
  --cc-font: inherit;
  --cc-z: 9999;
}

/* Mørk modus */
[data-theme="dark"] {
  --cc-bg: #1e1e1e;
  --cc-border: #333333;
  --cc-text: #f0f0f0;
  --cc-text-muted: #a0a0a0;
  --cc-btn-outline-border: #555555;
  --cc-btn-outline-hover: #2a2a2a;
  --cc-shadow: 0 4px 24px rgba(0,0,0,0.5);
}


/* =============================================================
   COOKIE BANNER (nedre venstre, bredde begrenset)
   ============================================================= */
#cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: var(--cc-z);
  max-width: 480px;
  width: calc(100vw - 3rem);
  background: var(--cc-bg);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  font-family: var(--cc-font);
  font-size: 0.9rem;
  color: var(--cc-text);
  animation: cc-slideup 0.3s ease;
}

@keyframes cc-slideup {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cb-inner {
  padding: 1.25rem 1.5rem 1rem;
}

.cb-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--cc-text);
}

.cb-desc {
  margin: 0 0 1rem;
  line-height: 1.6;
  color: var(--cc-text-muted);
  font-size: 0.875rem;
}

.cb-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.cb-privacy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--cc-text-muted);
}

.cb-link {
  color: var(--cc-accent);
  text-decoration: underline;
}
.cb-link:hover { color: var(--cc-accent-hover); }


/* =============================================================
   KNAPPER – delt mellom banner og modal
   ============================================================= */
.cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: var(--cc-radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  font-family: var(--cc-font);
}

/* Primær: fylt, varm rød */
.cb-btn--primary {
  background: var(--cc-accent);
  color: #ffffff;
}
.cb-btn--primary:hover { background: var(--cc-accent-hover); }
.cb-btn--primary:focus-visible {
  outline: 3px solid var(--cc-accent);
  outline-offset: 2px;
}

/* Sekundær: grå/nøytral – "Avvis alle" */
.cb-btn--secondary {
  background: #f0f0f0;
  color: var(--cc-text);
}
[data-theme="dark"] .cb-btn--secondary {
  background: #2a2a2a;
  color: var(--cc-text);
}
.cb-btn--secondary:hover { background: #e4e4e4; }
[data-theme="dark"] .cb-btn--secondary:hover { background: #383838; }
.cb-btn--secondary:focus-visible {
  outline: 3px solid var(--cc-text);
  outline-offset: 2px;
}

/* Outline: "Tilpass" */
.cb-btn--outline {
  background: transparent;
  color: var(--cc-text);
  border: 1.5px solid var(--cc-btn-outline-border);
}
.cb-btn--outline:hover { background: var(--cc-btn-outline-hover); }
.cb-btn--outline:focus-visible {
  outline: 3px solid var(--cc-text);
  outline-offset: 2px;
}


/* =============================================================
   BACKDROP
   ============================================================= */
#cookie-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: calc(var(--cc-z) + 1);
  animation: cc-fadein 0.2s ease;
}

@keyframes cc-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* =============================================================
   INNSTILLINGSMODAL
   ============================================================= */
#cookie-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: calc(var(--cc-z) + 2);
  width: min(560px, calc(100vw - 2rem));
  max-height: min(680px, calc(100vh - 2rem));
  background: var(--cc-bg);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  display: flex;
  flex-direction: column;
  font-family: var(--cc-font);
  color: var(--cc-text);
  animation: cc-popin 0.25s ease;
  overflow: hidden;
}

@keyframes cc-popin {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.97); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.cm-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Modal header */
.cm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--cc-border);
  flex-shrink: 0;
}

.cm-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--cc-text);
}

.cm-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cc-text-muted);
  padding: 0.3rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.cm-close:hover { color: var(--cc-text); background: var(--cc-btn-outline-hover); }
.cm-close:focus-visible {
  outline: 3px solid var(--cc-accent);
  outline-offset: 2px;
}

/* Modal body – scrollbar hvis innhold er høyt */
.cm-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.cm-intro {
  margin: 0 0 1.25rem;
  color: var(--cc-text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Kategori-rader */
.cm-category {
  padding: 1rem 0;
  border-bottom: 1px solid var(--cc-border);
}
.cm-category:last-child { border-bottom: none; }

.cm-category-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  justify-content: space-between;
}

.cm-category-info {
  flex: 1;
}

.cm-category-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--cc-text);
}

.cm-category-desc {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--cc-text-muted);
}

/* Toggle-bryter */
.cm-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  cursor: pointer;
}

.cm-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cm-toggle-track {
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--cc-toggle-off);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.cm-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cc-toggle-handle);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.cm-toggle-input:checked ~ .cm-toggle-track {
  background: var(--cc-toggle-on);
}

.cm-toggle-input:checked ~ .cm-toggle-track::after {
  transform: translateX(20px);
}

.cm-toggle-input:disabled ~ .cm-toggle-track {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Fokus-ring på toggle */
.cm-toggle-input:focus-visible ~ .cm-toggle-track {
  outline: 3px solid var(--cc-accent);
  outline-offset: 2px;
}

.cm-required-label {
  font-size: 0.7rem;
  color: var(--cc-text-muted);
  white-space: nowrap;
}

/* Modal footer */
.cm-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--cc-border);
  flex-shrink: 0;
  background: var(--cc-bg);
}


/* =============================================================
   COOKIE-INNSTILLINGER-LENKE (fast element i footer)
   ============================================================= */
.cookie-settings-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: #F5E6D0 !important;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--cc-font);
  transition: color 0.15s;
}
.cookie-settings-link:hover { color: var(--cc-text); }
.cookie-settings-link:focus-visible {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
  border-radius: 3px;
}


/* =============================================================
   RESPONSIVITET
   ============================================================= */
@media (max-width: 480px) {
  #cookie-banner {
    left: 0.75rem;
    bottom: 0.75rem;
    width: calc(100vw - 1.5rem);
    max-width: 100%;
  }

  .cb-actions {
    flex-direction: column;
  }

  .cb-btn {
    width: 100%;
    justify-content: center;
  }

  .cm-footer {
    flex-direction: column-reverse;
  }

  .cm-footer .cb-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Footer personvern-lenke */
.footer-privacy-link {
    color: #F5E6D0 !important;
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.15s;
}
.footer-privacy-link:hover {
    color: var(--cc-text, #1a1a1a);
    text-decoration: underline;
}

/* =============================================================
   SITE FOOTER – sentrering av copyright, personvern og cookies
   ============================================================= */
footer,
.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    text-align: center;
    padding: 1.25rem 1.5rem;
    font-size: 0.8125rem;
}

/* Plain <footer> sits on the page background – use body text colour */
footer {
    color: var(--text, #3D1F0A);
}

/* .site-footer has dark brown background – use nav link colour */
.site-footer {
    color: var(--nav-link, rgba(245,230,208,0.85));
}


/* ===== Kategori-artikler (cl-* = category landing) ===== */

/* ---- Breadcrumb ---- */
.cl-breadcrumb {
    padding: 0.75rem 0 0;
    font-size: 0.83rem;
}
.cl-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--text-muted);
    align-items: center;
}
.cl-breadcrumb li + li::before {
    content: "›";
    margin-right: 0.4rem;
    opacity: 0.5;
}
.cl-breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}
.cl-breadcrumb a:hover { text-decoration: underline; }
.cl-breadcrumb [aria-current="page"] { color: var(--text-muted); }

/* ---- Template-section title ---- */
.cl-templates-section {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

/* ---- Article wrapper ---- */
.cl-article {
    max-width: 860px;
    margin: 2.5rem auto 0;
}

/* ---- Generic section ---- */
.cl-section {
    padding: 2.5rem 0;
    border-top: 1px solid var(--border, rgba(0,0,0,0.07));
}
.cl-section:first-child { border-top: none; }

.cl-section h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 1rem;
    line-height: 1.25;
}

.cl-section p {
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

/* Alt background sections */
.cl-section--alt {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem 2rem;
    border: none;
    margin-bottom: 0.25rem;
}

/* CTA section */
.cl-section--cta {
    text-align: center;
    background: var(--accent);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    border: none;
    margin-bottom: 0.25rem;
}
.cl-section--cta h2,
.cl-section--cta p {
    color: #fff;
}
.cl-section--cta .btn-primary {
    background: #fff;
    color: var(--accent);
    border: none;
    font-weight: 700;
}
.cl-section--cta .btn-primary:hover {
    background: var(--bg);
    color: var(--accent);
}

/* Lead text */
.cl-lead {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* ---- Steps (guide) ---- */
.cl-steps {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.cl-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.cl-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.cl-step-body h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.25rem;
}
.cl-step-body p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}
.cl-cta-inline {
    margin-top: 1.5rem;
}

/* ---- Example quotes ---- */
.cl-examples {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.cl-example {
    background: var(--bg-card);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    margin: 0;
}
.cl-example p {
    font-style: italic;
    color: var(--text);
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}
.cl-example-tone {
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 600;
    font-style: normal;
}

/* ---- Benefits list ---- */
.cl-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
.cl-benefits li {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}
.cl-benefit-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1.2;
}
.cl-benefits strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.2rem;
}
.cl-benefits p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ---- Related categories ---- */
.cl-related {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}
.cl-related-card {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border, rgba(0,0,0,0.08));
    border-radius: 20px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cl-related-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-decoration: none;
}
.cl-related-icon {
    font-size: 1rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .cl-section--alt,
    .cl-section--cta {
        padding: 1.5rem 1.25rem;
        border-radius: 8px;
    }
    .cl-benefits {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .cl-examples {
        grid-template-columns: 1fr;
    }
    .cl-article {
        margin-top: 1.5rem;
    }
    .cl-section h2 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .cl-related-card {
        font-size: 0.82rem;
        padding: 0.4rem 0.8rem;
    }
}

/* ===== Inspirasjonsseksjonen på forsiden ===== */
.inspirasjon-section {
    padding: 3rem 1.5rem;
    background: var(--bg);
}

.inspirasjon-section .section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.inspirasjon-section .section-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.inspirasjon-section .section-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

.inspirasjon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

.inspirasjon-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border, rgba(0,0,0,0.08));
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.inspirasjon-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transform: translateY(-2px);
    border-color: var(--accent);
    text-decoration: none;
}

.inspirasjon-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    line-height: 1;
}

.inspirasjon-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.inspirasjon-text strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.inspirasjon-text span {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
}

@media (max-width: 768px) {
    .inspirasjon-grid {
        grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
        gap: 0.7rem;
    }
    .inspirasjon-card {
        padding: 0.75rem 0.9rem;
        gap: 0.6rem;
    }
    .inspirasjon-icon {
        font-size: 1.3rem;
    }
    .inspirasjon-text strong {
        font-size: 0.85rem;
    }
    .inspirasjon-text span {
        font-size: 0.73rem;
    }
}
