/* =============================================
   VOLEJBAL HUB · TJ Ostrava — BASE CSS
   Sdílený základ pro všechny veřejné stránky.
   Obsahuje: proměnné, reset, navbar, footer,
   sekce, hero, skeleton, modal, transitions.
   ============================================= */

:root {
    --red: #C41E3A;
    --red-dark: #9E1830;
    --red-glow: rgba(196, 30, 58, 0.25);
    --navy: #1B3A5C;
    --navy-deep: #0F1923;
    --navy-dark: #0A1118;
    --white: #FFFFFF;
    --gray-50: #FAFAF9;
    --gray-100: #F1F1EF;
    --gray-200: #E2E2DE;
    --gray-400: #9C9C98;
    --gray-600: #6B6B67;
    --gray-800: #2D2D2B;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font); color: var(--gray-800); background: var(--white);
    line-height: 1.6; overflow-x: hidden;
    display: flex; flex-direction: column; min-height: 100vh;
    min-height: 100dvh;
}
body > * { flex-shrink: 0; width: 100%; }
.site-footer { margin-top: auto; }
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }


/* ═══════════════════════════════════════════════
   NAVBAR (shared across all public pages)
   ═══════════════════════════════════════════════ */

.site-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 14px 32px;
    padding: max(14px, env(safe-area-inset-top)) 32px;
    display: flex; align-items: center; justify-content: space-between;
    transition: background var(--transition), padding var(--transition), box-shadow var(--transition);
}
.site-nav.scrolled {
    background: rgba(15, 25, 35, 0.95);
    backdrop-filter: blur(12px);
    padding: max(10px, env(safe-area-inset-top, 0px)) 32px 10px;
    box-shadow: 0 2px 24px rgba(0,0,0,0.3);
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand img { width: 38px; height: 38px; border-radius: 50%; }
.nav-brand span { font-size: 16px; font-weight: 700; color: var(--white); letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links a {
    color: rgba(255,255,255,0.7); font-size: 13px; font-weight: 500;
    padding: 7px 14px; border-radius: 99px;
    transition: color var(--transition), background var(--transition);
}
.nav-links a.nav-active { color: var(--white); background: rgba(255,255,255,0.12); }
.nav-cta { color: var(--white) !important; background: var(--red) !important; font-weight: 600 !important; }
#navToggle { display: none; background: none; border: none; color: var(--white); font-size: 24px; cursor: pointer; }



/* ═══════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════ */

.section { padding: 72px 40px; max-width: 1200px; margin: 0 auto; }
.section-dark { background: var(--navy-dark); max-width: 100%; }
.section-dark .section-inner { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.section-light { background: var(--gray-50); max-width: 100%; }
.section-light .section-inner { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.section-gray { background: var(--gray-100); max-width: 100%; }
.section-gray .section-inner { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.section-red { background: rgba(196, 30, 58, 0.03); max-width: 100%; border-top: 1px solid rgba(196,30,58,0.06); border-bottom: 1px solid rgba(196,30,58,0.06); }
.section-red .section-inner { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.section-header { margin-bottom: 36px; }
.section-header h2 { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.section-dark .section-header h2 { color: var(--white); }
.section-header p { font-size: 15px; color: var(--gray-600); margin-top: 6px; }
.section-dark .section-header p { color: rgba(255,255,255,0.4); }
.section-header .accent-line { width: 40px; height: 3px; background: var(--red); border-radius: 2px; margin-bottom: 12px; }



.no-data { text-align: center; padding: 40px 20px; font-size: 14px; color: var(--gray-400); }

/* ═══════════════════════════════════════════════
   FOOTER (shared)
   ═══════════════════════════════════════════════ */

.site-footer { background: var(--navy-dark); color: rgba(255,255,255,0.6); padding: 56px 40px 28px; padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand img { width: 48px; height: 48px; border-radius: 50%; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; line-height: 1.6; }
.site-footer h4 { font-size: 12px; font-weight: 600; color: var(--white); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.site-footer a { color: rgba(255,255,255,0.45); font-size: 13px; transition: color var(--transition); }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
#socialLinks { display: flex; gap: 10px; }
#socialLinks a { font-size: 20px; color: rgba(255,255,255,0.35); }
.footer-bottom { max-width: 1200px; margin: 0 auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.06); display: flex; justify-content: space-between; align-items: center; font-size: 12px; }



/* ═══════════════════════════════════════════════
   PUBLIC MODAL (match detail etc.)
   ═══════════════════════════════════════════════ */

.pub-modal {
    display: none;
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    align-items: center; justify-content: center;
    padding: 24px;
    animation: modalFadeIn 0.2s ease;
    overscroll-behavior: contain;
}
.pub-modal.open { display: flex; }
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.pub-modal__card {
    background: var(--white);
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 28px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.25s ease;
}
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.pub-modal__close {
    position: absolute;
    top: 12px; right: 12px;
    width: 36px; height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition);
    z-index: 2;
}
@media (max-width: 768px) {
    .pub-modal__close { width: 44px; height: 44px; font-size: 20px; }
}

/* Article modal — wider for news */
.pub-modal__card--article { max-width: 680px; padding: 0; overflow: hidden; }

/* Match detail modal — slightly wider for map */
.pub-modal__card--match { max-width: 560px; }
.pub-modal__card--article .pub-modal__close {
    top: 12px; right: 12px; z-index: 2;
    background: rgba(255,255,255,0.9); backdrop-filter: blur(4px);
}
.news-article__hero { width: 100%; max-height: 320px; overflow: hidden; }
.news-article__hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-article__content { padding: 28px 32px 32px; }
.news-article__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.news-article__title { font-size: 24px; font-weight: 800; line-height: 1.25; margin: 0 0 8px; color: var(--gray-800); }
.news-article__date { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-400); margin-bottom: 20px; }
.news-article__body { font-size: 15px; line-height: 1.7; color: var(--gray-700); }
.news-article__body p { margin: 0 0 14px; }
.news-article__body img { max-width: 100%; border-radius: var(--radius); margin: 12px 0; }
.news-article__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--gray-100); }
.news-card__tag { font-size: 11px; padding: 3px 10px; background: var(--gray-100); color: var(--gray-600); border-radius: 12px; }

/* Standings team links */
.standings-team-link {
    color: inherit; text-decoration: none; font-weight: inherit;
    display: inline-flex; align-items: center; gap: 8px;
    transition: color var(--transition);
}



/* ═══════════════════════════════════════════════
   SHARED COMPONENTS
   ═══════════════════════════════════════════════ */

.hero-eyebrow {
    font-size: 12px; font-weight: 600; color: var(--red);
    text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 12px;
}

.btn-shop {
    display: inline-flex; align-items: center; gap: 8px; padding: 11px 24px;
    font-size: 14px; font-weight: 600; border-radius: 99px; border: none;
    cursor: pointer; transition: all var(--transition); text-decoration: none;
}
.btn-shop--primary { background: var(--red); color: var(--white); box-shadow: 0 2px 12px var(--red-glow); }
.btn-shop--secondary { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.8); border: 1px solid rgba(255,255,255,0.15); }

@keyframes glowPulse {
    from { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
    to   { opacity: 0.6; transform: translate(-50%, -50%) scale(1.15); }
}

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; display: inline-block; }

/* Back to top button */
.back-to-top {
    position: fixed; bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px)); right: 24px; z-index: 90;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--red); color: var(--white);
    border: none; border-radius: 50%;
    font-size: 20px; cursor: pointer;
    box-shadow: 0 4px 16px rgba(196,30,58,0.3);
    opacity: 0; transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
.back-to-top.visible {
    opacity: 1; transform: translateY(0);
    pointer-events: auto;
}


/* ═══════════════════════════════════════════════
   PAGE HERO (subpages — akce, tým, etc.)
   ═══════════════════════════════════════════════ */

.page-hero {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    padding: 100px 40px 48px;
    background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy-deep) 60%, #0D0D12 100%);
    overflow: hidden;
    text-align: center;
    min-height: 260px;
}
.page-hero .hero-glow {
    position: absolute;
    width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle, var(--red-glow) 0%, transparent 70%);
    left: 50%; top: 50%; transform: translate(-50%, -50%);
    filter: blur(60px); opacity: 0.4;
    animation: glowPulse 4s ease-in-out infinite alternate;
}
.page-hero__content { position: relative; z-index: 2; max-width: 600px; }
.page-hero__logo {
    width: 56px; height: 56px; border-radius: 50%;
    margin: 0 auto 14px; display: block;
    box-shadow: 0 0 30px var(--red-glow);
}
.page-hero__content .hero-eyebrow { margin-bottom: 4px; }
.page-hero__brand {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 900; color: var(--white);
    letter-spacing: -0.03em; margin-bottom: 12px;
}
.page-hero__brand em { font-style: normal; color: var(--red); }
.page-hero__title {
    font-size: clamp(16px, 2.5vw, 20px);
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: inline-block;
}

/* Legacy h1 fallback (if any page still uses old pattern) */
.page-hero__content h1:not(.page-hero__title) {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 900;
    color: var(--white);
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}
.page-hero__content p {
    font-size: 16px;
    color: rgba(255,255,255,0.45);
}

/* Team hero variant */
.page-hero--team {
    min-height: 300px;
}

/* Hero with background photo — taller to show more of the image */
.page-hero--with-bg {
    min-height: 640px;
    padding: 140px 40px 72px;
}
/* Dark top strip so the fixed navbar stays readable over hero photos */
.page-hero--with-bg::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(10,17,24,0.7), transparent);
    z-index: 1;
    pointer-events: none;
}



/* ═══════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════ */

.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.no-data { text-align: center; color: var(--gray-400); padding: 32px; font-size: 14px; }



/* ═══════════════════════════════════════════════
   AUTH-AWARE HEADER
   ═══════════════════════════════════════════════ */

.nav-cta--admin {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%) !important;
    box-shadow: 0 2px 12px var(--red-glow);
    transition: box-shadow var(--transition) !important;
}
.nav-logout {
    color: rgba(255,255,255,0.4) !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    min-height: 44px;
    display: flex !important;
    align-items: center;
    gap: 8px;
}
.nav-logout::after {
    content: 'Odhlásit';
    font-size: 13px;
}
@media (min-width: 769px) {
    .nav-logout::after { display: none; }
    .nav-logout { padding: 7px 10px !important; font-size: 16px !important; }
}



/* ═══════════════════════════════════════════════
   SKELETON LOADING
   ═══════════════════════════════════════════════ */

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton-row { display: flex; gap: 10px; }
.skeleton-pill {
    width: 200px; height: 110px; flex-shrink: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    position: relative; overflow: hidden;
}
.skeleton-pill::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);
    background-size: 200px 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.skeleton-card {
    height: 260px;
    background: var(--gray-100); border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    position: relative; overflow: hidden;
}
.skeleton-card::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.03) 50%, transparent 100%);
    background-size: 200px 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.fade-in { animation: contentFadeIn 0.3s ease forwards; }
@keyframes contentFadeIn { from { opacity: 0; } to { opacity: 1; } }


/* ═══════════════════════════════════════════════
   RESPONSIVE (shared)
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
    .section { padding: 56px 24px; }
    .section-dark .section-inner, .section-light .section-inner, .section-gray .section-inner, .section-red .section-inner { padding: 0 24px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .site-nav { padding: 10px 16px; }
    #navToggle { display: block; }
    .nav-links {
        display: flex; position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; background: rgba(15,25,35,0.98);
        backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
        padding: 0 16px; gap: 1px;
        max-height: 0; overflow: hidden; opacity: 0;
        transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease;
    }
    .nav-links.open {
        max-height: 80dvh; opacity: 1;
        padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* Divider before special items */
    .nav-links li:has(.nav-tickets),
    .nav-links li:has(.nav-cta--admin) {
        margin-top: 6px;
        padding-top: 6px;
        border-top: 1px solid rgba(255,255,255,0.08);
    }
    /* Logout inline next to admin button */
    .nav-links li:has(.nav-logout) {
        margin-top: -1px;
    }
    .pub-modal { padding: 16px; }
    .pub-modal__card { padding: 20px; border-radius: 12px; max-height: 90vh; }
    .pub-modal__card--article { padding: 0; }
    .page-hero { padding: 80px 24px 32px; min-height: 220px; }
    .page-hero--with-bg { min-height: 400px; padding: 90px 24px 48px; }
    .page-hero__logo { width: 44px; height: 44px; margin-bottom: 10px; }
    .nav-links a { padding: 12px 14px; font-size: 14px; min-height: 44px; }
}

@media (max-width: 480px) {
    .section { padding: 40px 16px; }
    .section-dark .section-inner, .section-light .section-inner, .section-gray .section-inner, .section-red .section-inner { padding: 0 16px; }
    .section-header h2 { font-size: 26px; }
    .section-header p { font-size: 14px; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
    .site-footer { padding: 40px 20px 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
    .pub-modal { padding: 10px; }
    .pub-modal__card { padding: 16px; max-height: 92vh; }
    .page-hero { padding: 72px 16px 28px; min-height: 200px; }
    .page-hero__brand { margin-bottom: 8px; }
    .nav-links a { padding: 10px 14px; font-size: 14px; }
    .back-to-top { bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 8px)); right: 16px; width: 40px; height: 40px; font-size: 18px; }
    .pub-modal { padding: 0; }
    .pub-modal__card {
        max-width: 100%; max-height: 100dvh; height: 100%;
        border-radius: 0; margin: 0;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }
    .pub-modal__close {
        top: max(12px, env(safe-area-inset-top, 0px));
        right: max(12px, env(safe-area-inset-right, 0px));
    }
}

/* ── Hover-only visual effects ── */
@media (hover: hover) {
    .nav-links a:hover { color: var(--white); background: rgba(255,255,255,0.1); }
    .nav-cta:hover { background: var(--red-dark) !important; }
    .site-footer a:hover { color: var(--white); }
    #socialLinks a:hover { color: var(--red); }
    .back-to-top:hover {
        background: var(--red-dark);
        transform: translateY(-2px);
        box-shadow: 0 6px 24px rgba(196,30,58,0.4);
    }
    .pub-modal__close:hover { background: var(--gray-200); color: var(--gray-800); }
    .btn-shop--primary:hover { background: var(--red-dark); transform: translateY(-2px); box-shadow: 0 6px 20px var(--red-glow); }
    .btn-shop--secondary:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.12); color: #fff; }
    .standings-team-link:hover { color: var(--red); }
    .nav-cta--admin:hover {
        background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%) !important;
        box-shadow: 0 4px 24px var(--red-glow), 0 0 40px var(--red-glow) !important;
    }
    .nav-logout:hover { color: rgba(255,255,255,0.7) !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}