/* ============================================================
   Vlastní fonty (self-hosted, viz FONTY/ ve zdrojové složce)
   Geist        → --font-body   (variabilní řez, 100–900)
   The Seasons  → --font-display (Regular / Light / Bold + kurzívy)
   ============================================================ */
@font-face {
    font-family: 'Geist';
    src: url('../fonts/geist-variable.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: 'The Seasons';
    src: url('../fonts/the-seasons-light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'The Seasons';
    src: url('../fonts/the-seasons-regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: 'The Seasons';
    src: url('../fonts/the-seasons-bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'The Seasons';
    src: url('../fonts/the-seasons-light-italic.ttf') format('truetype');
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'The Seasons';
    src: url('../fonts/the-seasons-italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'The Seasons';
    src: url('../fonts/the-seasons-bold-italic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

/* Reset & proměnné */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-color: #F7F5F2;
    --card-bg: #373967;
    --card-hover-bg: #2E2F4F;
    --navy-primary: #2F2F50;
    --gold-accent: #B89867;
    --gold-light: #C6AD85;
    --gold-soft: #D9C9A8;
    --gold-subtle: #E5D9BD;
    --grayscale-white: #FFFFFF;
    --grayscale-300: #CCCCCC;
    --footer-text: #5A5B70;
    --font-display: 'The Seasons', Georgia, 'Times New Roman', serif;
    --font-body: 'Geist', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition-smooth: all 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
    min-height: 100dvh;
    background-color: var(--bg-color);
    color: var(--navy-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    position: relative;
}

/* Vizuálně skrytý text pro čtečky obrazovky (h1 stránky) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hlavní kontejner - centrovaný, max-width 1440px */
.portal-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px 40px;
    display: flex;
    flex-direction: column;
}

/* Hero / hlavička (desktop) — podle v2.svg.
   Zlaté křivky jsou vykresleny v rozsahu viewBox="0 0 1440 650" s overflow: visible,
   aby přirozeně procházely i mezerami pod hlavičkou za kartami (karty mají z-index: 2). */
.hero-section {
    width: 100%;
    padding: 0;
    margin: 0 auto;
}

.hero-decor-wrap {
    position: relative;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    aspect-ratio: 1440 / 324;
    max-height: 324px;
    overflow: visible;
}

.hero-decor {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    aspect-ratio: 1440 / 650;
    pointer-events: none;
}

.brand-logo-link {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: inline-block;
    text-decoration: none;
    width: 24.4%; /* 351.36px / 1440px = 24.4% */
    max-width: 351.36px;
    transition: transform 0.35s ease;
    z-index: 2;
}

.brand-logo-link:hover {
    transform: translate(-50%, -50%) scale(1.025);
}

.hero-logo-svg {
    display: block;
    width: 100%;
    height: auto;
    color: var(--navy-primary);
}

/* ============================================================
   Mobilní hero — přesně podle Mobile_scroll down.svg (390 × 200px),
   plnobarevný navy blok (#373967) s vektorovými zlatými křivkami a bílým logem
   ============================================================ */
.mobile-hero {
    display: none;
    width: 100%;
    background-color: var(--card-bg);
    position: relative;
    overflow: hidden;
}

.mobile-hero-logo-link {
    display: block;
    text-decoration: none;
    width: 100%;
}

.mobile-hero-svg {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 220px;
    height: auto;
    margin: 0 auto;
    aspect-ratio: 390 / 200;
}

/* Kontejner karet — jednotný grid pro všech 6 karet */
.cards-container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, 416px);
    justify-content: center;
    gap: 24px;
    margin: 0 auto 50px;
    width: 100%;
    max-width: 1296px; /* 3 x 416px + 2 x 24px gap = 1296px */
}

/* ============================================================
   Karta portálu — fotka nahoře + navy panel dole
   ============================================================ */
.portal-card {
    width: 100%;
    background-color: var(--card-bg);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.portal-card:hover,
.portal-card:active {
    background-color: var(--card-hover-bg);
}

/* Fotka */
.card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 833 / 442;
    overflow: hidden;
    background-color: var(--card-bg);
}

.card-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Tmavý přesvit přes fotku (shodné s v2.svg – černá, 20% krytí) */
.card-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #000000;
    opacity: 0.2;
    pointer-events: none;
}

.portal-card:hover .card-photo,
.portal-card:focus-visible .card-photo,
.portal-card:active .card-photo {
    transform: scale(1.045);
}

/* Navy obsahový panel pod fotkou */
.card-body {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 24px 28px 24px;
    overflow: hidden;
}

/* Hlavička karty se značkovým lockupem */
.card-header {
    margin-bottom: 24px;
    height: 60px;
    min-height: 60px;
    display: flex;
    align-items: center;
    position: relative;
}

.card-brand-svg {
    height: 60px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    display: block;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 400;
    color: var(--grayscale-white);
    line-height: 1.15;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
    position: relative;
    min-height: 2.3em; /* Rezervuje stabilní prostor pro nadpis i před dorenderováním fontu */
}

/* Spodní řádek: popis karty vlevo a šipka vpravo v jedné linii */
.card-bottom-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
}

.card-mobile-title {
    display: none;
}

.card-desc {
    position: relative;
    font-family: var(--font-body);
    font-size: 0.88rem;
    line-height: 1.45;
    letter-spacing: 0.015em;
    color: var(--grayscale-300);
    font-weight: 400;
    margin: 0;
    flex: 1 1 auto;
}

.card-action-bar {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Kruhové tlačítko se šipkou */
.action-circle-btn {
    width: 31px;
    height: 31px;
    border-radius: 50%;
    border: 1px solid #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.action-circle-btn svg {
    width: 8px;
    height: 12px;
    fill: #FFFFFF;
    transition: fill 0.3s ease;
    display: block;
}

.portal-card:hover .action-circle-btn,
.portal-card:focus-visible .action-circle-btn,
.portal-card:active .action-circle-btn {
    border-color: #FFFFFF;
    background-color: #FFFFFF;
    transform: scale(1.05);
}

.portal-card:hover .action-circle-btn svg,
.portal-card:focus-visible .action-circle-btn svg,
.portal-card:active .action-circle-btn svg {
    fill: var(--card-hover-bg);
}

/* Patička */
.portal-footer {
    text-align: center;
    padding: 25px 0 15px;
    font-size: 0.84rem;
    color: var(--footer-text);
    letter-spacing: 0.03em;
    font-weight: 400;
}

/* ============================================================
   Responzivita
   ============================================================ */
@media (max-width: 1376px) {
    .cards-container {
        grid-template-columns: repeat(3, 1fr);
        max-width: 100%;
    }

    .card-body {
        padding: 20px 20px 20px;
    }

    .card-desc {
        font-size: 0.82rem;
        line-height: 1.4;
    }
}

@media (max-width: 1200px) {
    .card-desc br {
        display: none;
    }
}

@media (max-width: 1024px) {
    .portal-wrapper {
        padding: 0 24px 30px;
    }

    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        max-width: none;
        gap: 24px;
    }

    .card-desc {
        font-size: 0.88rem;
        line-height: 1.45;
    }
}

/* --- Mobil: rozvržení podle Mobile_scroll down.svg (plátno 390px, karty 350px) --- */
@media (max-width: 768px) {
    body {
        background-color: #F2EEEB;
    }

    .hero-section {
        display: none;
    }

    .mobile-hero {
        display: block;
    }

    .portal-wrapper {
        padding: 0 20px 24px;
        max-width: 480px;
    }

    .cards-container {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 24px auto 30px;
        width: 100%;
        max-width: 100%;
    }

    .card-media {
        aspect-ratio: 350 / 180;
        height: auto;
    }

    .card-body {
        padding: 24px 24px 24px;
        min-height: 170px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .card-header {
        height: 50px;
        margin-bottom: 0;
    }

    .card-brand-svg {
        height: 50px;
        width: auto;
        max-width: 170px;
    }

    .card-title {
        display: none;
    }

    .card-bottom-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin-top: auto;
    }

    .card-mobile-title {
        display: block;
        font-family: var(--font-display);
        font-size: 1.7rem;
        font-weight: 400;
        color: var(--grayscale-white);
        line-height: 1.18;
        margin: 0;
        flex: 1 1 auto;
    }

    /* Na mobilu skryjeme dlouhý text */
    .card-desc {
        display: none;
    }

    .card-action-bar {
        margin: 0;
        flex-shrink: 0;
    }

    .action-circle-btn {
        width: 31px;
        height: 31px;
    }
}

/* Redukovaný pohyb */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
    .portal-card:hover,
    .portal-card:focus-visible,
    .portal-card:active {
        transform: none;
    }
    .portal-card:hover .card-photo,
    .portal-card:focus-visible .card-photo,
    .portal-card:active .card-photo {
        transform: none;
    }
}

/* Fokus (kontrast ≥ 3:1 na krémovém i navy pozadí) */
.portal-card:focus-visible,
.brand-logo-link:focus-visible {
    outline: 2px solid var(--navy-primary);
    outline-offset: 4px;
}

.mobile-hero-logo-link:focus-visible {
    outline: 2px solid #FFFFFF;
    outline-offset: -4px; /* Záporný offset, aby byl rámeček vidět uvnitř navy bloku i při overflow: hidden */
}