/* ================================
   SantaRosa – Layout Styles
   Datei: layout.css
   ================================ */

/* ===== Theme ===== */
:root {
  /* Dark Default */
  --bg: #0b1020;            /* tiefer Navy-Background (angelehnt an #111144) */
  --surface: #0f172a;       /* Header/Footer, Panels */
  --text: #e5e7eb;          /* Text auf dunkel */
  --muted: #9ca3af;         /* Sekundärtext */

  /* Brand (aus deiner Palette) */
  --brand: #F98513;         /* Primary CTA */
  --brand-600: #111144;     /* Dunkles Brand-Navy (Hover / Fokus) */
  --brand-alt: #9BACD8;     /* Softes Blau für Akzente, Badges, Flächen */
  --accent: #223382;        /* Sattes Blau für Icons, Links etc. */

  --border: rgba(148, 163, 253, 0.18); /* dezenter Rand mit blauem Einschlag */
  --container: 1200px;

  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);

  --info: color-mix(in oklab, var(--brand-alt) 80%, var(--brand) 20%);
  --info-ink: color-mix(in oklab, var(--brand-600) 70%, #fff 30%);
  --warn: #f59e0b;
  --warn-ink: #b45309;
}

/* Light Mode orientiert sich eng an der hellen Palette */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #F4F1EC;          /* Hell aus Palette */
    --surface: #ffffff;
    --text: #060620;        /* Dunkles Navy als Standardtext */
    --muted: #6b7280;
    --border: rgba(0, 0, 0, 0.06);
  }
}

/* ===== Base ===== */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body { min-height: 100%; }


button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

body {
  margin: 0;
  color: var(--text);
  background:
    /* links oben: softer Beige-Spot */
    radial-gradient(
      900px 600px at 10% -10%,
      #DAD1C8 0%,
      transparent 60%
    ),
    /* rechts: großer Dark-Spot, geht über ~halbe Seite */
    radial-gradient(
      1000px 600px at 80% 0%,
      #9BACD8 0%,
      transparent 80%
    ),
    var(--bg);
  font: 500 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
}

/* ===== Utils ===== */
.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}
.small { font-size: 0.875rem; }
.muted { color: var(--muted); }

a {
  color: inherit;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.body-no-scroll { overflow: hidden; }

/* ===== App shell ===== */
.app {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* ===== Header / Navbar ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02)),
    var(--surface);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 22px rgba(0,0,0,0.22);
}

.navbar { padding: 10px 0; }

/* Desktop-Grid: Brand | Toggle | Links | Actions */
.navbar__inner {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 14px;
}

.navbar__brand  { grid-column: 1; }
.navbar__toggle { grid-column: 2; }
.navbar__links  { grid-column: 3; justify-self: start; }
.navbar__actions{ grid-column: 4; justify-self: end; }

/* Brand */
.navbar__brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0.2px;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
}

/* Links */
.navbar__links {
  display: flex;
  align-items: center;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
  margin-left: clamp(8px,2vw,28px);
}

.navbar__links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--text);
  transition: background .18s, border-color .18s, color .18s;
  isolation: isolate;
}
.navbar__links a:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border);
  text-decoration: none;
}

/* Active / Current mit Brand statt fremdem Rot */
.navbar__links a[aria-current="page"],
.navbar__links a.active {
  background: color-mix(in oklab, var(--brand) 16%, transparent);
  border-color: color-mix(in oklab, var(--brand) 45%, transparent);
}

.navbar__links a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  opacity: 0;
  transform: scaleX(0.6);
  transition: opacity .18s ease, transform .18s ease;
}
.navbar__links a:hover::after,
.navbar__links a.active::after {
  opacity: .9;
  transform: scaleX(1);
}

/* Navbar actions */
.navbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  min-width: 160px;
  justify-content: flex-end;
}
.navbar__actions form { margin: 0; }

/* ===== Buttons (Designsystem) ===== */
.btn {
  --btn-bg: var(--brand);
  --btn-bg-hover: var(--brand-600);
  --btn-fg: #ffffff;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  /* Kompakter, wie "Zur Proforma hinzufügen" */
  padding: 0.55rem 0.9rem;
  border-radius: 0.6rem;

  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;

  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;

  transition: transform .04s, filter .15s, background .15s, border-color .15s, color .15s;
}

.btn:active { transform: translateY(1px); }

.btn:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--brand) 45%, transparent);
  outline-offset: 3px;
}

/* Primary ohne starken Gradient, konsistent projektweit */
.btn--primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-color: var(--btn-bg);
  box-shadow: 0 8px 22px color-mix(in oklab, var(--brand) 22%, transparent);
}
.btn--primary:hover {
  background: var(--btn-bg-hover);
  border-color: var(--btn-bg-hover);
  filter: brightness(1.03);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border);
}

/* Secondary */
.btn--secondary {
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--surface) 70%, #fff 30%),
    var(--surface)
  );
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.btn--secondary:hover {
  filter: brightness(1.05);
}

/* Danger systemweit definieren */
.btn--danger {
  --btn-danger: #dc2626;
  --btn-danger-hover: #991b1b;

  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--btn-danger) 92%, #fff 8%),
    var(--btn-danger)
  );
  color: #fff;
  border-color: color-mix(in oklab, var(--btn-danger) 55%, var(--border) 45%);
  box-shadow: 0 8px 22px rgba(0,0,0,0.20);
}
.btn--danger:hover {
  background: var(--btn-danger-hover);
  border-color: var(--btn-danger-hover);
  filter: brightness(1.02);
}

/* Kleine Button-Variante */
.btn--sm {
  font-size: 0.875rem;
  line-height: 1.2;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  min-height: 0;
}
.btn--sm.btn--primary {
  box-shadow: 0 6px 16px color-mix(in oklab, var(--brand) 18%, transparent);
}
.btn--sm.btn--primary:hover { filter: brightness(1.03); }

/* ===== Search ===== */
.navbar__search {
  position: relative;
  display: none;
}
.navbar__search input {
  width: 220px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px 8px 34px;
  border-radius: 12px;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.navbar__search input:focus {
  outline: none;
  background: rgba(255,255,255,0.08);
  border-color: color-mix(in oklab, var(--brand) 42%, transparent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 22%, transparent);
}
.navbar__search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

/* ===== Avatar ===== */
.navbar__avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg,rgba(255,255,255,0.08),rgba(255,255,255,0.04));
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
}

/* ===== Mobile Toggle ===== */
.navbar__toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.navbar__toggle:hover {
  background: rgba(255,255,255,0.06);
  border-color: color-mix(in oklab, var(--brand) 40%, var(--border));
}
.navbar__toggle:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--brand) 45%, transparent);
}

/* ===== Main ===== */
.app-main {
  padding-block: clamp(24px, 4vw, 40px);
}

/* ===== Footer ===== */
.app-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 18px 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Footer Layout */
.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Footer Links */
.footer-link {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
.footer-link:hover {
  color: var(--text);
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.25);
}

/* ===== Alerts ===== */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  margin: 1rem auto;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  max-width: 400px;
  text-align: center;
  transition: opacity .5s ease, transform .5s ease;
}

/* Erfolg in Grün, aber ins Dark-Design integriert */
.alert-success {
  background-color: color-mix(in oklab, #22c55e 10%, var(--bg) 90%);
  color: #4ade80;
  border: 1px solid #22c55e;
}

/* ===== Responsive ===== */
@media (max-width: 920px) {
  /* Mobile-Header-Row neu aufbauen:
     Brand | Toggle | Actions */
  .navbar__inner {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
  }

  .navbar__brand {
    grid-column: 1;
    justify-self: start;
  }

  /* Hamburger rechts, direkt vor den Actions */
  .navbar__toggle {
    grid-column: 2;
    justify-self: end;
    display: inline-flex;
  }

  /* Actions ganz rechts */
  .navbar__actions {
    grid-column: 3;
    justify-self: end;
    min-width: 0; /* überschreibt globales min-width: 160px */
  }

  /* Dropdown-Menü bleibt volle Breite unter der Row */
  .navbar__links {
    grid-column: 1 / -1;
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0 0 0;
    padding: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-left: 0;
  }
  .navbar__links.is-open { display: flex; }

  .navbar__links li { width: 100%; }

  .navbar__links a {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(
      180deg,
      rgba(255,255,255,0.04),
      rgba(255,255,255,0.02)
    );
    border: 1px solid var(--border);
  }
  .navbar__links a:hover {
    background: rgba(255,255,255,0.07);
    border-color: color-mix(in oklab, var(--brand) 30%, var(--border));
  }
  .navbar__links a.active {
    background: color-mix(in oklab, var(--brand) 18%, transparent);
    border-color: color-mix(in oklab, var(--brand) 45%, transparent);
  }
}

/* Desktop: zentrierte Navi */
@media (min-width: 921px) {
  .navbar__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
  }

  .navbar__brand  { grid-column: 1; justify-self: start; }
  .navbar__toggle { display: none; }
  .navbar__links  { grid-column: 2; justify-self: center; margin-left: 0; }
  .navbar__actions{ grid-column: 3; justify-self: end; }
}

@media (max-width: 520px) {
  .btn { padding: 9px 12px; }
  .navbar__brand { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}


/* Immer Scrollbar reservieren */
html { overflow-y: scroll; }

/* ===== Confirm Modal ===== */
.cmodal[hidden] { display: none !important; }
.cmodal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cmodal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
}

.cmodal__dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 440px);
  max-height: 86vh;
  overflow: auto;
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--surface) 96%, #fff 4%),
    var(--surface)
  );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.1rem 1rem;
  display: grid;
  gap: .9rem;
}

.cmodal__title {
  margin: 0;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}
.cmodal__message {
  margin: 0;
  color: var(--text);
}
.cmodal__actions {
  display: flex;
  gap: .6rem;
  justify-content: flex-end;
}

/* Wenn Modal offen: Seitenscroll sperren */
.body-no-scroll { overflow: hidden; }

/* ===== Cookie / Consent Banner ===== */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: none; /* wird per JS auf "block" gesetzt */
  z-index: 9000;
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--surface) 96%, #000 4%),
    var(--surface)
  );
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
  padding: 0.75rem 0;
  font-size: 0.85rem;
}

.cookie-banner__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-banner__text {
  color: var(--text);
  max-width: 640px;
}

.cookie-banner__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Mobile-Optimierung: Text und Buttons untereinander zentriert */
@media (max-width: 640px) {
  .cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }

  .cookie-banner__actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

     /* rd-topnav: Buttons full-width untereinander */
  .rd-topnav {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    padding-inline: 1rem;
  }

  .rd-topnav__left,
  .rd-topnav__right {
    width: 100%;
    justify-content: stretch;
  }

  .rd-topnav__right {
    margin-left: 0;
  }

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

/* ===== Forms: Segment-Radiobuttons (systemweit konsistent) ===== */
.material-form fieldset > label {
  font-size: 0.95rem; /* 15.2px bei 16px Root */
  line-height: 1.2;
}

.material-form fieldset legend {
  font-size: 0.95rem;
}


/* ✅ Topnav Row – robust gegen globale Overrides */
.rd-topnav {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 clamp(16px, 2vw, 24px);
}

/* links normal */
.rd-topnav__left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ✅ rechts hart nach rechts schieben */
.rd-topnav__right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  justify-content: flex-end;
}

/* Mobile: weiterhin links/rechts-Reihenfolge, aber sauber */
@media (max-width: 640px) {
  .rd-topnav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .rd-topnav__right {
    margin-left: auto;
  }
}

/* ================================
   Topnav Buttons – Look wie invoicepreview.css
   (nur innerhalb der rd-topnav)
   ================================ */

.rd-topnav .btn {
  gap: .35rem;
  padding: .6rem 1rem;
  border-radius: .6rem;
  font-weight: 800;
  user-select: none;

  transition:
    transform .08s ease,
    background .18s ease,
    filter .18s ease,
    box-shadow .18s ease,
    border-color .18s ease,
    color .18s ease;

  box-shadow: 0 6px 20px rgba(0,0,0,.18);

  color: var(--text);
  background: transparent;
}

.rd-topnav .btn:active {
  transform: translateY(1px);
}

/* Ghost in der Topnav mit dem gleichen Feeling */
.rd-topnav .btn--ghost {
  border-color: var(--border);
  background: transparent;
}

.rd-topnav .btn--ghost:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--brand);
}

/* Primary falls du in der Topnav welche hast */
.rd-topnav .btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.rd-topnav .btn--primary:hover {
  background: var(--brand-600);
  border-color: var(--brand-600);
  filter: brightness(1.03);
}

/* Small innerhalb der Topnav */
.rd-topnav .btn--sm {
  padding: .4rem .6rem;
  font-weight: 600;
  border-radius: .45rem;
}

/* Signup-Button nur auf Desktop/Tablet zeigen */
@media (max-width: 920px) {
  .navbar__actions .btn--signup {
    display: none !important;
  }
}

/* Mobile-Optimierung */
@media (max-width: 520px) {
  /* Verhindert "doppeltes" horizontales Padding
     (Section-Padding + Container-Abzug) */
  .quote-section .container {
    width: 100%;
   
  }

  /* Section-Padding klar und kontrolliert */
  .quote-section {
    padding: 16px 12px;
  }

  /* Blockquote als eigene Card */
  .quote-section blockquote {
    padding: 14px 14px;
    border-radius: var(--radius);
    background: linear-gradient(
      180deg,
      rgba(255,255,255,0.04),
      rgba(255,255,255,0.02)
    );
    border: 1px solid var(--border);
  }

  /* Falls du eine Zitat-Quelle/Autor hast */
  .quote-section cite,
  .quote-section .quote-author {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.9rem;
  }

  .slide {
    margin-left: 0;
  }
}

/* Kompakte Sektionen (außen) – gilt auch für RELATED */
.blog-page .section {
  padding-block: clamp(28px, 2vw, 72px);
}

/* Typo für Überschrift "Weitere Beiträge" */
.blog-page .headline {
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: .1px;
}
.blog-page .h3 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
}

/* RELATED posts */
.blog-page .related {
  margin-top: 8px;
}

.blog-page .related-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  margin-top: 10px;
}

@media (min-width: 880px) {
  .blog-page .related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Card Styling für die Related-Artikel */
.blog-page .outline-card {
  border: 1px solid color-mix(in oklab, var(--line) 70%, var(--accent) 30%);
  border-radius: var(--radius-xxl);
  padding: 14px;
  background:
    radial-gradient(420px 180px at 10% 8%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in oklab, var(--panel) 98%, #000 2%), transparent);
  transition:
    transform .16s var(--ease-out),
    border-color .16s var(--ease-out),
    box-shadow .16s var(--ease-out);
}

.blog-page .outline-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--accent) 42%, var(--line));
  box-shadow: 0 12px 24px rgba(0,0,0,.24);
}

/* Meta, Titel, CTA innerhalb der Cards */
.blog-page .post-card__meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
}

.blog-page .post-card__title {
  margin: 6px 0 6px;
  font-weight: 900;
  line-height: 1.2;
}

.blog-page .post-card__title a {
  text-decoration: none;
}

.blog-page .post-card__title a:hover {
  text-decoration: underline;
}

.blog-page .post-card__cta {
  margin-top: 8px;
}

/* Reveal + Stagger (du nutzt .reveal und data-stagger in der Section) */
.blog-page .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity .45s var(--ease-out),
    transform .45s var(--ease-out);
}

.blog-page .reveal.in {
  opacity: 1;
  transform: none;
}

.blog-page [data-stagger] > * {
  --i: 0;
  transition-delay: calc(var(--i) * 80ms);
}

/* Reduced Motion (betrifft auch die RELATED Section) */
@media (prefers-reduced-motion: reduce) {
  .blog-page * {
    transition: none !important;
    animation: none !important;
  }
}
