/* ── Fonts ─────────────────────────────────────────────────────────
   Transducer (Wortmeister) – place woff2 files in /fonts/
   Barlow used as fallback.
──────────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Transducer';
  src: url('fonts/Transducer-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Transducer';
  src: url('fonts/Transducer-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --font:      'Transducer', 'Barlow', sans-serif;
  --fw-light:  300;
  --fw-bold:   700;
  --black:     #000;
  --white:     #fff;
  --sidebar-w: 33.333vw;
  --mobile-bar-h: 56px;
}

html { height: 100%; }

body {
  font-family: var(--font);
  font-weight: var(--fw-light);
  background: var(--white);
  color: var(--black);
  font-size: 13px;
  line-height: 1.5;
  height: 100%;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; padding: 0; }
/* Ensure [hidden] always wins over display: flex/grid rules */
[hidden] { display: none !important; }

/* ── Mobile top bar (desktop: hidden) ────────────────────────────── */
.mobile-bar {
  display: none;
}

/* ── Sidebar overlay (mobile only) ───────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ── Layout ───────────────────────────────────────────────────────── */
.layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 28px 20px;
  overflow-y: auto;
  border-right: 1px solid var(--black);
  background: var(--white);
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.logo-link { display: block; }
.logo {
  width: 100%;
  max-width: 330px;
  height: auto;
  /* align the visible text with menu items below by pulling slightly left */
  margin-left: -4px;
}

/* Menu */
.menu {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.menu-item {
  font-family: 'Ubuntu', 'Barlow', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 2;
  opacity: 0.35;
  transition: opacity 0.15s;
  display: block;
}
.menu-item:hover { opacity: 0.75; }
.menu-item.active {
  opacity: 1;
  font-weight: 700;
  font-size: 19px;
  line-height: 1.6;
}

/* News */
.news-section {
  border-top: 1px solid var(--black);
  padding-top: 14px;
}
.news-text { font-size: 13px; line-height: 1.6; }

/* Artwork / event info */
.artwork-info,
.event-info {
  border-top: 1px solid var(--black);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.info-row         { font-size: 12px; line-height: 1.6; }
.info-row[hidden] { display: none; }
.info-num         { font-weight: var(--fw-bold); }
.info-author      { font-weight: var(--fw-bold); }
.info-en          { font-weight: var(--fw-light); }
.info-pl          { font-weight: var(--fw-light); }
.info-es          { font-weight: var(--fw-light); font-style: italic; }

.bio-btn {
  display: inline-block;
  margin-top: 10px;
  width: 13px;
  height: 13px;
  border: 1px solid var(--black);
  background: var(--black);
  outline: none;
  transition: background 0.15s;
}
.bio-btn:hover { background: transparent; }

.info-event-label { font-weight: var(--fw-bold); }
.info-event-pos   { opacity: 0.5; font-size: 11px; }

.info-event-desc {
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-line;   /* respects \n in the string */
  opacity: 0.8;
}

.info-event-links {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.event-press-link {
  font-size: 11px;
  color: #1a56cc;
  text-decoration: underline;
  text-underline-offset: 2px;
  line-height: 1.5;
  word-break: break-word;
}
.event-press-link:hover { color: #0d3a99; }

/* Sidebar footer */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 20px;
}

.instagram-link {
  display: inline-block;
  line-height: 0;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.instagram-link:hover { opacity: 1; }

.copyright {
  font-size: 10px;
  opacity: 0.45;
  letter-spacing: 0.03em;
}

/* ── Content area ─────────────────────────────────────────────────── */
.content {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ── Tab panels ───────────────────────────────────────────────────── */
.tab-panel {
  display: flex;
  height: 100%;
  width: 100%;
  overflow: hidden;
}
.tab-panel[hidden] { display: none; }

/* ── Grid wrap (scrollable column) ───────────────────────────────── */
.grid-wrap {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

/* When detail is open, thumbnails take left half */
.tab-panel.detail-active .grid-wrap {
  flex: 0 0 50%;
  width: 50%;
}

/* ── Masonry grid (CSS columns – no gaps, proportional images) ────── */
.masonry-grid {
  column-count: 3;
  column-gap: 0;
  width: 100%;
}

/* Thumbnail mode: detail active → narrower panel → fewer columns */
.tab-panel.detail-active .masonry-grid {
  column-count: 2;
}

.gallery-item {
  /* prevents image being split across two columns */
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  display: block;
  width: 100%;
  cursor: pointer;
  overflow: hidden;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  /* vertical-align removes phantom gap under inline images */
  vertical-align: top;
  transition: opacity 0.18s;
}

.gallery-item:hover img          { opacity: 0.82; }
.gallery-item.selected img       { opacity: 0.35; }

/* ── Detail panel ─────────────────────────────────────────────────── */
.detail-panel {
  flex: 0 0 50%;
  width: 50%;
  height: 100%;
  overflow-y: auto;
  border-left: 1px solid var(--black);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px 20px 44px;
  background: #000;
}
.detail-panel[hidden] { display: none; }

/* Close button white on dark detail panel */
.detail-panel .close-btn { color: #fff; }

.detail-images {
  display: flex;
  flex-direction: column;
  width: 100%;
}

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

.detail-back {
  margin-top: 2px;
  opacity: 0.8;
}

/* Close button */
.close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 24px;
  line-height: 1;
  opacity: 0.35;
  transition: opacity 0.15s;
  z-index: 2;
}
.close-btn:hover { opacity: 1; }

/* Events detail: image scrolls, nav is fixed at bottom */
#events-detail {
  overflow: hidden;       /* panel itself does NOT scroll */
  padding: 0;             /* scroll wrapper handles padding */
}
#events-detail .close-btn {
  top: 10px;
  right: 14px;
}
.events-img-scroll {
  flex: 1;
  min-height: 0;          /* critical: lets flex child shrink below content */
  overflow-y: auto;
  padding: 44px 20px 16px;
}

/* Event navigation — always at the bottom of the panel */
.event-nav {
  flex-shrink: 0;
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 14px 0;
  background: #000;
  width: 100%;
}
.nav-btn {
  font-size: 20px;
  color: #fff;
  opacity: 0.5;
  padding: 4px 14px;
  border: 1px solid transparent;
  transition: opacity 0.15s, border-color 0.15s;
}
.nav-btn:not(:disabled):hover {
  opacity: 1;
  border-color: #fff;
}
.nav-btn:disabled { cursor: default; }

/* ── Admin panel ──────────────────────────────────────────────────── */
.admin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.admin-overlay[hidden] { display: none; }

.admin-panel {
  background: var(--white);
  width: 100%;
  max-width: 860px;
  border: 1px solid var(--black);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--black);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.admin-title {
  font-size: 13px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-actions { display: flex; gap: 12px; align-items: center; }

.admin-save-note {
  font-size: 11px;
  opacity: 0.45;
}

.admin-export-btn {
  font-size: 11px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--black);
  padding: 4px 10px;
  transition: background 0.15s, color 0.15s;
}
.admin-export-btn:hover {
  background: var(--black);
  color: var(--white);
}

.admin-close-btn {
  font-size: 22px;
  line-height: 1;
  opacity: 0.4;
  transition: opacity 0.15s;
}
.admin-close-btn:hover { opacity: 1; }

/* Column headers */
.admin-col-headers {
  display: grid;
  grid-template-columns: 60px 1fr 1fr 1fr 1fr;
  gap: 0;
  padding: 6px 20px;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f8f8;
}
.admin-col-header {
  font-size: 10px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.5;
  padding: 0 6px;
}

/* Artwork rows */
.admin-row {
  display: grid;
  grid-template-columns: 60px 1fr 1fr 1fr 1fr;
  gap: 0;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding: 8px 20px;
}
.admin-row:last-child { border-bottom: none; }
.admin-row:hover { background: #fafafa; }

.admin-thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  display: block;
}

.admin-meta {
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-num    { font-size: 11px; font-weight: var(--fw-bold); opacity: 0.5; }
.admin-author { font-size: 12px; font-weight: var(--fw-bold); line-height: 1.3; }

.admin-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid #ddd;
  padding: 4px 6px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: var(--fw-light);
  background: transparent;
  outline: none;
  transition: border-color 0.15s;
}
.admin-input:focus { border-bottom-color: var(--black); }
.admin-input::placeholder { opacity: 0.35; font-style: italic; }

/* ── Manifesto ────────────────────────────────────────────────────── */
#tab-manifesto {
  overflow: hidden;
  background: #000;
}

/* Left scrollable column — text */
.manifesto-left {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.manifesto-text {
  max-width: 500px;
  padding: 56px 44px 80px;
  color: #fff;
}

.manifesto-text p {
  font-size: 13px;
  line-height: 1.85;
  margin-bottom: 1.3em;
}

.manifesto-rules-title {
  font-size: 12px;
  font-weight: var(--fw-bold);
  color: #fff;
  margin-top: 2.2em;
  margin-bottom: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.manifesto-rules {
  list-style: decimal;
  padding-left: 1.4em;
}

.manifesto-rules li {
  font-size: 12px;
  color: #fff;
  line-height: 1.75;
  margin-bottom: 0.5em;
}

/* Right fixed column — object image
   Only right padding (100px from screen edge) — left gap comes naturally
   from the text column separation. Image is shifted up by 50% of its own
   height so the lower half (collar + bowl) is centred in the viewport.    */
.manifesto-right {
  flex: 0 0 46%;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-right: 100px;
  box-sizing: border-box;
}

.manifesto-obj-img {
  max-width: 100%;   /* = column − 100px right padding */
  width: auto;
  height: auto;
  display: block;
  /* shift up: top 50% (handle) exits frame, bowl hangs in view */
  transform: translateY(-50%);
}

@media (max-width: 1099px) {
  .manifesto-right  { flex: 0 0 42%; padding-right: 100px; }
  .manifesto-text   { max-width: 420px; padding: 44px 32px 60px; }
}

@media (max-width: 699px) {
  #tab-manifesto   { flex-direction: column; overflow-y: auto; overflow-x: hidden; }
  .manifesto-left  { flex: none; overflow: visible; }

  /* Phone: chochla ABOVE text, bowl visible (cropped from handle side) */
  .manifesto-right {
    order: -1;        /* flips to top */
    flex: none;
    height: 55vw;
    width: 100%;
    padding: 0;
    position: relative;
    align-items: flex-end;
    justify-content: center;
    box-sizing: border-box;
  }
  .manifesto-obj-img {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 55vw;
    height: auto;
    max-height: none;
    max-width: none;
  }
  .manifesto-text  { max-width: 100%; padding: 32px 20px 40px; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── Tablet  (< 1100px) ───────────────────────────────────────────── */
@media (max-width: 1099px) {
  :root { --sidebar-w: 260px; }

  .masonry-grid { column-count: 2; }
  .tab-panel.detail-active .masonry-grid { column-count: 1; }

  .sidebar { padding: 22px 20px 16px; }
  .logo { max-width: 180px; }
}

/* ── Mobile  (< 700px) ────────────────────────────────────────────── */
@media (max-width: 699px) {

  body { overflow: hidden; }

  /* Fixed top bar */
  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--mobile-bar-h);
    padding: 0 16px;
    border-bottom: 1px solid var(--black);
    background: var(--white);
    z-index: 100;
  }

  .mobile-logo { max-width: 160px; }

  /* Hamburger button */
  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
  }
  .hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--black);
    transition: transform 0.2s, opacity 0.2s;
  }
  .hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .hamburger.open span:nth-child(2) { opacity: 0; }
  .hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

  /* Layout: full-width content below top bar */
  .layout {
    flex-direction: column;
    padding-top: var(--mobile-bar-h);
    height: 100dvh;
  }

  /* Sidebar: slide-in overlay */
  .sidebar {
    position: fixed;
    top: var(--mobile-bar-h);
    left: 0;
    bottom: 0;
    width: min(80vw, 300px);
    height: auto;
    flex: none;
    border-right: 1px solid var(--black);
    z-index: 100;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
  }
  .sidebar.open { transform: translateX(0); }

  /* Hide the desktop logo inside sidebar on mobile */
  .desktop-logo-link { display: none; }

  /* Content fills everything below top bar */
  .content {
    flex: 1;
    height: auto;
    overflow: hidden;
  }

  /* Detail view on mobile: hide thumbnails, show detail full-width */
  .tab-panel.detail-active .grid-wrap { display: none; }
  .tab-panel.detail-active .detail-panel {
    flex: 1;
    width: 100%;
    border-left: none;
  }

  .masonry-grid { column-count: 2; }
  .tab-panel.detail-active .masonry-grid { column-count: 2; }

  .detail-panel { padding: 36px 14px 36px; }
}

/* ── Very small phones (< 400px) ──────────────────────────────────── */
@media (max-width: 399px) {
  .masonry-grid { column-count: 1; }
}
