/* ============================================================
   ARCO feed – Sdílený stylesheet
   Verze: 1.0 | Platí pro všechny stránky webu
   ============================================================ */

/* --- Proměnné a globální nastavení --- */
:root {
    --primary-color:   #005a31;
    --secondary-color: #f4f4f4;
    --text-color:      #333;
    --accent-color:    #e67e22;
    --header-height:   72px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

/* --- Header a navigace --- */
header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    box-sizing: border-box;
}

.logo {
    font-size: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    font-family: 'Segoe UI', sans-serif;
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s;
    font-weight: 500;
    padding-bottom: 3px;
}

nav ul li a:hover {
    color: var(--primary-color);
}

/* Aktivní položka navigace – nastavuje se přes JS */
nav ul li a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/* --- Hamburger menu (mobil) --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s;
}

/* --- Sub-hero (nadpis podstránek) --- */
.sub-hero {
    color: #fff;
    padding: 80px 5%;
    text-align: center;
}

.sub-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.sub-hero p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
}

/* --- Tlačítka --- */
.btn {
    padding: 15px 35px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: transform 0.2s, opacity 0.3s;
    font-size: 1.05rem;
    display: inline-block;
}

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

.btn-accent {
    background-color: var(--accent-color);
    color: white;
}

.btn-outline {
    border: 2px solid white;
    color: white;
}

.btn:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

/* --- Back to top tlačítko --- */
#backToTop {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
    background-color: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s, background-color 0.3s;
    justify-content: center;
    align-items: center;
}

#backToTop:hover {
    transform: scale(1.1);
    background-color: var(--accent-color);
}

/* --- Footer --- */
footer {
    background: #222;
    color: #fff;
    padding: 50px 5%;
    text-align: center;
    margin-top: 80px;
}

footer p {
    margin: 0;
    opacity: 0.8;
}

/* --- Sdílené JS funkce (backToTop a active nav) jsou v shared.js --- */

/* ============================================================
   RESPONZIVITA
   ============================================================ */

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    nav {
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        display: none;
        padding: 10px 5% 20px;
    }

    nav.open {
        display: block;
    }

    nav ul {
        flex-direction: column;
    }

    nav ul li {
        margin: 0;
        border-bottom: 1px solid #eee;
    }

    nav ul li a {
        display: block;
        padding: 12px 0;
    }

    .sub-hero h1 {
        font-size: 1.8rem;
    }

    .sub-hero {
        padding: 50px 5%;
    }
}

/* ============================================================
   HERO OBRÁZKY – background-image per stránka
   Lokální soubory mají přednost; Unsplash jako fallback
   dokud nebudou dodány vlastní fotografie.
   ============================================================ */

/* index.html */
.hero {
    background-image:
        linear-gradient(rgba(0,0,0,0.50), rgba(0,0,0,0.15)),
        image-set(
            url('img/hero-uvod.webp') type('image/webp'),
            url('img/hero-uvod.jpg')  type('image/jpeg')
        ),
        url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&q=80&w=1920');
    background-position: center;
    background-size: cover;
}

/* produkty-sluzby.html */
.sub-hero.hero-produkty {
    background-image:
        linear-gradient(rgba(0,0,0,0.50), rgba(0,0,0,0.15)),
        image-set(
            url('img/hero-produkty.webp') type('image/webp'),
            url('img/hero-produkty.jpg')  type('image/jpeg')
        ),
        url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&q=80&w=1920');
    background-position: center;
    background-size: cover;
}

/* software.html */
.sub-hero.hero-software {
    background-image:
        linear-gradient(rgba(0,0,0,0.50), rgba(0,0,0,0.15)),
        image-set(
            url('img/hero-software.webp') type('image/webp'),
            url('img/hero-software.jpg')  type('image/jpeg')
        ),
        url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&q=80&w=1920');
    background-position: center;
    background-size: cover;
}

/* eshop.html */
.sub-hero.hero-eshop {
    background-image:
        linear-gradient(rgba(0,0,0,0.50), rgba(0,0,0,0.15)),
        image-set(
            url('img/hero-eshop.webp') type('image/webp'),
            url('img/hero-eshop.jpg')  type('image/jpeg')
        ),
        url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&q=80&w=1920');
    background-position: center;
    background-size: cover;
}

/* kontakt.html */
.sub-hero.hero-kontakt {
    background-image:
        linear-gradient(rgba(0,0,0,0.50), rgba(0,0,0,0.15)),
        image-set(
            url('img/hero-kontakt.webp') type('image/webp'),
            url('img/hero-kontakt.jpg')  type('image/jpeg')
        ),
        url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&q=80&w=1920');
    background-position: center;
    background-size: cover;
}

/* Produktové obrázky v e-shopu */
.product-img {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: contain;
    object-position: center;
    border-radius: 4px;
    background: #f5f5f5;
    margin: 0;
    padding: 8px;
    box-sizing: border-box;
}

/* ============================================================
   PŘÍSTUPNOST (WCAG 2.1 AA)
   ============================================================ */

/* Skip-to-content odkaz – viditelný pouze při fokusu klávesnicí */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary-color);
    color: #fff;
    padding: 12px 20px;
    font-weight: bold;
    text-decoration: none;
    z-index: 9999;
    border-radius: 0 0 6px 0;
    transition: top 0.2s;
}

.skip-to-content:focus {
    top: 0;
}

/* Focus viditelný pro klávesnicové uživatele – ne pro myš */
*:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Potlačení výchozího outline pouze pro myš */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Zvýšený kontrast pro navigační odkazy */
nav ul li a {
    color: #222; /* poměr kontrastu > 7:1 na bílém pozadí */
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--primary-color); /* #005a31 → poměr 7.2:1 na bílém ✅ */
}

/* Tlačítka – přidáme viditelný focus ring */
.btn:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/* Formulářová pole – viditelný focus */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 0;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 90, 49, 0.15);
}

/* Zajistíme dostatečnou výšku řádku pro čitelnost */
p, li {
    line-height: 1.7;
}

/* Reduced motion – respektujeme systémové nastavení */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Vizuálně skrytý text – čitelný čtečkami obrazovky */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}
