* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* FONT */

html, body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

html {
    font-size: 14px;
    background-color: var(--background);
}

body {
    font-family: 'ZV-Regular', sans-serif;
    font-weight: 500;
    background-color: var(--background);
    color: var(--text);

    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
body::-webkit-scrollbar {
    width: 0;
}

p {
    font-size: 23px;
    line-height: 1.8rem;
    color: var(--text);
}

h1, h2, h3, h4, h5 {
    font-family: 'ZV-Display';
    font-weight: normal;
    text-transform: uppercase;
}


h1 {
    font-size: 6.5rem;
    line-height: 6.1rem;
}

h2 {
    font-size: 3.5rem;
}

h3 {
    font-size: 3rem;
}

h4 {
    font-size: 2.5rem;
}

h5 {
    font-size: 2rem;
}

small {
    font-size: 0.750rem;
}

/* LAYOUT */

.layout-container {
    width: 100%;
    padding: var(--spacer);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}
.layout-content {
    width: min(90%, 1200px);
    display: flex;
    padding: 2.5rem;
    flex-direction:column; 
    gap:2rem;
}
main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* DESKTOP NAV */

nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--background);
    position: sticky;
    top: 0;
    z-index: 1000;
}
nav .layout-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}
.nav-logo img {
    height: 70px;
    width: auto;
}
.nav-logo a:nth-of-type(2) {
    display: none;
}
.nav-links, .nav-links div {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}
.nav-link {
    text-decoration: none;
    text-wrap: nowrap;
    color: var(--text);
    text-transform: uppercase;
    font-family: 'ZV-Display';
    font-size: 1.8em;
    font-weight: normal;
    transition: var(--transition);
}
.nav-link:hover {
    color: var(--black-zv);
}

/* FOOTER */

footer {
    width: 100%;
    padding: var(--spacer);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

footer .layout-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
    background-color: var(--secondary-background);
    color: var(--text);
}
.footer-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}
.footer-body {
    width: min(100%,320px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.footer-logo {
    width: 200px;
}
.footer-socials {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
}
.footer-socials a {
    text-decoration: none;
    font-size: 2.4rem;
    transition: var(--transition);
    color: var(--text);
}
.footer-socials a:hover {
    color: var(--primary);
}
.footer-columns {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 2rem;
}
.footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: .2rem;
}
.footer-column-title {
    font-weight: 700;
    padding-bottom: 1rem;
}
.footer-link {
    text-decoration: none;
    text-wrap: nowrap;
    color: var(--text);
    transition: var(--transition);
}
.footer-link:hover {
    color: var(--primary);
}
.subfooter {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

/* BASE ELEMENTS */

/* tlačítko měnící barvu na základě white/dark mode*/
/* WHITE MODE: žluté tlačítko s černým textem + při přejetí černé tlačítko s bílím textem*/
/* DARK MODE: žluté tlačítko s černým textem + při přejetí žluté tlačítko s bílím textem */
.primary-button {
    padding: 0.3em 0.7em;
    background-color: var(--primary);
    color: var(--black-zv);
    text-decoration: none;
    transition: var(--transition);
    display: block;
    width: fit-content;
    font-size: 1.8em;
    font-family: ZV-Display;
    text-transform: uppercase;
    font-weight: normal;
}
.primary-button:hover {
    background-color: var(--black-zv);
    color: var(--background);
}

@media (prefers-color-scheme: dark) {
    .primary-button {
        color: var(--black-zv);
    }
    .primary-button:hover {
        background-color: var(--primary);
        color: var(--text);
    }
}

/* Obyčejné a spolehlivé prohození barev */
.secondary-button {
    /* Tvůj původní layout */
    padding: 1ch 1rem;
    font-size: 1.6rem;
    font-family: ZV-Display;
    text-decoration: none;
    text-transform: uppercase;
    display: block;
    width: fit-content;
    text-wrap: nowrap;
    transition: var(--transition);
    cursor: pointer;
    
    /* Výchozí stav: černé tlačítko, žlutý text a rámeček */
    border: 3px solid var(--black-zv);
    background-color: var(--black-zv);
    color: var(--primary);
}

.secondary-button:hover {
    /* Hover stav: žluté tlačítko, černý text (rámeček zůstává černý) */
    background-color: var(--black-zv); 
    color: var(--white-zv);
    border-color: var(--black-zv);
}


.quote-title {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-block: 9rem;
    position: relative;
    font-size: 5rem;
    text-align: center;
    font-family: ZV-Display;
    text-transform: uppercase;
    font-weight: normal;
}
.quote-title-highlight {
    position: relative;
    z-index: 1;
}
.quote-title-highlight::after {
    position: absolute;
    display: block;
    width: 110%;
    height: 20px;
    content: "";
    bottom: 5px;
    right: -5%;
    z-index: -1;
    transform: rotate(-2deg);
    background-color: var(--secondary);
}

#partners .layout-content{
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
    background-color: var(--primary);
    padding: var(--inspacer);
    color: var(--black-zv);
}

#supporters .layout-content{
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
    background-color: var(--primary);
    padding: var(--inspacer);
    color: var(--black-zv);
}

.partner-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    align-items: center;
    justify-items: center;
    width: 100%;
}

.partner-body a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.partner-logo-img {
    height: 120px; 
    width: auto; 
    object-fit: contain; 
    max-width: min(25vw, 85%);
    transition: var(--transition);
}
.supporter-logo-img {
    height: 80px; 
    width: auto; 
    object-fit: contain; 
    max-width: min(25vw, 85%);
    transition: var(--transition);
}
/* 1. Hide the white version (2nd image) by default */
.partner-logo-img:nth-of-type(2) {
    display: none;
}
/* 1. Hide the white version (2nd image) by default */
.supporter-logo-img:nth-of-type(2) {
    display: none;
}

/* 2. On hover of the link, swap visibility */
.partner-body a:hover .partner-logo-img:nth-of-type(1) {
    display: none; /* Hide black */
}

.partner-body a:hover .partner-logo-img:nth-of-type(2) {
    display: block; /* Show white */
}

@media (max-width: 900px) {
    .partner-logo-img {
        /* Slightly smaller height for mobile screens */
        height: 40px;
        max-width: 80%;
    }
    .supporter-logo-img {
        /* Slightly smaller height for mobile screens */
        height: 30px;
        max-width: 60%;
    }
}
/* HEADER */
.header-text {
    font-size: 2rem;
    margin: 3rem 0;
    color: var(--text);
    font-family: ZV-Bold;
    display: flex;
    flex-direction: column; /* Stack vertically on mobile */
    gap: 0.5rem;            /* Space between the stacked items */
    align-items: flex-start; /* Align to the left */
}

/* Prevent the text (date/location) from splitting in half */
.header-meta-item {
    white-space: nowrap; 
}

/* On screens larger than 768px (Tablets/Desktop), put them side-by-side */
@media (min-width: 768px) {
    .header-text {
        flex-direction: row; /* Switch to horizontal */
        align-items: center; /* Center them vertically relative to each other */
        gap: 1.5rem;         /* Space between the items side-by-side */
    }
}

header .layout-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
}
.header-body {
    width: min(100%, 700px);
}
header img {
    width: 200px;
}

.team-member-link {
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
}

.team-member-link:hover {
    color: var(--secondary);
}

.team-member-link-body {
    text-align: center;
    display: flex;
    flex-direction: column;
}
.team-member-link-item-body strong {
    font-size: 1.2rem;
    margin-bottom: .3rem;
}

.link-button-item {
  display: flex;
  flex-direction: row; /* Keep it row for desktop */
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; /* Key fix: allows items to wrap if space runs out */
  
  padding: var(--inspacer);
  gap: 2rem;
  width: 100%;
  background-color: var(--secondary);
  color: var(--black-zv);
}

.link-button {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* MEDIA */

@media (max-width:760px) {
    .nav-logo a:first-of-type {
        display: none;
    }
    .nav-logo a:nth-of-type(2) {
        display: block;
    }
    .footer-columns {
        flex-wrap: wrap;
    }
    
    /* Allow nav links to wrap into two lines */
    .nav-links {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.5rem;
        max-width: 100%;
    }
}

@media (max-width:650px) {
    h1 {
        font-size: 3rem;
        line-height: 3rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    h4 {
        font-size: 1rem;
    }
    
    h5 {
        font-size: 1rem;
    }
    .quote-title {
        font-size: 2rem;
        padding-block: 3rem;
    }
    .quote-title-highlight::after {
        height: 12px;
    }
    header img {
        width: 120px;
    }
}

@media (max-width:570px) {
    nav {
        font-size: .8rem;
    }
    header img {
        display: none;
    }
    .header-body {
        width: 100%;
    }
}

/* --- Base Mobile Elements (Hidden by Default) --- */
/* Hide all main mobile nav elements on larger screens */
.mobile-top-bar,
.mobile-off-canvas-menu,
.mobile-menu-overlay {
    display: none;
}

main,
footer,
.mobile-top-bar {
    filter: blur(0);
    pointer-events: auto; /* Re-enable interaction */
    transition: filter 0.3s ease-in-out;
}

input {
    font-family: 'ZV-Display';
}

/* --- Media Query for Mobile Screens --- */
@media (max-width: 700px) { /* Changed from 500px to 800px */

    /* Show and style the Mobile Top Bar (Logo + Hamburger) */
    .mobile-top-bar {
        display: flex; /* Show and use flexbox */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: sticky;
        top: 0;
        left: 0;
        width: 100%;
        /* Use your theme colors */
        background-color: var(--background, #fbfbfe); /* Background color for top bar */
        box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Subtle shadow */
        align-items: center; /* Vertically center content */
        padding-block: 1rem;
        z-index: 1000; /* Ensure it's above content */
    }
    .mobile-top-bar-content {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: min(90%, 1200px);
    }

     .mobile-top-bar .mobile-logo-link img.nav-logo {
        /* Style the logo image inside the top bar */
        height: 40px; /* Adjust logo height */
        width: auto;
     }

    .hamburger-button {
        background: none;
        border: none;
        font-size: 1.8rem; /* Size of the hamburger icon */
        color: var(--text, #000); /* Color of the icon */
        cursor: pointer;
        padding: 5px;
        z-index: 1001; /* Ensure button is above other elements in the bar */
    }


    /* Initial state of the Mobile Off-Canvas Menu (off-screen) */
    .mobile-off-canvas-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 60%; /* Set the width of the menu */
        height: 100%;
        background-color: var(--background, #fbfbfe); /* Menu background color */
        box-shadow: -2px 0 5px rgba(0,0,0,0.2);
        transform: translateX(100%); /* Slide it completely off-screen */
        transition: transform 0.3s ease-in-out; /* Slide animation */
        z-index: 1010; /* Above overlay and content */
        display: flex; /* Use flexbox for internal layout */
        flex-direction: column; /* Stack header, links, footer */
        overflow-y: auto; /* Scrolling if content overflows */
        -webkit-overflow-scrolling: touch;
    }

    /* Styles for the menu header (optional, adapt as needed) */
    .mobile-off-canvas-menu .menu-header {
         display: flex;
         justify-content: space-between;
         align-items: center;
         padding: 1rem 2rem 0 0;
    }

    .mobile-off-canvas-menu .mobile-menu-logo-link img.nav-logo {
         height: 40px; /* Match top bar logo height */
         width: auto;
    }

    .close-menu-button {
         background: none;
         border: none;
         font-size: 1.8rem;
         color: var(--text, #000);
         cursor: pointer;
         padding: 5px;
         margin-left: auto;
    }

    /* Styles for the menu links container */
    .mobile-off-canvas-menu .menu-links {
        display: flex;
        align-items: flex-end;
        flex-direction: column;
        padding: 1rem 2rem 0 0;
        flex-grow: 1; /* Allow links section to take up space */
        gap: 1.2rem;
    }

    /* Styles for the menu footer (optional) */
    .mobile-off-canvas-menu .menu-footer {
         padding: 15px;
    }

    .mobile-off-canvas-menu .menu-footer .footer-socials {
         justify-content: center;
    }


    /* Initial state of the Overlay/Backdrop (hidden) */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
        z-index: 1005; /* Between content and menu */
        /* display: none; /* Already set above, but explicitly hidden by default */
    }


    /* --- State Class (Added to body by JS when menu is open) --- */
    body.menu-open {
        overflow: hidden; /* Prevent scrolling main content */
    }

    /* When menu-open class is on body, slide the menu into view */
    body.menu-open .mobile-off-canvas-menu {
        transform: translateX(0);
    }

    /* When menu-open class is on body, show the overlay */
    body.menu-open .mobile-menu-overlay {
        display: block;
    }

    body.menu-open main,
    body.menu-open footer,
    body.menu-open .mobile-top-bar{
        filter: blur(5px); /* Applies a 5px blur */
        pointer-events: none; /* Prevents clicks/interactions on the blurred content */
        transition: filter 0.3s ease-in-out; /* Smooth animation for the blur */
    }
}

/* Additional styles for handling nav link wrapping before mobile breakpoint */
@media (max-width: 950px) and (min-width: 701px) {
    .nav-links {
        justify-content: center;
        gap: 0.5rem;
        line-height: 1.2;
    }
    
    /* Reduce padding if needed to give more space */
    nav .layout-content {
        padding-inline: 1rem;
    }
}

@media (max-width: 370px) {
    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    #username {
        order: 99;
        width: 100%;
        text-align: right;
    }
}

/* Tablebox utility: shared background and border using :root variables */
.tablebox {
    background: var(--tablebox-bg);
    border: var(--tablebox-border-outer);
    border-collapse: collapse;
}