/* Design tokens — a+ Akademien der Wissenschaften Schweiz */
:root {
  --font-sans: "Montserrat", system-ui, -apple-system, sans-serif;

  /* Brand colors */
  --red-500: #EA515A;
  --red-600: #D43F48;
  --gray-100: #F0F4F3;
  --gray-200: #EBECEB;
  --gray-250: #E1E2E6;
  --gray-500: #68707A;
  --slate-500: #5A616B;
  --black: #000;
  --white: #fff;

  /* Radius — bottom-left only motif */
  --radius-bl: 0.625rem;
  --radius-bl-sm: 0.5rem;

  /* Motion */
  --duration: 200ms;
  --duration-slow: 300ms;
  --ease: cubic-bezier(.4, 0, .2, 1);

  /* Layout */
  --container: 87rem;
  --gutter: 1.5rem;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { color: transparent; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--red-500); text-decoration: none; }
a:hover { color: var(--red-600); }


/* ── Page container ── */
.page-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}


/* ── Site header ── */
.site-header {
  border-bottom: 1px solid var(--gray-250);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-logo {
  height: 52px;
  width: auto;
}

.header-right {
  display: flex;
  align-items: center;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-btn {
  font-size: 0.8125rem;
  font-weight: 300;
  color: var(--gray-500);
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  transition: color var(--duration) var(--ease);
}

.lang-btn:hover,
.lang-btn.active {
  color: var(--black);
  font-weight: 500;
}


/* ── Loading / error screen ── */
.gallery-loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2rem;
  color: var(--gray-500);
  font-size: 1rem;
  font-weight: 300;
  text-align: center;
}

.gallery-loading-screen code {
  background: var(--gray-100);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}


/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 0 0;
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--gray-500);
  flex-wrap: wrap;
}

.breadcrumb-link {
  color: var(--gray-500);
  transition: color var(--duration) var(--ease);
}

.breadcrumb-link:hover { color: var(--black); }
.breadcrumb-current { color: var(--black); }
.breadcrumb-sep { color: var(--gray-500); }


/* ── Hero section ── */
.hero-section {
  padding: 2.5rem 0 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 3rem;
  align-items: end;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 2rem;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--red-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-label-rule {
  display: block;
  width: 1.75rem;
  height: 2px;
  background: var(--red-500);
  flex: none;
}

.hero-title {
  margin: 0.875rem 0 0;
  font-size: clamp(1.875rem, 3.4vw, 3.25rem);
  line-height: 1.1;
  font-weight: 600;
  color: var(--black);
  max-width: 28ch;
}

.hero-description {
  margin-top: 1.25rem;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--black);
  max-width: 60ch;
}

.hero-description p { margin: 0; }

.hero-description a {
  color: var(--red-500);
  font-weight: 400;
}

.hero-right {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-bottom: 0.25rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 1rem 1.5rem;
  border-left: 1px solid var(--gray-250);
  padding-left: 1.5rem;
}

.hero-stat dt {
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-stat dd {
  margin: 0.375rem 0 0;
  font-size: 1.125rem;
  font-weight: 600;
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-left: 1.5rem;
}

/* Primary button — red, bottom-left radius */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--red-500);
  color: var(--white);
  border: none;
  border-radius: 0 0 0 var(--radius-bl);
  padding: 0.6875rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  transition: background var(--duration) var(--ease);
}

.btn-primary:hover { background: var(--red-600); }

.btn-primary svg {
  width: 0.875rem;
  height: 0.875rem;
  flex: none;
}


/* ── Gallery toolbar ── */
.gallery-toolbar {
  padding: 2rem 0 0;
}

.toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 0.875rem;
}

.toolbar-text {
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--gray-500);
  white-space: nowrap;
}

.toolbar-sep-v {
  display: block;
  width: 1px;
  height: 1rem;
  background: var(--gray-250);
  flex: none;
}

#photographer-credit:empty,
#photographer-credit:empty + #toolbar-sep {
  display: none;
}


/* ── Gallery grid ── */
.gallery-section {
  padding: 1rem 0 4rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.grid-item {
  position: relative;
  display: block;
  background: var(--gray-100);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

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

.grid-item:hover img {
  transform: scale(1.03);
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity var(--duration) ease-in-out;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.grid-item:hover .grid-overlay {
  opacity: 1;
}

.dl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--red-500);
  border: none;
  border-radius: 0 0 0 var(--radius-bl-sm);
  color: var(--white);
  flex: none;
  padding: 0;
  transition: background var(--duration) var(--ease);
}

.dl-btn:hover { background: var(--red-600); }

.dl-btn svg {
  width: 0.9rem;
  height: 0.9rem;
}


/* ── Footer ── */
.site-footer {
  background: var(--slate-500);
  color: var(--white);
  margin-top: 1rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.footer-logo-wrap {
  display: flex;
  align-items: flex-start;
}

.footer-logo {
  height: 48px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer-col {
  font-size: 0.8125rem;
  font-weight: 300;
  line-height: 1.7;
}

.footer-col-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}


/* ── Lightbox ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease);
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  color: var(--white);
  flex: none;
}

.lightbox-meta {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  min-width: 0;
  flex: 1;
}

.lightbox-counter {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--red-500);
  flex: none;
}

.lightbox-caption {
  font-size: 0.8125rem;
  font-weight: 300;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--white);
}

.lightbox-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: none;
}

.lightbox-action-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  border: 1px solid var(--white);
  color: var(--white);
  background: transparent;
  border-radius: 0 0 0 var(--radius-bl);
  padding: 0.5rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 500;
  transition: background var(--duration) var(--ease);
}

.lightbox-action-btn:hover { background: rgba(255,255,255,0.12); }

.lightbox-action-btn svg {
  width: 0.85rem;
  height: 0.85rem;
  flex: none;
}

.lightbox-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.375rem;
  height: 2.375rem;
  border: 1px solid rgba(255,255,255,0.35);
  background: transparent;
  color: var(--white);
  border-radius: 0 0 0 var(--radius-bl);
  transition: border-color var(--duration) var(--ease);
  padding: 0;
}

.lightbox-close-btn:hover { border-color: var(--white); }

.lightbox-close-btn svg {
  width: 1rem;
  height: 1rem;
}

.lightbox-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  min-height: 0;
}

.lightbox-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  border: 1px solid rgba(255,255,255,0.35);
  background: transparent;
  color: var(--white);
  border-radius: 0 0 0 var(--radius-bl);
  transition: border-color var(--duration) var(--ease);
  padding: 0;
}

.lightbox-nav-btn:hover { border-color: var(--white); }

.lightbox-nav-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.lightbox-img-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Film strip at the bottom of the lightbox */
.lightbox-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  flex: none;
  scrollbar-width: none;
}

.lightbox-strip::-webkit-scrollbar { display: none; }

.lightbox-thumb-btn {
  width: 4.5rem;
  height: 3.25rem;
  flex: none;
  padding: 0;
  border: 2px solid transparent;
  background: none;
  opacity: 0.45;
  transition: opacity var(--duration) ease-in-out, border-color var(--duration) ease-in-out;
  outline: none;
}

.lightbox-thumb-btn.active {
  opacity: 1;
  border-color: var(--red-500);
}

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


/* ── Responsive ── */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-stats {
    border-left: none;
    border-top: 1px solid var(--gray-250);
    padding-left: 0;
    padding-top: 1.5rem;
  }

  .hero-actions { padding-left: 0; }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.875rem;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    row-gap: 2rem;
  }

  .footer-logo-wrap {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .site-header-inner { padding: 1rem var(--gutter); }
  .site-logo { height: 38px; }

  .hero-title { font-size: 1.75rem; }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .lightbox-topbar {
    padding: 0.875rem 1rem;
    gap: 0.75rem;
  }

  .lightbox-action-btn span { display: none; }
  .lightbox-action-btn { padding: 0.5rem 0.625rem; }

  .lightbox-body {
    padding: 0 0.75rem;
    gap: 0.5rem;
  }

  .toolbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
  }

  .toolbar-sep-v { display: none; }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
