/**
 * Kërlaçki - Theme-Stile
 *
 * Aufbau: Tokens, Grundlagen, Kopf, Layout, Bausteine, Sportseiten.
 * Mobil zuerst; Breitenregeln kommen als min-width dazu.
 * Die Vereinsfarbe --k-club setzt inc/sportdata.php pro Seite auf <html>.
 */

/* ============================================================ Tokens == */

:root {
    --k-bg: #fcfcfb;
    --k-surface: #ffffff;
    --k-surface-2: #f4f4f2;
    --k-text: #191a1c;
    --k-muted: #6d6f74;
    --k-line: #e6e6e3;
    --k-club: #1f2937;
    --k-club-2: #64748b;
    --k-on-club: #ffffff;

    --k-win: #1f7a4d;
    --k-win-bg: #e4f4ea;
    --k-loss: #a3391c;
    --k-loss-bg: #fbe9e6;
    --k-draw: #8a6100;
    --k-draw-bg: #fdf4e0;

    --k-radius: 10px;
    --k-radius-sm: 6px;
    --k-shell: 1180px;
    --k-gap: 18px;

    --k-shadow: 0 1px 2px rgba(25, 26, 28, .05), 0 6px 20px rgba(25, 26, 28, .05);

    --k-font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --k-bg: #121316;
        --k-surface: #191b1f;
        --k-surface-2: #1f2228;
        --k-text: #eceef1;
        --k-muted: #9ca1a9;
        --k-line: #2a2d33;
        --k-win: #5fc48d;
        --k-win-bg: #10301f;
        --k-loss: #e08163;
        --k-loss-bg: #341612;
        --k-draw: #e0b45c;
        --k-draw-bg: #2e2411;
        --k-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 20px rgba(0, 0, 0, .3);
    }
}

:root[data-theme="dark"] {
    --k-bg: #121316;
    --k-surface: #191b1f;
    --k-surface-2: #1f2228;
    --k-text: #eceef1;
    --k-muted: #9ca1a9;
    --k-line: #2a2d33;
    --k-win: #5fc48d;
    --k-win-bg: #10301f;
    --k-loss: #e08163;
    --k-loss-bg: #341612;
    --k-draw: #e0b45c;
    --k-draw-bg: #2e2411;
    --k-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 20px rgba(0, 0, 0, .3);
}

/* ======================================================== Grundlagen == */

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

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

body {
    margin: 0;
    background: var(--k-bg);
    color: var(--k-text);
    font-family: var(--k-font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
}

img,
svg,
video { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
    margin: 0 0 .5em;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.01em;
    text-wrap: balance;
}

h1 { font-size: clamp(26px, 5vw, 38px); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(21px, 3.4vw, 27px); }
h3 { font-size: 19px; }

p { margin: 0 0 1em; }

a { color: var(--k-club); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
    outline: 2px solid var(--k-club);
    outline-offset: 2px;
    border-radius: 3px;
}

table { border-collapse: collapse; width: 100%; }

/* Barrierefreiheit: für Screenreader sichtbar, optisch nicht. */
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%);
    white-space: nowrap; border: 0;
}

.k-skip {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 100;
    background: var(--k-club);
    color: var(--k-on-club);
    padding: 10px 18px;
    border-radius: var(--k-radius-sm);
    font-weight: 600;
    text-decoration: none;
}
.k-skip:focus { left: 8px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================ Shell === */

.k-shell {
    width: 100%;
    max-width: var(--k-shell);
    margin-inline: auto;
    padding-inline: 16px;
}

.k-main { min-height: 50vh; padding-bottom: 48px; }

/* ============================================================ Kopf ==== */

.k-header {
    background: var(--k-surface);
    border-bottom: 1px solid var(--k-line);
    position: sticky;
    top: 0;
    z-index: 50;
}

.k-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 58px;
}

.k-brand-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.02em;
    text-decoration: none;
    color: var(--k-text);
}

.k-brand img { max-height: 40px; width: auto; }

.k-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0 9px;
    background: none;
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius-sm);
    cursor: pointer;
}

.k-burger span {
    display: block;
    height: 2px;
    background: var(--k-text);
    border-radius: 2px;
    transition: transform .18s ease, opacity .18s ease;
}

.k-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.k-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.k-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobil: Navigation als Schublade unter dem Kopf. */
.k-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--k-surface);
    border-bottom: 1px solid var(--k-line);
    padding: 8px 16px 16px;
    display: none;
}

.k-nav.is-open { display: block; }

.k-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.k-menu li { border-bottom: 1px solid var(--k-line); }
.k-menu li:last-child { border-bottom: 0; }

.k-menu a {
    display: block;
    padding: 12px 2px;
    font-weight: 600;
    font-size: 15.5px;
    color: var(--k-text);
    text-decoration: none;
}

.k-menu a:hover,
.k-menu .current-menu-item > a { color: var(--k-club); }

/* Untermenüs bleiben mobil einfach eingerückt. */
.k-menu .sub-menu {
    list-style: none;
    margin: 0 0 6px;
    padding-left: 14px;
}
.k-menu .sub-menu a { padding: 8px 2px; font-weight: 500; font-size: 14.5px; color: var(--k-muted); }

.k-nav-search { margin-top: 12px; }

@media (min-width: 860px) {
    .k-burger { display: none; }

    .k-nav {
        position: static;
        display: flex;
        align-items: center;
        gap: 18px;
        border: 0;
        padding: 0;
        background: none;
    }

    .k-menu { display: flex; gap: 4px; align-items: center; }
    .k-menu li { border: 0; position: relative; }
    .k-menu > li > a { padding: 8px 12px; border-radius: var(--k-radius-sm); }
    .k-menu > li > a:hover { background: var(--k-surface-2); }

    .k-menu .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 190px;
        background: var(--k-surface);
        border: 1px solid var(--k-line);
        border-radius: var(--k-radius-sm);
        box-shadow: var(--k-shadow);
        padding: 6px;
        margin: 0;
        display: none;
        z-index: 20;
    }
    .k-menu li:hover > .sub-menu,
    .k-menu li:focus-within > .sub-menu { display: block; }
    .k-menu .sub-menu a { padding: 8px 10px; border-radius: 4px; }
    .k-menu .sub-menu a:hover { background: var(--k-surface-2); }

    .k-nav-search { margin: 0; }
}

/* ============================================================ Suche === */

.k-search { display: flex; gap: 6px; }

.k-search-input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    font: inherit;
    font-size: 14.5px;
    color: var(--k-text);
    background: var(--k-bg);
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius-sm);
}

.k-search-btn {
    padding: 9px 15px;
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--k-on-club);
    background: var(--k-club);
    border: 0;
    border-radius: var(--k-radius-sm);
    cursor: pointer;
}

@media (min-width: 860px) {
    .k-nav-search .k-search-input { width: 168px; flex: 0 0 auto; }
}

/* ============================================================ Band ==== */

.k-band {
    background: var(--k-club);
    color: var(--k-on-club);
    padding: 26px 0 24px;
    margin-bottom: 24px;
}

.k-band-label {
    margin: 0 0 8px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .84;
}

.k-band-title { margin: 0; color: inherit; }

.k-band-sub { margin-top: 8px; font-size: 15px; opacity: .9; }
.k-band-sub p:last-child { margin-bottom: 0; }

.k-band-search { margin-top: 16px; max-width: 420px; }
.k-band-search .k-search-input { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .26); color: #fff; }
.k-band-search .k-search-input::placeholder { color: rgba(255, 255, 255, .7); }
.k-band-search .k-search-btn { background: #fff; color: var(--k-club); }

/* ========================================================== Layout ==== */

.k-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
    padding-top: 24px;
    align-items: start;
}

@media (min-width: 1000px) {
    .k-layout { grid-template-columns: minmax(0, 1fr) 288px; }
}

.k-content { min-width: 0; }

/* ========================================================= Bausteine == */

.k-card {
    background: var(--k-surface);
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius);
    overflow: hidden;
}

.k-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--k-line);
}

.k-card-title {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--k-muted);
}

.k-card-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--k-club);
    text-decoration: none;
}
.k-card-link:hover { text-decoration: underline; }

.k-eyebrow {
    margin: 0 0 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--k-muted);
}

.k-empty { color: var(--k-muted); padding: 14px 16px; margin: 0; }

.k-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--k-club);
    color: var(--k-on-club);
    border-radius: var(--k-radius-sm);
    font-weight: 600;
    text-decoration: none;
}

/* ------------------------------------------------------ Beitragsraster */

.k-post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--k-gap);
}

@media (min-width: 620px) {
    .k-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.k-post-card { display: flex; flex-direction: column; }
.k-post-card-img { display: block; aspect-ratio: 3 / 2; overflow: hidden; }
.k-post-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.k-post-card-body { padding: 15px 16px 17px; }

.k-post-card-title { margin: 0 0 6px; font-size: 18px; line-height: 1.3; }
.k-post-card-title a { color: inherit; text-decoration: none; }
.k-post-card-title a:hover { color: var(--k-club); }

.k-post-card-meta { margin: 0 0 8px; font-size: 12.5px; color: var(--k-muted); }
.k-post-card-excerpt { margin: 0; font-size: 14.5px; color: var(--k-muted); }

/* --------------------------------------------------------- Einzelseite */

.k-single { padding-top: 30px; max-width: 780px; }
.k-single-head { margin-bottom: 20px; }
.k-single-title { margin: 0 0 8px; }
.k-single-meta { margin: 0; font-size: 13.5px; color: var(--k-muted); }

.k-single-figure { margin: 0 0 24px; border-radius: var(--k-radius); overflow: hidden; }
.k-single-figure img { width: 100%; display: block; }

.k-prose { font-size: 17px; line-height: 1.72; }
.k-prose > :first-child { margin-top: 0; }
.k-prose h2 { margin-top: 1.6em; }
.k-prose h3 { margin-top: 1.4em; }
.k-prose img { border-radius: var(--k-radius); }
.k-prose blockquote {
    margin: 1.5em 0;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--k-club);
    color: var(--k-muted);
    font-style: italic;
}
.k-prose table { display: block; overflow-x: auto; white-space: nowrap; }
.k-prose pre { overflow-x: auto; background: var(--k-surface-2); padding: 14px; border-radius: var(--k-radius-sm); }
.k-prose :where(ul, ol) { padding-left: 22px; }

.k-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin: 24px 0 0; padding: 0; }
.k-tags a {
    display: inline-block;
    padding: 4px 11px;
    background: var(--k-surface-2);
    border-radius: 999px;
    font-size: 13px;
    color: var(--k-muted);
    text-decoration: none;
}

/* ------------------------------------------------------------ Seitenl. */

.k-sidebar { display: grid; gap: var(--k-gap); }

.k-widget {
    background: var(--k-surface);
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius);
    padding: 16px 18px;
}

.k-widget-title {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--k-muted);
}

.k-widget :where(ul, ol) { list-style: none; margin: 0; padding: 0; }
.k-widget li { padding: 7px 0; border-bottom: 1px solid var(--k-line); font-size: 14.5px; }
.k-widget li:last-child { border-bottom: 0; }
.k-widget a { color: inherit; text-decoration: none; }
.k-widget a:hover { color: var(--k-club); }

/* -------------------------------------------------------- Navigationen */

.pagination,
.post-navigation { margin-top: 30px; }

.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius-sm);
    text-decoration: none;
    color: var(--k-text);
    font-weight: 600;
    font-size: 14.5px;
}

.pagination .page-numbers.current {
    background: var(--k-club);
    border-color: var(--k-club);
    color: var(--k-on-club);
}

.post-navigation .nav-links { display: grid; gap: 12px; }
@media (min-width: 620px) { .post-navigation .nav-links { grid-template-columns: 1fr 1fr; } }

.post-navigation a {
    display: block;
    padding: 14px 16px;
    background: var(--k-surface);
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius);
    text-decoration: none;
    color: var(--k-text);
    font-weight: 600;
}
.post-navigation .nav-next a { text-align: right; }
.k-navlabel {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--k-muted);
    margin-bottom: 3px;
}

/* --------------------------------------------------------------- 404 - */

.k-404 { padding: 56px 0 40px; max-width: 560px; }
.k-404-title { margin: 0 0 10px; }
.k-404-text { color: var(--k-muted); }
.k-404-search { margin: 20px 0 24px; }

/* ========================================================== Fusszeile = */

.k-footer {
    background: var(--k-surface);
    border-top: 1px solid var(--k-line);
    padding: 34px 0 30px;
    margin-top: 40px;
}

.k-footer-widgets {
    display: grid;
    gap: var(--k-gap);
    margin-bottom: 26px;
}

@media (min-width: 720px) {
    .k-footer-widgets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.k-footer-widgets .k-widget { background: none; border: 0; padding: 0; }

.k-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--k-line);
}

.k-footer-name { margin: 0; font-weight: 800; letter-spacing: -.01em; }

.k-footer-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0;
    padding: 0;
    font-size: 14.5px;
}
.k-footer-menu a { color: var(--k-muted); text-decoration: none; }
.k-footer-menu a:hover { color: var(--k-text); }

.k-footer-copy { margin: 0; font-size: 13.5px; color: var(--k-muted); }

/* ==================================================== Startseite ====== */

.k-home-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--k-gap);
    padding-top: 24px;
}

@media (min-width: 1000px) {
    .k-home-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}

.k-home-col { display: grid; gap: var(--k-gap); align-content: start; }

.k-fixtures { list-style: none; margin: 0; padding: 0; }

.k-fixtures li { border-bottom: 1px solid var(--k-line); }
.k-fixtures li:last-child { border-bottom: 0; }

.k-fixtures a,
.k-fixtures .k-fixture-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    text-decoration: none;
    color: inherit;
}

.k-fixtures a:hover { background: var(--k-surface-2); }

.k-fixture-date {
    font-size: 11.5px;
    line-height: 1.3;
    color: var(--k-muted);
    font-variant-numeric: tabular-nums;
}

.k-fixture-teams { font-size: 14px; line-height: 1.35; min-width: 0; }
.k-fixture-teams strong { font-weight: 700; }

.k-fixture-score {
    font-weight: 700;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    padding: 3px 10px;
    border-radius: var(--k-radius-sm);
    background: var(--k-surface-2);
    color: var(--k-muted);
    white-space: nowrap;
}

.k-fixture-score.is-win { background: var(--k-win-bg); color: var(--k-win); }
.k-fixture-score.is-loss { background: var(--k-loss-bg); color: var(--k-loss); }
.k-fixture-score.is-draw { background: var(--k-draw-bg); color: var(--k-draw); }

/* ------------------------------------------------------------- Tabelle */

.k-table-wrap { overflow-x: auto; }

.k-table {
    font-size: 13.5px;
    min-width: 420px;
}

.k-table th {
    text-align: right;
    padding: 10px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--k-muted);
    border-bottom: 1px solid var(--k-line);
    white-space: nowrap;
}

.k-table th:nth-child(2) { text-align: left; }

.k-table td {
    padding: 9px 6px;
    text-align: right;
    border-bottom: 1px solid var(--k-line);
    font-variant-numeric: tabular-nums;
}

.k-table td:nth-child(2) { text-align: left; font-weight: 600; }
.k-table tbody tr:last-child td { border-bottom: 0; }
.k-table a { color: inherit; text-decoration: none; }
.k-table a:hover { text-decoration: underline; }

.k-table .is-self td { background: color-mix(in srgb, var(--k-club) 8%, transparent); }
.k-table .is-self td:first-child { color: var(--k-club); font-weight: 800; }

.k-table-club { display: flex; align-items: center; gap: 8px; }
.k-table-club img { width: 20px; height: 20px; object-fit: contain; flex: 0 0 auto; }

/* ==================================================== Sportdata ======= */

/* Das Plugin bringt profiles.css mit. Hier nur der Rahmen, damit die
   Plugin-Seiten dieselbe Bühne bekommen wie der Rest des Themes. */

.k-sportdata .k-main { padding-top: 0; }
.k-sportdata .sdc-p { max-width: var(--k-shell); padding-inline: 16px; }
