/* LANNER News – Redaktions-Tool. Design nach lannermedia.at (Sofia Sans, Navy/Blau).
   Mobile first, funktioniert ab 250 px Breite. */

@font-face {
  font-family: 'Sofia Sans';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/assets/fonts/sofia-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sofia Sans';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/assets/fonts/sofia-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --navy: #37437c;
  --navy-dark: #22273f;
  --ink: #22273f;
  --muted: #5b6075;
  --line: #dde1ea;
  --bg: #f3f5f8;
  --card: #ffffff;
  --blue: #67b2e3;
  --sky: #81b1e1;
  --teal: #2eafc2;
  --ok: #1d7f4e;
  --ok-bg: #e3f4ea;
  --warn: #8a5a00;
  --warn-bg: #fff3d6;
  --err: #b42318;
  --err-bg: #fde8e6;
  --radius: 10px;
  --gutter: clamp(10px, 3vw, 32px);
  --shadow: 0 1px 2px rgba(34, 39, 63, 0.06), 0 4px 16px rgba(34, 39, 63, 0.06);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-width: 250px;
  background: var(--bg);
  color: var(--ink);
  font: 400 clamp(15px, 0.6vw + 13px, 17px) / 1.5 'Sofia Sans', system-ui, sans-serif;
  overflow-x: hidden;
}

img { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 800; }
h1 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
h2 { font-size: clamp(1.15rem, 2.4vw, 1.4rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.75em; }
a { color: var(--navy); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Kopfzeile ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--navy-dark);
  color: #fff;
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; min-width: 0; }
.brand img { height: clamp(22px, 5vw, 30px); width: auto; display: block; }
.brand-tag {
  font-weight: 800; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--blue); border-left: 1px solid rgba(255, 255, 255, 0.25); padding-left: 10px;
}
.menu-toggle {
  margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, 0.08); cursor: pointer;
}
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 20px; height: 2px; background: #fff; position: relative; content: '';
}
.menu-icon::before { position: absolute; top: -6px; }
.menu-icon::after { position: absolute; top: 6px; }

.nav { display: none; width: 100%; flex-direction: column; gap: 2px; padding: 6px 0 4px; }
.nav.is-open { display: flex; }
.nav a {
  color: #fff; text-decoration: none; font-weight: 600;
  padding: 10px 12px; border-radius: 8px;
}
.nav a:hover { background: rgba(255, 255, 255, 0.08); }
.nav a.is-active { background: rgba(103, 178, 227, 0.2); color: #fff; }
.nav a.nav-cta { background: var(--blue); color: var(--navy-dark); font-weight: 800; }
.nav-user {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 4px;
  font-size: 0.9rem; color: rgba(255, 255, 255, 0.75);
}
.link-button {
  background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer;
}

@media (min-width: 900px) {
  .menu-toggle { display: none; }
  .topbar-inner { flex-wrap: nowrap; }
  .nav { display: flex; flex-direction: row; align-items: center; width: auto; margin-left: auto; padding: 0; gap: 4px; }
  .nav-user { border: 0; margin: 0 0 0 10px; padding: 0 0 0 14px; border-left: 1px solid rgba(255, 255, 255, 0.2); }
}

/* --- Layout ------------------------------------------------------------- */
.main { max-width: 1280px; margin: 0 auto; padding: clamp(14px, 3vw, 32px) var(--gutter) 64px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head .lead { color: var(--muted); margin: 4px 0 0; }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(12px, 2.5vw, 24px); min-width: 0;
}
.card + .card { margin-top: 16px; }
.stack > * + * { margin-top: 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 16px; max-width: 100%;
  border: 1.5px solid var(--navy); border-radius: 8px;
  background: #fff; color: var(--navy);
  font: inherit; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none;
  cursor: pointer; white-space: normal;
}
.btn:hover { background: #eef1f8; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-success:hover { background: #166640; }
.btn-danger { border-color: var(--err); color: var(--err); }
.btn-danger:hover { background: var(--err-bg); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-small { min-height: 34px; padding: 4px 10px; font-size: 0.875rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 420px) {
  .btn-row > .btn { flex: 1 1 100%; }
}

/* --- Tabs --------------------------------------------------------------- */
.tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin;
  margin: 0 0 16px; padding-bottom: 2px; border-bottom: 1px solid var(--line);
}
.tabs a {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 12px; text-decoration: none; color: var(--muted); font-weight: 700;
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a.is-active { color: var(--navy); border-bottom-color: var(--navy); }
.count {
  display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: #e7eaf2; color: var(--navy); font-size: 0.78rem; text-align: center;
}
.count.is-alert { background: var(--warn-bg); color: var(--warn); }

/* --- Meldungsliste ------------------------------------------------------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input { flex: 1 1 200px; }
.article-list { display: grid; gap: 12px; }
.article {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(10px, 2vw, 16px);
}
@media (min-width: 720px) {
  .article { grid-template-columns: 220px minmax(0, 1fr); }
}
/* Mini-Folie im LANNER-Look als Vorschaubild */
.mini-slide {
  aspect-ratio: 4 / 3; border-radius: 6px; padding: 8%;
  background: var(--navy); color: #fff; display: flex; flex-direction: column; gap: 6%; overflow: hidden;
}
.mini-slide-kicker {
  color: var(--blue); font-weight: 800; font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-slide-headline {
  font-weight: 800; font-size: 0.98rem; line-height: 1.08; flex: 1; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; white-space: pre-line;
}
.mini-slide-logo { align-self: flex-end; height: 12%; min-height: 12px; }
@media (max-width: 719px) {
  .mini-slide { aspect-ratio: auto; min-height: 120px; }
}
.article-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.article-headline { font-size: 1.15rem; font-weight: 800; line-height: 1.2; margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.875rem; color: var(--muted); }
.meta span { overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.02em; background: #e7eaf2; color: var(--navy);
}
.badge-live { background: var(--ok-bg); color: var(--ok); }
.badge-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-err { background: var(--err-bg); color: var(--err); }
.badge-top { background: var(--navy); color: #fff; }
.note { padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 0.92rem; }
.note-err { background: var(--err-bg); color: var(--err); }
.note-ok { background: var(--ok-bg); color: var(--ok); }
.note-info { background: #e8f2fb; color: #1d4f7a; }
.empty { text-align: center; padding: 40px 12px; color: var(--muted); }

/* --- Formulare ---------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field, .field + .field-row, .field-row + .field, .field-row + .field-row { margin-top: 16px; }
.field-row > .field { margin-top: 0; }
.field-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.label { font-weight: 800; font-size: 0.95rem; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.hint { font-size: 0.85rem; color: var(--muted); }
.counter { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.counter.is-warn { color: var(--warn); }
.counter.is-err { color: var(--err); }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='search'],
input[type='datetime-local'], select, textarea {
  width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
  font: inherit;
}
textarea { resize: vertical; line-height: 1.35; }
textarea.headline-input { font-size: clamp(1.05rem, 2.2vw, 1.3rem); font-weight: 800; min-height: 110px; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 2px solid rgba(103, 178, 227, 0.35); outline-offset: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 38px; padding: 6px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: 0.92rem;
}
.chip input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }

.switch { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.switch input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); flex: none; }
.switch-text { display: flex; flex-direction: column; }

.quick { display: flex; flex-wrap: wrap; gap: 6px; }

/* --- Editor ------------------------------------------------------------- */
.editor { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) {
  .editor { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .editor-previews { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
}
.editor-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

/* --- Vorschau ----------------------------------------------------------- */
.preview-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.preview { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.preview-frame {
  position: relative; width: 100%; overflow: hidden; border-radius: 6px; background: var(--navy);
  box-shadow: 0 0 0 1px rgba(34, 39, 63, 0.12);
}
.preview-frame iframe {
  position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none;
}
.preview-label { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.82rem; }
.preview-label strong { font-weight: 800; }

/* Ablauf-Leiste im Editor (Folie 1 / Folie 2 / Schluss), gleichzeitig Vorschau-Umschalter */
.timeline { display: flex; gap: 4px; margin: 6px 0 14px; }
.timeline button {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink);
  font: inherit; font-size: 0.82rem; line-height: 1.2; text-align: left; cursor: pointer; overflow: hidden;
}
.timeline button strong, .timeline button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline button span { color: var(--muted); }
.timeline button.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.timeline button.is-active span { color: rgba(255, 255, 255, 0.8); }
.color-input { width: 72px; min-height: 44px; padding: 4px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }

/* --- Sendeplan ---------------------------------------------------------- */
.status-bar { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.channel-head { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; align-items: baseline; margin-bottom: 12px; }
.channel-head h2 { margin: 0; }
.slot-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.slot { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.slot-image {
  width: 100%; aspect-ratio: 4 / 3; border-radius: 6px; background: var(--navy-dark); display: block; object-fit: contain;
  box-shadow: 0 0 0 1px rgba(34, 39, 63, 0.12);
}
.slot-title { font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.slot-images { display: grid; gap: 4px; }
.slot-images.is-pair { grid-template-columns: 1fr 1fr; }
.slot-period { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.slot-label { font-weight: 700; font-size: 0.92rem; line-height: 1.25; overflow-wrap: anywhere; }

/* --- Einstellungen ------------------------------------------------------ */
.settings-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) {
  .settings-split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
.list { display: grid; gap: 10px; }
.list-item {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px;
  padding: 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 0;
}
.list-item > div { min-width: 0; }
.list-item strong { overflow-wrap: anywhere; }
dialog {
  width: min(640px, calc(100vw - 20px)); max-height: calc(100vh - 20px); padding: 0;
  border: 0; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
dialog::backdrop { background: rgba(34, 39, 63, 0.55); }
.dialog-body { padding: clamp(14px, 3vw, 24px); }

/* --- Login -------------------------------------------------------------- */
.login {
  min-height: calc(100vh - 80px); display: flex; align-items: center; justify-content: center;
}
.login .card { width: min(420px, 100%); }
.login-logo { display: block; height: clamp(28px, 8vw, 40px); width: auto; margin: 0 0 18px; }

/* --- Hinweise ----------------------------------------------------------- */
.toasts {
  position: fixed; z-index: 50; left: 10px; right: 10px; bottom: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto; max-width: min(520px, 100%); padding: 12px 16px; border-radius: 8px;
  background: var(--navy-dark); color: #fff; box-shadow: var(--shadow); font-weight: 600;
}
.toast.is-error { background: var(--err); }

/* --- Sehr schmale Bildschirme (bis 320 px) ----------------------------- */
@media (max-width: 320px) {
  .brand-tag { display: none; }
  .card { border-radius: 8px; }
  .tabs a { padding: 8px; }
  .label { font-size: 0.9rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .chip span, .nav a { transition: background-color 0.15s, color 0.15s, border-color 0.15s; }
}
