@font-face {
  font-family: "Ubuntu";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ubuntu-400.woff2") format("woff2");
}

@font-face {
  font-family: "Ubuntu";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ubuntu-500.woff2") format("woff2");
}

@font-face {
  font-family: "Ubuntu";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/ubuntu-700.woff2") format("woff2");
}

:root {
  --brand: #d3031c;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --bg: #ffffff;
  --bg-alt: #f4f4f4;
  --header-h: 64px;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Ubuntu", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid #e5e5e5;
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header__logo img {
  height: 36px;
  width: auto;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  color: var(--text);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover {
  color: var(--brand);
}

.site-nav a.is-active {
  color: var(--brand);
  border-color: var(--brand);
}

.site-nav a[aria-disabled="true"] {
  color: #b9b9b9;
  cursor: default;
  pointer-events: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
}

/* ---------- Intro ---------- */

.intro {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1rem;
  text-align: left;
}

.intro h1 {
  margin: 0 0 0.35rem;
  font-size: 2rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.intro p {
  margin: 0;
  color: var(--muted);
}

/* ---------- Simple content pages ---------- */

.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem 3.5rem;
}

.page-content p {
  color: var(--muted);
}

/* ---------- Gallery grid ---------- */

.gallery {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.gallery__loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
}

.gallery__item {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--bg-alt);
  aspect-ratio: 1 / 1;
  cursor: pointer;
  border: none;
  padding: 0;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery__item:hover img {
  transform: scale(1.05);
}

.gallery__item-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.5rem 0.6rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
  color: #fff;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gallery__item:hover .gallery__item-caption,
.gallery__item:focus .gallery__item-caption {
  opacity: 1;
}

/* ---------- Footer ---------- */

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__stage {
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  user-select: none;
}

.lightbox__image {
  max-width: 92vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox__caption {
  color: #f0f0f0;
  text-align: center;
  font-size: 0.95rem;
  margin: 0;
  max-width: 80vw;
}

.lightbox__caption .lightbox__tec {
  display: block;
  color: #b5b5b5;
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__nav:hover {
  background: var(--brand);
}

.lightbox__nav--prev {
  left: 1rem;
}

.lightbox__nav--next {
  right: 1rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid #e5e5e5;
    transform: translateY(calc(-100% - var(--header-h)));
    transition: transform 0.2s ease;
  }

  .site-nav.is-open {
    transform: translateY(0);
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
  }

  .site-nav li {
    border-bottom: 1px solid #eee;
  }

  .site-nav a {
    display: block;
    padding: 0.75rem 0;
  }

  .lightbox__nav {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.1rem;
  }

  .lightbox__close {
    font-size: 1.75rem;
  }
}

@media (max-width: 420px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
    padding: 1rem 0.75rem 2rem;
  }
}
