/* =========================================================
   ZÁKLAD
   ========================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

:root{
  /* jednotné zaoblení */
  --r: 12px;
   --stick-offset: 120px;

  /* offset pro kotvy (sticky nav + subnav) */
  --stick-offset: 112px;

  /* tlačítka – jednotné */
  --btn-bg: #8b0000;
  --btn-bg-hover: #a11212;
  --btn-fg: #fff;
  --btn-radius: 999px;
  --btn-shadow: 0 6px 10px rgba(0,0,0,.35);

  /* lightbox pilulky */
  --lb-size: 56px;

  --focus-ring: 2px solid #ffffff;
  --focus-shadow: 0 0 0 4px rgba(155, 0, 0, 0.6);
}
/* ======================
   POD-NAVIGACE (scroll)
   ====================== */

.subnav {
  position: sticky;
  top: 48px;
  z-index: 40;
  margin: 12px auto;
  background: #333;
  border-radius: 999px;
  padding: 8px 4px;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.18);
  display: flex;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;        
  width: fit-content;     
}

/* Flex kontejner pro vodorovné scrollování */
.subnav ul {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Zamezí zalomení */
.subnav li {
  flex: 0 0 auto;
}

/* Styl pilulek */
.subnav a {
  display: inline-block;
  padding: 8px 14px;
  background: #444;
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.subnav a:hover {
  background: #555;
  transform: translateY(-1px);
}

.subnav a.active {
  background: #5a5a5a;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}


.burger-btn {
  display: none;
  font-size: 24px;
  background: transparent;
  border: none;
  color: var(--btn-fg);
  padding: 10px;
  cursor: pointer;
  z-index: 9999;
}


@media (max-width: 700px) {
  .subnav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    overflow-x: unset;
    background: transparent;
    box-shadow: none;
    padding: 16px;
    border-radius: 16px;
    margin: 20px auto;
  }

  .subnav ul {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 8px 12px;
    padding: 0;
    justify-content: center;
    
  }

  .subnav li {
    list-style: none;
    text-align: center;
  }

  .subnav li:last-child {
    grid-column: span 2;
    display: flex;
    justify-content: center;
  }

  .subnav a {
    display: inline-block;
    width: 100%;
    padding: 10px;
    font-weight: bold;
    text-align: center;
  }

  .subnav[hidden] {
    display: none !important;
  }

  .subnav.active {
    display: flex;
  }
}


body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: #e3dfd6;
}

/* pomůcky */
.container {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* nadpisy */
h1, h2 {
  margin: 24px 0 8px;
  text-align: center;
  color: #7a1111;
}
h1 { font-size: clamp(28px, 2.5vw + 12px, 40px); }
h1 { margin-bottom: 20px; }
.divider { margin-top: 18px; }
h2 { font-size: clamp(22px, 1.6vw + 10px, 30px); }

/* úvod pod hlavním H1 */
.portfolio-intro{
  max-width: 860px;
  margin: 0 auto 18px;
  padding: 0 12px;
  text-align: center;
  color: #1a1a1a;
  line-height: 1.55; 
}

/* úvodní texty v sekcích */
.portfolio-section .intro {
  max-width: 860px;
  margin: 0 auto 18px;
  padding: 0 12px;
  text-align: center;
  color: #2b2b2b;
  line-height: 1.55;
}

.divider {
  width: 120px; height: 3px; margin: 14px auto 0;
  background: linear-gradient(90deg,#8b0000,#d04d4d,#8b0000);
  border-radius: 999px;
}

/* mezera nad sekcemi při skoku z kotvy (aby je nepřekrývalo sticky menu) */
.portfolio-section {  scroll-margin-top: var(--stick-offset); }

@media (max-width: 700px) {
  :root {
    --stick-offset: 230px; 
  }
}


/* Štítky „Proces / Výsledek“ v rohu karty */
.tag-wrap{ position: relative; }
.tag {
  position: absolute;
  top: 10px;
  right: 10px;   
  left: auto;    
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .8rem;
  letter-spacing: .2px;
}
#preparace {
  margin-bottom: 60px;
}

/* odkaz „Nahoru“ – společná stylizace */
.btn-top-index,
.btn-top-omne {
  position: fixed;
  right: 22px;
  bottom: 28px;
  padding: 12px 18px;
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: var(--btn-radius);
  z-index: 9999; /* zvýšeno pro jistotu */
  box-shadow: var(--btn-shadow);
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.2s ease;
}

/* když je aktivní */
.btn-top-index.show,
.btn-top-omne.show {
  opacity: 1;
  pointer-events: auto;
}

/* hover efekt */
.btn-top-index:hover,
.btn-top-omne:hover {
  background-color: var(--btn-bg-hover);
  transform: translateY(-2px);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: #9b0000;
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  z-index: 10000;
  transition: top .2s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 12px;
  left: 12px;
  outline: 3px solid #fff;
  box-shadow: 0 0 6px rgba(0,0,0,.6);
}

/* =========================================================
   HLAVNÍ MENU
   ========================================================= */
nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(51,51,51,.9);
  backdrop-filter: saturate(120%) blur(6px);
}
nav ul {
  margin: 0; padding: 0; list-style: none;
  display: flex; gap: 14px; align-items: center;
  justify-content: center;
}
nav li { display: flex; align-items: center; padding: 0 6px; }
nav:not(.subnav) li::before {
  content:""; inline-size:6px; block-size:6px;
  background:#8b0000; border-radius:50%; margin-right:10px;
}

/* pilulky v top navigaci */
nav:not(.subnav) a{
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  background: transparent;
  transition: background .2s ease, box-shadow .2s ease, transform .1s ease;
}
nav:not(.subnav) a:hover,
nav:not(.subnav) a:focus{
  background: #555;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0,0,0,.25);
  outline: none;
}
nav:not(.subnav) a[aria-current="page"]{
  background: #4b4b4b;
  box-shadow: 0 6px 12px rgba(0,0,0,.25);
}

/* =========================================================
   BUTTONS – jednotný vzhled
   ========================================================= */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  padding:10px 20px;
  border:none; outline: none;
  border-radius: var(--btn-radius);
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 700; text-decoration: none;
  box-shadow: var(--btn-shadow);
  transition: background .2s, transform .05s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.btn:hover{ background: var(--btn-bg-hover); }
.btn:active{ transform: translateY(1px); }
.btn:focus-visible{
  outline: 2px solid #fff; outline-offset: 2px;
}

.btn--ghost{
  background: #444; color: #fff;
  box-shadow: 0 6px 10px rgba(0,0,0,.25);
}
.btn--ghost:hover{ background:#555; }

/* =========================================================
   GALERIE – společné
   ========================================================= */
.gallery{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;                               
  margin: 18px auto 4px;
  max-width: 1100px;
  padding-inline: 16px;
}

/* Figure karty (fotky, kresby) */
.gallery figure{
  margin: 0; background:#fff; border-radius: var(--r);
  box-shadow: 0 4px 14px rgba(0,0,0,.08);  
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.gallery figure:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,.12);
}
.gallery figure img{
  display:block; width:100%; height:220px; object-fit:cover;
  border-radius: 0; 
}
.gallery figcaption{
  padding:10px 12px; font-size:.95rem; color:#1a1a1a; 
  text-align:center;
}

/* Pixelart jako <a> karta */
.gallery a.gallery-item{
  display:block; background:#fff; border-radius: var(--r);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  overflow:hidden; text-decoration:none;
  transition: transform .15s, box-shadow .15s;
}
.gallery a.gallery-item:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}
.gallery a.gallery-item img{
  display:block; width:100%; height:150px;      
  padding: 10px 0;                               
  object-fit: contain; object-position: center;
  image-rendering: pixelated; image-rendering: crisp-edges;
  background:#fff;
}
.gallery a.gallery-item span{
  display:block; padding:8px 12px; font-size:.95rem; color:#383838; text-align:center;
}
.gallery img.top-crop { object-position: top; }
.with-bg {
  background-color: #e0e0e0;
  padding: 10px; 
  display: inline-block;
}
.lightbox__img.has-bg {
  background-color: #e0e0e0;
}

/* Pixelart – mobilní úpravy */
#pixel .gallery a.gallery-item span { padding: 8px 12px; }

@media (max-width: 520px){
  .gallery figure img{ height: 190px; }
  .gallery a.gallery-item img{ height: 140px; padding: 8px 0; }
}

/* drobná mezera pod gridy v sekcích */
#foto .gallery, #pixel .gallery, #kresby .gallery { margin-bottom: 8px; }

/* =========================================================
   LIGHTBOX – layout a ovládání
   ========================================================= */
.lightbox { position: fixed; inset: 0; display: none; z-index: 1000; }
.lightbox:target { display: grid; place-items: center; }

/* tmavší overlay, aby fotka víc vystoupila */
.lightbox__bg { position: absolute; inset: 0; background: rgba(0,0,0,.78); }

.lightbox__content{
  position: relative; z-index: 1;
  max-width: min(92vw, 960px);
  max-height: 92vh;
  display: flex; flex-direction: column; align-items: center;
}

.lightbox__img{
  display:block; margin:0 auto;
  max-width:100%;
  max-height: calc(92vh - 64px);
  object-fit: contain;
  border-radius: var(--r);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.lightbox__caption{
  margin-top: 8px; padding: 8px 12px;
  font-size: .95rem; line-height: 1.35;
  color: #fff; background: rgba(0,0,0,.58);
  border-radius: 10px; backdrop-filter: blur(2px);
  text-align: center;
}

/* Ovládací prvky (pilulky) */
.lightbox__close,
.lightbox__prev,
.lightbox__next{
  position: fixed;               
  z-index: 1002;                 
  display:flex; align-items:center; justify-content:center;
  width: var(--lb-size); height: var(--lb-size);
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  color:#fff; text-decoration:none; line-height:1;
  font-size: 28px; font-weight: 700;             
  box-shadow: 0 8px 16px rgba(0,0,0,.35);
  transition: background .15s ease, transform .15s ease;
}
.lightbox__prev{ left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__next{ right:16px; top: 50%; transform: translateY(-50%); }
.lightbox__close{ left:16px; top: 16px; }


.lightbox__close:hover,
.lightbox__close:focus-visible{
  background: rgba(0,0,0,.72);
  transform: scale(1.06);
  outline: none;
}
.lightbox__prev:hover,
.lightbox__prev:focus-visible{
  background: rgba(0,0,0,.72);
  transform: translateY(-50%) scale(1.06);
  outline: none;
}
.lightbox__next:hover,
.lightbox__next:focus-visible{
  background: rgba(0,0,0,.72);
  transform: translateY(-50%) scale(1.06);
  outline: none;
}
.lb-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  z-index: 5;
  cursor: pointer;
}
.lb-hit--left {
  left: 0;
}
.lb-hit--right {
  right: 0;
}

/* Pozadí jen pro lightbox obrázky v sekci Grafický design */
#graficky-design .lightbox__content {
  background: #2a2a2a;
  padding: 12px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

@media (max-width: 540px){
  :root{ --lb-size: 46px; }
  .lightbox__prev{ left: 12px; }
  .lightbox__next{ right:12px; }
  .lightbox__close{ left:12px; top:12px; }
  .lightbox__img{ max-height: calc(92vh - 80px); }
  .lightbox__caption{ font-size:.9rem; padding:6px 10px; }
}

/* =========================================================
   STRÁNKA „O mně“ + KONTAKT
   ========================================================= */
.o-mne{ max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.o-mne h1{ margin-top: 28px; }

.o-mne-container{
  display: grid; gap: 28px;
  grid-template-columns: 1.4fr .9fr; align-items: center;
}
.o-mne-text p{ margin: 0 0 14px; }
.o-mne-foto img{
  display:block; width: 100%; max-width: 320px; height:auto;
  border-radius: var(--r); margin-inline: auto;
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
@media (max-width: 700px) {
  .o-mne-container {
    grid-template-columns: 1fr;
    align-items: start;   /* vrátí zarovnání nahoru na mobilech */
    text-align: center;
  }

  .o-mne-foto {
    text-align: center;
  }
}

/* červené odkazy i v textu sekce "O mně" a jinde */
.o-mne a,
.portfolio-intro a,
.portfolio-section .intro a {
  color: #8b0000;              
  text-decoration: none;       
  font-weight: 500;
}

.o-mne a:hover,
.portfolio-intro a:hover,
.portfolio-section .intro a:hover {
  text-decoration: underline;  
  color: #a11212;              
}

/* kontakt – řádek s e-mailem apod. */
.kontakt-info{
  max-width: 1100px; margin: 20px auto; padding: 0 16px;
  font-size: 16px; color: #222; text-align: center;
}
.kontakt-info a{
  color:#8b0000; text-decoration:none; display:inline-block; margin: 6px 0;
}
.kontakt-info a:hover{ text-decoration:underline; }

/* jednoduchý kontaktní formulář */
.kontakt-formular{
  max-width: 660px; margin: 12px auto 32px;
  display: grid; gap: 14px; grid-template-columns: 1fr; 
  padding-inline: 16px;
}
.kontakt-formular label{ font-weight: 700; }
.kontakt-formular input,
.kontakt-formular textarea{
  width: 100%; padding: 10px 12px;
  border: 1px solid #d5d5d5; border-radius: 8px;
  font: inherit; background:#fff;
}
.kontakt-formular textarea{ min-height: 110px; resize: vertical; }
.kontakt-formular button{
  justify-self: start;
  padding: 10px 20px; border-radius: 24px; font-weight: 700;
  background:#8b0000; color:#fff; cursor: pointer;
  transition: background .2s, transform .05s;
}
@media (max-width: 700px) {
  .kontakt-formular button {
    display: block;
    margin: 20px auto 0 auto;
  }
}

.kontakt-formular button:hover{ background:#a11212; }
.kontakt-formular button:active{ transform: translateY(1px); }


/* =========================================================
   FOOTER (desktop a obecné styly)
   ========================================================= */
.site-footer {
  background: rgba(51,51,51,.9);
  backdrop-filter: saturate(120%) blur(6px);
}
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: #e34747; }

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px;
  display: grid;
  align-items: center;
  gap: 24px;
  grid-template-columns: 1fr 24px 1fr;
}

.footer-left {
  display: flex;
  justify-content: center;
}

.footer-logo {
  width: min(150px, 34vw);
  height: auto;
  display: block;
}

.footer-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-divider span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9b0000;
  display: block;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  column-gap: 0;
}

.footer-row .row-left {
  justify-self: end;
  color: #f0f0f0;
}
.footer-row .row-right {
  justify-self: start;
  color: #f0f0f0;
}

.footer-row a {
  color: #f0f0f0;
  text-decoration: none;
  font-weight: 600;
}
.footer-row a:hover {
  color: #fff;
}


.footer-row .row-sep {
  display: inline-block;
  background: #9b0000;
  width: 1px;
  height: 1em;
  margin: 0 10px;
  vertical-align: middle;
  content: "";
}

/* =========================================================
   MOBILE STYLY
   ========================================================= */
@media (max-width: 900px) {
  .site-footer {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .footer-inner {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 16px;
    padding-bottom: 60px;
  }

  .footer-left,
  .footer-right {
    width: 100%;
    text-align: center;
  }

  .footer-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

  .footer-row .row-left,
  .footer-row .row-right {
    display: block;
  }

  .footer-divider {
    display: flex !important;
    justify-content: center;
    flex-direction: row !important;
    gap: 6px;
    margin: 12px 0;
  }

  .footer-divider span {
    display: inline-block !important;
  }

  .footer-row .row-sep {
    background: none;
    width: auto;
    height: auto;
    margin: 0 10px;
    display: none !important;
    vertical-align: baseline;
  }

}


/* =========================================================
   PŘÍSTUPNOST – focus ring
   ========================================================= */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
nav a:focus-visible,
.subnav a:focus-visible,
.footer-row a:focus-visible,
.gallery .thumb:focus-visible,
.lightbox__close:focus-visible,
.lightbox__nav:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
  box-shadow: var(--focus-shadow);
  border-radius: 12px;
}

@media (prefers-reduced-motion: reduce){
  a:focus-visible,
  button:focus-visible,
  .btn:focus-visible,
  .footer-row a:focus-visible,
  .gallery .thumb:focus-visible,
  .lightbox__close:focus-visible,
  .lightbox__nav:focus-visible {
    box-shadow: 0 0 0 3px rgba(155,0,0,0.6);
  }
}
