/*
Theme Name: GJK Kepler
Theme URI: https://www.gjk.cz/
Author: Gymnázium Jana Keplera
Author URI: https://www.gjk.cz/
Description: Moderní editoriálně laděná šablona pro Gymnázium Jana Keplera (gjk.cz). Tmavý kinematografický hero, světlé "paper" pozadí, serifová typografie Fraunces, modulární sekce s pilíři, evidence čísly, aktualitami a rychlými přístupy. Plně responsivní, plnohodnotně lokalizovaná pro WordPress 6+. Nahrazuje zastaralou Smartline šablonu.
Version: 1.5.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gjk-kepler
Tags: education, school, custom-menu, custom-logo, featured-images, full-width-template, threaded-comments, translation-ready, block-styles

Veškeré styly v této šabloně jsou vlastní. Šablona využívá Google Fonts (Fraunces, Inter, JetBrains Mono) licencované pod SIL Open Font License.
*/

/* ============ TOKENS ============ */
:root {
    --paper: #FBFAF7;
    --paper-tint: #F5F3ED;
    --paper-edge: #ECE8DD;
    --ink: #111111;
    --ink-soft: #2A2A2A;
    --ink-mute: #6B6862;
    --ink-faint: #A6A29A;
    --kepler: #1A3A8A;
    --brass: #B88A3A;
    --line: rgba(17, 17, 17, 0.12);
    --line-soft: rgba(17, 17, 17, 0.07);

    --serif: "Fraunces", "Times New Roman", serif;
    --sans: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

    --gutter: clamp(28px, 5vw, 96px);
    --max: 1360px;
    --rhythm: clamp(60px, 7vw, 110px);
}

/* ============ RESET / BASE ============ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.55;
    overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* WordPress core required */
.alignleft  { float: left;  margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-mute);
    text-align: center;
    padding: 8px 0;
}
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}
.screen-reader-text:focus {
    background-color: var(--paper);
    clip: auto !important;
    clip-path: none;
    color: var(--ink);
    display: block;
    font-size: 14px;
    font-weight: 600;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ============ HELPERS ============ */
.mono {
    font-family: var(--mono);
    font-weight: 400;
    letter-spacing: 0.02em;
}
.eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--ink-mute);
    font-weight: 500;
}
.container {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

/* ============ HEADER ============ */
.header-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 80;
    background: var(--paper);
    transition: box-shadow .35s ease, background .35s ease;
}
.header-wrap.on-dark {
    background: linear-gradient(180deg, rgba(11, 11, 11, 0.85) 0%, rgba(11, 11, 11, 0.6) 70%, transparent 100%) !important;
    color: var(--paper);
    border-bottom-color: rgba(251, 250, 247, 0.14);
    box-shadow: none;
}
.header-wrap.on-dark .main-nav a { color: rgba(251, 250, 247, 0.82); }
.header-wrap.on-dark .main-nav a:hover,
.header-wrap.on-dark .main-nav a.is-active,
.header-wrap.on-dark .main-nav .current-menu-item > a,
.header-wrap.on-dark .main-nav .current_page_item > a { color: var(--paper); }
.header-wrap.on-dark .util-nav .util-item a {
    color: rgba(251, 250, 247, 0.82);
    border-color: rgba(251, 250, 247, 0.3);
}
.header-wrap.on-dark .util-nav .util-item a:hover,
.header-wrap.on-dark .util-nav .util-item a:focus-visible {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--paper);
}
.header-wrap.on-dark .util-nav .util-item:first-child a {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--paper);
}
.header-wrap.on-dark .util-nav .util-item:first-child a:hover {
    background: var(--brass);
    border-color: var(--brass);
    color: var(--ink);
}
.header-wrap.on-dark .wordmark { color: var(--paper); }
.header-wrap.on-dark .wordmark .sub { color: rgba(251, 250, 247, 0.6); }
.header-wrap.on-dark .wordmark .rule { background: var(--paper); opacity: 0.35; }
.header-wrap.on-dark .menu-toggle { color: var(--paper); }
.header-wrap.on-dark .menu-toggle .bar { background: var(--paper); }

.header-row {
    display: flex;
    align-items: center;
    height: 104px;
    gap: 0;
    border-bottom: 1px solid var(--line-soft);
    transition: border-color .35s;
}
.header-wrap.on-dark .header-row { border-bottom-color: rgba(251, 250, 247, 0.14); }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--ink);
    transition: color .25s;
}
.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    line-height: 1;
}
.wordmark .kepler {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 22px;
    letter-spacing: 0.10em;
    line-height: 1;
    font-variation-settings: "opsz" 60;
    text-transform: uppercase;
}
.wordmark .rule {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: currentColor;
    opacity: 0.22;
}
.wordmark .sub {
    font-family: var(--sans);
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-weight: 500;
    color: var(--ink-mute);
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    max-width: none;
}
.custom-logo-link img {
    height: 36px;
    width: auto;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 48px;
    margin-left: 60px;
}
.main-nav > ul:not(.sub-menu),
.main-nav > .primary-menu {
    display: flex;
    align-items: center;
    gap: 48px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.main-nav a {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-soft);
    position: relative;
    padding: 6px 0;
    transition: color .2s;
    white-space: nowrap;
}
.main-nav a:hover { color: var(--ink); }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a,
.main-nav .current-menu-ancestor > a {
    color: var(--ink);
}
.main-nav .current-menu-item > a::after,
.main-nav .current_page_item > a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: currentColor;
}

/* Submenu (dropdown) — vertikální rozbalovací seznam */

/* ========== SUBMENU — VERTIKÁLNÍ DROPDOWN (nuclear version) ========== */

/* Všechny přímé <li> uvnitř hlavní navigace mají position:relative pro anchor submenu */
.main-nav li {
    position: relative;
}

/* Submenu MUSÍ být svislé — nuclear specificity + !important */
.header-wrap .main-nav .sub-menu,
.main-nav ul.sub-menu,
ul.sub-menu {
    position: absolute !important;
    top: calc(100% + 4px) !important;
    left: 0 !important;
    width: max-content !important;
    min-width: 240px !important;
    max-width: 320px !important;
    display: block !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 10px 0 !important;
    background: var(--paper) !important;
    border: 1px solid var(--line) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.09) !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .2s, transform .2s, visibility .2s;
    z-index: 90;
    pointer-events: none;
    /* FORCE vertical layout */
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
}

/* Otevření podmenu na hover / focus */
.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
}

/* Každá položka podmenu je blokový prvek přes celou šířku */
.main-nav .sub-menu > li,
.main-nav ul.sub-menu > li,
ul.sub-menu > li {
    display: block !important;
    width: 100% !important;
    border-bottom: none !important;
    float: none !important;
    clear: both !important;
}

/* Odkaz v podmenu */
.main-nav .sub-menu a,
.main-nav ul.sub-menu a,
ul.sub-menu a {
    display: block !important;
    width: 100% !important;
    padding: 9px 22px !important;
    font-family: var(--sans) !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    color: var(--ink-soft) !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    line-height: 1.55 !important;
    transition: background .15s, color .15s;
}
.main-nav .sub-menu a:hover,
.main-nav .sub-menu a:focus {
    background: var(--paper-tint) !important;
    color: var(--ink) !important;
}

/* On-dark: podmenu zůstává světlé (papírové) i na tmavé hlavičce */
.header-wrap.on-dark .main-nav .sub-menu {
    background: var(--paper) !important;
    border-color: var(--line) !important;
}
.header-wrap.on-dark .main-nav .sub-menu a {
    color: var(--ink-soft) !important;
}
.header-wrap.on-dark .main-nav .sub-menu a:hover {
    background: var(--paper-tint) !important;
    color: var(--ink) !important;
}

/* ============ UTILITY MENU — VARIANTA B (pill kapsle s ikonami) ============ */
.util-nav {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--sans);
}
.util-nav ul {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.util-nav .util-item a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-soft);
    background: transparent;
    line-height: 1;
    white-space: nowrap;
    transition: background .25s, color .25s, border-color .25s, transform .25s;
}
.util-nav .util-item a:hover,
.util-nav .util-item a:focus-visible {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}
.util-nav .util-item a:focus-visible {
    outline: 2px solid var(--brass);
    outline-offset: 2px;
}
.util-nav .util-icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    opacity: 0.85;
}
.util-nav .util-label {
    display: inline-block;
}

/* Accent the first item (Bakaláři) — primary action */
.util-nav .util-item:first-child a {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}
.util-nav .util-item:first-child a:hover {
    background: var(--brass);
    border-color: var(--brass);
    color: var(--ink);
}

/* Utility menu uvnitř mobile drawer — skryté na desktopu, zobrazené v mobilním menu */
.main-nav-util { display: none; }
.main-nav-util-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin: 0 0 16px;
}
.main-nav-util .utility-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.main-nav-util .util-item a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
    text-decoration: none;
}
.main-nav-util .util-item:first-child a {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}
.main-nav-util .util-icon { width: 16px; height: 16px; }
.header-wrap.on-dark .main-nav-util-label { color: rgba(251, 250, 247, 0.55); }
.header-wrap.on-dark .main-nav-util .util-item a {
    color: var(--paper);
    border-color: rgba(251, 250, 247, 0.3);
}
.header-wrap.on-dark .main-nav-util .util-item:first-child a {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--paper);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    appearance: none;
    background: transparent;
    border: none;
    padding: 10px;
    margin-left: auto;
    color: var(--ink);
    position: relative;
    width: 44px;
    height: 44px;
    cursor: pointer;
}
.menu-toggle .bar {
    display: block;
    width: 22px;
    height: 1.5px;
    background: currentColor;
    margin: 4px auto;
    transition: transform .3s, opacity .3s;
}
.menu-toggle.is-open .bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.menu-toggle.is-open .bar:nth-child(2) { opacity: 0; }
.menu-toggle.is-open .bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ============ HERO ============ */
.hero {
    position: relative;
    min-height: 92vh;
    background: #0B0B0B;
    color: var(--paper);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 180px var(--gutter) 140px;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 60%, rgba(28, 40, 72, 0.25) 0%, rgba(11, 11, 11, 0) 55%),
        linear-gradient(180deg, rgba(11, 11, 11, 0.4) 0%, rgba(11, 11, 11, 0) 35%, rgba(11, 11, 11, 0.35) 100%);
    background-size: cover;
    background-position: center 40%;
    filter: grayscale(0.5) brightness(0.72) contrast(1.05);
    transform: scale(1.04);
    z-index: 0;
}
.hero-bg.has-image {
    background:
        radial-gradient(ellipse at 50% 60%, rgba(28, 40, 72, 0.35) 0%, rgba(11, 11, 11, 0) 55%),
        linear-gradient(180deg, rgba(11, 11, 11, 0.55) 0%, rgba(11, 11, 11, 0) 35%, rgba(11, 11, 11, 0.45) 100%),
        var(--hero-image);
    background-size: cover;
    background-position: center 40%;
}
.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.018) 0 1px, transparent 1px 3px);
    mix-blend-mode: overlay;
    pointer-events: none;
}
.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    filter: grayscale(0.3) brightness(0.72) contrast(1.05);
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
    z-index: 1;
}

.hero-inner {
    position: relative;
    z-index: 2;
    max-width: 920px;
    width: 100%;
    margin: 0 auto;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: rgba(251, 250, 247, 0.72);
    margin-bottom: 44px;
}
.hero-eyebrow .bar {
    width: 36px;
    height: 1px;
    background: currentColor;
    opacity: 0.6;
}
.hero-title {
    font-family: var(--serif);
    font-weight: 400;
    font-variation-settings: "opsz" 144;
    font-size: clamp(48px, 7.2vw, 104px);
    line-height: 1.02;
    letter-spacing: -0.022em;
    margin: 0 0 36px;
    color: var(--paper);
    text-wrap: balance;
}
.hero-title em {
    font-style: italic;
    font-weight: 400;
}
.hero-title .line { display: block; }

.hero-sub {
    font-size: 18px;
    line-height: 1.6;
    color: rgba(251, 250, 247, 0.82);
    max-width: 560px;
    margin: 0 auto 56px;
    text-wrap: pretty;
}
.hero-cta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 16px 26px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    border-radius: 0;
    border: 1px solid currentColor;
    transition: background-color .25s ease, color .25s ease, border-color .25s ease, transform .25s ease;
    cursor: pointer;
    background: transparent;
    color: inherit;
}
.btn .arrow { transition: transform .25s ease; }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--paper);
}
.btn-primary:hover { background: transparent; color: var(--paper); }
.btn-ghost {
    background: transparent;
    color: var(--paper);
    border-color: rgba(251, 250, 247, 0.5);
}
.btn-ghost:hover {
    border-color: var(--paper);
    background: rgba(251, 250, 247, 0.06);
}
.btn-dark {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}
.btn-dark:hover { background: var(--kepler); border-color: var(--kepler); }
.btn-outline-dark {
    background: transparent;
    color: var(--ink);
    border-color: var(--ink);
}
.btn-outline-dark:hover { background: var(--ink); color: var(--paper); }

.hero-foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 38px;
    z-index: 2;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: rgba(251, 250, 247, 0.58);
}
.hero-foot .scroll {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: rgba(251, 250, 247, 0.7);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.hero-foot .scroll .tick {
    width: 1px;
    height: 32px;
    background: currentColor;
    opacity: 0.55;
    animation: tickdrop 2.6s ease-in-out infinite;
    transform-origin: top center;
}
@keyframes tickdrop {
    0%, 100% { transform: scaleY(0.4); opacity: 0.25; }
    50% { transform: scaleY(1); opacity: 0.7; }
}

/* ============ SECTION COMMONS ============ */
section.block {
    padding-top: var(--rhythm);
    padding-bottom: var(--rhythm);
}
.section-head {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 80px;
    margin-bottom: 80px;
    align-items: end;
}
.section-num {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.section-num .tick { width: 22px; height: 1px; background: currentColor; }
.section-title {
    font-family: var(--serif);
    font-weight: 400;
    font-variation-settings: "opsz" 96;
    font-size: clamp(36px, 4.6vw, 60px);
    line-height: 1.05;
    letter-spacing: -0.015em;
    margin: 0;
    text-wrap: balance;
}
.section-title em { font-style: italic; font-weight: 400; }
.section-lede {
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink-mute);
    max-width: 520px;
    margin: 0;
    text-wrap: pretty;
}

/* ============ PILLARS ============ */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 32px;
    border-top: 1px solid var(--line);
}
.pillar {
    padding: 44px 0 48px;
    border-bottom: 1px solid var(--line);
}
/* Pillar 4 spans 2 columns */
.pillar:nth-child(4) {
    grid-column: span 2;
}
.pillar .p-num {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 26px;
}
.pillar h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-variation-settings: "opsz" 72;
    font-size: 26px;
    line-height: 1.15;
    letter-spacing: -0.008em;
    margin: 0 0 14px;
}
.pillar .p-lead {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: 16px;
    color: var(--ink-soft);
    margin: 0 0 16px;
    line-height: 1.4;
}
.pillar p.p-body {
    margin: 0;
    color: var(--ink-mute);
    font-size: 14.5px;
    line-height: 1.6;
}

/* ============ EVIDENCE (numbers) ============ */
.evidence { background: var(--paper-tint); }
.evidence-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.evidence-cell {
    padding: 64px 32px 60px;
    border-right: 1px solid var(--line);
    text-align: left;
}
.evidence-cell:last-child { border-right: none; }
.evidence-num {
    font-family: var(--serif);
    font-weight: 400;
    font-variation-settings: "opsz" 144;
    font-size: clamp(60px, 6.5vw, 92px);
    line-height: 1;
    letter-spacing: -0.025em;
    color: var(--ink);
    margin: 0 0 18px;
}
.evidence-num .unit {
    font-family: var(--serif);
    font-style: italic;
    font-size: 0.42em;
    color: var(--brass);
    margin-left: 4px;
    vertical-align: 0.55em;
    font-weight: 400;
}
.evidence-cell .label {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-mute);
    line-height: 1.45;
}

/* ============ NEWS ============ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 32px;
}
/* Skryj případnou 7. a další kartu — grid je pevně 3×2 = 6 karet */
.news-grid .card:nth-child(n+7) { display: none; }
.card {
    border: 1px solid var(--line);
    background: var(--paper);
    transition: background-color .3s ease, border-color .3s ease, transform .3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.card:hover {
    background: var(--paper-tint);
    border-color: rgba(17, 17, 17, 0.22);
}
.card-thumb {
    aspect-ratio: 4 / 3;
    background: var(--paper-tint);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s ease;
}
.card:hover .card-thumb img { transform: scale(1.04); }
.card-thumb-placeholder {
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(45deg, var(--paper-edge) 0 2px, transparent 2px 8px),
        var(--paper-tint);
}
.card-meta {
    padding: 22px 26px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-mute);
}
.card-meta .cat { color: var(--kepler); font-weight: 500; }
.card h4 {
    font-family: var(--serif);
    font-weight: 400;
    font-variation-settings: "opsz" 60;
    font-size: 22px;
    line-height: 1.25;
    letter-spacing: -0.005em;
    padding: 16px 26px 28px;
    margin: 0;
    text-wrap: pretty;
}
.news-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 56px;
}
.text-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink);
    border-bottom: 1px solid var(--ink);
    padding-bottom: 4px;
    transition: gap .25s, color .25s;
}
.text-link:hover { gap: 20px; color: var(--kepler); border-bottom-color: var(--kepler); }

/* ============ QUICK ACCESS ============ */
.quick {
    background: var(--paper);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}
.quick-cell {
    padding: 28px 32px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 0;
    text-decoration: none;
    color: inherit;
    transition: background-color .25s;
    position: relative;
}
.quick-cell:hover { background: var(--paper-tint); }
.quick-cell:nth-child(3n) { border-right: none; }
.quick-cell:nth-last-child(-n+3) { border-bottom: none; }
.quick-cell h5 {
    font-family: var(--serif);
    font-weight: 400;
    font-variation-settings: "opsz" 72;
    font-size: 24px;
    line-height: 1.15;
    margin: 0;
    letter-spacing: -0.01em;
}
.quick-cell .desc {
    display: block;
    margin-top: 6px;
}
.quick-cell .desc {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-mute);
}
.quick-cell .arrow {
    flex-shrink: 0;
    color: var(--ink-mute);
    transition: transform .25s, color .25s;
}
.quick-cell:hover .arrow {
    transform: translate(4px, -4px);
    color: var(--kepler);
}

/* ============ PAGE HEADER (vnitřní stránky) ============ */
.page-header {
    padding: 200px var(--gutter) 56px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.page-header .container {
    padding-left: 0;
    padding-right: 0;
}
.page-header .eyebrow {
    color: var(--brass);
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.page-header .eyebrow .tick {
    width: 22px;
    height: 1px;
    background: currentColor;
}
.page-header h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-variation-settings: "opsz" 96;
    font-size: clamp(40px, 5.4vw, 72px);
    line-height: 1.04;
    letter-spacing: -0.02em;
    margin: 0;
    max-width: 920px;
    text-wrap: balance;
}
.page-header h1 em { font-style: italic; }
.page-header .lede {
    margin-top: 24px;
    max-width: 640px;
    font-size: 18px;
    color: var(--ink-mute);
    line-height: 1.6;
}

/* ============ CONTENT (vnitřní stránka / single článek) ============ */
.content-wrap {
    padding: 56px var(--gutter) var(--rhythm);
}
.content-wrap .container { max-width: 800px; padding-left: 0; padding-right: 0; }
.entry-content {
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.7;
    color: var(--ink-soft);
    font-variation-settings: "opsz" 24;
}
.entry-content > * + * { margin-top: 1.2em; }
.entry-content h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-variation-settings: "opsz" 96;
    font-size: 36px;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-top: 1.5em;
    margin-bottom: 0.4em;
}
.entry-content h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-variation-settings: "opsz" 72;
    font-size: 26px;
    line-height: 1.2;
    margin-top: 1.5em;
    margin-bottom: 0.4em;
}
.entry-content h4 {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 1.5em;
    margin-bottom: 0.4em;
    color: var(--ink);
}
.entry-content a {
    color: var(--kepler);
    border-bottom: 1px solid currentColor;
    transition: color .2s;
}
.entry-content a:hover { color: var(--brass); }
.entry-content blockquote {
    border-left: 2px solid var(--brass);
    padding: 4px 0 4px 32px;
    margin: 2em 0;
    font-style: italic;
    color: var(--ink);
    font-size: 22px;
    line-height: 1.5;
}
.entry-content blockquote cite {
    display: block;
    margin-top: 16px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-mute);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-style: normal;
}
.entry-content code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--paper-tint);
    padding: 2px 6px;
}
.entry-content pre {
    font-family: var(--mono);
    background: var(--ink);
    color: var(--paper);
    padding: 24px;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.55;
}
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li + li { margin-top: 0.4em; }
.entry-content img, .entry-content figure {
    margin: 2em 0;
}
.entry-content figure figcaption {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-mute);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 12px;
    text-align: center;
}
.entry-content hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 3em 0;
}
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--sans);
    font-size: 15px;
}
.entry-content th, .entry-content td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}
.entry-content th {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-mute);
    font-weight: 500;
}

/* Entry meta on single */
.entry-meta {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}
.entry-meta .cat { color: var(--kepler); }
.entry-thumbnail {
    margin: 0 0 56px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--line);
}
.entry-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Pagination */
.pagination {
    margin-top: 64px;
    display: flex;
    justify-content: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.16em;
}
.pagination .page-numbers {
    padding: 12px 18px;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    transition: all .25s;
    text-transform: uppercase;
}
.pagination .page-numbers:hover {
    border-color: var(--ink);
    color: var(--ink);
}
.pagination .page-numbers.current {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

/* Single navigation prev/next */
.post-nav {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 32px;
}
.post-nav a {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-soft);
    transition: color .2s;
}
.post-nav a:hover { color: var(--kepler); }
.post-nav .label {
    display: block;
    color: var(--brass);
    font-size: 10px;
    margin-bottom: 8px;
}

/* Archive grid */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

/* Search & 404 */
.search-form {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 1px solid var(--ink);
    max-width: 480px;
    margin: 0 auto;
}
.search-form input[type="search"] {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 4px;
    font-family: var(--serif);
    font-size: 20px;
    color: var(--ink);
    outline: none;
}
.search-form input[type="search"]::placeholder { color: var(--ink-faint); }
.search-form button {
    appearance: none;
    background: transparent;
    border: none;
    padding: 14px 4px;
    color: var(--ink-mute);
    transition: color .2s;
}
.search-form button:hover { color: var(--ink); }

.not-found {
    text-align: center;
    padding: var(--rhythm) var(--gutter);
}
.not-found .big {
    font-family: var(--serif);
    font-size: clamp(120px, 18vw, 240px);
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin: 0;
    font-variation-settings: "opsz" 144;
}
.not-found .label {
    font-family: var(--mono);
    color: var(--brass);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 11px;
    margin-bottom: 20px;
}

/* ============ FOOTER ============ */
.site-footer {
    background: var(--ink);
    color: var(--paper);
    padding: 120px 0 56px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    padding-bottom: 64px;
    border-bottom: 1px solid rgba(251, 250, 247, 0.13);
}
.footer-brand .wordmark { color: var(--paper); margin-bottom: 32px; }
.footer-brand .wordmark .sub { color: rgba(251, 250, 247, 0.55); }
.footer-brand address {
    font-style: normal;
    font-size: 14px;
    line-height: 1.7;
    color: rgba(251, 250, 247, 0.7);
}
.footer-col h6 {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(251, 250, 247, 0.5);
    font-weight: 500;
    margin: 0 0 22px;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.footer-col a {
    font-size: 14.5px;
    color: rgba(251, 250, 247, 0.82);
    transition: color .2s;
}
.footer-col a:hover { color: var(--paper); }
/* ---------- Partnerská loga v patičce ---------- */
.footer-partners {
    padding: 44px 0 36px;
    border-bottom: 1px solid rgba(251, 250, 247, 0.13);
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.partner-group h6 {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(251, 250, 247, 0.5);
    font-weight: 500;
    margin: 0 0 14px;
}
.partner-logos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    grid-auto-rows: 70px;
    grid-auto-flow: row dense;
    gap: 10px;
}
.partner-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: span 2;
    padding: 10px 20px;
    background: var(--paper);
    border-radius: 6px;
}
.partner-logo--sq {
    grid-column: span 1;
    grid-row: span 2;
    padding: 14px;
}
.partner-logo img {
    display: block;
    max-height: 47px;
    max-width: 85%;
    width: auto;
    height: auto;
    filter: grayscale(1);
    opacity: 0.82;
    transition: filter .25s ease, opacity .25s ease;
}
.partner-logo--sq img {
    max-height: 118px;
    max-width: 118px;
}
.partner-logo img.logo-dofe {
    height: 50px;
    max-height: 50px;
    max-width: 200px;
}
a.partner-logo:hover img,
a.partner-logo:focus-visible img {
    filter: grayscale(0);
    opacity: 1;
}

/* Fakultní školy — jednotné rámečky i optická velikost log */
.partner-group--fakultni-skoly .partner-logos {
    display: flex;
    flex-wrap: wrap;
}
.partner-group--fakultni-skoly .partner-logo {
    width: 224px;
    height: 70px;
    padding: 8px 14px;
}
.partner-group--fakultni-skoly .partner-logo img {
    height: 50px;
    max-height: 50px;
    width: auto;
    max-width: 196px;
    filter: grayscale(1);
}

.footer-base {
    padding-top: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(251, 250, 247, 0.5);
}
.footer-base em {
    font-family: var(--serif);
    font-style: italic;
    text-transform: none;
    letter-spacing: 0.02em;
    color: rgba(251, 250, 247, 0.7);
    font-size: 13px;
}

/* ============ REVEAL ============ */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .9s ease, transform .9s ease;
}
.reveal.in {
    opacity: 1;
    transform: none;
}
.reveal.d1 { transition-delay: .05s; }
.reveal.d2 { transition-delay: .12s; }
.reveal.d3 { transition-delay: .2s; }
.reveal.d4 { transition-delay: .28s; }
.reveal.d5 { transition-delay: .36s; }
.hero .reveal.in { transition-duration: 1.1s; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .hero-foot .scroll .tick { animation: none; }
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============ COMMENTS (jednoduchý styl) ============ */
.comments-area {
    margin-top: 80px;
    padding-top: 56px;
    border-top: 1px solid var(--line);
}
.comments-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 28px;
    margin: 0 0 32px;
}
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list li { padding: 24px 0; border-bottom: 1px solid var(--line); }
.comment-meta {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 12px;
}
.comment-form { margin-top: 40px; }
.comment-form label {
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 8px;
}
.comment-form input,
.comment-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--paper);
    padding: 14px 16px;
    font-family: var(--sans);
    font-size: 15px;
    color: var(--ink);
    margin-bottom: 18px;
    outline: none;
    transition: border-color .2s;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--ink); }
.comment-form input[type="submit"] {
    width: auto;
    background: var(--ink);
    color: var(--paper);
    border: 1px solid var(--ink);
    padding: 14px 26px;
    font-family: var(--sans);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .25s;
}
.comment-form input[type="submit"]:hover {
    background: var(--kepler);
    border-color: var(--kepler);
}

/* ============ WIDGETS / SIDEBAR (footer) ============ */
.widget { margin-bottom: 32px; }
.widget-title {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(251, 250, 247, 0.5);
    font-weight: 500;
    margin: 0 0 22px;
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 6px 0; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1280px) {
    .main-nav, .main-nav > ul:not(.sub-menu), .main-nav > .primary-menu { gap: 36px; }
    .main-nav { margin-left: 48px; }
    .util-nav, .util-nav ul { gap: 6px; }
    .util-nav .util-item a { padding: 8px 12px; letter-spacing: 0.14em; }
}
@media (max-width: 1180px) {
    /* Skryjeme textové labely u utility pillů — zůstávají jen ikony */
    .util-nav .util-item a {
        padding: 8px;
        width: 34px;
        height: 34px;
        justify-content: center;
        gap: 0;
    }
    .util-nav .util-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .util-nav .util-icon {
        width: 16px;
        height: 16px;
        opacity: 1;
    }
}
@media (max-width: 1100px) {
    .main-nav, .main-nav > ul:not(.sub-menu), .main-nav > .primary-menu { gap: 28px; }
    .main-nav { margin-left: 40px; font-size: 11.5px; letter-spacing: 0.18em; }
    .main-nav a { letter-spacing: 0.18em; }
    .section-head { grid-template-columns: 1fr; gap: 28px; }
    .pillars-grid { grid-template-columns: repeat(2, 1fr); }
    .pillar:nth-child(4) { grid-column: span 2; }
    .evidence-row { grid-template-columns: repeat(2, 1fr); }
    .evidence-cell:nth-child(2) { border-right: none; }
    .evidence-cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .news-grid, .archive-grid { grid-template-columns: 1fr 1fr; }
    .quick-grid { grid-template-columns: 1fr 1fr; }
    .quick-cell:nth-child(3n) { border-right: 1px solid var(--line); }
    .quick-cell:nth-child(2n) { border-right: none; }
    .quick-cell:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
    .quick-cell:nth-last-child(-n+2) { border-bottom: none; }
}
/* Mobil + tablet: schováme vodorovné menu a zobrazíme hamburger ikonu (drawer).
   Zlom 1024px = standardní hranice mezi tablety a desktopem, takže se ikonka
   objeví na telefonech i na tabletech (na výšku i na šířku). */
@media (max-width: 1024px) {
    .util-nav { display: none; }
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; flex-direction: column; }
    
    /* Můj Kepler na mobilu: jen ikona, bez textu, vpravo */
    .muj-kepler-toggle {
        padding: 8px;
    }
    .muj-kepler-label,
    .muj-kepler-chevron {
        display: none;
    }
    .muj-kepler-icon {
        width: 22px;
        height: 22px;
    }
    .muj-kepler-dropdown {
        padding-left: 0;
        margin-left: auto;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--paper);
        z-index: 70;
        flex-direction: column;
        gap: 0;
        margin: 0;
        padding: 120px 24px 40px;
        align-items: flex-start;
        transform: translateX(100%);
        transition: transform .35s cubic-bezier(.4, 0, .2, 1);
        overflow-y: auto;
    }
    .header-wrap.on-dark .main-nav { background: var(--ink); }
    .main-nav.is-open { transform: none; }
    .main-nav > ul:not(.sub-menu),
    .main-nav > .primary-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
    }
    .main-nav > ul:not(.sub-menu) > li,
    .main-nav > .primary-menu > li { width: 100%; border-bottom: 1px solid var(--line); }
    .header-wrap.on-dark .main-nav > ul:not(.sub-menu) > li,
    .header-wrap.on-dark .main-nav > .primary-menu > li { border-bottom-color: rgba(251, 250, 247, 0.14); }
    .main-nav a {
        font-size: 16px;
        letter-spacing: 0.14em;
        padding: 18px 0;
        display: block;
    }
    .main-nav .sub-menu {
        position: static;
        display: block;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: none;
        box-shadow: none;
        padding: 0 0 16px 16px;
        background: transparent;
        width: 100%;
    }
    .main-nav .sub-menu li { border-bottom: none; }
    .main-nav .sub-menu a {
        padding: 10px 0;
        font-size: 14px;
    }
    /* Zobrazit utility (rychlý přístup) pod hlavním menu uvnitř mobile drawer */
    .main-nav-util {
        display: block;
        width: 100%;
        margin-top: 32px;
        padding-top: 24px;
        border-top: 1px solid var(--line);
    }
    .header-wrap.on-dark .main-nav-util { border-top-color: rgba(251, 250, 247, 0.14); }
}
@media (max-width: 720px) {
    .header-row { height: 68px; }
    .wordmark .sub, .wordmark .rule { display: none; }
    .hero { min-height: 88vh; padding: 140px 24px 120px; }
    .hero-eyebrow { margin-bottom: 28px; }
    .hero-foot { display: none; }
    .news-grid, .archive-grid, .quick-grid, .pillars-grid {
        grid-template-columns: 1fr;
    }
    .pillar:nth-child(4) {
        grid-column: span 1;
    }
    .evidence-row { grid-template-columns: 1fr 1fr; }
    .pillar { padding: 32px 0 36px; }
    .quick-cell {
        border-right: none !important;
        border-bottom: 1px solid var(--line) !important;
        padding: 22px 24px;
        min-height: 0;
    }
    .quick-cell:last-child { border-bottom: none !important; }
    .footer-base {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    .post-nav { flex-direction: column; gap: 24px; }
    .page-header { padding: 130px 24px 56px; }
}
