/* =========================
   RESET & BASE
   ========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand / EU */
    --eu-blue: #003399;
    /* EU Blue */
    --eu-blue-dark: #002b80;
    --eu-yellow: #ffcc00;
    /* EU Yellow */

    /* Klientom požadovaná červená (NEZMENENÁ) */
    --brand-red: #ff0000;

    /* WCAG-safe red tokens (používaj pre text/pozadia) */
    --red-ui: #d50000;
    /* biely text na tomto prejde */
    --red-text: #b00020;
    /* červený text na bielom prejde */
    --focus-ring: var(--red-ui);

    /* UI neutrals */
    --bg: #f2f5f9;
    --text: #222;
    --muted: #555;
    --card: #fff;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    --radius: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

/* Rešpektuj nastavenie používateľa (WCAG) */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition: none !important;
    }
}

/* =========================
   ACCESSIBILITY HELPERS
   ========================= */
.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* Skip link – WCAG-safe: červené pozadie + biely text */
.skip-link {
    position: absolute;
    top: -50px;
    left: 10px;
    background: var(--red-ui);
    color: #fff;
    padding: 10px 15px;
    font-weight: 700;
    text-decoration: none;
    z-index: 1000;
    border-radius: 4px;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 10px;
}

/* Fokus len pre klávesnicu */
a:focus,
button:focus,
summary:focus {
    outline: none;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* =========================
   TOP BAR / NAV  (UPDATED)
   ========================= */

/* Vonkajší header je len full-width pozadie */
.topbar {
    background: var(--eu-blue);
    color: #fff;
}

/* Vnútorný wrapper má rovnakú "os" ako .layout */
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Responzívne obrázky v hlavičke */
.logo-left img,
.logo-right img {
    height: 100px;
    width: auto;
    display: block;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.main-nav a {
    color: #fff;
    margin: 0 10px;
    padding: 5px 8px;
    text-decoration: none;
    font-weight: 500;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    background: rgba(255, 255, 255, 0.1);
}

/* Aktívna stránka – červené podčiarknutie */
.main-nav a[aria-current="page"] {
    box-shadow: inset 0 -3px 0 0 var(--brand-red);
}

/* =========================
   LAYOUT
   ========================= */
.layout {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    align-items: flex-start;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--card);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);

    position: sticky;
    top: 20px;
}

.sidebar h3 {
    color: var(--eu-blue);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--brand-red);
    padding-bottom: 8px;
}

.sidebar ul {
    list-style: none;
    margin: 10px 0;
    padding-left: 5px;
}

.sidebar li {
    margin: 8px 0;
}

.sidebar a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: color 0.2s, text-decoration-color 0.2s;
}

.sidebar a:hover,
.sidebar a:focus-visible {
    color: var(--eu-blue);
    text-decoration: underline;
    text-decoration-color: var(--brand-red);
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
}

.sidebar details {
    margin-bottom: 10px;
}

.sidebar details summary {
    cursor: pointer;
    font-weight: bold;
    margin: 10px 0;
    color: var(--eu-blue);
    list-style: none;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sidebar summary::-webkit-details-marker {
    display: none;
}

.sidebar summary::after {
    content: '+';
    font-weight: bold;
    flex: 0 0 auto;
}

.sidebar details[open]>summary::after {
    content: '-';
}

/* Jemný akcent len na PRÁVE otvorený summary */
.sidebar details[open]>summary {
    color: var(--red-text);
}


/* =========================
   CONTENT
   ========================= */
.content {
    flex: 1;
    min-width: 0;
}

.card {
    background: var(--card);
    padding: 30px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.card h1,
.card h2 {
    color: var(--eu-blue);
    margin-bottom: 15px;
    line-height: 1.3;
}

.meta {
    list-style: none;
    color: var(--muted);
    background: #f9f9f9;
    padding: 15px;
    border-left: 4px solid var(--eu-blue);
    border-radius: 4px;
}

.meta li {
    margin: 6px 0;
}

.map img {
    width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: block;
}

/* Details in content library */
.materials details {
    margin: 15px 0;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px 15px;
}

.materials summary {
    cursor: pointer;
    font-weight: bold;
    color: var(--eu-blue);
}

.materials details[open] {
    background: #fafafa;
    border-left: 4px solid var(--brand-red);
}

.materials details ul {
    margin-top: 10px;
    margin-left: 20px;
}

/* =========================
   FOOTER
   ========================= */
.footer {
    background: var(--eu-blue);
    color: #fff;
    padding: 40px 20px;
    font-size: 0.9rem;
    text-align: center;
    margin-top: auto;
}

.footer p {
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 1024px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .topbar-inner {
        flex-direction: column;
        padding: 20px;
        text-align: center;
    }

    .logo-left img,
    .logo-right img {
        height: 80px;
        margin-bottom: 15px;
    }

    .main-nav {
        flex-direction: column;
        width: 100%;
        gap: 5px;
    }

    .main-nav a {
        display: block;
        background: rgba(255, 255, 255, 0.1);
        padding: 10px;
        margin: 0;
        /* aby to v stĺpci nebolo rozhádzané marginmi */
    }

    .card {
        padding: 20px;
    }

    .card h1 {
        font-size: 1.5em;
    }
}

/* Dotykové zariadenia – väčšie tap targety */
@media (pointer: coarse) {
    .main-nav a {
        padding: 10px 12px;
    }

    .sidebar a {
        padding: 6px 0;
        display: inline-block;
    }
}

/* =========================
   CONSORTIUM LOGOS (CARD)
   ========================= */

.consortium-logos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
        ". ukf ."
        "ualg auth polsl";
    gap: 16px;
    margin: 16px 0 18px;
}

/* Poradie zodpovedá tvojmu HTML: UKF, UAlg, AUTh, POLSL */
.consortium-logos .partner:nth-child(1) {
    grid-area: ukf;
}

.consortium-logos .partner:nth-child(2) {
    grid-area: ualg;
}

.consortium-logos .partner:nth-child(3) {
    grid-area: auth;
}

.consortium-logos .partner:nth-child(4) {
    grid-area: polsl;
}

/* Mobile: všetko pod sebou (tak ako chceš) */
@media (max-width: 768px) {
    .consortium-logos {
        grid-template-columns: 1fr;
        grid-template-areas:
            "ukf"
            "ualg"
            "auth"
            "polsl";
    }
}

/* Zvyšok tvojich štýlov pre .partner môže zostať tak ako máš */
.partner {
    display: grid;
    grid-template-rows: 72px auto;
    align-items: center;
    justify-items: center;
    gap: 10px;

    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 10px;
    padding: 14px 14px 12px;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.partner:hover,
.partner:focus-visible {
    border-color: var(--brand-red);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.partner img {
    max-height: 56px;
    width: 100%;
    object-fit: contain;
    display: block;
}

.partner-name {
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.2;
}

/* =========================
   LANGUAGE FLAGS IN SUMMARY
   ========================= */

.lang-summary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.lang-summary img {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

/* =========================
   NESTED DETAILS (WP)
   ========================= */

.sidebar details details {
    margin: 6px 0 6px 12px;
}

.sidebar details details summary {
    font-weight: 600;
    font-size: 0.95em;
}

.sidebar details details ul {
    margin-left: 18px;
}

/* =========================
   PHOTO GALLERY
   ========================= */

.gallery{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
gap:12px;
margin-top:15px;
}

.gallery img{
width:100%;
height:160px;
object-fit:cover;
border-radius:6px;
cursor:pointer;
transition:transform .2s, box-shadow .2s;
}

.gallery img:hover{
transform:scale(1.04);
box-shadow:0 6px 14px rgba(0,0,0,0.2);
}


/* =========================
   LIGHTBOX
   ========================= */

.lightbox{
position:fixed;
inset:0;
background:rgba(0,0,0,0.9);
display:none;
align-items:center;
justify-content:center;
z-index:3000;
}

.lightbox img{
max-width:90%;
max-height:85%;
border-radius:6px;
}

.lb-close{
position:absolute;
top:25px;
right:35px;
font-size:40px;
color:white;
background:none;
border:none;
cursor:pointer;
}

.lb-prev,
.lb-next{
position:absolute;
top:50%;
transform:translateY(-50%);
font-size:50px;
color:white;
background:none;
border:none;
cursor:pointer;
padding:10px 20px;
}

.lb-prev{
left:20px;
}

.lb-next{
right:20px;
}