/*
Theme Name: Tay Z Bedynky
Theme URI: https://www.tayzbedynky.sk
Author: Tvoj Team
Version: 1.0
*/

:root{
  --max: 1100px;
  --black: #0f0f0f;
  --white: #ffffff;
  --muted: #f3f4f6;
  --text: #151515;
  --navH: 64px; /* výška menu baru */
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: #fff;
}

/* ==========================================================================
   PANELY / SEKCIe
   FIX prekryvania: NEPOUŽÍVAŤ pevné height:100vh pre sekcie s veľa obsahom.
   - default: natiahnuť podľa obsahu (height:auto) + min-height:100vh
   - hero: nech ostane fullscreen
   ========================================================================== */
.panel{
  height: auto;
  min-height: 100vh;
}

/* ===== HERO ===== */
.hero{
  /*
    Desktop default:
    - ak máš v front-page.php nastavené --hero-url, použije sa ono
    - ak nie, použije sa assets/images/hero-desktop.jpg
  */
  background-image: var(--hero-url, url("assets/images/hero-desktop.jpg"));
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  position: relative;
}

/* Hero ostáva fullscreen na desktope */
.hero.panel{
  height: 100vh;
  min-height: 100vh;
}

.hero__overlay{
  height: 100%;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: clamp(18px, 3vw, 34px);
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.12), rgba(0,0,0,0.28));
  padding-bottom: calc(clamp(18px, 3vw, 34px) + var(--navH));
}

.hero__text{
  width: min(var(--max), 92vw);
  padding: clamp(14px, 2.4vw, 22px);
  border-radius: 16px;
  color: var(--white);
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0.18), rgba(0,0,0,0));
}

.hero__title{
  margin: 0;
  font-weight: 900;
  letter-spacing: .2px;
  font-size: clamp(28px, 5vw, 60px);
  line-height: 1.05;
  text-shadow: 0 2px 22px rgba(0,0,0,.35);
}
.hero__subtitle{
  margin: 10px 0 0;
  font-size: clamp(14px, 1.7vw, 18px);
  opacity: .95;
  text-shadow: 0 2px 22px rgba(0,0,0,.35);
}

/* ===== NAV BAR (bottom fixed) ===== */
.nav-bar{
  background: var(--black);
  color: var(--white);
  border-top: 1px solid rgba(255,255,255,0.10);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  z-index: 999;
}
.nav-bar--bottom{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
}

.nav-bar__inner{
  max-width: var(--max);
  margin: 0 auto;
  height: var(--navH);
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-bar__brand{
  color: var(--white);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .2px;
  white-space: nowrap;
}

.nav-bar__links{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 22px;
  margin-left: auto;
}

.nav-bar__links a{
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  opacity: .95;
}
.nav-bar__links a:hover{
  opacity: 1;
  text-decoration: underline;
}

/* ===== Mobile hamburger ===== */
.nav-bar__toggle{
  display: none;
  margin-left: auto;
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
}
.nav-bar__toggle span{
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  border-radius: 1px;
}

/* ===== Scroll snap pages ===== */
.snap{
  scroll-snap-type: y mandatory;
  padding-bottom: var(--navH);
}

.section{
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #fff;
}

.section--alt{ background: var(--muted); }

.section__inner{
  width: min(var(--max), 92vw);
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: clamp(18px, 2.6vw, 34px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.section__inner h2{
  margin: 0 0 12px;
  font-size: clamp(22px, 2.8vw, 34px);
}

.list{ margin: 10px 0 0; padding-left: 18px; }

.contest-block{
  margin-bottom: 26px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.08);
}

.contest-block h3{
  margin: 0 0 6px;
  font-size: 20px;
}

.contest-place{
  margin: 0 0 10px;
  font-weight: 600;
  opacity: 0.75;
}

.contest-results{
  margin: 0;
  padding-left: 18px;
}

.contest-results li{
  margin-bottom: 6px;
}

.contest-highlight{
  background: #111;
  color: #fff;
}

/* Footer skôr “technický”, keďže menu je fixed */
footer{
  background: #101010;
  color: #fff;
  text-align: center;
  padding: 14px 12px calc(14px + var(--navH));
}

/* =======================================================================
   TABLET + MOBIL: prepnutie na hero-mobile.jpg + zobraziť celý obrázok
   ======================================================================= */
@media (max-width: 1024px){

  :root{
    --navH: 86px;
  }

  .snap{ scroll-snap-type: y proximity; }

  .hero{
    background-image: url("assets/images/hero-mobile.jpg") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-color: #000 !important;
  }

  .hero.panel{
    height: clamp(420px, 72svh, 760px) !important;
    min-height: 0 !important;
  }

  .hero__overlay{
    padding: 10px !important;
    padding-bottom: calc(10px + var(--navH)) !important;
    background: rgba(0,0,0,0.08) !important;
  }

  .hero__text{
    padding: 10px !important;
    border-radius: 12px !important;
    background: rgba(0,0,0,0.28) !important;
  }

  .hero__subtitle{
    display: none !important;
  }

  #about.panel{
    height: auto;
    min-height: 0;
  }

  #about.section{
    align-items: flex-start;
    padding-top: 34px;
    padding-bottom: calc(20px + var(--navH));
  }

  /* hamburger */
  .nav-bar__toggle{ display: inline-block; }
  .nav-bar__inner{ position: relative; }

  .nav-bar__inner{
    height: var(--navH);
    padding: 0 16px;
    gap: 16px;
  }

  .nav-bar__brand{
    font-size: 18px;
  }

  .nav-bar__toggle{
    padding: 14px;
  }
  .nav-bar__toggle span{
    width: 28px;
    height: 3px;
    margin: 6px 0;
  }

  .nav-bar__links{
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--navH);
    background: var(--black);
    padding: 14px 16px;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid rgba(255,255,255,0.10);
  }

  .nav-bar__links a{
    display: block;
    padding: 14px 10px;
    font-size: 18px;
    line-height: 1.2;
  }

  .nav-bar__links.is-open{ display: flex; }
}

/* =======================================================================
   LEN MOBIL: jemnejšie rozloženie
   ======================================================================= */
@media (max-width: 820px){
  .hero.panel{
    height: clamp(380px, 70svh, 640px) !important;
  }
}

/* ===== Výstavy: sekcia sa môže natiahnuť podľa obsahu ===== */
.section--contests.panel{
  height: auto;
  min-height: 100vh;
  padding-bottom: calc(20px + var(--navH));
}

/* ===== Ocenenia + Galéria: nech sa sekcie natiahnu podľa obsahu ===== */
.section--awards.panel,
.section--gallery.panel{
  height: auto;
  min-height: 100vh;
  padding-bottom: calc(20px + var(--navH));
}

/* aby obsah nezačínal “na stred” pri vysokom obsahu */
.section--awards.section,
.section--gallery.section{
  align-items: flex-start;
}

/* ===== Mesiacový blok (HTML5 details/summary) ===== */
.shows-month{
  margin-top: 18px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.92);
}

.shows-month__summary{
  cursor: pointer;
  list-style: none;
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(0,0,0,0.03);
}

.shows-month__summary::-webkit-details-marker{ display:none; }

.shows-month__title{
  font-weight: 900;
}

.shows-month__meta{
  opacity: 0.7;
  font-weight: 700;
}

/* ===== Grid: minimálne 3 karty na desktop ===== */
.shows-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px 16px;
}

/* Tablet */
@media (max-width: 1024px){
  .shows-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobil */
@media (max-width: 640px){
  .shows-grid{
    grid-template-columns: 1fr;
  }
}

/* ===== Výstavy: GRID 3 stĺpce ===== */
#contests .contests-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

/* tablet */
@media (max-width: 1024px){
  #contests .contests-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* mobil */
@media (max-width: 640px){
  #contests .contests-grid{
    grid-template-columns: 1fr;
  }
}

/* karta = detail */
#contests .contest-card{
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  overflow: hidden;
}

/* summary = klikateľný header */
#contests .contest-card__summary{
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px;
  background: rgba(0,0,0,0.03);
}

#contests .contest-card__summary::-webkit-details-marker{ display:none; }

#contests .contest-card__month{
  font-weight: 900;
  font-size: 18px;
}

#contests .contest-card__place{
  font-weight: 700;
  opacity: 0.75;
}

/* telo karty */
#contests .contest-card__body{
  padding: 12px 14px 14px;
}

/* existujúce triedy nechávame, len ich jemne doladíme v kartách */
#contests .contest-place{
  margin: 0 0 10px;
  font-weight: 700;
  opacity: 0.8;
}

#contests .contest-results{
  margin: 0;
  padding-left: 18px;
}

#contests .contest-results li{
  margin: 6px 0;
}

/* zvýraznenie */
#contests .contest-card--highlight{
  background: #111;
  color: #fff;
  border-color: rgba(255,255,255,0.12);
}

#contests .contest-card--highlight .contest-card__summary{
  background: rgba(255,255,255,0.06);
}

#contests .contest-card--highlight .contest-results li{
  color: #fff;
}

/* ===== Ocenenia + Galéria (grid) ===== */
.media-grid{
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1024px){
  .media-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px){
  .media-grid{ grid-template-columns: 1fr; }
}

.media-tile{
  display: block;
  text-decoration: none;
  color: inherit;
}

.media-figure{
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
  box-shadow: 0 10px 26px rgba(0,0,0,0.06);
}

.media-figure img{
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: rgba(0,0,0,0.03);
}

@media (max-width: 640px){
  .media-figure img{ height: 220px; }
}

.media-caption{
  padding: 10px 12px;
  font-weight: 800;
  opacity: 0.85;
}

/* ===== Lightbox (HTML5 dialog) ===== */
.lightbox{
  border: 0;
  padding: 0;
  width: min(1100px, 96vw);
  max-width: 1100px;
  max-height: 92vh;
  border-radius: 16px;
  overflow: hidden;
  background: #0b0b0b;
  color: #fff;
}

.lightbox::backdrop{
  background: rgba(0,0,0,0.82);
}

.lightbox__bar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  background: rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.lightbox__title{
  font-weight: 900;
  padding-left: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox__actions{
  display: flex;
  gap: 8px;
}

.lightbox__btn{
  appearance: none;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  cursor: pointer;
}

.lightbox__btn--close{
  border-color: rgba(255,255,255,0.28);
}

.lightbox__body{
  display: grid;
  place-items: center;
  padding: 12px;
  max-height: calc(92vh - 56px);
  overflow: auto;
}

.lightbox__body img{
  width: 100%;
  height: auto;
  max-height: calc(92vh - 90px);
  object-fit: contain;
  border-radius: 12px;
}

.lightbox__pdf{
  width: min(1000px, 92vw);
  height: min(78vh, 900px);
  border: 0;
  border-radius: 12px;
  background: #111;
}

/* ===== Fallback pre prehliadače bez <dialog>.showModal() ===== */
.lightbox[open]{
  display: block;
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 10000;
}

.lightbox-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 9999;
}

/* ==========================================================================
   CRITICAL FIX: aby lightbox nikdy “nepretínal” layout, keď nie je otvorený
   - keď <dialog> nemá [open], musí byť reálne display:none
   - keď má [open], je to overlay (fixed) mimo layout
   ========================================================================== */
dialog.lightbox:not([open]){
  display: none;
}

dialog.lightbox[open]{
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 10000;
}

/* PDF placeholder (keď chýba thumb) */
.media-figure--pdf{
  display: grid;
  place-items: center;
}

.pdf-thumb{
  height: 230px;
  width: 100%;
  display: grid;
  place-items: center;
  gap: 10px;
  color: rgba(0,0,0,0.75);
  background: rgba(0,0,0,0.03);
}

.section--alt .pdf-thumb{
  background: rgba(0,0,0,0.04);
}

.pdf-thumb__label{
  font-weight: 900;
  letter-spacing: .2px;
}

/* ===== About (O mne) ===== */
.about-card{
  margin-top: 14px;
  padding: 16px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.08);
}

.about-card__title{
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 900;
}

.about-dl{
  margin: 0;
}

.about-dl__row{
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 10px 16px;
  padding: 10px 0;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.about-dl__row:first-child{
  border-top: 0;
}

.about-dl dt{
  font-weight: 900;
  opacity: 0.85;
}

.about-dl dd{
  margin: 0;
  font-weight: 700;
  opacity: 0.9;
}

.about-dl a{
  color: inherit;
  text-decoration: underline;
}

@media (max-width: 640px){
  .about-dl__row{
    grid-template-columns: 1fr;
  }
}
/* ===== Layout About (ľavo údaje / pravo rodokmeň) ===== */
.about-layout{
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 1024px){
  .about-layout{
    grid-template-columns: 1fr;
  }
}

/* ===== Rodokmeň ===== */
.pedigree-wrap{
  margin-top: 10px;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.95);
}

.pedigree{
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.pedigree__cell{
  border-right: 1px solid rgba(0,0,0,0.10);
  border-bottom: 1px solid rgba(0,0,0,0.10);
  padding: 16px 14px;
  vertical-align: middle;
  font-weight: 800;
  background: #fff;
  word-wrap: break-word;
}

.pedigree tr:last-child .pedigree__cell{
  border-bottom: 0;
}

.pedigree__cell:last-child{
  border-right: 0;
}

.pedigree__cell--level1{ background: rgba(0,0,0,0.02); }
.pedigree__cell--level2{ background: rgba(0,0,0,0.01); }
.pedigree__cell--level3{ background: #fff; }

@media (max-width: 640px){
  .pedigree-wrap{
    overflow-x: auto;
  }
  .pedigree{
    min-width: 720px;
  }
}

/* ===== ABOUT: fix layout (flex), aby sa to NIKDY nerozpadlo ===== */
#about .about-layout{
  display: flex !important;
  gap: 28px !important;
  align-items: flex-start !important;
}

/* ľavý blok */
#about .about-left{
  flex: 0 0 420px !important;   /* pevnejšia šírka */
  min-width: 320px !important;
}

/* pravý blok */
#about .about-right{
  flex: 1 1 auto !important;
  min-width: 0 !important;      /* dôležité: dovolí zmrštenie */
}

/* tabuľka rodokmeňa nech sa môže scrollovať, keď je široká */
#about .pedigree-wrap{
  overflow-x: auto !important;
}

/* na tablete/mobil pod seba */
@media (max-width: 1024px){
  #about .about-layout{
    flex-direction: column !important;
  }
  #about .about-left{
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}