/* ── 1. GLOBÁLNÍ NASTAVENÍ A PROMĚNNÉ ── */
:root {
  --bg: #0a0e14;
  --surface: #111720;
  --border: #1e2d3d;
  --accent: #00d4ff;
  --text: #c8d8e8;
  --muted: #5a7a8a;
  --white: #f0f8ff;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* AUTOMATICKÝ ZÁMEK SCROLLOVÁNÍ POZADÍ (Když je otevřená fotka, pozadí se ani nehne) */
html:has(.lightbox-overlay:target) body {
  overflow: hidden;
}

/* Mřížka na pozadí */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Hlavní obal obsahu */
.content-wrapper {
  flex: 1;
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 140px 40px 80px; 
}

/* ── 2. FIXNÍ NAVIGACE (LOGO A ODKAZ) ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: rgba(10,14,20,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: 3px;
  color: var(--white);
}
.logo span { color: var(--accent); }

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .2s;
}
nav a:hover { color: var(--accent); }

/* ── 3. TYPOGRAFIE ── */
h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  letter-spacing: 2px;
  color: var(--white);
  line-height: 1;
  margin-bottom: 40px; 
}

/* ── 4. AUTOMATICKÁ MŘÍŽKA (CSS GRID) ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ── 5. KARTA S NÁHLEDEM ── */
.gallery-card {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  
  content-visibility: auto;
  contain-intrinsic-size: 300px 225px;
}

/* Obrázek uvnitř náhledu s low-res efektem */
.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(40%) brightness(0.7) ;
  transition: filter 0.3s ease, transform 0.3s ease;
}

/* Hover efekty náhledu */
.gallery-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
}
.gallery-card:hover .gallery-img {
  filter: grayscale(0%) brightness(1) blur(0px);
  transform: scale(1.03);
}

/* ── 6. LIGHTBOX (VYSKAKOVACÍ OKNO) ── */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, 0.96);
  backdrop-filter: blur(8px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px; /* Bezpečná mezera pro mobily */
}

.lightbox-overlay:target {
  display: flex;
}

.lightbox-img {
  max-width: 90%;
  max-height: 85vh;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
}

/* TLAČÍTKO NA ZAVŘENÍ (Základní verze pro PC) */
.lightbox-close {
  position: fixed;
  top: 90px;            /* OPRAVA: Vráceno zpět na 30px, aby křížek neujížděl dolů */
  right: 40px;
  color: #ffffff !important;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
  z-index: 100000;
  cursor: pointer;
  background: #111720;
  padding: 10px 20px;
  border-radius: 6px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  background: var(--accent);
  color: #0a0e14 !important;
}

/* ── 7. PATIČKA ── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 40px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  z-index: 1;
  margin-top: auto;
}

/* ── Média dotazy pro MOBILNÍ TELEFONY ── */
@media (max-width: 768px) {
  nav { padding: 14px 20px; }
  .content-wrapper { padding: 120px 20px 60px; }
  
  /* Upravíme velkou fotku, aby zbylo místo na tlačítko dole */
  .lightbox-img {
    max-height: 70vh;
    max-width: 100%;
  }

  /* Přesuneme tlačítko na mobilu dolů na střed pod fotku pro skvělý dosah palce */
  .lightbox-close { 
    top: auto;
    right: auto;
    bottom: 40px; 
    left: 50%;
    transform: translateX(-50%);
    border-radius: 30px; /* Kulaté moderní tlačítko */
    padding: 14px 32px;
  }
}