/* ====================================================================
   Graphic design pages
   Everything scales with the screen width, so the phone version looks
   like the desktop one (only smaller, with the text kept readable).

   FINE-TUNING (if the images don't sit perfectly inside the card
   picture project-bg.png, change these 3 numbers):
     --inset-x       gap between the card's edge and the image window (sides)
     --inset-bottom  gap at the bottom
     --title-top     vertical position of the title in the card's tab
   ==================================================================== */

:root {
  /* tab font: 1.56rem on desktop, shrinks with the window */
  --tab-font: min(1.56rem, 2vw);
}

body {
  background-color: #f4f4f4;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* ---------- Secondary menu (tabs) ---------- */
.graphic-d-pagination {
  font-size: var(--tab-font);
  font-weight: 600;
  position: relative;
  display: flex;
  flex-direction: row;
  text-wrap: nowrap;
  justify-content: center;
  gap: 1.33em;
  margin-top: 50px;
}

.graphic-d-categories a {
  background-color: #d5d5d5;
  color: rgb(134, 134, 134);
  position: relative;
  top: 0;
  padding: 0.6em;
  padding-bottom: 1.6em;
  border: none;
  border-radius: 10px 10px 0 0;
  z-index: 0;
  transition: all 0.5s ease;
}

.graphic-d-categories a:hover {
  top: -0.6em;
  color: rgb(81, 81, 81);
  background-color: #e4e4e4;
}

.graphic-d-categories a.active {
  background-color: white;
  color: black;
  z-index: 1;
}

.graphic-d-categories a.active:hover {
  top: -0.6em;
  color: rgb(63, 63, 63);
}

.label-short { display: none; }

/* ---------- White card ---------- */
.graphic-design-bg {
  box-sizing: border-box;
  width: min(1097px, calc(100% - 16px));
  background-color: white;
  padding: clamp(10px, 2.7vw, 30px) clamp(6px, 2.1vw, 23px);
  border: none;
  border-radius: 0 0 clamp(16px, 3.6vw, 40px) clamp(16px, 3.6vw, 40px);
  margin-top: calc(var(--tab-font) * 0.4);
  position: relative;
  z-index: 2;
}

.projects-container {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4.5vw, 50px);
}

.empty-message {
  text-align: center;
  color: rgb(150, 150, 150);
  padding: 60px 0;
}

/* ---------- One project ---------- */
.project {
  width: 100%;
}

.project-background {
  --inset-x: 0.95cqw;
  --inset-bottom: 1cqw;
  --title-top: 0.32cqw;

  position: relative;
  display: block;
  width: 100%;
  container-type: inline-size;   /* lets the children use cqw = 1% of the card width */
}

.project-bg-img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0px 0px 4px rgba(0, 0, 0, 0.05));
}

.project-title {
  position: absolute;
  top: var(--title-top);
  left: 6.67cqw;
  z-index: 2;
  margin: 0;
  font-size: max(11px, 1.714cqw);
  font-weight: 600;
  white-space: nowrap;
  color: rgb(0, 0, 0);
}

.project-subtitle {
  font-size: max(10px, 1.333cqw);
  font-weight: 400;
  color: rgb(100, 100, 100);
}

/* ---------- Scrolling window ---------- */
.gallery-container {
  position: absolute;
  left: var(--inset-x);
  bottom: var(--inset-bottom);
  width: calc(100% - 2 * var(--inset-x));
  aspect-ratio: 1030 / 500;
  overflow: hidden;
  border-radius: max(4px, 0.95cqw);
}

.gallery-track {
  display: flex;
  width: max-content;
  height: 100%;
  will-change: transform;
}

.gallery-track img,
.gallery-track video {
  flex: none;
  height: 100%;
  width: auto;
  margin-right: max(4px, 0.95cqw);
  border-radius: max(4px, 0.95cqw);
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- Phones (desktop is not affected by anything below) ---------- */
@media (max-width: 700px) {
  :root {
    --tab-font: 3.7vw;
  }

  /* Menu: stretches over the full width of the white card */
  .graphic-d-pagination {
    box-sizing: border-box;
    width: calc(100% - 16px);
    gap: 0.25em;
    margin-top: 30px;
  }

  .graphic-d-categories {
    flex: 1 1 auto;
  }

  .graphic-d-categories a {
    display: block;
    text-align: center;
    padding: 0.5em 0.2em 1.6em;
  }

  /* the card slides up under the tabs (the extra tab padding hides behind it) */
  .graphic-design-bg {
    margin-top: calc(var(--tab-font) * -1.2);
  }

  .label-full { display: none; }
  .label-short { display: inline; }

  /* More space between the projects */
  .projects-container {
    gap: 48px;
  }

  /* Title + description are written ABOVE the project window,
     not inside the little tab */
  .project-title {
    position: static;
    margin: 0 0 8px 4px;
    font-size: 20px;
    line-height: 1.15;
    white-space: normal;
  }

  .project-subtitle {
    display: block;
    margin-top: 3px;
    font-size: 14px;
    line-height: 1.25;
  }
}


/* ====================================================================
   LIGHTBOX (full-screen view: the same endless strip, but big)
   ==================================================================== */

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.94);
  font-family: Gabarito, Arial, Helvetica, sans-serif;
  color: #fff;
  outline: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0s;
}

/* the big scrolling window */
.lightbox-strip {
  position: relative;
  width: 100%;
  height: calc(100vh - 250px);
  height: calc(100dvh - 250px);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}

.lightbox-strip.ready {
  opacity: 1;
}

.lightbox-track {
  display: flex;
  width: max-content;
  height: 100%;
  will-change: transform;
}

.lightbox-track img,
.lightbox-track video {
  flex: none;
  height: 100%;
  width: auto;
  margin-right: 20px;
  border-radius: 6px;
  user-select: none;
  -webkit-user-drag: none;
}

/* videos: size comes from the file; 16:9 is only used until it is known */
.gallery-track video,
.lightbox-track video {
  aspect-ratio: auto 16 / 9;
  background: #000;
}

.lightbox-track video {
  cursor: pointer;
}

.lightbox-caption {
  margin-top: 18px;
  padding: 0 16px;
  line-height: 1.35;
  text-align: center;
}

.lightbox-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
}

.lightbox-subtitle {
  font-size: 1rem;
  color: rgb(190, 190, 190);
}

.lightbox-subtitle:empty {
  display: none;
}

.lightbox-close,
.lightbox-arrow {
  position: absolute;
  border: none;
  color: rgb(215, 215, 215);
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.lightbox-close {
  top: 16px;
  right: 24px;
  padding: 12px;
  background: none;
  font-size: 3rem;
}

.lightbox-arrow {
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 56px;
  height: 56px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  font-size: 1.6rem;
}

.lightbox-close:hover,
.lightbox-arrow:hover {
  color: #fff;
}

.lightbox-arrow:hover {
  background: rgba(0, 0, 0, 0.8);
}

.lightbox-close:focus-visible,
.lightbox-arrow:focus-visible,
.lightbox-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lightbox-next:hover { transform: translateY(-50%) translateX(3px); }

/* play / pause / reverse buttons */
.lightbox-controls {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
}

.lightbox-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 112px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: rgb(215, 215, 215);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.lightbox-btn svg {
  width: 18px;
  height: 18px;
}

.lightbox-btn[aria-pressed="true"] {
  background: #fff;
  color: #000;
}

.lightbox-play .icon-play { display: none; }
.lightbox-play.is-paused .icon-play { display: block; }
.lightbox-play.is-paused .icon-pause { display: none; }

@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox-strip, .lightbox-close, .lightbox-arrow { transition: none; }
}

/* Phones: arrows go down next to the buttons, the strip keeps the full width */
@media (max-width: 600px) {
  .lightbox-strip {
    height: min(calc(100vh - 280px), 120vw);
    height: min(calc(100dvh - 280px), 120vw);
  }

  .lightbox-track img,
  .lightbox-track video { margin-right: 12px; }

  .lightbox-close { top: 8px; right: 12px; }

  .lightbox-arrow {
    top: auto;
    bottom: 22px;
    transform: none;
    width: 46px;
    height: 46px;
  }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-prev:hover, .lightbox-next:hover { transform: none; }

  .lightbox-controls { bottom: 26px; gap: 8px; }
  /* with three buttons only the icons are shown, so everything fits between the arrows */
  .lightbox-controls.has-sound .btn-label { display: none; }
  .lightbox-btn { min-width: 0; padding: 9px 12px; font-size: 0.85rem; }
}
