/* ================================================================
   NEW PROJECT CONTENT ENGINE - FOUNDATION STYLES
   Minimal, high-performance, and responsive.
   No "hidden" states in CSS — GSAP handles all entry animations.
   ================================================================ */

:root {
  --bg: #ffffff;
  --text: #171717;
  --line: #111;
  --accent: #8a58f5;
  --gray: #888;
  --edge-pad: clamp(24px, 5vw, 80px);
  --section-gap: clamp(60px, 10vw, 160px);
  --grid-gap: clamp(16px, 2.5vw, 32px);
}

* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
}

.fullscreen-content {
  background: var(--bg);
  color: var(--text);
  font-family: 'PPMori', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-top: 0;
}

.page-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding-bottom: 0;
}

/* Shchebet Layout Core (Desktop) */
.shchebet-layout {
  display: flex;
  flex-direction: row;
  width: 100%;
  align-items: stretch;
  /* Take remaining height between header and footer */
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.shchebet-left {
  /* Static — never scrolls, never moves */
  position: relative;
  width: 33.333%;
  height: 100%;
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

/* ── Title: name (regular) + date (bold) ── */
.page-title-container {
  margin-top: 0;
  padding: 100px var(--edge-pad) 0;
  z-index: 10;
  pointer-events: none;
}

.project-title-line {
  display: flex;
  flex-direction: column;
  line-height: 0.95;
  letter-spacing: -0.06em;
  gap: 0.05em;
}

.project-name {
  font-size: clamp(26px, 3.2vw, 52px);
  font-weight: 700;
  font-style: italic;
  margin: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

.project-date {
  font-size: clamp(16px, 2vw, 32px);
  font-weight: 300;
  margin: 0;
  opacity: 0.45;
  letter-spacing: 0.01em;
}

/* Legacy: keep .project-title for mobile / any remaining refs */
.project-title {
  font-size: clamp(40px, 6vw, 90px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin: 0;
}

/* ── Accordion: below title, top-anchored ── */
.shchebet-accordion-wrapper {
  padding: clamp(16px, 2.5vh, 32px) var(--edge-pad) 0 var(--edge-pad);
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* ── Right column: independent scroll container ── */
.shchebet-right {
  width: 66.667%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  /* This is the ONLY scroll container — left panel is unaffected */
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: y mandatory;
  container-type: size;
}

.shchebet-right::-webkit-scrollbar {
  display: none;
  width: 0 !important;
}

/* Section groups: vertically stacked, full height per section */
.section-right-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(12px, 2vw, 32px);
  gap: 0;
  box-sizing: border-box;
}

/* First group */
.section-right-group:first-child {
  padding-top: 0;
}

/* Images fill container width, height from natural aspect ratio — never cropped */
.section-right-group .media-container {
  width: 100%;
  height: 100cqh;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  background: transparent;
  clip-path: inset(100% 0 0 0);
  will-change: clip-path;
  overflow: hidden;
}

/* Link container: same height/snap as images, white bg, no clip-path reveal needed */
.section-right-group .media-link-container {
  background: #ffffff;
  color: #1e1e1e;
  clip-path: none;
  will-change: transform;
  height: 100cqh;
  aspect-ratio: unset;
  border-radius: 0;
}

.section-right-group .media-container img,
.section-right-group .media-container video {
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  transform: scale(1.05) translateY(2%);
  will-change: transform;
}

/* Visibility classes */
.mobile-only { display: none !important; }
.desktop-only { display: flex; }

@media (max-width: 1024px) {
  .mobile-only { display: flex !important; }
  .desktop-only { display: none !important; }
}

/* --- MOBILE INTERLEAVED LAYOUT --- */
.interleaved-layout {
  padding: 24px var(--edge-pad) 0;
  flex-direction: column;
  gap: 60px;
  /* Mobile scroll container (mirrors shchebet-right role on desktop) */
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.project-title-mobile {
  margin-bottom: 40px;
}

.mobile-section {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.mobile-section-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-section-media {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Typography System ── */
.project-text h1 {
  font-size: clamp(24px, 2.5vw, 40px);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.04em;
  margin: 0 0 0.5em 0;
}

.project-text h2 {
  font-size: clamp(20px, 2vw, 32px);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.04em;
  margin: 0 0 0.5em 0;
}

.project-text h3 {
  font-size: clamp(17px, 1.6vw, 26px);
  font-weight: 700;
  line-height: 1.0;
  margin: 0 0 0.5em 0;
  letter-spacing: -0.04em;
}

.project-text p {
  font-size: clamp(14px, 1.3vw, 20px);
  max-width: 44ch;
  margin: 0 0 1.25em 0;
  color: #747474;
  opacity: 1;
  line-height: 1.4;
  letter-spacing: -0.03em;
}

.project-text strong {
  font-weight: 600;
  color: #000;
}

/* Media Handling (base — non-right-column) */
.media-container {
  position: relative;
  overflow: hidden;
  background: transparent;
  width: 100%;
  border-radius: 0;
}

.media-container img,
.media-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pdf-wrapper, .model-wrapper {
  padding: 2em;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.pdf-wrapper a {
  font-size: 1.2rem;
  text-decoration: underline;
  color: var(--accent);
}

@media (max-width: 768px) {
  :root {
    --edge-pad: 24px;
    --section-gap: 80px;
  }
}

/* ── Accordion Styles ── */
.accordion-container {
  display: flex;
  flex-direction: column;
  margin-top: 0.8em;
}

.accordion-item {
  display: flex;
  flex-direction: column;
}

/* Inactive heading: collapsed, invisible — no grey preview */
.accordion-heading {
  margin: 0;
  cursor: default;
  font-size: clamp(16px, 1.8vw, 28px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
  display: flex;
  gap: 0.5em;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 0.45s cubic-bezier(0.25, 1, 0.5, 1),
              opacity 0.35s ease,
              transform 0.35s ease,
              padding 0.35s ease;
}

/* Active heading: slides in, no uppercase */
.accordion-item.is-active .accordion-heading {
  max-height: 4em;
  padding: 0 0 0.3em 0;
  opacity: 1;
  transform: translateY(0);
}

.accordion-heading .acc-num {
  display: none;
}

.accordion-heading .acc-title {
  color: #161719;
}

.accordion-item .accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.5s cubic-bezier(0.25, 1, 0.5, 1),
              opacity 0.35s ease;
  pointer-events: none;
}

.accordion-item.is-active .accordion-body {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
}

.accordion-inner {
  overflow: hidden;
}

.accordion-item.is-active .accordion-inner {
  padding-bottom: 2em;
}

/* ── Reveal Helpers (Classes for GSAP) ── */

/* Default (non-right-column) media containers */
.media-container {
  clip-path: inset(100% 0 0 0);
  will-change: clip-path;
}

/* Prevent FOUC before GSAP takes over — exclude accordion headings (CSS-managed) */
.shchebet-left h1,
.shchebet-left h3,
.shchebet-left p,
.shchebet-left li {
  opacity: 0;
  transform: translateY(20px);
  will-change: transform, opacity;
}

/* Accordion body manages its own opacity via CSS, not GSAP */
.accordion-body h1,
.accordion-body h2,
.accordion-body h3,
.accordion-body p,
.accordion-body li {
  opacity: 1 !important;
  transform: none !important;
}

.accordion-body p {
  letter-spacing: 0.03em;
}

.media-container img,
.media-container video {
  transform: scale(1.05) translateY(2%);
  will-change: transform;
}

/* ── Project Info Header ── */
.project-info-header {
  display: flex;
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  /* Stays at top as a flex child — no sticky needed */
  flex-shrink: 0;
  z-index: 50;
}

.project-info-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 5px var(--edge-pad);
  aspect-ratio: 9 / 1;
  min-height: 32px;
}

.project-info-cell:not(:last-child) {
  border-right: 1px solid var(--line);
}

.info-label {
  font-size: clamp(9px, 0.65vw, 11px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
  font-weight: 300;
  line-height: 1;
}

.info-value {
  font-size: clamp(14px, 1.3vw, 20px);
  font-weight: 400;
  letter-spacing: 0.03em;
  color: #747474;
  line-height: 1.4;
}

/* ── Project Footer Navigation ── */
.project-footer {
  display: flex;
  width: 100%;
  border-top: 1px solid var(--line);
  /* Always visible at bottom — flex child of fullscreen-content */
  flex-shrink: 0;
}

.project-footer-prev,
.project-footer-close,
.project-footer-next {
  width: 33.333%;
  position: relative;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 9 / 1;
  opacity: 1;
  font-family: 'PPMori', sans-serif;
  font-size: clamp(13px, 1.3vw, 20px);
  font-weight: 300;
  letter-spacing: 0.01em;
}

.project-footer-prev,
.project-footer-close,
.project-footer-next {
  transition: opacity 0.2s ease;
}

.project-footer-prev:hover,
.project-footer-close:hover,
.project-footer-next:hover {
  opacity: 0.45;
}

.project-footer-prev {
  border-right: 1px solid var(--line);
}

.project-footer-close {
  border-right: 1px solid var(--line);
}

/* Tooltip: project title on hover */
.project-footer-prev[data-title],
.project-footer-next[data-title] {
  overflow: visible;
}

.project-footer-prev::after,
.project-footer-next::after {
  content: attr(data-title);
  position: absolute;
  bottom: calc(100% + 12px);
  font-family: 'PPMori', sans-serif;
  font-size: clamp(16px, 1.8vw, 28px);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--gray);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.project-footer-prev::after {
  left: var(--edge-pad);
}

.project-footer-next::after {
  right: var(--edge-pad);
  text-align: right;
}

.project-footer-prev:hover::after,
.project-footer-next:hover::after {
  opacity: 1;
}


.footer-x,
.footer-arrow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ── Project Transition ── */
.fullscreen-content {
  will-change: transform, opacity;
}

/* ── Image Counter
   Sitzt in .shchebet-left (position: relative) →
   klebt am unteren Rand der linken Textspalte, bewegt sich nie. ── */
.image-counter {
  position: absolute;
  bottom: clamp(20px, 3vh, 40px);
  left: var(--edge-pad);
  z-index: 10;
  font-family: 'PPMori', sans-serif;
  font-size: clamp(14px, 1.6vw, 26px);
  font-weight: 300;
  letter-spacing: 0.01em;
  color: #888;
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

.counter-sep {
  margin: 0 0.15em;
}

/* ── Fullscreen Image Overlay ── */
.img-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
}

.img-fullscreen-overlay.is-open {
  pointer-events: auto;
}

.fs-media-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 6vh, 80px) clamp(80px, 10vw, 160px);
  box-sizing: border-box;
}

.fs-media-wrap img,
.fs-media-wrap video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.fs-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-family: 'PPMori', sans-serif;
  font-size: clamp(28px, 3.5vw, 56px);
  color: var(--gray);
  cursor: pointer;
  opacity: 0.5;
  padding: 16px 20px;
  transition: opacity 0.2s ease;
  z-index: 10;
  line-height: 1;
}

.fs-arrow:hover { opacity: 1; }

.fs-arrow-prev { left: clamp(12px, 2.5vw, 40px); }
.fs-arrow-next { right: clamp(12px, 2.5vw, 40px); }

.fs-close {
  position: absolute;
  top: -8px;
  right: 0;
  background: none;
  border: none;
  font-family: 'PPMori', sans-serif;
  font-size: clamp(36px, 4.5vw, 68px);
  color: var(--gray);
  cursor: pointer;
  opacity: 0.5;
  padding: 10px;
  transition: opacity 0.2s ease;
  z-index: 10;
  line-height: 1;
}

.fs-close:hover { opacity: 1; }

.fs-counter {
  position: absolute;
  bottom: clamp(20px, 3vh, 40px);
  left: clamp(20px, 3vw, 48px);
  font-family: 'PPMori', sans-serif;
  font-size: clamp(16px, 2vw, 32px);
  letter-spacing: 0.06em;
  color: var(--gray);
  opacity: 1;
  user-select: none;
}

/* --- MEDIA LINK --- */
.media-link-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  color: #1e1e1e;
  overflow: hidden;
  cursor: pointer;
}

.media-link-anchor {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.media-link-arrow {
  width: min(44%, 44vh);
  height: min(44%, 44vh);
  display: block;
  flex-shrink: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center center;
}

.media-link-label {
  font-family: 'PPMori', sans-serif;
  font-size: clamp(0.65rem, 1.1vw, 0.9rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: absolute;
  bottom: 14%;
}

.media-link-container:hover .media-link-arrow {
  transform: scale(1.14) translate(3%, -3%);
}

.media-link-container:hover .media-link-label {
  opacity: 0.65;
  transform: translateY(0);
}

@media (max-width: 1024px) {
  .media-link-arrow {
    width: min(58%, 38vh);
    height: min(58%, 38vh);
  }
  .media-link-label {
    font-size: clamp(0.6rem, 2.2vw, 0.85rem);
    bottom: 12%;
  }
}

/* ── Mobile: project-info-header drei Felder ── */
@media (max-width: 768px) {
  .project-info-cell {
    padding: 6px 10px;
    aspect-ratio: auto;
    min-height: 44px;
    overflow: hidden;
  }

  .info-label {
    font-size: 8px;
  }

  .info-value {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0;
  }

  /* Mobile section headings: always visible (no accordion collapse) */
  .mobile-section .accordion-heading {
    max-height: none;
    opacity: 1;
    transform: none;
    padding: 0 0 0.4em 0;
    font-size: clamp(16px, 4.5vw, 22px);
    cursor: default;
  }

  /* Mobile section heading text also needs to be revealed (GSAP excludes accordion-heading) */
  .mobile-section .accordion-heading .acc-title {
    opacity: 1;
    transform: none;
  }
}
