@font-face {
  font-family: 'Playfair Display';
  src: url('../fonts/PlayfairDisplay-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Playfair Display';
  src: url('../fonts/PlayfairDisplay-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Playfair Display';
  src: url('../fonts/PlayfairDisplay-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/DMSans-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/DMSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --color-bg: #faf9f7;
  --color-text: #111110;
  --color-muted: #7a7870;
  --color-border: #e4e2dc;
  --sidebar-width: 200px;
  --transition: 0.2s ease;
}

html, body {
  height: 100%;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 300;
  display: flex;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* ── SIDEBAR ── */

.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 2.8rem 2rem;
  border-right: 1px solid var(--color-border);
  background: var(--color-bg);
  z-index: 50;
}

.sidebar-logo {
  margin-bottom: 3rem;
}

.sidebar-logo a {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.3;
  display: block;
}

.sidebar-logo span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 300;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-top: 4px;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sidebar-nav a {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--color-muted);
  transition: color var(--transition);
  display: block;
  padding: 2px 0;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--color-text);
}

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-contact {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
}

.sidebar-contact a,
.sidebar-contact span {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  transition: color var(--transition);
}

.sidebar-contact a:hover {
  color: var(--color-text);
}

.sidebar-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
}

.sidebar-socials a {
  font-size: 0.70rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  transition: color var(--transition);
}

.sidebar-socials a:hover {
  color: var(--color-text);
}

.sidebar-copy {
  margin-top: 1.2rem;
  font-size: 0.68rem;
  color: var(--color-muted);
  letter-spacing: 0.04em;
}

/* ── MAIN CONTENT ── */

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  padding: 2.8rem 2.5rem;
}

/* ── POČETNA ── */

.home-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 3rem;
}

.home-photo {
  width: fit-content;
}

.home-photo img {
  width: auto;
  max-width: 380px;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

.home-photo-placeholder {
  display: none;
  width: 320px;
  height: 320px;
  background: var(--color-border);
}

@media (max-width: 860px) {
  .home-photo {
    width: 80%;
  }

  .home-photo img {
    width: 100%;
    max-width: 100%;
    max-height: none;
  }

  .home-photo-placeholder {
    width: 100%;
    height: 60vw;
  }
}

.home-text p {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 400;
  font-style: italic;
  color: var(--color-muted);
  line-height: 1.7;
}

.home-hint {
  display: none;
  margin-top: 0.8rem;
  font-size: 0.68rem;
  font-style: italic;
  letter-spacing: 0.06em;
  color: var(--color-border);
}

@media (max-width: 860px) {
  .home-hint {
    display: block;
  }
}

/* ── GALLERY ── */

.gallery-header {
  margin-bottom: 2rem;
}

.gallery-header h1 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  font-style: italic;
  color: var(--color-muted);
  letter-spacing: 0.01em;
}

.gallery-grid {
  columns: 3;
  column-gap: 6px;
  max-width: 1240px;
  padding-bottom: 2rem;
}

@media (max-width: 1100px) {
  .gallery-grid {
    max-width: 100%;
    columns: 2;
  }
}


.gallery-item {
  break-inside: avoid;
  margin-bottom: 6px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.gallery-item img {
  width: 100%;
  display: block;
  transition: opacity 0.3s ease;
}

.gallery-item:hover img {
  opacity: 0.88;
}

.gallery-item .item-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 0.6rem 0.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.35));
  opacity: 0;
  transition: opacity var(--transition);
}

.gallery-item:hover .item-meta {
  opacity: 1;
}

.gallery-item .item-meta span {
  display: block;
  color: rgba(255,255,255,0.8);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── FADE IN ── */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gallery-grid .gallery-item {
  animation: fadeIn 0.35s ease forwards;
  opacity: 0;
}

/* ── EMPTY STATE ── */

.gallery-empty {
  padding: 4rem 0;
}

.gallery-empty p {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--color-border);
}

/* ── LIGHTBOX ── */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 6, 0.96);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lightbox-img {
  max-width: 88vw;
  max-height: 92vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 1.2rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color var(--transition);
  padding: 4px;
  line-height: 1;
}

.lightbox-close:hover { color: rgba(255,255,255,0.9); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 1.5rem;
  transition: color var(--transition);
  line-height: 1;
}

.lightbox-nav:hover { color: rgba(255,255,255,0.8); }
.lightbox-prev { left: 0.5rem; }
.lightbox-next { right: 0.5rem; }

.lightbox-caption {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.lightbox-caption span {
  color: rgba(255,255,255,0.3);
  font-size: 0.70rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── O MENI ── */

.about-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  align-items: start;
  padding-bottom: 4rem;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}

.about-photo-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--color-border);
}

.about-text h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 1.5rem;
  color: var(--color-muted);
}

.about-text p {
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--color-text);
  margin-bottom: 1.2rem;
}

.about-contact {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.about-contact h3 {
  font-size: 0.70rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 1rem;
  font-weight: 400;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-links a {
  font-size: 0.78rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: color var(--transition);
}

.contact-links a:hover { color: var(--color-muted); }

.contact-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  min-width: 56px;
}

/* ── PROJEKTI ── */

.projects-list {
  padding-bottom: 4rem;
}

.project-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 3rem;
  border-bottom: 1px solid var(--color-border);
  padding: 2.5rem 0;
  align-items: start;
}

.project-number {
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.8rem;
}

.project-info h2 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.3;
  margin-bottom: 0.8rem;
}

.project-info p {
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--color-muted);
}

.project-year {
  display: block;
  margin-top: 1rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.project-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.project-images img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  cursor: pointer;
  transition: opacity var(--transition);
}

.project-images img:hover { opacity: 0.85; }

.project-images.single img {
  grid-column: 1 / -1;
  aspect-ratio: 16/9;
}

/* ── MOBILE ── */

.mobile-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.2rem;
}

.mobile-logo {
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.mobile-burger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
}

.mobile-burger span {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--color-text);
}

@media (max-width: 860px) {
  body { display: block; }

  .mobile-bar { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 220px;
    top: 52px;
  }

  .sidebar.open { transform: translateX(0); }

  .main-content {
    margin-left: 0;
    padding: 1.5rem 1.2rem;
    padding-top: calc(52px + 1.5rem);
  }

  .gallery-grid { columns: 2; }

  .about-wrap {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .project-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid { columns: 1; }
}

/* ── FRAGMENTI ── */

.fragmenti-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.fragmenti-stage {
  flex: 1;
  display: flex;
  align-items: flex-start;
  padding: 2.8rem 2.5rem 40px;
  position: relative;
  overflow-y: auto;
}

.fragmenti-inner {
  max-width: 800px;
  width: 100%;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.fragmenti-inner.fade-out {
  opacity: 0;
  transform: translateY(10px);
}

.frag-photo {
  margin-bottom: 28px;
}

.frag-photo img {
  max-width: min(720px, 100%);
  max-height: 540px;
  width: 100%;
  object-fit: contain;
  display: block;
}

.frag-body {
  font-family: var(--font-display);
  font-size: 1.47rem;
  line-height: 1.7;
  color: var(--color-text);
  font-weight: 400;
  margin: 0 0 20px 0;
}

.frag-body em {
  font-style: italic;
  color: #4a4840;
}

.frag-meta {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--color-muted);
  letter-spacing: 0.06em;
  display: flex;
  gap: 20px;
}

.frag-meta span::before {
  content: '— ';
}

.frag-controls {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.frag-counter {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--color-muted);
  letter-spacing: 0.05em;
}

.frag-nav {
  display: flex;
  gap: 4px;
}

.frag-nav button {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), color var(--transition);
  font-family: var(--font-body);
}

.frag-nav button:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.frag-nav button:disabled {
  opacity: 0.2;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 860px) {
  .fragmenti-stage {
    padding: 32px 24px 40px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .fragmenti-inner {
    max-width: 100%;
  }

  .frag-body {
    font-size: 1.25rem;
  }

  .frag-photo img {
    width: 100%;
    max-width: 100%;
    max-height: none;
  }
}

.frag-hint {
  margin-top: 24px;
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: #b0aea8;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

/* ── MOBILE FOOTER ── */
.mobile-footer {
  display: none !important;
}

@media (max-width: 860px) {
  .mobile-footer {
    display: block !important;
    text-align: center;
    padding: 24px 20px;
    font-family: 'DM Sans', sans-serif;
    font-size: 9px;
    color: #7a7870;
  }
}
