/*
Theme Name:  Studio Oktagram
Theme URI:   https://studio-oktagram.cz
Author:      Studio Oktagram
Description: Portfolio téma pro architektonické studio Oktagram
Version:     1.0.0
Text Domain: studio-oktagram
*/

/* ═══════════════════════════════════════════════════════════
   ZÁKLAD
   ═══════════════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --black: #1d1d1b;
  --white: #ffffff;
  --grey:  #f4f4f2;
  --mid:   #9a9a98;
  --font:  'Plus Jakarta Sans', Arial, sans-serif;
  --nav-h: 64px;
  --gap:   4px;
  --pad:   64px;
  --max:   1400px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  overflow-x: hidden;
}

a    { text-decoration: none; color: inherit; }
img  { display: block; max-width: 100%; }
ul   { list-style: none; }

/* ═══════════════════════════════════════════════════════════
   NAVIGACE
   ═══════════════════════════════════════════════════════════ */
#main-nav {
  --nc:           var(--white);
  --nc-mid:       rgba(255,255,255,0.65);
  --nc-dim:       rgba(255,255,255,0.45);
  --nb:           transparent;
  --nborder:      rgba(255,255,255,0.12);
  --nlang-border: rgba(255,255,255,0.22);

  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h); z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad);
  background: var(--nb);
  border-bottom: 1px solid var(--nborder);
  transition: background .4s ease, border-color .4s ease;
}

#main-nav.scrolled {
  --nc:           var(--black);
  --nc-mid:       rgba(29,29,27,.55);
  --nc-dim:       rgba(29,29,27,.35);
  --nb:           var(--white);
  --nborder:      rgba(29,29,27,.08);
  --nlang-border: rgba(29,29,27,.15);
  background: var(--nb);
  border-color: var(--nborder);
}

/* Nav skrytá při intro animaci – zobrazena JS po jejím skončení */
.home #main-nav { opacity: 0; }
.home #main-nav.visible { opacity: 1; transition: opacity .5s ease; }

#nav-logo { display: flex; align-items: center; gap: 14px; }
#nav-logo-svg { width: 30px; height: 30px; fill: var(--nc); transition: fill .4s; }
#nav-logo-text {
  font-weight: 700; font-size: 13px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--nc); transition: color .4s;
}

#nav-right { display: flex; align-items: center; gap: 40px; }
#nav-right li a {
  font-size: 11px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--nc-mid); transition: color .4s;
}
#nav-right li a:hover,
#nav-right li.current-menu-item a,
#nav-right li.current_page_item a { color: var(--nc); }

.nav-lang {
  display: flex; align-items: center; gap: 8px;
  padding-left: 32px; border-left: 1px solid var(--nlang-border);
  transition: border-color .4s;
}
.nav-lang a {
  font-size: 11px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--nc-dim); transition: color .4s;
}
.nav-lang a.active { color: var(--nc); }
.nav-lang span { color: var(--nc-dim); font-size: 10px; transition: color .4s; }

/* ── "O" kontaktní odkaz v nav – stejný styl jako ostatní položky ── */
a.nav-o {
  font-size: 11px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--nc-mid);
  transition: color .4s;
}
a.nav-o:hover { color: var(--nc); }

/* ═══════════════════════════════════════════════════════════
   INTRO ANIMACE  (pouze úvodní stránka)
   ═══════════════════════════════════════════════════════════ */
#intro {
  position: fixed; inset: 0;
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  pointer-events: none;
}

#logo-wrap {
  display: flex; flex-direction: column; align-items: center;
  opacity: 0;
}

#logo-svg { width: 480px; height: 480px; overflow: visible; }

.tri-tumble { fill: var(--black); }

#logo-text { margin-top: 52px; text-align: center; opacity: 0; line-height: 1; user-select: none; }
#text-oktagram {
  font-family: var(--font); font-weight: 700; font-size: 66px;
  letter-spacing: .15em; color: var(--black); text-transform: uppercase;
}
#text-studio {
  font-family: var(--font); font-weight: 600; font-size: 29px;
  letter-spacing: .15em; color: var(--black); text-transform: uppercase;
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════
   HERO SEKCE – úvodní stránka
   ═══════════════════════════════════════════════════════════ */
#hero-bg {
  position: fixed; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
}

#page-content {
  position: relative; z-index: 1;
  /* opacity řídí intro overlay (z-index 100) – content je vždy plně viditelný */
}

#hero-section {
  height: 100vh; position: relative;
  display: flex; align-items: flex-end;
  padding: 0 var(--pad) 56px;
  background-size: cover;
  background-position: center;
  color: var(--white);
}
/* Gradient overlay přes hero foto – odděleno od background-image, aby nedošlo ke konfliktu */
#hero-section::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,.08) 50%, transparent 100%);
  z-index: 0;
}
#hero-section > * { position: relative; z-index: 1; }

.hero-title { font-size: clamp(44px, 6vw, 84px); font-weight: 300; letter-spacing: .02em; line-height: 1.0; }
.hero-sub   { margin-top: 12px; font-size: 12px; font-weight: 400; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.5); }

.hero-cta {
  display: inline-block; margin-top: 28px;
  padding: 13px 28px;
  border: 1px solid rgba(255,255,255,.55);
  font-size: 10px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--white);
  transition: background .25s ease, border-color .25s ease;
}
.hero-cta:hover {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.85);
}

/* ═══════════════════════════════════════════════════════════
   PORTFOLIO GRID
   ═══════════════════════════════════════════════════════════ */
#portfolio {
  background: var(--white);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  padding: var(--gap);
}

.tile {
  display: block; position: relative;
  overflow: hidden; background: var(--grey);
  aspect-ratio: 1/1;
  cursor: pointer;
}

.tile-img { width: 100%; height: 100%; overflow: hidden; }
.tile-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s cubic-bezier(.25, 0, .25, 1);
}
.tile:hover .tile-img img { transform: scale(1.05); }

.tile-info {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 32px 28px;
  background: linear-gradient(to top, rgba(0,0,0,.65) 0%, rgba(0,0,0,.1) 50%, transparent 100%);
  opacity: 0; transition: opacity .4s ease;
  color: var(--white);
}
.tile:hover .tile-info { opacity: 1; }

.tile-cat  { font-size: 9px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: rgba(255,255,255,.7); margin-bottom: 8px; transform: translateY(8px); transition: transform .4s ease; }
.tile-title{ font-size: 20px; font-weight: 300; letter-spacing: .01em; transform: translateY(8px); transition: transform .4s ease .05s; }
.tile-year { font-size: 10px; font-weight: 400; letter-spacing: .18em; color: rgba(255,255,255,.55); margin-top: 6px; transform: translateY(8px); transition: transform .4s ease .1s; }
.tile:hover .tile-cat,
.tile:hover .tile-title,
.tile:hover .tile-year { transform: translateY(0); }

/* ═══════════════════════════════════════════════════════════
   HERO SEKCE – projekt detail
   ═══════════════════════════════════════════════════════════ */
#project-hero {
  position: relative; width: 100%; height: 100vh;
  overflow: hidden; background: #111;
  background-size: cover; background-position: center;
}
/* zachovat zpětnou kompatibilitu s případným <img> uvnitř */
#project-hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
#project-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,.08) 55%, transparent 100%);
  z-index: 1;
}
#hero-caption {
  position: absolute; bottom: 56px; left: var(--pad);
  z-index: 2; color: var(--white);
}
#hero-caption .tag {
  display: inline-block; font-size: 10px; font-weight: 500;
  letter-spacing: .28em; text-transform: uppercase;
  color: rgba(255,255,255,.6); margin-bottom: 14px;
}
#hero-caption h1 {
  font-size: clamp(34px, 4.5vw, 62px); font-weight: 300;
  letter-spacing: .02em; line-height: 1.05;
}
#hero-caption .loc {
  margin-top: 10px; font-size: 12px; font-weight: 400;
  letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255,255,255,.45);
}
#scroll-cue {
  position: absolute; bottom: 56px; right: var(--pad); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 9px; letter-spacing: .25em; text-transform: uppercase;
  color: rgba(255,255,255,.35);
  animation: cue 2s ease-in-out infinite;
}
#scroll-cue::after {
  content: ''; display: block; width: 1px; height: 44px;
  background: rgba(255,255,255,.25);
}
@keyframes cue { 0%,100%{transform:translateY(0)} 50%{transform:translateY(6px)} }

/* ═══════════════════════════════════════════════════════════
   PROJEKT – záhlaví s metadaty
   ═══════════════════════════════════════════════════════════ */
#project-header {
  max-width: var(--max); margin: 0 auto;
  padding: 88px var(--pad) 72px;
  display: grid; grid-template-columns: 1fr 300px;
  gap: 80px; align-items: start;
}
.ph-intro p {
  font-size: 18px; font-weight: 300;
  line-height: 1.75; max-width: 600px;
}
.ph-meta { padding-top: 4px; border-top: 1px solid rgba(29,29,27,.1); }
.ph-meta dl { display: grid; grid-template-columns: auto 1fr; gap: 18px 20px; }
.ph-meta dt {
  font-size: 10px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--mid); padding-top: 1px;
}
.ph-meta dd { font-size: 14px; font-weight: 400; line-height: 1.4; }

/* ═══════════════════════════════════════════════════════════
   PROJEKT – obsah
   ═══════════════════════════════════════════════════════════ */
.img-fw { width: 100%; overflow: hidden; aspect-ratio: 16/9; }
.img-fw img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 6s ease;
}
.img-fw:hover img { transform: scale(1.015); }
.gap-top { margin-top: var(--gap); }

.text-block {
  max-width: var(--max); margin: 0 auto;
  padding: 64px var(--pad);
}
.text-block p {
  font-size: 15px; font-weight: 300; line-height: 1.85;
  color: rgba(29,29,27,.75); margin-bottom: 20px; max-width: 780px;
}
.text-block p:last-child { margin-bottom: 0; }

.section-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--mid); margin-bottom: 36px;
}

/* WordPress editor content */
.projekt-content {
  max-width: var(--max); margin: 0 auto; padding: 64px var(--pad);
}
.projekt-content p {
  font-size: 15px; font-weight: 300; line-height: 1.85;
  color: rgba(29,29,27,.75); margin-bottom: 20px; max-width: 780px;
}
.projekt-content h2 {
  font-size: 22px; font-weight: 400; margin: 48px 0 20px;
}
.projekt-content h3 {
  font-size: 10px; font-weight: 600;
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--mid); margin: 40px 0 20px;
}
.projekt-content ul {
  list-style: disc; padding-left: 20px;
  font-size: 14px; font-weight: 300; line-height: 2;
  color: rgba(29,29,27,.7); margin-bottom: 20px;
}
.projekt-content figure { margin: 0 0 var(--gap); }
.projekt-content figure img { width: 100%; height: auto; }
.projekt-content .wp-block-image { margin: var(--gap) 0; }
.projekt-content .wp-block-columns {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--gap); margin: var(--gap) 0;
}
.projekt-content .wp-block-column {}

/* ═══════════════════════════════════════════════════════════
   PARALLAX SEKCE
   ═══════════════════════════════════════════════════════════ */
.parallax-section {
  position: relative; overflow: hidden;
  padding: 50px 0; background: #f0ede8;
}
.parallax-wrap { width: 100%; will-change: transform; }
.parallax-wrap img { display: block; width: 100%; height: auto; }

.parallax-card {
  position: absolute; z-index: 2;
  bottom: 70px; right: var(--pad);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  padding: 28px 32px; max-width: 320px;
}
.parallax-card h3 {
  font-size: 10px; font-weight: 600;
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--mid); margin-bottom: 10px;
}
.parallax-card p {
  font-size: 13px; font-weight: 300; line-height: 1.65;
}
.parallax-card-left { left: var(--pad); right: auto; }

/* ═══════════════════════════════════════════════════════════
   MZI DIAGRAMY
   ═══════════════════════════════════════════════════════════ */
.mzi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.mzi-item { background: var(--grey); }
.mzi-item img { width: 100%; height: auto; padding: 24px; }
.mzi-item-full { background: var(--grey); }
.mzi-item-full img { width: 100%; height: auto; max-width: 960px; margin: 0 auto; padding: 32px; }

.mzi-captions {
  max-width: var(--max); margin: 0 auto; padding: 40px var(--pad);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px;
}
.mzi-cap-item .cap-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--mid); margin-bottom: 10px; display: block;
}
.mzi-cap-item p {
  font-size: 13px; font-weight: 300; line-height: 1.75;
  color: rgba(29,29,27,.65);
}
.mzi-legend { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad) 56px; }
.mzi-legend p {
  font-size: 12px; font-weight: 400;
  letter-spacing: .05em; color: var(--mid); line-height: 2;
}

/* ═══════════════════════════════════════════════════════════
   PROJEKT NAVIGACE (prev/next)
   ═══════════════════════════════════════════════════════════ */
#project-nav {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 24px;
  padding: 64px var(--pad);
  border-top: 1px solid rgba(29,29,27,.08);
  max-width: var(--max); margin: 0 auto;
}
.pnav-link { display: flex; flex-direction: column; gap: 8px; }
.pnav-link .pnav-lbl {
  font-size: 10px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--mid);
}
.pnav-link .pnav-title {
  font-size: 17px; font-weight: 300;
  transition: opacity .2s;
}
.pnav-link:hover .pnav-title { opacity: .45; }
.pnav-link.right { text-align: right; }
#project-nav .all-link {
  font-size: 10px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--mid); transition: color .2s; text-align: center;
}
#project-nav .all-link:hover { color: var(--black); }

/* ═══════════════════════════════════════════════════════════
   ARCHIVE – seznam projektů
   ═══════════════════════════════════════════════════════════ */
.archive-header {
  padding: calc(var(--nav-h) + 56px) var(--pad) 48px;
  max-width: var(--max); margin: 0 auto;
  border-bottom: 1px solid rgba(29,29,27,.08);
}
.archive-header h1 {
  font-size: clamp(28px, 4vw, 48px); font-weight: 300; letter-spacing: .02em;
}

/* ═══════════════════════════════════════════════════════════
   GENERICKÁ STRÁNKA (O studiu, Kontakt)
   ═══════════════════════════════════════════════════════════ */
.page-wrap {
  max-width: 800px; margin: 0 auto;
  padding: calc(var(--nav-h) + 80px) var(--pad) 80px;
}
.page-wrap h1 {
  font-size: clamp(28px, 4vw, 48px); font-weight: 300;
  letter-spacing: .02em; margin-bottom: 40px;
}
.page-wrap .page-content p {
  font-size: 16px; font-weight: 300; line-height: 1.85;
  color: rgba(29,29,27,.75); margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════
   PATIČKA
   ═══════════════════════════════════════════════════════════ */
#main-footer {
  padding: 40px var(--pad);
  border-top: 1px solid rgba(29,29,27,.08);
  display: flex; align-items: center; justify-content: space-between;
}
.ft-logo { display: flex; align-items: center; gap: 12px; opacity: .35; }
.ft-logo svg { width: 20px; height: 20px; fill: currentColor; }
.ft-logo span { font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }
.ft-copy { font-size: 10px; letter-spacing: .1em; color: var(--mid); }
.ft-contact a { font-size: 11px; font-weight: 500; letter-spacing: .1em; opacity: .45; transition: opacity .2s; }
.ft-contact a:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   RESPONZIVITA
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  #portfolio { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  :root { --pad: 40px; }
  #project-header { grid-template-columns: 1fr; gap: 48px; }
  .mzi-captions { grid-template-columns: 1fr; gap: 24px; }
  .projekt-content .wp-block-columns { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  :root { --pad: 24px; }
  #portfolio { grid-template-columns: 1fr; }
  #logo-svg  { width: 280px; height: 280px; }
  #text-oktagram { font-size: 38px; }
  #text-studio   { font-size: 17px; }
  .mzi-grid { grid-template-columns: 1fr; }
  #project-nav { grid-template-columns: 1fr 1fr; }
  #project-nav .all-link { display: none; }
  .pnav-link.right { grid-column: 2; }
  #main-footer { flex-direction: column; gap: 16px; text-align: center; }
  #main-nav { padding: 0 var(--pad); }
  #nav-right { gap: 20px; }
}
