/* ==========================================================================
   Boris Leskovec - Arhitekt | Pure HTML & CSS Faithful Rebuild
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts (@font-face)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'din-next-w01-light';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/din-next-w02-light.woff2') format('woff2');
  unicode-range: U+000D, U+0100-010F, U+0111-0130, U+0132-0151, U+0154-015F, U+0162-0177, U+0179-017C, U+01FA-01FF, U+0218-021B, U+0237, U+02C9, U+02D8-02D9, U+02DB, U+02DD, U+0394, U+03A9, U+03C0, U+1E80-1E85, U+1EF2-1EF3, U+2070, U+2074-2079, U+2080-2089, U+2113, U+2126, U+212E, U+2153-2154, U+215B-215E, U+2202, U+2206, U+220F, U+2211-2212, U+2215, U+2219-221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25CA, U+F8FF, U+FB00-FB04;
  font-display: swap;
}

@font-face {
  font-family: 'din-next-w01-light';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/din-next-w01-light.woff2') format('woff2');
  unicode-range: U+0020-007E, U+00A0-00FF, U+0110, U+0131, U+0152-0153, U+0160-0161, U+0178, U+017D-017E, U+0192, U+02C6-02C7, U+02DA, U+02DC, U+03BC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122;
  font-display: swap;
}

:root {
  --font-family: 'din-next-w01-light', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   Reset & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  /* the original always reserves the vertical scrollbar */
  overflow-y: scroll;
}

html, body {
  min-width: 980px;
  background-color: #ffffff;
  color: #000000;
  font-family: var(--font-family);
  font-synthesis: weight style;
  font-size: 14px;
  line-height: 1.4em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

/* --------------------------------------------------------------------------
   Layout Containers
   -------------------------------------------------------------------------- */
site-header,
site-footer,
slide-gallery {
  display: block;
}

.site-wrapper {
  width: 980px;
  margin: 0 auto;
  position: relative;
  display: flow-root;
}

.main-content {
  width: 980px;
  min-height: 500px;
}

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  margin-top: 80px;
  width: 980px;
  position: relative;
  z-index: 1000;
  display: flow-root;
}

.nav-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 979px;
  height: 28px;
}

.main-nav {
  display: block;
}

.menu-list {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-item {
  position: relative;
  height: 28px;
  box-sizing: border-box;
  border-left: 1px solid #000000;
}

.menu-item:nth-child(1) { width: 78px; }
.menu-item:nth-child(2) { width: 83px; }
.menu-item:nth-child(3) { width: 65px; }
.menu-item:nth-child(4) { width: 85px; }
.menu-item:nth-child(5) { width: 94px; }
.menu-item:nth-child(6) { width: 83px; }

.menu-item > a {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  height: 28px;
  line-height: 28px;
  font-family: var(--font-family);
  font-size: 16px;
  color: #000000;
  padding: 0 0 0 15px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Active top-level item (only Domov on home, Kontakt on kontakt) */
.menu-item.active-top > a {
  background-color: #000000;
  color: #ffffff;
}

/* Hover on top-level item (items that open a submenu stay white, as on the original) */
.menu-item:not(.has-dropdown):hover > a {
  background-color: #000000;
  color: #ffffff;
}

/* Dropdown menus */
.dropdown-menu {
  position: absolute;
  top: 35px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ffffff;
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 2000;
  visibility: hidden;
  transition: visibility 0s 0.2s;
  min-width: calc(100% + 1px);
  width: max-content;
  box-shadow: none;
  text-align: center;
}

/* invisible bridge over the gap between the item and its dropdown */
.dropdown-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -7px;
  height: 7px;
}

.menu-item:hover .dropdown-menu {
  visibility: visible;
  transition-delay: 0s;
}

.dropdown-menu li {
  height: 32px;
  border-top: 1px solid #000000;
  transition: background-color 0.4s ease;
}

.dropdown-menu li:first-child {
  height: 31px;
  border-top: none;
}

.dropdown-menu li a {
  display: block;
  height: 31px;
  line-height: 31px;
  font-family: var(--font-family);
  font-size: 16px;
  color: #000000;
  padding: 0 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.4s ease, color 0.4s ease;
}

.dropdown-menu li a:hover,
.dropdown-menu li.active-sub a {
  background-color: #000000;
  color: #ffffff;
}

.mobile-bar,
.submenu-toggle {
  display: none;
}

/* Top divider line */
.header-divider {
  width: 980px;
  height: 1px;
  border-top: 1px solid #000000;
  margin: 6px auto 30px auto;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  display: flow-root;
  width: 980px;
  margin: 0 auto;
  padding-bottom: 15px;
}

.footer-divider {
  width: 980px;
  height: 1px;
  border-top: 1px solid #000000;
  margin: 28px 0 16px 0;
}

.footer-content {
  width: 980px;
  margin: 0;
}

.footer-content p {
  font-family: var(--font-family);
  font-size: 12px;
  line-height: normal;
  color: #000000;
  margin: 0;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Homepage: index.html
   -------------------------------------------------------------------------- */
.hero-slider-container {
  position: relative;
  width: 980px;
  height: 500px;
  margin: 0 auto;
  overflow: hidden;
}

.hero-title-overlay {
  position: absolute;
  top: 4px;
  left: 8px;
  z-index: 10;
  pointer-events: none;
}

.hero-title-overlay h1 {
  font-family: var(--font-family);
  font-size: 50px;
  font-weight: 400;
  line-height: normal;
  margin: 0;
  letter-spacing: normal;
}

.hero-title-overlay .title-white {
  color: #ffffff;
}

.hero-title-overlay .title-gray {
  color: rgb(191, 191, 191);
}

.hero-slider {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* slides move horizontally, like the original */
.hero-slide {
  position: absolute;
  inset: 0;
  visibility: hidden;
}

.hero-slide.active,
.hero-slide.is-entering {
  visibility: visible;
}

.hero-slide.is-moving {
  transition: transform 1s cubic-bezier(0.87, 0, 0.13, 1);
}

.hero-slide a {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-slide img {
  width: 980px;
  height: 500px;
  max-width: none;
  object-fit: cover;
  display: block;
}

/* bottom bar with the slide title, shown on hover */
.hero-caption {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 55px;
  padding: 10px 100px 10px 10px;
  background-color: rgba(0, 0, 0, 0.9);
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 25px;
  line-height: 35px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.5s;
}

.hero-counter {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: 70px;
  height: 24px;
  padding: 0 10px 10px 0;
  text-align: right;
  font: 12px arial, helvetica, sans-serif;
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

.hero-nav {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

.hero-nav button {
  position: absolute;
  top: 215px;
  width: 45px;
  height: 70px;
  padding: 0;
  border: 0;
  background: url("../images/icons/slideshow-arrows.png") no-repeat;
  opacity: 0.4;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.5s;
}

.hero-nav .hero-prev {
  left: 20px;
  background-position: 0 0;
}

.hero-nav .hero-next {
  right: 20px;
  background-position: 100% 0;
}

.hero-nav button:hover,
.hero-nav button:focus-visible {
  opacity: 1;
}

.hero-slider-container:hover .hero-caption,
.hero-slider-container:hover .hero-counter,
.hero-slider-container:hover .hero-nav,
.hero-slider-container:focus-within .hero-caption,
.hero-slider-container:focus-within .hero-counter,
.hero-slider-container:focus-within .hero-nav {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Biografija: biografija.html
   -------------------------------------------------------------------------- */
.bio-page-header {
  margin-top: 65px;
  margin-bottom: 23px;
}

.bio-title {
  font-family: var(--font-family);
  font-size: 50px;
  font-weight: 400;
  line-height: normal;
  color: #000000;
  margin-bottom: 29px;
  letter-spacing: normal;
}

.bio-subtitle {
  font-family: var(--font-family);
  font-size: 25px;
  font-weight: 400;
  line-height: normal;
  color: #000000;
  letter-spacing: normal;
}

.bio-accent-line {
  width: 314px;
  height: 1px;
  border-top: 1px solid #000000;
  margin-bottom: 28px;
}

.bio-grid {
  display: flex;
  gap: 20px;
  width: 979px;
  margin: 0 0 0 1px;
  align-items: flex-start;
}

.bio-col {
  width: 313px;
  font-family: var(--font-family);
  font-size: 12px;
  line-height: normal;
  color: #000000;
  flex-shrink: 0;
}

.bio-col p {
  margin: 0;
  padding: 0;
}

.bio-col span[style*="font-weight: bold"],
.bio-col strong {
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Projekti (Index): projekti.html
   -------------------------------------------------------------------------- */
.projekti-header {
  margin-top: 65px;
  margin-bottom: 0;
}

.projekti-title {
  font-family: var(--font-family);
  font-size: 50px;
  font-weight: 400;
  line-height: normal;
  color: #000000;
  margin-bottom: 0;
}

.projekti-subtitle {
  font-family: var(--font-family);
  font-size: 25px;
  font-weight: 400;
  line-height: normal;
  color: #000000;
  margin-top: 0;
  margin-bottom: 30px;
}

.projekti-subtitle2 {
  font-family: var(--font-family);
  font-size: 25px;
  font-weight: 400;
  line-height: normal;
  color: #000000;
  margin-bottom: 33px;
}

.projekti-accent-line {
  width: 314px;
  height: 1px;
  border-top: 1px solid #000000;
  margin-bottom: 32px;
  margin-left: 1px;
}

.projekti-grid {
  display: flex;
  gap: 20px;
  width: 979px;
  align-items: flex-start;
  margin: 0 0 0 1px;
}

.projekti-col {
  width: 313px;
  font-family: var(--font-family);
  font-size: 12px;
  line-height: normal;
  color: #000000;
  flex-shrink: 0;
}

.projekti-col p {
  margin: 0;
  padding: 0;
  line-height: normal;
}

.projekti-col ul {
  list-style: outside none disc;
  margin: 0 0 0 6px;
  padding: 0;
}

.projekti-col li {
  list-style: outside none disc;
  margin: 0 0 0 15.6px;
  padding: 0;
  line-height: normal;
}

.projekti-col li::before {
  display: none;
}

.projekti-col li p {
  margin: 0;
}

.spacer-p {
  height: 14px;
}

/* --------------------------------------------------------------------------
   Project Cards (Portfolio pages)
   -------------------------------------------------------------------------- */
/* Cards are laid out with the exact offsets of the original page:
   each card is positioned inside .cards, and its parts inside the card. */
.cards {
  position: relative;
  width: 980px;
}

.project-card {
  position: absolute;
  left: 0;
  width: 980px;
}

.cards > *,
.project-card > * {
  position: absolute;
}

/* Project lists: cards stack in normal flow, each card only sets its height */
.cards-flow > .project-card {
  position: relative;
}

/* Plain image component (server-cropped on the original, so cover-crop here) */
.abs-img img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
}

.abs-img img.zoomable-img {
  cursor: pointer;
}

/* Framed images (home slider, contact photo, book covers) carry a soft shadow */
.hero-slider-container,
.kontakt-photo,
.page-bibliografija .abs-img {
  box-shadow: rgba(0, 0, 0, 0.5) 0 1px 3px 0;
}

.page-bibliografija .abs-img {
  background-color: #aaa8a8;
}

/* Horizontal line component */
.abs-line {
  border-top: 1px solid #000000;
}

/* Grid ("matrix") gallery: white overlay with the name on hover */
.matrix-gallery {
  overflow: hidden;
}

.matrix-item {
  position: absolute;
  overflow: hidden;
  background-color: #ffffff;
  cursor: pointer;
}

.matrix-item img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
}

.matrix-overlay {
  position: absolute;
  inset: 0;
  padding: 10px;
  background-color: #ffffff;
  opacity: 0;
  transition: opacity 0.4s ease;
  overflow: hidden;
}

.matrix-item:hover .matrix-overlay,
.matrix-item:focus-visible .matrix-overlay {
  opacity: 1;
}

.matrix-title {
  font-family: var(--font-family);
  font-size: 25px;
  line-height: 35px;
  color: #000000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Slideshow gallery (matches the original slideshow gallery) */
.project-gallery {
  --vh: 300px;
  width: 638px;
  height: 370px;
  overflow: hidden;
}

.gallery-viewport {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: var(--vh);
  overflow: hidden;
  cursor: pointer;
}

.gallery-viewport img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
  max-width: none;
  transition: opacity 0.4s ease;
}

.project-gallery.fit-contain .gallery-viewport img {
  object-fit: contain;
}

.gallery-panel {
  position: absolute;
  top: var(--vh);
  left: 0;
  width: calc(100% - 130px);
  cursor: pointer;
}

.gallery-title {
  margin: 10px 0 0;
  font-family: var(--font-family);
  font-size: 25px;
  font-weight: 400;
  line-height: 35px;
  color: #000000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-desc {
  margin: 0;
  font-family: var(--font-family);
  font-size: 12px;
  line-height: 16.8px;
  color: #000000;
  white-space: pre-line;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-controls {
  position: absolute;
  top: var(--vh);
  left: 0;
  width: 100%;
  height: 10px;
  text-align: right;
  font: 12px arial, helvetica, sans-serif;
  white-space: nowrap;
}

.gallery-controls button {
  display: inline-block;
  margin: 0;
  padding: 15px;
  border: 0;
  background: transparent;
  box-sizing: border-box;
  font: 13.3333px Arial, sans-serif;
  color: #000000;
  cursor: pointer;
  vertical-align: baseline;
}

.gallery-controls button span {
  display: inline-block;
  box-sizing: content-box;
}

.gal-play {
  width: 40px;
  height: 30px;
  line-height: 10px;
}

/* play: CSS triangle */
.gal-play span {
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-left-color: #000000;
}

/* pause: two bars */
.gal-play.is-playing span {
  width: 1px;
  height: 10px;
  border: 0;
  border-left: 2px solid #000000;
  border-right: 2px solid #000000;
  margin-right: 5px;
}

.gallery-nav {
  display: inline-block;
  height: 45px;
  text-align: right;
}

.gal-prev span,
.gal-next span {
  position: relative;
  width: 6px;
  height: 6px;
  border: 0 solid #000000;
  transform: rotate(-45deg);
}

.gal-prev span {
  border-top-width: 1px;
  border-left-width: 1px;
}

.gal-next span {
  border-right-width: 1px;
  border-bottom-width: 1px;
}

.gallery-counter {
  display: inline-block;
  padding-top: 15px;
  font: 12px arial, helvetica, sans-serif;
  color: #000000;
  text-align: right;
}

/* Rich text blocks (same base styles as the original's font_5 / font_8) */
.rt {
  font-family: var(--font-family);
  color: #000000;
  overflow-wrap: break-word;
}

.rt h1,
.rt h2,
.rt h5,
.rt h6 {
  margin: 0;
  font-size: 24px;
  font-weight: 400;
  line-height: normal;
}

.rt h1,
.rt h2 {
  font-size: 50px;
}

.rt h6 {
  font-size: 25px;
}

.rt .color_13 {
  color: #aaa8a8;
}

.rt a {
  color: inherit;
}

.rt p,
.rt ul {
  margin: 0;
  font-size: 12px;
  line-height: normal;
}

.rt .lh14 {
  line-height: 1.4em;
}

.rt em {
  font-style: italic;
}

.rt ul {
  margin-left: 6px;
  padding: 0;
  list-style: disc outside;
}

.rt li {
  margin: 0 0 0 15.6px;
  padding: 0;
  list-style: disc outside;
}

/* Gray PROJEKTI button */
.project-btn-link {
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  width: 285px;
  height: 36px;
  border: 1px solid #ffffff;
  background-color: #717070;
  font-family: var(--font-family);
  font-size: 12px;
  line-height: 16.8px;
  text-decoration: none;
  transition: border-color 0.4s ease, background-color 0.4s ease;
}

.project-btn-link span {
  color: #ffffff;
  transition: color 0.4s ease;
}

.project-btn-link:hover {
  background-color: #ffffff;
  border-color: #000000;
}

.project-btn-link:hover span {
  color: #000000;
}

/* --------------------------------------------------------------------------
   Kontakt: kontakt.html
   -------------------------------------------------------------------------- */
.kontakt-grid {
  display: flex;
  width: 979px;
  margin-top: 0;
  margin-left: 1px;
  min-height: 500px;
}

.kontakt-photo {
  width: 514px;
  height: 393px;
  flex-shrink: 0;
}

.kontakt-photo img {
  width: 514px;
  height: 393px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.kontakt-info {
  width: 393px;
  margin-left: 27px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.kontakt-info h1 {
  font-family: var(--font-family);
  font-size: 50px;
  font-weight: 400;
  line-height: normal;
  color: #000000;
  margin: 0;
}

.kontakt-details {
  margin-top: 225px;
  font-family: var(--font-family);
  font-size: 12px;
  line-height: normal;
  color: #000000;
}

.kontakt-details p {
  margin: 0;
  padding: 0;
  line-height: normal;
}

.kontakt-details a {
  text-decoration: underline;
  color: #000000;
}

/* --------------------------------------------------------------------------
   Lightbox (native <dialog>, created by js/site.js)
   -------------------------------------------------------------------------- */
html:has(dialog.lightbox[open]) {
  overflow: hidden;
  scrollbar-gutter: stable;
}

dialog.lightbox {
  outline: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background-color: rgba(0, 0, 0, 0.9);
  color: #ffffff;
}

dialog.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

dialog.lightbox::backdrop {
  background: transparent;
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-caption {
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 14px;
  margin-top: 15px;
  text-align: center;
}

.lightbox button {
  position: absolute;
  z-index: 1;
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

.lightbox button:focus-visible {
  outline: 1px solid #ffffff;
  outline-offset: 2px;
}

.lightbox-close {
  top: 20px;
  right: 35px;
  font-family: Arial, sans-serif;
  font-size: 40px;
  font-weight: bold;
  line-height: 1;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  width: 60px;
  height: 80px;
  margin-top: -40px;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev span,
.lightbox-next span {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 0 solid #ffffff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85));
  transform: rotate(-45deg);
}

.lightbox-prev span { border-top-width: 2px; border-left-width: 2px; }
.lightbox-next span { border-right-width: 2px; border-bottom-width: 2px; }

/* --------------------------------------------------------------------------
   Responsive Layouts (Tablet <= 979px, Mobile <= 767px, Small <= 599px)
   Desktop (>= 980px) keeps the fixed 980px layout untouched.
   -------------------------------------------------------------------------- */
@media (max-width: 979px) {
  html {
    overflow-y: auto;
  }

  html, body {
    min-width: 0;
    overflow-x: clip;
  }

  .site-wrapper {
    width: 100%;
    max-width: 980px;
    padding: 0 16px;
  }

  .main-content {
    width: 100%;
    min-height: 0;
  }

  .site-header {
    width: 100%;
    margin-top: 24px;
  }

  .nav-container,
  .header-divider,
  .site-footer,
  .footer-divider,
  .footer-content {
    width: 100%;
  }

  .header-divider {
    margin: 6px 0 20px 0;
  }

  .site-footer {
    padding-bottom: 20px;
  }

  .footer-divider {
    margin: 28px 0 16px 0;
  }

  /* Homepage hero slideshow */
  .hero-slider-container {
    width: 100%;
    height: auto;
    aspect-ratio: 980 / 500;
    min-height: 220px;
  }

  .hero-slide img {
    width: 100%;
    height: 100%;
  }

  .hero-title-overlay {
    top: 8px;
    left: 10px;
    right: 10px;
  }

  .hero-title-overlay h1 {
    font-size: clamp(22px, 5.2vw, 46px);
    line-height: 1.08;
  }

  .hero-caption {
    height: auto;
    min-height: 44px;
    padding: 10px 64px 10px 12px;
    font-size: clamp(14px, 3.2vw, 22px);
    line-height: 1.3;
  }

  .hero-counter {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 60px;
    height: 44px;
    padding: 0 12px 0 0;
  }

  .hero-nav button {
    top: 50%;
    transform: translateY(-50%) scale(0.75);
  }

  .hero-nav .hero-prev { left: 6px; }
  .hero-nav .hero-next { right: 6px; }

  /* Biografija, Projekti, 404 */
  .bio-page-header,
  .projekti-header {
    margin-top: 24px;
  }

  .bio-title,
  .projekti-title {
    font-size: clamp(28px, 7.5vw, 50px);
    margin-bottom: 12px;
  }

  .bio-subtitle,
  .projekti-subtitle,
  .projekti-subtitle2 {
    font-size: clamp(18px, 4.5vw, 25px);
  }

  .bio-accent-line,
  .projekti-accent-line {
    width: 100%;
    max-width: 314px;
    margin-bottom: 20px;
  }

  .bio-grid,
  .projekti-grid {
    width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }

  .bio-col,
  .projekti-col {
    width: 100%;
    font-size: 13.5px;
    line-height: 1.5;
  }

  /* Project flow cards (Arhitektura, Urbanizem, Natecaji, ...) */
  .cards {
    width: 100%;
  }

  .cards-flow {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  .cards-flow > .project-card {
    position: relative;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(240px, 1fr);
    column-gap: 20px;
    row-gap: 14px;
    align-items: start;
  }

  .cards-flow > .project-card > * {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
  }

  .cards-flow > .project-card > .project-gallery {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .cards-flow > .project-card > .project-content {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }

  .cards-flow > .project-card > .project-btn-link {
    grid-column: 2;
    grid-row: 2;
    max-width: none;
    width: 100%;
    height: 44px !important;
    font-size: 13px;
    letter-spacing: 0.05em;
    align-self: start;
  }

  .cards-flow > .project-card:has(.project-btn-link) .project-content p:last-child {
    display: none;
  }

  /* Slide gallery reflow */
  .project-gallery {
    --vh: auto;
    width: 100% !important;
    height: auto !important;
    overflow: visible;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 6px;
    align-items: start;
  }

  .gallery-viewport {
    grid-column: 1 / -1;
    position: relative !important;
    left: auto;
    top: auto;
    width: 100%;
    height: auto !important;
    aspect-ratio: 638 / 300;
  }

  .gallery-panel {
    grid-column: 1;
    grid-row: 2;
    position: static !important;
    width: 100% !important;
  }

  .gallery-controls {
    grid-column: 2;
    grid-row: 2;
    position: static !important;
    width: auto !important;
    height: auto !important;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
  }

  .gallery-title {
    margin-top: 4px;
    font-size: clamp(18px, 4.2vw, 25px);
    line-height: 1.25;
    white-space: normal;
  }

  .gallery-controls button {
    padding: 8px;
  }

  .gal-play {
    width: auto;
    height: auto;
  }

  .gallery-nav {
    display: inline-flex;
    align-items: center;
    height: auto;
  }

  .gallery-counter {
    padding: 0 2px;
  }

  /* Rich text scaling */
  .rt h1,
  .rt h2 {
    font-size: clamp(24px, 6.2vw, 50px);
    line-height: 1.15;
  }

  .rt h2[style*="font-size"] {
    font-size: clamp(18px, 4.8vw, 25px) !important;
  }

  .rt h5 {
    font-size: clamp(18px, 4.4vw, 24px);
    line-height: 1.25;
  }

  .rt h6 {
    font-size: clamp(18px, 4.2vw, 25px);
    line-height: 1.25;
  }

  .rt p,
  .rt ul {
    font-size: 13.5px;
    line-height: 1.5;
  }

  /* Workshop / Seminar detail pages */
  body:not(.page-bibliografija) .cards:not(.cards-flow) {
    position: static;
    width: 100% !important;
    height: auto !important;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  body:not(.page-bibliografija) .cards:not(.cards-flow) > * {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
  }

  body:not(.page-bibliografija) .cards:not(.cards-flow) > .abs-img img {
    width: 100%;
    height: auto;
    aspect-ratio: 978 / 382;
    object-fit: cover;
  }

  body:not(.page-bibliografija) .cards:not(.cards-flow) > .abs-line {
    height: 1px !important;
    margin: 4px 0;
  }

  .matrix-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    overflow: visible;
  }

  .matrix-item {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    display: flex;
    flex-direction: column;
  }

  .matrix-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  .matrix-overlay {
    position: static;
    opacity: 1;
    padding: 6px 0 4px;
    background-color: transparent;
  }

  .matrix-title {
    font-size: 16px;
    line-height: 1.3;
    white-space: normal;
  }

  /* Bibliografija */
  .page-bibliografija .cards {
    position: static;
    width: 100% !important;
    height: auto !important;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 146px));
    gap: 16px 12px;
    align-items: start;
  }

  .page-bibliografija .cards > * {
    position: static !important;
    left: auto !important;
    top: auto !important;
  }

  .page-bibliografija .cards > .rt {
    grid-column: 1 / -1;
    width: 100% !important;
  }

  .page-bibliografija .cards > .abs-line {
    grid-column: 1 / -1;
    width: 100% !important;
    max-width: 314px;
    height: 1px !important;
    margin: 4px 0 8px;
  }

  .page-bibliografija .cards > .abs-img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 146 / 208;
  }

  .page-bibliografija .cards > :nth-child(1)  { order: 1; }
  .page-bibliografija .cards > :nth-child(2)  { order: 2; }
  .page-bibliografija .cards > :nth-child(3)  { order: 3; }
  .page-bibliografija .cards > :nth-child(4)  { order: 4; }
  .page-bibliografija .cards > :nth-child(5)  { order: 5; }
  .page-bibliografija .cards > :nth-child(6)  { order: 6; }
  .page-bibliografija .cards > :nth-child(7)  { order: 7; }
  .page-bibliografija .cards > :nth-child(9)  { order: 8; margin-top: 12px; }
  .page-bibliografija .cards > :nth-child(10) { order: 9; margin-top: 12px; }
  .page-bibliografija .cards > :nth-child(12) { order: 10; margin-top: 12px; }
  .page-bibliografija .cards > :nth-child(11) { order: 11; }
  .page-bibliografija .cards > :nth-child(8)  { order: 12; }

  .page-bibliografija .cards > :nth-child(7) > p:nth-child(-n+3),
  .page-bibliografija .cards > :nth-child(8) > p:nth-child(-n+2) {
    display: none;
  }

  /* Kontakt */
  .kontakt-grid {
    width: 100%;
    margin-left: 0;
    min-height: 0;
    gap: 24px;
  }

  .kontakt-photo {
    width: 52%;
    height: auto;
  }

  .kontakt-photo img {
    width: 100%;
    height: auto;
    aspect-ratio: 514 / 393;
  }

  .kontakt-info {
    width: auto;
    flex: 1;
    margin-left: 0;
  }

  .kontakt-info h1 {
    font-size: clamp(28px, 7.5vw, 50px);
  }

  .kontakt-details {
    margin-top: 48px;
    font-size: 13.5px;
    line-height: 1.6;
  }
}

/* Larger horizontal nav for tablet widths (768px - 979px) */
@media (min-width: 768px) and (max-width: 979px) {
  .nav-container,
  .menu-list,
  .menu-item {
    height: 38px;
  }

  .menu-item {
    width: auto !important;
  }

  .menu-item > a {
    height: 38px;
    line-height: 38px;
    padding: 0 18px;
    font-size: 18px;
  }

  .dropdown-menu {
    top: 45px;
  }

  .dropdown-menu li {
    height: 40px;
  }

  .dropdown-menu li:first-child {
    height: 39px;
  }

  .dropdown-menu li a {
    height: 39px;
    line-height: 39px;
    padding: 0 16px;
    font-size: 17px;
  }
}

/* Tablet touch dropdown support (>= 768px) */
@media (min-width: 768px) and (hover: none) {
  .menu-item.touch-open .dropdown-menu {
    visibility: visible;
    transition-delay: 0s;
  }
}

/* Always show hero caption & controls cleanly on touch / small screens */
@media (hover: none), (max-width: 767px) {
  .hero-caption,
  .hero-counter,
  .hero-nav {
    opacity: 1;
  }
}

@media (max-width: 767px) {
  .site-header {
    margin-top: 0;
  }

  .nav-container {
    position: relative;
    flex-direction: column;
    align-items: stretch;
    height: auto;
  }

  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 64px;
  }

  .mobile-brand {
    font-family: var(--font-family);
    font-size: clamp(19px, 5vw, 24px);
    letter-spacing: 0.03em;
    color: #000000;
    white-space: nowrap;
  }

  .mobile-brand span {
    color: #717070;
  }

  .mobile-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 7px;
    width: 48px;
    height: 48px;
    margin-right: -10px;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .mobile-toggle:focus-visible,
  .submenu-toggle:focus-visible {
    outline: 2px solid #000000;
    outline-offset: -2px;
  }

  .mobile-toggle span {
    display: block;
    width: 28px;
    height: 2px;
    background-color: #000000;
    transition: transform 0.25s ease, opacity 0.2s ease;
  }

  .mobile-toggle.is-open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .mobile-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .mobile-toggle.is-open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: -16px;
    right: -16px;
    width: auto;
    z-index: 2000;
    background-color: #ffffff;
    border-top: 1px solid #000000;
    border-bottom: 1px solid #000000;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
  }

  .main-nav.is-open {
    display: block;
  }

  .menu-list {
    flex-direction: column;
    align-items: stretch;
    height: auto;
  }

  .menu-item {
    width: 100% !important;
    height: auto;
    border-left: 0;
    border-top: 1px solid #e0e0e0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .menu-item:first-child {
    border-top: 0;
  }

  .menu-item > a {
    height: 54px;
    line-height: 54px;
    padding: 0 16px;
    font-size: 20px;
  }

  .submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border: 0;
    border-left: 1px solid #e0e0e0;
    background: transparent;
    cursor: pointer;
  }

  .submenu-toggle span {
    display: block;
    width: 10px;
    height: 10px;
    border-right: 1.5px solid #000000;
    border-bottom: 1.5px solid #000000;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
  }

  .menu-item.sub-open > .submenu-toggle span {
    transform: translateY(2px) rotate(-135deg);
  }

  .dropdown-menu {
    position: static;
    left: auto;
    transform: none;
    visibility: visible;
    display: none;
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    text-align: left;
    background-color: #f8f8f8;
    border-top: 1px solid #e0e0e0;
  }

  .dropdown-menu::before {
    display: none;
  }

  .menu-item:hover .dropdown-menu,
  .menu-item:focus-within .dropdown-menu {
    display: none;
  }

  .menu-item.sub-open > .dropdown-menu {
    display: block;
  }

  .dropdown-menu li {
    height: auto;
    border-top: 1px solid #e5e5e5;
  }

  .dropdown-menu li:first-child {
    height: auto;
    border-top: 0;
  }

  .dropdown-menu li a {
    height: 48px;
    line-height: 48px;
    padding: 0 28px;
    font-size: 18px;
  }

  .header-divider {
    margin: 0 0 20px 0;
  }

  .hero-slider-container {
    min-height: 260px;
  }

  /* Full-width horizontal accent lines on phone */
  .bio-accent-line,
  .projekti-accent-line,
  .page-bibliografija .cards > .abs-line {
    max-width: none;
    width: 100% !important;
  }

  /* Stack multi-column grids & project cards on phone */
  .bio-grid,
  .projekti-grid,
  .cards-flow > .project-card {
    grid-template-columns: 1fr;
  }

  .cards-flow {
    gap: 28px;
  }

  .cards-flow > .project-card {
    row-gap: 12px;
  }

  .cards-flow > .project-card:not(:last-child) {
    padding-bottom: 28px;
    border-bottom: 1px solid #e0e0e0;
  }

  .cards-flow > .project-card > .project-gallery,
  .cards-flow > .project-card > .project-content,
  .cards-flow > .project-card > .project-btn-link {
    grid-column: 1;
    grid-row: auto;
  }

  .cards-flow > .project-card > .project-btn-link {
    width: 100% !important;
    max-width: none;
    height: 46px !important;
    margin-top: 4px;
    font-size: 14px;
    letter-spacing: 0.06em;
  }

  .gallery-controls {
    margin-top: 2px;
  }

  .gallery-controls button {
    padding: 8px 10px;
  }

  .kontakt-grid {
    flex-direction: column;
    gap: 20px;
  }

  .kontakt-photo {
    width: 100%;
  }

  .kontakt-details {
    margin-top: 16px;
  }

  .site-footer {
    padding-bottom: 28px;
  }

  /* Lightbox mobile controls */
  .lightbox-close {
    top: 10px;
    right: 14px;
    padding: 8px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 44px;
    height: 60px;
    margin-top: -30px;
  }

  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }

  .lightbox-content {
    max-width: 92vw;
    max-height: 75vh;
  }

  .lightbox-caption {
    padding: 0 16px;
    font-size: 13px;
  }
}

@media (max-width: 599px) {
  .matrix-gallery {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .matrix-item img {
    border: 1px solid #efefef;
  }

  .matrix-item:not(:last-child) {
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e5e5;
  }
}
/* --------------------------------------------------------------------------
   Keyboard focus (only shown when navigating with the keyboard)
   -------------------------------------------------------------------------- */
.menu-item > a:focus-visible,
.dropdown-menu a:focus-visible,
.gallery-controls button:focus-visible,
.gallery-viewport:focus-visible,
.matrix-item:focus-visible,
img.zoomable-img:focus-visible,
.project-btn-link:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 2px;
}

.gallery-viewport:focus-visible,
.matrix-item:focus-visible {
  outline-offset: -2px;
  outline-color: #ffffff;
  box-shadow: inset 0 0 0 4px #000000;
}

/* keyboard users can open dropdowns too */
.menu-item:focus-within .dropdown-menu {
  visibility: visible;
  transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0s !important;
  }
}
