/* Reset */
body, h2, p, ul {
  margin: 0;
  padding: 0;
}

h1, h2 {
  margin-bottom: 40px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  background: #f4f4f9; /* light gray background */
  color: #333;
  font-size: larger;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Header navigation */
header {
  background: #ffffff;
  padding: 20px 40px; /* more space = higher header */
  display: flex;      /* place logo and nav in one row */
  justify-content: space-between; /* logo left, nav right */
  align-items: center; /* vertically center them */
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* Logo styling */
header .logo img {
  height: 60px;   /* adjust logo height */
  width: auto;    /* keep aspect ratio */
}

/* Ensure the menu items are laid out horizontally on desktop */
.mobile-menu-container {
    display: flex;
    align-items: center;
    gap: 60px;
}

/* Navigation */
header .main-nav {
  display: flex;
  gap: 30px;
}

header .main-nav a {
  color: rgb(0, 0, 0);
  text-decoration: none;
  font-weight: lighter;
  font-family: Verdana, Tahoma, sans-serif;
  font-size: smaller; /* slightly smaller links */
}

header .main-nav a:hover {
  color: #3b82f6;
}

/* --- Language Menu Container --- */
/* Your existing lang-switch styling is slightly changed/moved to .lang-menu */
.lang-menu {
    display: flex;
    gap: 5px; /* Adjust spacing between EN | CZ */
    align-items: center;
}

.lang-menu .lang-link img {
    width: 22px;        /* Slightly larger for better visibility */
    aspect-ratio: 4 / 3; /* Forces a consistent "icon" shape */
    object-fit: cover;   /* Crops the edges instead of squishing the image */
    display: inline-block;
    border-radius: 2px;
    box-shadow: 0 0 1px rgba(0,0,0,0.2)
}

.lang-menu .separator {
    color: rgb(0, 0, 0);
    font-size: 18px; 
}

/* Ensure the links within the menu match your original styling */
.lang-menu .lang-link {
    display: flex;
    align-items: center;
    color: rgb(0, 0, 0);
    text-decoration: none;
    font-weight: lighter;
    font-family: Verdana, Tahoma, sans-serif;
    font-size: 18px;
}

.lang-menu .lang-link:hover {
    color: #3b82f6;
}


/* Hamburger Button Styling */
.hamburger {
    display: none; /* Hide the button by default on large screens */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1010; /* Ensure it's above the menu */
}

.hamburger .bar {
    width: 100%;
    height: 3px;
    background: #000;
    border-radius: 10px;
    transition: all 0.3s linear;
}

/* FADE EFFECT */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}


/* HERO SECTION with background image */

#hero {
  background: url("../images/atom.jpg") no-repeat center center;
  background-size: cover;
  height: 60vh; /* full screen */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

}

#hero .content {
  max-width: 1200px;
  width: 100%; /* Important: Makes it span the full 1200px width */
  margin: 0 auto; /* Keeps the block centered within its parent */
  padding: 80px 20px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,3);
}

/* ABOUT and other sections with solid color */
#about, #members, #news, #books, #compass, #useful-links, #contact {
  padding: 80px 20px;
  max-width: 1200px;
  margin: auto;
  background: #f4f4f9; /* solid light color */
  color: #333;
}


/* Odsazení odstavců */
main p {
  text-indent: 2em;      /* první řádek odsazený */
  margin-bottom: 1.2em;  /* mezera mezi odstavci */
  line-height: 1.6;      /* lepší čitelnost */
}

/* Seznam vsude*/
main ul {
  margin-left: 2em;   /* posun doprava */
  margin-bottom: 1.2em;
}

main li {
  margin-bottom: 0.5em; /* mezera mezi položkami seznamu */
}

#fusion { 
  background: url("../images/sun.jpg") no-repeat center center;
  background-size: cover;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;   /* ensure full width */
  height: 50vh;
}

#fusion .content {
  max-width: 1200px;
  margin: auto;
  padding: 80px 20px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,3);
}

footer {
  text-align: center;
  padding: 20px;
  background: #2c3e50;
  color: white;
  font-size: smaller;
}

.members-list li {
  list-style: disc;
  padding: 0;
  border-bottom: 1px solid #ddd;
  margin-bottom: 1rem;
  padding: 0.5rem;
  font-weight: bold;
}

a {
  color: inherit;
  text-decoration: none;
  transition: transform 0.3s ease; /* smooth animation */
  display: inline-block; /* required so transform works properly */
}

a:visited {
  color: inherit;      /* removes purple visited color */
}

a:hover {
  color: #3b82f6;      /* optional: change color on hover */ 
  transform: scale(1.01); /* 1.01 = 101% size */
}

.news-list {
  list-style: none;
  padding: 0;
}

.news-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  border-bottom: 1px solid #ddd;
}

.news-date {
  font-weight: bold;
  margin-right: 0.5rem;
  color: #444;
  white-space: nowrap; /* prevent date from wrapping */
}

.news-text {
  margin-right: 1rem;
  flex: 1; /* take up remaining space */
}

.news-link {
  white-space: nowrap; /* prevent link from wrapping */
  color: #007acc;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  transition: transform 0.3s ease, color 0.3s ease;
}

.videos-and-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 40px auto;
    max-width: 1200px;
    padding: 20px;
}

.videos-and-links h1 {
    text-align: left;
    width: 100%; /* Ensure H1 spans full width */
    margin-bottom: 50px;
    font-size: 2.25rem;
    border-bottom: 3px solid #93c5fd;
    padding-bottom: 10px;
}

/* --- Content Container & Responsive Layout --- */
.content-container {
    display: flex;
    gap: 40px;
    width: 100%;
    flex-direction: column;
    align-items: stretch; /* both columns always same height */
}


/* Left column: links (now flex: 1) */
.links-column {
    flex: 1 1 100%;
    background-color: #ffffff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    order: 1;
    display: flex;
    flex-direction: column;
}

/* Right column: videos (now flex: 2) */
.videos-column {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    order: 2;
    align-content: stretch; /* default: cards stretch to fill links column height */
}

/* Once expanded, both columns revert to natural height — no forced stretching */
.videos-column.expanded {
    align-content: start;
}

.links-column.expanded,
.videos-column.expanded {
    align-self: flex-start;
}

.links-column h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 20px;
    border-bottom: 2px solid #93c5fd;
    padding-bottom: 5px;
}

.links-column ul {
    list-style: none;
    padding: 0;
    flex: 1; /* pushes button to sit right below last visible link */
}

.links-column li {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed #bfdbfe;
}

.links-column li:last-child {
    border-bottom: none;
}

.links-column a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    display: block; /* Make the whole li clickable/hoverable area */
}

.links-column a:hover {
    color: #3b82f6;
    text-decoration: underline;
}

/* Class to hide links, managed by JavaScript */
.links-column li.link-hidden {
    display: none;
}

/* When being revealed — switches from display:none to visible+animating */
.links-column li.revealing {
    display: list-item;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 1s ease;
}

.links-column li.revealing.visible {
    opacity: 1;
    transform: translateY(0);
}

.video-card.revealing {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.video-card.revealing.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Styling for the toggle button */
.links-toggle-btn {
    width: 100%;
    padding: 10px 15px;
    margin-top: 15px;
    background: linear-gradient(135deg, #0f2d6e, #1d838d);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.links-toggle-btn:hover {
    opacity: 0.88;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.links-toggle-btn:active {
    transform: translateY(1px);
}

.video-card {
    text-align: center;
    background-color: #f9fafb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
}

.video-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.video-card iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none; /* Removed border-radius here to let the card handle it */
}

.video-card h3 {
    font-size: 1rem;
    padding: 15px;
    margin: 0;
    color: #374151;
    font-weight: 600;
}


.hidden-video {
  display: none;
}


/* --- Toggle button visibility by breakpoint --- */

/* Mobile-only buttons: visible on mobile, hidden on desktop */
.mobile-only-btn {
  display: block;
}

/* Desktop-only button: hidden on mobile, visible on desktop */
.desktop-only-btn {
  display: none;
}

@media (min-width: 768px) {
  .mobile-only-btn {
    display: none !important;
  }
  .desktop-only-btn {
    display: block;
    width: auto;
    margin: 20px 0 0 0; /* left-aligned, near the links column */
    padding: 12px 40px;
    font-size: 1rem;
    align-self: flex-start; /* don't stretch to full width */
  }
}

/* Video toggle button — spans both grid columns so it sits below all cards */
#toggle-videos-btn {
    display: block;
    grid-column: 1 / -1; /* span all columns whether grid is 1 or 2 cols */
    margin: 10px auto 0;
    padding: 10px 25px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    width: fit-content;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: background-color 0.3s, box-shadow 0.2s;
}

#toggle-videos-btn:hover {
    background-color: #2563eb;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.useful-links-list li{
  list-style: disc;
  padding: 0;
  border-bottom: 1px solid #ddd;
  margin-bottom: 1rem;
  padding: 0.5rem;
}


/* CONTACT SECTION */

.contact-container {
  max-width: 1200px;
  text-align: left;
  display: flex;
  gap: 25rem; /* adjust as you like, e.g., 1rem or 20px */
}

.list-title {
  font-weight: bold;
  list-style: none;    /* removes bullet */
  margin-bottom: 0.5rem;
}

/* Remove default left padding of <ul> if you want a cleaner alignment */
.contact-person ul,
.webmaster ul {
  padding-left: 0;
  list-style: none; 
}

.contact-person a, .webmaster a {
  color: #1abc9c;
  text-decoration: none;
}
.contact-person a:hover, .webmaster a:hover {
  text-decoration: underline;
}

.contact-map {
  width: 100%;      /* full width */
  height: 400px;    /* adjust map height as needed */
}

.contact-map iframe {
  width: 100%;
  height: 100%;
  border: none;
}


/* RESPONSIVE */
@media (max-width: 900px) {
    .hamburger {
        display: flex;
    }

    /* Transform the entire container into the slide-out menu */
    .mobile-menu-container {
        /* Position off-screen to the right by default */
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 75%; /* Increased width for main nav links */
        max-width: 350px;
        background-color: #ffffff; 
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
        
        /* Menu Content Layout: Stack nav and lang links vertically */
        display: flex;
        flex-direction: column; 
        align-items: center;
        padding-top: 100px;
        
        /* Move it off-screen */
        transform: translateX(100%); 
        transition: transform 0.3s ease-in-out;
        z-index: 1005;

        /* Scrollable menu, independent from page */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 80px;

        /* Readable font */
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }

    /* State when the menu is active (toggled by JS) */
    .mobile-menu-container.open {
        transform: translateX(0); /* Slide into view */
    }
    
    /* Main Navigation Links Layout (Vertical Stack) */
    .main-nav {
        flex-direction: column;
        width: 100%;
        gap: 0; /* Remove gap from desktop */
        margin-bottom: 20px;
    }

    .main-nav a {
        padding: 15px 20px;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid #eee;
        font-size: 26px !important;
        font-weight: 400;
    }
    
    /* Mobile adjustments (keeping your existing logic) */
    header .lang-menu .lang-link,
    header .lang-menu .separator {
        font-size: 20px;
    }

    /* Hide the main nav on mobile (it lives inside the drawer) */
    header .main-nav {
        display: none;
    }

    /* Show nav when drawer is open */
    header .mobile-menu-container.open .main-nav {
        display: flex;
    }

    /* Lang menu stays in header, always visible on mobile */
    header .lang-menu {
        display: flex;
        font-size: 20px;
        gap: 8px;
    }

    header .lang-menu .lang-link {
        font-size: 20px;
    }

    header .lang-menu .separator {
        font-size: 20px;
    }
    
    /* Hamburger to X transition (keep existing styles) */
    .hamburger.open .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.open .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.open .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Lock page scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}


@media (max-width: 900px) {
    .members-grid {
      grid-template-columns: 1fr;
    }

    .member-card img {
      height: 180px; /* menší výška pro mobily */
    }
}

/* Breakpoint 768px - Videa a tlačítka */
@media (max-width: 768px) {
    .contact-container{
      flex-direction: column;
    }
      .videos-column {
        display: grid;
        grid-template-columns: 1fr; /* force single column */
        justify-items: stretch;
    }

    .video-card {
        width: 100%;
        max-width: 100%;
        justify-self: stretch; /* ensures it fills the grid cell */
    }
    
    /* Skryje videa (kromě prvního), pokud je třída přidána JS */
    .video-hidden-mobile {
        display: none !important; 
    }
}


@media (min-width: 768px) {
    .content-container {
        flex-direction: row;
    }
/* Links Column: Reverts to 1 part (1/3) on desktop */
    .links-column {
        flex: 1; /* Shorthand for flex: 1 1 0% */
    }

    /* Videos Column: Reverts to 2 parts (2/3) on desktop */
    .videos-column {
        flex: 2; /* Shorthand for flex: 2 1 0% */
        /* Also ensures two videos per row on desktop */
        grid-template-columns: 1fr 1fr;
    }
    /* On desktop, the button is shown/hidden by JS only — no CSS override */
}

/* For mobile phones */
@media (max-width: 768px) {
  .contact-container {
    flex-direction: column; /* stack vertically */
    gap: 4rem; /* even smaller gap between the blocks */
  }

  /* Hero section — fit text on small screens */
  #hero {
    height: auto;
    min-height: 40vh;
    padding: 20px 0;
  }

  #hero .content {
    padding: 30px 20px;
    text-align: left;
  }

  #hero .content h1 {
    margin-bottom: 12px;
    line-height: 1.3;
    word-break: break-word;
    white-space: normal;
  }

  #hero .content p {
    text-indent: 0;
    white-space: normal;
  }
}


@media (min-width: 768px) {
  .hidden-mobile {
    display: block;
  }
}