@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,500&family=Inter:wght@400;500&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,500&family=Cormorant:ital,wght@0,400;0,500;0,600;1,500&family=Public+Sans:wght@400;500&family=Work+Sans:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Alex+Brush&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,500&family=Libre+Caslon+Display&family=Bodoni+Moda:ital,wght@0,400;0,500;0,600;1,500&family=Source+Sans+3:wght@400;500&family=Karla:wght@400;500&family=IBM+Plex+Sans:wght@400;500&display=swap');

:root {
  --ink: #17140F;
  --ink-text: #ECE7DC;
  --ink-text-muted: #9C978A;
  --paper: #FFFFFF;
  --paper-alt: #F6F5F3;
  --text: #201D17;
  --text-muted: #8B8577;
  --rule: #D6CFBC;
  --serif: 'Fraunces', serif;
  --sans: 'Inter', -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; }

/* Scroll-triggered entrance reveal — shared by the "O Domnu" block and
   headings/body text site-wide. The photo grid's own fade-in (.photo-card,
   further down) is a separate, older mechanism and is left untouched. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.12s; }
.reveal-delay-2 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .lightbox-info, .reveal-word, .photo-card {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Header */
.site-header {
  background: var(--ink);
  color: var(--ink-text);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header .brand img {
  height: 36px;
  width: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.site-header .brand span {
  font-family: var(--serif);
  font-size: 19px;
  color: #fff;
}

.site-header nav {
  display: flex;
  gap: 30px;
  font-size: 14px;
}

.site-header nav a {
  color: var(--ink-text-muted);
  transition: color 0.2s;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}

.site-header nav a:hover,
.site-header nav a.active {
  color: #fff;
  border-bottom-color: var(--ink-text-muted);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 66vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #222;
}

.hero-slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hero-slide.active { opacity: 1; }

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(0,0,0,0.72), rgba(0,0,0,0.05) 55%);
}

.hero-ticks {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 6px;
  z-index: 2;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.5) 0 3px, transparent 3px 14px);
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 48px;
  color: #fff;
  text-align: center;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.hero-arrow:hover { background: rgba(0,0,0,0.55); }

.hero-arrow-prev { left: 16px; }
.hero-arrow-next { right: 16px; }

.hero-dots {
  position: absolute;
  left: 0; right: 0;
  bottom: 20px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.15);
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.hero-dot:hover { background: rgba(255,255,255,0.4); }

.hero-dot.active {
  background: #fff;
  transform: scale(1.25);
}

.hero-content h1 {
  font-family: 'Alex Brush', cursive;
  font-weight: 400;
  font-size: 82px;
  margin-bottom: 6px;
  -webkit-text-stroke: 1.5px #000;
  paint-order: stroke fill;
}
.hero-content p { font-size: 15px; color: #ddd; }

/* Sections */
.section { padding: 64px 32px; max-width: 1180px; margin: 0 auto; }
.section-title { font-size: 27px; margin-bottom: 8px; }
.section-sub { color: var(--text-muted); font-size: 15px; margin-bottom: 36px; }

.btn {
  display: inline-block;
  padding: 12px 26px;
  border: 1px solid var(--text);
  font-size: 14px;
  transition: all 0.2s;
}
.btn:hover { background: var(--text); color: var(--paper); }

/* Photo grid — masonry via CSS columns, natural aspect ratios */
.photo-grid {
  column-count: var(--gallery-columns, 4);
  column-gap: 10px;
}

/* Breakpoints still cap columns down as the viewport narrows, regardless
   of the admin-configured desktop column count. */
@media (max-width: 900px) { .photo-grid { column-count: min(3, var(--gallery-columns, 4)); } }
@media (max-width: 760px) { .photo-grid { column-count: min(2, var(--gallery-columns, 4)); } }
@media (max-width: 480px) { .photo-grid { column-count: 1; } }

.photo-card {
  display: block;
  break-inside: avoid;
  margin-bottom: 10px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.35s, transform 0.35s;
}

.photo-card.visible { opacity: 1; transform: translateY(0); }

.photo-card .frame {
  overflow: hidden;
  background: var(--paper-alt);
  box-shadow: 0 2px 10px rgba(23,20,15,0.08);
  transition: box-shadow 0.2s, transform 0.2s;
}

.photo-card:hover .frame {
  box-shadow: 0 8px 22px rgba(23,20,15,0.14);
  transform: translateY(-2px);
}

.photo-card img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s;
}

.photo-card:hover img { transform: scale(1.04); }

/* Dosežki homepage section — sidebar-label layout: heading/subtitle/link
   in a fixed-width left column beside a vertical divider, photos filling
   the rest of the row. Stacks back to text-on-top below 760px. */
.dosezki-row {
  display: flex;
  align-items: center;
  gap: 48px;
}

.dosezki-text {
  flex: 0 0 240px;
  padding-right: 48px;
  border-right: 1px solid rgba(23,20,15,0.12);
}

.dosezki-text .section-title { margin-bottom: 8px; }
.dosezki-text .section-sub { margin-bottom: 20px; }

.dosezki-photos { flex: 1; min-width: 0; }

@media (max-width: 760px) {
  .dosezki-row { flex-direction: column; align-items: stretch; gap: 24px; }
  .dosezki-text {
    flex: none;
    padding-right: 0;
    border-right: none;
    text-align: center;
  }
}

/* Dosežki preview row (homepage only) — fixed 3-across, matched-height
   tiles, distinct from the gallery's masonry. Same tile chrome (shadow,
   sharp corners, no caption) via the shared .photo-card rules above. */
.photo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.photo-row .photo-card { margin-bottom: 0; }

.photo-row .frame { aspect-ratio: 4 / 3; }

.photo-row img { height: 100%; object-fit: cover; }

@media (max-width: 760px) { .photo-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .photo-row { grid-template-columns: 1fr; } }

/* Understated "see more" links — text + arrow, used in place of a boxed
   .btn where a lighter touch fits (Dosežki preview, O Domnu block). */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  transition: gap 0.2s;
}

.link-arrow:hover { gap: 11px; }

/* Category filters */
.filters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.filter-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  box-shadow: none;
  transition: background-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.filter-btn:hover {
  opacity: 0.7;
}

.filter-btn.active {
  background: #fff;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  opacity: 1;
}

/* Lightbox — photo with a black info panel alongside it */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,9,7,0.94);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.open { display: flex; }

.lightbox-content {
  display: flex;
  max-width: 1100px;
  max-height: 88vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.lightbox-image img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
}

.lightbox-info {
  flex: 0 0 300px;
  background: var(--ink);
  color: var(--ink-text);
  padding: 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s cubic-bezier(0.16,1,0.3,1), transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.lightbox-info.visible { opacity: 1; transform: translateY(0); }
.lightbox-info h3 {
  color: #fff;
  font-size: 22px;
  margin-bottom: 16px;
}
.lightbox-desc-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-text-muted);
  margin: 0 0 6px;
}
#lightboxDesc {
  font-size: 15px;
  line-height: 1.6;
}

/* Word-by-word reveal, shared by the name (in the h3) and the description
   (in #lightboxDesc) — each word is its own inline-block so translateY
   actually applies, with per-word transition-delay set in JS. */
.reveal-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(5px);
  margin-right: 0.28em;
  will-change: opacity, transform;
  transition: opacity 0.22s cubic-bezier(0.16,1,0.3,1), transform 0.22s cubic-bezier(0.16,1,0.3,1);
}
.lightbox-info.visible .reveal-word {
  opacity: 1;
  transform: translateY(0);
}

.lightbox .close {
  position: absolute;
  top: 24px; right: 32px;
  color: #fff;
  font-size: 28px;
  background: none; border: none; cursor: pointer;
  z-index: 1;
}

@media (max-width: 760px) {
  .lightbox-content {
    width: 100%;
    flex-direction: column;
    max-height: 92vh;
    overflow-y: auto;
  }
  .lightbox-image img { max-height: 55vh; max-width: 100%; }
  .lightbox-info { flex: none; }
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 48px;
  align-items: start;
}
.about-grid img { width: 100%; border: 1px solid var(--rule); }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } }

/* O Domnu — full-bleed dark editorial block (homepage only) */
.about-block {
  background: var(--ink);
  color: var(--ink-text);
}

.about-block-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 56px;
  align-items: center;
  max-width: 980px;
  padding: 48px 32px;
}

/* Sized from --portrait-height (admin-controlled); width follows via the
   fixed aspect-ratio so the box never has to guess at layout. */
.about-block-photo {
  background: var(--ink);
  height: var(--portrait-height, 450px);
  aspect-ratio: 2 / 3;
}

.about-block-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--ink);
}

.about-block-heading {
  font-size: 36px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 20px;
}

.about-block-heading em { font-style: italic; }

.about-block-text p { font-size: 16px; margin-bottom: 24px; }

@media (max-width: 760px) {
  .about-block-grid { grid-template-columns: 1fr; }
  /* Mobile ignores --portrait-height (calibrated for the desktop side-by-side
     layout) and goes back to sizing from a capped width instead. */
  .about-block-photo { order: -1; width: 100%; height: auto; max-width: 280px; margin: 0 auto; }
}

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

form input, form textarea {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 14px;
  background: #fff;
}
form textarea { min-height: 130px; resize: vertical; }
form button { border: none; cursor: pointer; }

.contact-info p { margin: 0 0 10px; font-size: 15px; }
.contact-info a:hover { text-decoration: underline; }

/* Footer */
.site-footer {
  background: var(--ink);
  color: var(--ink-text-muted);
  padding: 30px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
}
.site-footer .socials { display: flex; gap: 16px; }
.site-footer .socials a { color: var(--ink-text); }
.site-footer .socials a:hover { color: #fff; }

/* Responsive nav */
@media (max-width: 720px) {
  .site-header nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--ink);
    flex-direction: column;
    padding: 16px 32px 24px;
    gap: 16px;
    display: none;
  }
  .site-header nav.open { display: flex; }
  .menu-toggle { display: block; }
  .hero-content h1 { font-size: 54px; }
}
