:root {
  --bg: #0b0b0c;
  --text: rgba(255, 255, 255, 0.78);
  --muted: rgba(255, 255, 255, 0.6);
  --white: #fff;
  --mail: #ffd84d;
  --mail-hover: #ffe680;
  --overlay: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.15) 55%, transparent);
}

/* ==================================================
   Fonts
================================================== */

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

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

/* ==================================================
   Reset and Base Styles
================================================== */

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

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}

main {
  display: block;
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
}

/* ==================================================
   Typography
================================================== */

h1,
h2,
h3,
h4,
.gallery-title {
  width: 100%;
  text-align: center;
}

h1 {
  margin-bottom: 12px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1;
}

h2,
h3,
.gallery-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.04;
}

h4 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.1;
}

/* ==================================================
   Links
================================================== */

a[href^="mailto:"] {
  color: var(--mail);
  font-weight: 700;
  text-decoration: none;
}

a[href^="mailto:"]:hover,
a[href^="mailto:"]:focus-visible {
  color: var(--mail-hover);
  text-decoration: underline;
}

/* ==================================================
   Gallery Banner
================================================== */

.gallery-banner {
  display: flex;
  width: 100%;
  min-height: 500px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 80px 24px 0;
  color: var(--white);
  text-align: center;
  background:
    linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.65)),
    url("../images/banner-1.jpg") center / cover no-repeat;
  transition: background-image 1s ease-in-out;
}

.gallery-banner-content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}

.gallery-kicker {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.75);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.gallery-banner h1 {
  margin-bottom: 18px;
  color: var(--white);
}

.gallery-intro {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.86);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.35;
  text-align: center;
}

/* ==================================================
   Gallery Grid
================================================== */

#gallery-container {
  display: block;
  width: 100%;
  min-height: 1px;
  margin: 0;
  padding: 0;
  background: var(--bg);
}

.grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: -1px 0 0;
  padding: 0;
  background: var(--bg);
}

.tile {
  min-width: 0;
  margin: 0;
  padding: 0;
}

.tile-link {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  color: inherit;
  line-height: 0;
  text-decoration: none;
}

/* ==================================================
   Gallery Images
================================================== */

.tile-link img,
#gallery-container img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  object-fit: cover;
  vertical-align: middle;
  transition:
    transform 0.3s ease,
    filter 0.3s ease;
}

/* ==================================================
   Optional Captions
================================================== */

.caption {
  display: block;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================================================
   Image Overlay
================================================== */

.tile-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--overlay);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.alt-overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  padding: 24px 12px 12px;
  color: var(--white);
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

/* ==================================================
   Hover and Keyboard Focus
================================================== */

.tile-link:hover img,
.tile-link:focus-visible img {
  filter: contrast(1.02) brightness(1.02);
  transform: scale(1.01);
}

.tile-link:hover::after,
.tile-link:focus-visible::after,
.tile-link:hover .alt-overlay,
.tile-link:focus-visible .alt-overlay {
  opacity: 1;
  visibility: visible;
}

.tile-link:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: -2px;
}

/* ==================================================
   Responsive Layout
================================================== */

@media (max-width: 1100px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .gallery-banner {
    min-height: 420px;
    padding: 48px 12px 0;
  }

  .gallery-banner-content {
    padding: 0 8px;
  }

  .gallery-banner h1 {
    font-size: 44px;
  }

  .gallery-intro {
    max-width: none;
    font-size: 21px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .alt-overlay {
    padding: 20px 10px 10px;
    font-size: 14px;
  }
}

/* ==================================================
   Reduced Motion
================================================== */

@media (prefers-reduced-motion: reduce) {
  .gallery-banner,
  .tile-link img,
  .tile-link::after,
  .alt-overlay {
    transition: none;
  }
}