/* True Friends — Design system components
 * Buttons, inputs, nav, service items, social icons, modal, footer.
 */

/* ---------- Button ---------- */
.btn {
  --btn-bg: var(--color-accent);
  --btn-fg: var(--color-accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.25rem;
  border-radius: 0;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: normal;
  cursor: pointer;
  transition:
    background-color var(--duration-base) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

.btn:hover {
  --btn-bg: var(--color-cream);
}

.btn:active {
  --btn-bg: var(--color-accent-pressed);
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn[aria-disabled="true"]:hover,
.btn[aria-disabled="true"]:active {
  --btn-bg: var(--color-accent);
  transform: none;
}

.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--color-cream);
  border: 2px solid var(--color-cream);
}

.btn--outline:hover {
  --btn-bg: var(--color-cream);
  --btn-fg: var(--color-bg);
}

/* ---------- Form ---------- */
.field {
  position: relative;
  display: block;
}

.field__input,
.field__textarea {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: transparent;
  color: var(--color-text-strong);
  border: 1px solid var(--color-border-input);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  transition:
    border-color var(--duration-base) var(--ease-out),
    background-color var(--duration-base) var(--ease-out);
}

.field__textarea {
  height: 109px;
  padding: 12px 14px;
  resize: vertical;
  min-height: 96px;
}

.field__input::placeholder,
.field__textarea::placeholder {
  color: var(--color-text-subtle);
}

.field__input:hover,
.field__textarea:hover {
  border-color: var(--color-border-strong);
}

.field__input:focus,
.field__textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  background: rgba(254, 228, 64, 0.04);
}

.field__input:invalid:not(:placeholder-shown),
.field__textarea:invalid:not(:placeholder-shown) {
  border-color: #ff7676;
}

.form {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 384px;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form__status {
  font-size: var(--fs-small);
  min-height: 1.25rem;
  color: var(--color-text-muted);
}

.form__status:empty {
  display: none;
}

.form__status[data-state="success"] { color: var(--color-accent); }
.form__status[data-state="error"]   { color: #ff7676; }

/* ---------- Top nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: rgba(10, 10, 10, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.nav__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 1.5rem;
  height: 72px;
  padding: 0 var(--container-padding);
}

.nav__brand  { justify-self: start; }
.nav__crumbs { justify-self: start; display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.nav__links  { justify-self: center; }

.nav__crumb-sep {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text-subtle);
  user-select: none;
}

.nav__crumb-current {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: normal;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* On narrow viewports the breadcrumb crumbs get squeezed against the
   hamburger; drop the separator + current page to keep the brand readable. */
@media (max-width: 480px) {
  .nav__crumb-sep,
  .nav__crumb-current { display: none; }
}

.nav__right {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 20px;
}

@media (min-width: 768px) {
  .nav__inner { height: 96px; }
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: normal;
  color: var(--color-nav-fg);
  font-size: 16px;
  white-space: nowrap;
  transition: color var(--duration-base) var(--ease-out);
}

.nav__brand:hover { color: var(--color-nav-fg-hover); }

.nav__brand img { width: 28px; height: 28px; }

.nav__links {
  display: none;
  align-items: center;
  gap: 2rem;
}

.nav__link {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: uppercase;
  color: var(--color-nav-fg);
  padding: 0.5rem 0;
  position: relative;
}

.nav__link:hover { color: var(--color-nav-fg-hover); }

.nav__link[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
}

.nav__socials {
  display: none;
  align-items: center;
  gap: 1rem;
}

.nav__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 0;
}

.nav__langs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav__lang {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: uppercase;
  color: var(--color-nav-fg);
  padding: 4px 6px;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color var(--duration-base) var(--ease-out);
}

.nav__lang:hover {
  color: var(--color-nav-fg-hover);
}

.nav__lang[aria-pressed="true"] {
  color: var(--color-accent);
}

.nav__lang-divider {
  color: var(--color-text-subtle);
  font-size: 14px;
  user-select: none;
}

.nav__langs--drawer {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0 0;
}

.nav__toggle:hover { background: var(--color-surface-hover); }

.nav__toggle .icon-bar,
.nav__toggle .icon-bar::before,
.nav__toggle .icon-bar::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-strong);
  border-radius: 2px;
  transition: transform var(--duration-base) var(--ease-out),
              opacity var(--duration-base) var(--ease-out);
}

.nav__toggle .icon-bar {
  position: relative;
}

.nav__toggle .icon-bar::before,
.nav__toggle .icon-bar::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav__toggle .icon-bar::before { top: -7px; }
.nav__toggle .icon-bar::after  { top: 7px; }

.nav[data-open="true"] .nav__toggle .icon-bar {
  background: transparent;
}
.nav[data-open="true"] .nav__toggle .icon-bar::before {
  transform: translateY(7px) rotate(45deg);
}
.nav[data-open="true"] .nav__toggle .icon-bar::after {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile drawer */
.nav__drawer {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem var(--container-padding) 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 10, 10, 0.95);
}

.nav__drawer .nav__link {
  padding: 0.875rem 0;
  font-size: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav__drawer .nav__socials {
  display: flex;
  margin-top: 0.75rem;
}

.nav[data-open="true"] .nav__drawer {
  display: flex;
}

@media (min-width: 900px) {
  .nav__links    { display: flex; }
  .nav__socials  { display: flex; }
  .nav__langs    { display: inline-flex; }
  .nav__toggle   { display: none; }
  .nav__drawer   { display: none !important; }
}

@media (max-width: 899px) {
  /* Hide the desktop-only language switcher (the one in the right group);
     drawer keeps its own. */
  .nav__right .nav__langs { display: none; }
}

/* ---------- Social icons ---------- */
.social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--color-text-strong);
  transition:
    color var(--duration-base) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.social:hover { color: var(--color-accent); }

.nav .social { color: var(--color-nav-fg); }
.nav .social:hover { color: var(--color-nav-fg-hover); }

.social:active { transform: scale(0.95); }

.social svg { width: 20px; height: 20px; }

.socials-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

/* ---------- Service item (accordion row) ---------- */
.service-list {
  display: grid;
  gap: 12px;
}

.service-item {
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  transition:
    border-color var(--duration-base) var(--ease-out);
}

.service-item:hover {
  border-color: var(--color-border-strong);
}

.service-item[open] {
  border-color: var(--color-accent);
}

.service-item__summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
  cursor: pointer;
  padding: 1.125rem 1.25rem;
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--color-text-strong);
  user-select: none;
}

.service-item__summary::-webkit-details-marker { display: none; }

.service-item__icon {
  width: 32px;
  height: 32px;
  flex: none;
  display: block;
}

.service-item__title {
  flex: 1;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  color: var(--color-cream);
}

.service-item__chevron {
  width: 24px;
  height: 24px;
  color: var(--color-cream);
  transition: transform 420ms var(--ease-out),
              color var(--duration-base) var(--ease-out);
}

.service-item:hover .service-item__chevron { color: var(--color-accent); }
.service-item[open] .service-item__chevron {
  transform: rotate(180deg);
  color: var(--color-accent);
}

/* Override UA `display: none` on closed details so the body stays in flow
   and the grid-row animation can interpolate from 0fr → 1fr. */
.service-item__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 420ms var(--ease-out);
}

.service-item[open] .service-item__body {
  grid-template-rows: 1fr;
}

.service-item__body-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 1.25rem 1.25rem calc(1.25rem + 32px + 1rem);
  color: var(--color-text);
  line-height: var(--lh-relaxed);
}

@media (max-width: 540px) {
  .service-item__body-inner {
    padding-left: 1.25rem;
  }
  .service-item__summary {
    padding: 1rem 1rem;
    gap: 0.75rem;
  }
  .service-item__title {
    font-size: 18px;
  }
}

/* Supplementary note shown beneath the services list. */
.services__note {
  margin-top: 0.5rem;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 0;
  padding: 1rem var(--container-padding);
  text-align: center;
}

.site-footer__copyright {
  font-size: var(--fs-caption);
  color: var(--color-text-subtle);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ---------- Modal ---------- */
.modal {
  width: 506px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  background: var(--color-bg);
  color: var(--color-cream);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 40px;
  gap: 41px;
  position: relative;
}

.modal__heading {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: stretch;
}

.modal__title {
  font-family: var(--font-body);
  font-weight: 700;
  font-style: normal;
  font-size: 32px;
  line-height: 1;
  color: var(--color-cream);
  text-transform: none;
}

.modal__desc {
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  margin: 0;
}

.modal__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: stretch;
  width: 100%;
}

.modal__form .field__textarea {
  min-height: 109px;
  height: 109px;
}

.modal__actions {
  display: flex;
  flex-direction: row;
  gap: 14px;
  width: 100%;
  margin-top: 2px;
}

.modal__actions .btn {
  flex: 1;
  height: 48px;
  padding: 0;
}

@media (max-width: 540px) {
  .modal__inner {
    padding: 32px 20px;
    gap: 28px;
  }
  .modal__form .form__row {
    grid-template-columns: 1fr;
  }
  .modal__actions {
    flex-direction: column-reverse;
  }
  .modal__actions .btn {
    flex: none;
    width: 100%;
    height: 48px;
    min-height: 48px;
  }
}

/* Prevent body scroll while dialog is open */
body:has(dialog[open]) { overflow: hidden; }

/* ---------- Inline email row ---------- */
.email-row {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--color-text-strong);
  font-weight: 500;
}

.email-row:hover { color: var(--color-accent); }

.email-row svg { width: 20px; height: 20px; flex: none; }

.address-row {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.625rem;
  color: var(--color-text-strong);
  font-weight: 500;
  font-style: normal;
}

.address-row svg { width: 20px; height: 20px; flex: none; margin-top: 0.125rem; }

.address-row > span { display: flex; flex-direction: column; }

/* ---------- Clients (logo wall) ---------- */
.clients__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem 2.5rem;
}

.clients__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 56px;
  opacity: 0.75;
  transition: opacity var(--duration-base) var(--ease-out);
}

.clients__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.clients__logo:hover,
.clients__logo:focus-visible {
  opacity: 1;
}

/* ---------- Team / Who are we ---------- */
.team-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 64px;
}

.team-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .team-card {
    grid-template-columns: minmax(0, 280px) 1fr;
    gap: 32px;
  }
}

.team-card__photo {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--color-surface);
}

@media (min-width: 768px) {
  .team-card__photo {
    aspect-ratio: auto;
    height: 100%;
  }
}

.team-card__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-card__content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.team-card__header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}

.team-card__name {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 32px;
  line-height: var(--lh-snug);
  color: var(--color-cream);
}

.team-card__role {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 24px;
  line-height: var(--lh-snug);
  color: var(--color-cream);
}

.team-card__bio {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  color: var(--color-text);
}

.team-card__refs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-card__refs-title {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 24px;
  line-height: var(--lh-snug);
  color: var(--color-cream);
}

.team-card__refs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.team-card__refs-list li {
  display: inline-flex;
  align-items: center;
}

.team-card__refs-list li:not(:last-child)::after {
  content: "|";
  margin: 0 16px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-body);
  color: var(--color-cream);
  user-select: none;
}

.team-card__ref {
  display: inline-block;
  padding: 6px 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--fs-body);
  line-height: var(--lh-snug);
  color: var(--color-text-strong);
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-out);
}

.team-card__ref:hover,
.team-card__ref:focus-visible {
  color: var(--color-accent);
}

.team-card__cv {
  align-self: flex-start;
}

/* ---------- Gallery ---------- */
.gallery { display: grid; gap: 1.5rem; }

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 160px;
  gap: 6px;
}

.gallery__item[hidden] { display: none; }

/* Odd-page layout (page 1, 3, 5, …) — 1 feature + 2 wide + 1 tall + 2 plain:
   F F W W
   F F T p
   W W T p
*/
.gallery__item:nth-child(12n+1) { grid-column: 1 / span 2; grid-row: 1 / span 2; }
.gallery__item:nth-child(12n+2) { grid-column: 3 / span 2; grid-row: 1; }
.gallery__item:nth-child(12n+3) { grid-column: 3;          grid-row: 2 / span 2; }
.gallery__item:nth-child(12n+4) { grid-column: 4;          grid-row: 2; }
.gallery__item:nth-child(12n+5) { grid-column: 1 / span 2; grid-row: 3; }
.gallery__item:nth-child(12n+6) { grid-column: 4;          grid-row: 3; }

/* Even-page layout (page 2, 4, 6, …) — 1 feature + 3 wide + 2 plain:
   W W W W
   F F W W
   F F p p
*/
.gallery__item:nth-child(12n+7)  { grid-column: 1 / span 2; grid-row: 1; }
.gallery__item:nth-child(12n+8)  { grid-column: 3 / span 2; grid-row: 1; }
.gallery__item:nth-child(12n+9)  { grid-column: 1 / span 2; grid-row: 2 / span 2; }
.gallery__item:nth-child(12n+10) { grid-column: 3 / span 2; grid-row: 2; }
.gallery__item:nth-child(12n+11) { grid-column: 3;          grid-row: 3; }
.gallery__item:nth-child(12n+12) { grid-column: 4;          grid-row: 3; }

.gallery__tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  /* The icon is shown at a fixed pixel size so it stays subtle on big tiles
     and doesn't dominate small ones. Surface fill makes empty tiles feel
     intentional. Real photos sit on top via the <img> element. */
  background:
    rgba(255, 255, 255, 0.05)
    url("../img/gallery/placeholder.svg") center / 56px no-repeat;
  cursor: pointer;
  overflow: hidden;
}

.gallery__tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-base) var(--ease-out);
}

.gallery__tile:hover img { transform: scale(1.04); }

.gallery__tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  transition: border-color var(--duration-base) var(--ease-out);
  pointer-events: none;
}

.gallery__tile:hover::after,
.gallery__tile:focus-visible::after { border-color: var(--color-accent); }

.gallery__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.gallery__viewall {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-strong);
  text-decoration: underline;
  text-underline-offset: 4px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.gallery__viewall:hover { color: var(--color-accent); }

.gallery__pagination {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.gallery__page-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  color: var(--color-text-strong);
  cursor: pointer;
  transition:
    border-color var(--duration-base) var(--ease-out),
    color var(--duration-base) var(--ease-out);
}

.gallery__page-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.gallery__page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.gallery__page-btn svg { width: 18px; height: 18px; }

.gallery__page-indicator {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.1em;
}

@media (max-width: 720px) {
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 140px;
  }
  /* On mobile collapse every tile back to a single cell and let them flow.
     6 tiles in 2 columns = 3 perfectly-filled rows. */
  .gallery__item { grid-column: auto !important; grid-row: auto !important; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  width: min(1100px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  background: var(--color-bg);
  color: var(--color-cream);
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lightbox__inner {
  display: grid;
  /* minmax(0, 1fr) lets the stage row shrink below its min-content so the
     thumbnail row always has room — without it, a tall image stretches the
     stage and pushes the thumbnails out of view. */
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  height: min(80vh, 720px);
}

.lightbox__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.6);
  color: var(--color-cream);
  border-radius: 0;
  cursor: pointer;
}

.lightbox__close:hover { color: var(--color-accent); }
.lightbox__close svg { width: 22px; height: 22px; }

.lightbox__stage {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  /* Image row absorbs available height; caption row sits in its own slot
     so it can never collide with the thumbnail strip below. */
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: 8px;
  padding: 16px;
  min-height: 0;
}

.lightbox__image {
  grid-column: 2;
  grid-row: 1;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background:
    var(--color-surface)
    url("../img/gallery/placeholder.svg") center / 96px no-repeat;
}

.lightbox__caption {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
}

.lightbox__nav {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--color-cream);
  border-radius: 0;
  cursor: pointer;
  transition: color var(--duration-base) var(--ease-out);
}

.lightbox__nav:hover { color: var(--color-accent); }
.lightbox__nav svg { width: 22px; height: 22px; }

.lightbox__thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 16px 16px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.lightbox__thumb {
  flex: none;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  background:
    var(--color-surface)
    url("../img/gallery/placeholder.svg") center / 28px no-repeat;
  cursor: pointer;
  opacity: 0.6;
  transition:
    opacity var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out);
}

.lightbox__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox__thumb:hover { opacity: 0.85; }
.lightbox__thumb[aria-current="true"] {
  opacity: 1;
  border-color: var(--color-accent);
}

@media (max-width: 720px) {
  .lightbox__inner { height: min(85vh, 600px); }
  .lightbox__image { max-height: calc(85vh - 200px); }
  .lightbox__nav { width: 36px; height: 36px; }
  .lightbox__thumb { width: 52px; height: 52px; }
}

/* ---------- Back-to-top button ---------- */
.back-to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: var(--z-nav);
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out),
    background-color var(--duration-base) var(--ease-out);
}

.back-to-top[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover { background: var(--color-cream); }

.back-to-top svg { width: 22px; height: 22px; }
