/* ============================================================
   style.css — Hlavní styly
   Dětřichovský memoriál
   TODO: WordPress — přesunout do theme/style.css
   ============================================================ */

/* --- Proměnné --- */
:root {
    --color-primary:    #0d1b2a;
    --color-secondary:  #8b1a1a;
    --color-accent:     #c9a84c;
    --color-bg:         #f5f0e8;
    --color-surface:    #ffffff;
    --color-text:       #1c1c1c;
    --color-text-muted: #6b6b6b;
    --color-border:     #ddd6c8;
    --color-white:      #ffffff;

    --nav-height: 68px;
    --section-pad: clamp(3rem, 6vw, 6rem);

    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans:  'Inter', system-ui, sans-serif;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
    --shadow-md:  0 4px 16px rgba(0,0,0,.12);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.18);

    --radius-sm:  4px;
    --radius-md:  8px;
    --radius-lg:  16px;

    --transition: 200ms ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul[role="list"] { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* --- Typografie --- */
h1, h2, h3, h4, h5 {
    font-family: var(--font-serif);
    line-height: 1.25;
    color: var(--color-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.1rem; font-family: var(--font-sans); font-weight: 600; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* --- Layout --- */
.container {
    width: min(100%, 1200px);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
}

.site-main { flex: 1; }

.section {
    padding-block: var(--section-pad);
}

.section-alt {
    background: var(--color-surface);
}

.section-dark {
    background: var(--color-primary);
    color: var(--color-white);
}

.section-dark h2,
.section-dark h3,
.section-dark h4 {
    color: var(--color-accent);
}

.section-header {
    text-align: center;
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.section-header h2 { margin-bottom: .5rem; }

.section-header .subtitle {
    color: var(--color-text-muted);
    font-size: 1.05rem;
}

.section-dark .section-header .subtitle {
    color: rgba(255,255,255,.6);
}

/* --- Navigace --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 400ms ease, box-shadow 400ms ease, border-color 400ms ease;
}

.site-header.scrolled {
    background: rgba(13, 27, 42, .96);
    border-bottom-color: rgba(201, 168, 76, .15);
    box-shadow: 0 2px 20px rgba(0,0,0,.4);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 100%;
    width: min(100%, 1400px);
    margin-inline: auto;
    padding-inline: clamp(1rem, 3vw, 2rem);
}

.nav-logo {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    flex-shrink: 0;
}

.logo-title {
    font-family: var(--font-serif);
    font-size: clamp(.9rem, 2vw, 1.15rem);
    font-weight: 700;
    color: var(--color-white);
    line-height: 1.1;
    letter-spacing: .01em;
}

.logo-sub {
    font-size: .65rem;
    color: var(--color-accent);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: clamp(.25rem, 1.5vw, 1.25rem);
    list-style: none;
}

.nav-menu a {
    color: rgba(255,255,255,.8);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .03em;
    padding: .3rem .1rem;
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* Hamburger */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: .5rem;
    z-index: 1010;
}

.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-white);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

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

/* --- Mega Menu plugin override --- */
/* Plugin's own toggle is hidden — theme hamburger handles mobile */
.mega-menu-wrap .mega-menu-toggle { display: none !important; }

/* Reset any background on the plugin wrapper */
#mega-menu-wrap-hlavni-menu,
#mega-menu-wrap-hlavni-menu * {
    box-sizing: border-box;
}
#mega-menu-wrap-hlavni-menu {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Force display:flex so plugin JS can't hide the list on mobile */
ul#mega-menu-hlavni-menu {
    display: flex !important;
    align-items: center;
    gap: clamp(.25rem, 1.5vw, 1.25rem);
    list-style: none;
    margin: 0;
    padding: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

ul#mega-menu-hlavni-menu > li.mega-menu-item {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

ul#mega-menu-hlavni-menu > li.mega-menu-item > a.mega-menu-link {
    color: rgba(255,255,255,.8) !important;
    font-size: .82rem !important;
    font-weight: 700 !important;
    letter-spacing: .03em !important;
    padding: .3rem .1rem !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    background: transparent !important;
    transition: color var(--transition), border-color var(--transition) !important;
    white-space: nowrap;
}

ul#mega-menu-hlavni-menu > li.mega-menu-item > a.mega-menu-link:hover,
ul#mega-menu-hlavni-menu > li.mega-current-menu-item > a.mega-menu-link,
ul#mega-menu-hlavni-menu > li.mega-current_page_item > a.mega-menu-link,
ul#mega-menu-hlavni-menu > li.mega-current-menu-ancestor > a.mega-menu-link {
    color: var(--color-accent) !important;
    border-bottom-color: var(--color-accent) !important;
    background: transparent !important;
}

ul#mega-menu-hlavni-menu > li.mega-menu-item > a.mega-menu-link::before,
ul#mega-menu-hlavni-menu > li.mega-menu-item > a.mega-menu-link::after {
    display: none !important;
}

ul#mega-menu-hlavni-menu > li.mega-menu-flyout,
ul#mega-menu-hlavni-menu > li.mega-menu-flyout > a.mega-menu-link {
    background: transparent !important;
    box-shadow: none !important;
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: var(--color-primary);
}

.hero-bg {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0; /* fallback pro inset */
    inset: 0;
    background-image:
        -webkit-linear-gradient(bottom,
            rgba(13,27,42,.90) 0%,
            rgba(13,27,42,.60) 50%,
            rgba(13,27,42,.75) 100%),
        url('../img/frontpage.webp');
    background-image:
        linear-gradient(to bottom,
            rgba(13,27,42,.75) 0%,
            rgba(13,27,42,.60) 50%,
            rgba(13,27,42,.90) 100%),
        url('../img/frontpage.webp');
    background-position: center center;
    background-repeat: no-repeat;
    -webkit-background-size: cover;
    background-size: cover;
    -webkit-background-attachment: fixed;
    background-attachment: fixed;
}

/* iOS Safari nepodporuje background-attachment: fixed na elementech */
@supports (-webkit-touch-callout: none) {
    .hero-bg {
        -webkit-background-attachment: scroll;
        background-attachment: scroll;
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: calc(var(--nav-height) + 2rem) 1.5rem 4rem;
    max-width: 860px;
    width: 100%;
}

@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-kicker,
.hero h1,
.hero-motto,
.hero-meta,
.countdown,
.hero-actions {
    animation: heroFadeUp .7s ease both;
}

.hero-kicker  { animation-delay: .1s; }
.hero h1      { animation-delay: .3s; }
.hero-motto   { animation-delay: .5s; }
.hero-meta    { animation-delay: .65s; }
.countdown    { animation-delay: .8s; }
.hero-actions { animation-delay: 1s; }

.hero-kicker {
    display: inline-block;
    font-size: 1rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 1.25rem;
    font-weight: 500;
}

.hero h1 {
    color: var(--color-white);
    margin-bottom: .5rem;
    text-shadow: 0 2px 12px rgba(0,0,0,.5);
}

.hero-motto {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: rgba(255,255,255,.75);
    margin-bottom: 1rem;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem 1.5rem;
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
    color: rgba(255,255,255,.7);
}

.hero-meta strong { color: var(--color-accent); font-weight: 600; }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.hero-actions .btn {
    min-width: 220px;
    justify-content: center;
}

/* Countdown */
.countdown-title {
    font-size: clamp(.75rem, 1.5vw, .9rem);
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 1rem;
    font-weight: 500;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: clamp(1rem, 4vw, 3rem);
    margin-top: .5rem;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.countdown-num {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    color: var(--color-white);
    line-height: 1;
    text-shadow: 0 2px 16px rgba(0,0,0,.5);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    width: 2.2ch;
    text-align: center;
}

.countdown-label {
    font-size: .9rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-top: .4rem;
}

/* Scroll arrow */
.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    animation: bounce 2s infinite;
}

.hero-scroll-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.hero-scroll svg { fill: none; stroke: var(--color-accent); stroke-width: 2; }

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(8px); }
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1.75rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .04em;
    transition: background var(--transition), color var(--transition),
                transform var(--transition), box-shadow var(--transition);
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--color-secondary);
    color: var(--color-white);
    border: 2px solid var(--color-secondary);
}

.btn-primary:hover {
    background: #a52020;
    border-color: #a52020;
    box-shadow: 0 4px 16px rgba(139,26,26,.4);
}

.btn-outline {
    background: transparent;
    color: var(--color-white);
    border: 2px solid rgba(255,255,255,.6);
}

.btn-outline:hover {
    background: rgba(255,255,255,.1);
    border-color: var(--color-white);
}

.btn-accent {
    background: var(--color-accent);
    color: var(--color-primary);
    border: 2px solid var(--color-accent);
}

.btn-accent:hover {
    background: #b8933e;
    border-color: #b8933e;
    box-shadow: 0 4px 16px rgba(201,168,76,.4);
}

.btn-sm { padding: .5rem 1.25rem; font-size: .82rem; }

/* --- Divider --- */
.divider {
    width: 60px;
    height: 3px;
    background: var(--color-accent);
    margin: .75rem auto 0;
    border-radius: 2px;
}

/* --- Page header (vnořené stránky) --- */
.page-hero {
    padding: calc(var(--nav-height) + 2.5rem) 0 3rem;
    text-align: center;
    position: relative;
    background:
        linear-gradient(to bottom, rgba(13,27,42,.78) 0%, rgba(13,27,42,.72) 100%),
        url('../img/frontpage.webp') center/cover no-repeat;
}

.page-hero h1 { color: var(--color-white); }
.page-hero .subtitle { color: rgba(255,255,255,.6); margin-top: .5rem; font-size: 1rem; }

/* --- Patička --- */
.site-footer {
    background: #060e17;
    color: rgba(255,255,255,.65);
    font-size: .88rem;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2.5rem;
    padding: 3.5rem clamp(1rem, 4vw, 2rem) 2.5rem;
    width: min(100%, 1200px);
    margin-inline: auto;
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--color-white);
    font-weight: 600;
    margin-bottom: .4rem;
}

.footer-motto {
    color: var(--color-accent);
    font-style: italic;
    margin-bottom: .5rem;
}

.footer-nav h4,
.footer-info h4 {
    color: var(--color-accent);
    font-size: .75rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.footer-nav ul { list-style: none; }
.footer-nav li + li { margin-top: .4rem; }
.footer-nav a { color: rgba(255,255,255,.6); transition: color var(--transition); }
.footer-nav a:hover { color: var(--color-accent); }

.footer-info p { color: rgba(255,255,255,.6); font-size: .88rem; margin-bottom: .35rem; }
.footer-info a { color: rgba(255,255,255,.6); transition: color var(--transition); }
.footer-info a:hover { color: var(--color-accent); }

.footer-cta {
    display: inline-block;
    margin-top: .5rem;
    padding: .4rem .9rem;
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-sm);
    color: var(--color-accent);
    font-size: .8rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    transition: background var(--transition), color var(--transition);
}
.footer-cta:hover { background: var(--color-accent); color: var(--color-bg); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    text-align: center;
    padding: 1.25rem clamp(1rem, 4vw, 2rem);
    font-size: .78rem;
}

.footer-bottom a { color: var(--color-accent); }
.footer-bottom a:hover { text-decoration: underline; }

/* --- Perex pod hero --- */
.intro-section {
    background: var(--color-primary);
    padding: 3rem 0 4rem;
    border-top: 1px solid rgba(201,168,76,.15);
}

.intro-section p {
    color: rgba(255,255,255,.75);
    font-size: 1.05rem;
    max-width: 720px;
    margin-inline: auto;
    text-align: center;
}

/* --- Responzivita --- */
@media (max-width: 900px) {
    .nav-hamburger { display: flex; }

    .site-header nav {
        position: fixed;
        inset: 0;
        background: rgba(13,27,42,.97);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition);
    }

    .site-header nav.open {
        opacity: 1;
        pointer-events: all;
    }

    .nav-menu,
    ul#mega-menu-hlavni-menu {
        flex-direction: column !important;
        gap: 1.75rem;
        text-align: center;
    }

    .nav-menu a,
    ul#mega-menu-hlavni-menu > li.mega-menu-item > a.mega-menu-link {
        font-size: 1.25rem !important;
    }
}

@media (max-width: 480px) {
    .hero-actions { flex-direction: column; align-items: center; }
    .btn { width: 100%; justify-content: center; max-width: 280px; }
}
