/* ============================================================================
   RIDNI — gallery stylesheet
   Shared by /weddings, /events, /video, /real-estate, /aerial.
   Change any rule in this file and every gallery picks it up.
   The palette, type scale, and accent intentionally mirror the homepage
   (index.html). Do NOT add a second colour family — keep it monastic.
   ============================================================================ */

/* ------- 1. Design tokens (single source of truth for colours / type) ------ */
:root {
  --ink: #0e0d0b;                         /* near-black page background */
  --paper: #f0ede8;                       /* off-white body text */
  --gold: #c9a96e;                        /* single warm accent colour */
  --muted: rgba(240, 237, 232, 0.55);     /* secondary / tagline text */
  --link: rgba(240, 237, 232, 0.78);      /* nav link at rest */
  --ghost: rgba(240, 237, 232, 0.38);     /* footer / very low-priority text */
  --hairline: rgba(240, 237, 232, 0.12);  /* thin dividers, form underlines */
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --script: "Pinyon Script", "Allura", "Dancing Script", cursive;

  /* Horizontal page padding. One knob controls the whole layout. */
  --gutter: clamp(1.25rem, 2vw + 1rem, 3rem);

  /* Masonry tuning. Change --cols to 2 / 3 / 4 to change grid density. */
  --cols: 3;
  --row: 10px;    /* masonry row unit (JS computes span-N from this) */
  --cell-gap: 18px;
}

/* ------- 2. Minimal reset (kept tiny on purpose) ----------------------------*/
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--ink); }
body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Accessible skip link — keyboard only. */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.sr-only:focus {
  position: fixed; top: 1rem; left: 1rem;
  width: auto; height: auto; clip: auto;
  padding: .5rem 1rem; background: var(--paper); color: var(--ink);
  z-index: 50; letter-spacing: .1em;
}

/* ------- 3. Top navigation bar --------------------------------------------- */
/*
   Fixed at the top on desktop, relative on mobile so it doesn't eat the
   viewport. Wordmark on the left links to the homepage; category links
   sit centre-right. The current category is subtly highlighted with gold.
*/
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
  background: linear-gradient(to bottom, rgba(14,13,11,0.95) 0%, rgba(14,13,11,0.85) 70%, rgba(14,13,11,0) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.topbar__brand img {
  height: 40px; width: auto;
}
/* Nav links container */
.topbar__nav {
  display: flex;
  gap: clamp(1rem, 2vw, 2.25rem);
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.topbar__nav a {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: clamp(0.7rem, 0.65rem + 0.2vw, 0.8rem);
  color: var(--link);
  transition: color 400ms ease;
  padding: .25rem 0;
}
.topbar__nav a:hover,
.topbar__nav a:focus-visible { color: var(--paper); outline: none; }
/* Mark the current gallery so the user knows where they are. */
.topbar__nav a[aria-current="page"] { color: var(--gold); }

/* Discreet "EN | IT" language toggle. The current language is paper-
   colour with a thin underline; the inactive language sits at low
   opacity and lifts on hover. */
.topbar__lang {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: clamp(0.7rem, 0.65rem + 0.2vw, 0.8rem);
  margin-left: 0.5rem;
  padding-left: 0.9rem;
  border-left: 1px solid var(--hairline);
}
.topbar__lang-current { color: var(--paper); }
.topbar__lang-sep     { color: var(--ghost); }
.topbar__lang-other   {
  color: var(--ghost);
  text-decoration: none;
  transition: color 400ms ease;
}
.topbar__lang-other:hover,
.topbar__lang-other:focus-visible { color: var(--gold); outline: none; }

/* ------- 4. Gallery title block -------------------------------------------- */
.gallery-head {
  padding: clamp(3rem, 6vw, 6rem) var(--gutter) clamp(2rem, 4vw, 3.5rem);
  text-align: center;
}
.gallery-head__title {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.5rem, 4vw + 1rem, 4.5rem);
  letter-spacing: 0.01em;
  color: var(--paper);
}
.gallery-head__rule {
  width: 40px;
  margin: 1.5rem auto;
  border: none;
  border-top: 1px solid var(--gold);
}
.gallery-head__tagline {
  margin: 0 auto;
  max-width: 520px;
  font-style: italic;
  color: var(--muted);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
}

/* ------- 4b. About-this-work prose block ----------------------------------- */
/*
   Editorial paragraph between the title and the image grid. Adds substantial
   text content so search engines and AI crawlers can understand what the
   page is about beyond a one-line tagline.
*/
.about-work {
  padding: 0 var(--gutter) clamp(2rem, 4vw, 3.5rem);
}
.about-work__inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.about-work__kicker {
  display: block;
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.about-work__copy {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.18rem);
  color: rgba(240, 237, 232, 0.78);
  line-height: 1.75;
}
.about-work__copy p { margin: 0 0 1.1em; }
.about-work__copy p:last-child { margin-bottom: 0; }

/* ------- 5. Masonry image grid --------------------------------------------- */
/*
   Technique: CSS Grid with short `grid-auto-rows` units. JavaScript sets
   each item's `grid-row-end: span N` after the image loads, where N is
   the item's rendered height divided by (row + gap). Visual effect =
   Pinterest-style masonry. Order = left-to-right, top-to-bottom, so the
   owner's numbered file 1.jpg always lands top-left.
*/
.gallery-grid {
  --cols-desktop: var(--cols);
  display: grid;
  grid-template-columns: repeat(var(--cols-desktop), 1fr);
  gap: var(--cell-gap);
  grid-auto-rows: var(--row);
  padding: 0 var(--gutter);
}
.gallery-grid__item {
  /* JS replaces this at load time with grid-row: span N */
  grid-row: span 40;
  position: relative;
  overflow: hidden;
  background: #17140f;       /* deep warm black while the file downloads */
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 800ms ease, transform 800ms ease;
  cursor: zoom-in;
}
.gallery-grid__item.is-loaded {
  opacity: 1;
  transform: none;
}
.gallery-grid__item img,
.gallery-grid__item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 900ms cubic-bezier(.2,.6,.2,1), filter 600ms ease;
}
.gallery-grid__item:hover img,
.gallery-grid__item:hover video {
  transform: scale(1.025);
  filter: brightness(1.04);
}
/* Play glyph for the video gallery. Plain CSS triangle = no SVG needed. */
.gallery-grid__item[data-kind="video"]::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 56px; height: 56px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(14,13,11,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow: 0 0 0 1px rgba(240,237,232,0.3) inset;
  pointer-events: none;
  transition: background 300ms ease, transform 300ms ease;
}
.gallery-grid__item[data-kind="video"]::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  margin-left: -6px;
  transform: translate(-50%, -50%);
  border-left: 14px solid var(--paper);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  z-index: 1;
  pointer-events: none;
}
.gallery-grid__item[data-kind="video"]:hover::after {
  background: rgba(201,169,110,0.25);
}

/* ------- 6. Lightbox -------------------------------------------------------- */
/*
   A zero-dependency lightbox. JS inserts one of these when an image is
   clicked. Closing happens on Esc, on the × button, or on backdrop click.
*/
.lightbox {
  position: fixed; inset: 0;
  background: rgba(6,5,4,0.94);
  display: grid;
  place-items: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 300ms ease;
  padding: 2vmin;
}
.lightbox.is-open { opacity: 1; }
.lightbox__media {
  max-width: 94vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
  box-shadow: 0 40px 80px rgba(0,0,0,0.4);
}
/* When the lightbox is showing a video (not an image), wrap it in a
   gold hairline + dark container so the native player sits in a frame
   that feels like Ridni rather than the operating system. */
video.lightbox__media {
  background: #0a0908;
  outline: 1px solid rgba(201, 169, 110, 0.35);
  outline-offset: 0;
  color-scheme: dark;     /* hints the OS controls to render in dark mode */
}
/* Soft fade-in on every render so videos don't snap in mid-stream. */
.lightbox__media {
  animation: ridni-lb-fade 320ms ease-out;
}
@keyframes ridni-lb-fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox__close,
.lightbox__nav {
  position: absolute;
  color: var(--paper);
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.8rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--hairline);
  background: rgba(14,13,11,0.4);
  transition: border-color 300ms ease, color 300ms ease, background 300ms ease;
}
.lightbox__close { top: 1.25rem; right: 1.25rem; }
.lightbox__nav--prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox__close:hover,
.lightbox__nav:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(14,13,11,0.7);
}
.lightbox__counter {
  position: absolute;
  bottom: 1.25rem; left: 50%;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  letter-spacing: 0.18em;
  font-size: 0.85rem;
}

/* ------- 7. Section break (gold hairline) ---------------------------------- */
.section-rule {
  width: 40px;
  margin: clamp(5rem, 8vw, 8rem) auto clamp(3rem, 5vw, 5rem);
  border: none;
  border-top: 1px solid var(--gold);
}

/* ------- 8. "Let's Connect" contact section -------------------------------- */
.connect {
  padding: 0 var(--gutter) clamp(4rem, 6vw, 6rem);
  text-align: center;
}
.connect__eyebrow {
  display: block;
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}
.connect__title {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.75rem, 5vw + 1rem, 5.25rem);
  letter-spacing: 0.015em;
}
.connect__script {
  display: block;
  margin: 0.75rem auto 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(1.5rem, 2vw + 1rem, 2.5rem);
  color: var(--gold);
  line-height: 1;
}
.connect__lede {
  margin: 2rem auto 0;
  max-width: 560px;
  color: var(--muted);
  font-style: italic;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
}

/* ------- 9. Contact form ---------------------------------------------------- */
.contact-form {
  margin: clamp(2.5rem, 5vw, 4rem) auto 0;
  max-width: 640px;
  display: grid;
  gap: 1.75rem;
  text-align: left;
}
.contact-form__row {
  display: grid;
  gap: 0.4rem;
}
.contact-form__label {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
}
.contact-form__input,
.contact-form__textarea {
  width: 100%;
  background: transparent;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 300;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  padding: 0.75rem 0 0.6rem;
  transition: border-color 300ms ease;
  outline: none;
  resize: vertical;
}
.contact-form__input::placeholder,
.contact-form__textarea::placeholder { color: rgba(240,237,232,0.25); }
.contact-form__input:focus,
.contact-form__textarea:focus { border-bottom-color: var(--gold); }
.contact-form__textarea { min-height: 120px; }
/* Honeypot — hidden from humans, catches bots that fill every field. */
.contact-form__hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px; opacity: 0;
}
.contact-form__submit {
  justify-self: start;
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--paper);
  padding: 1rem 2.25rem;
  border: 1px solid var(--hairline);
  background: transparent;
  transition: color 400ms ease, border-color 400ms ease, background 400ms ease;
}
.contact-form__submit:hover,
.contact-form__submit:focus-visible {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold);
}
.contact-form__status {
  min-height: 1.25em;
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.contact-form__status[data-state="success"] { color: var(--gold); }
.contact-form__status[data-state="error"]   { color: #d88a7a; }

/* ------- 10. Footer -------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: clamp(3rem, 5vw, 4.5rem) var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  align-items: center;
  justify-content: space-between;
  color: var(--ghost);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.site-footer a {
  color: var(--ghost);
  transition: color 400ms ease;
}
.site-footer a:hover,
.site-footer a:focus-visible { color: var(--link); }
.site-footer__meta {
  font-family: var(--serif);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.08em;
  color: var(--ghost);
  font-size: 0.85rem;
}

/* ------- 11. Responsive ---------------------------------------------------- */
@media (max-width: 900px) {
  :root { --cols: 2; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 0.75rem; padding-bottom: 1rem; }
  .topbar__nav { justify-content: flex-start; gap: 1.25rem; }
}
@media (max-width: 520px) {
  :root { --cols: 1; }
  .gallery-grid { --cell-gap: 12px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}

/* ------- 12. Accessibility: reduced motion --------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  .gallery-grid__item,
  .gallery-grid__item img,
  .gallery-grid__item video,
  .lightbox { transition: none !important; }
}

/* ============================================================================
   13. GDPR / email-consent banner — galleries only.
   Sticks to the bottom of the viewport, restrained and quiet, until the
   visitor clicks Accept (which sets a 1-year cookie). After that it never
   reappears, on this gallery or any other.
   ============================================================================ */
.consent {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: rgba(14, 13, 11, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--gold);
  padding: 1.25rem var(--gutter);
  /* hidden until JS decides to show it (avoids a flash for repeat visitors). */
  transform: translateY(110%);
  transition: transform 600ms cubic-bezier(.2,.7,.2,1), opacity 400ms ease;
  opacity: 0;
  pointer-events: none;
}
.consent.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.consent__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  justify-content: space-between;
}
.consent__text {
  margin: 0;
  flex: 1 1 380px;
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(0.85rem, 0.8rem + 0.2vw, 0.95rem);
  line-height: 1.55;
  color: rgba(240, 237, 232, 0.78);
}
.consent__actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.consent__privacy {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--ghost);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 2px;
  transition: color 400ms ease, border-color 400ms ease;
}
.consent__privacy:hover,
.consent__privacy:focus-visible {
  color: var(--paper);
  border-bottom-color: var(--gold);
  outline: none;
}
.consent__accept {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--paper);
  padding: 0.85rem 2rem;
  border: 1px solid var(--hairline);
  background: transparent;
  cursor: pointer;
  transition: color 400ms ease, border-color 400ms ease, background 400ms ease;
}
.consent__accept:hover,
.consent__accept:focus-visible {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold);
  outline: none;
}
@media (max-width: 640px) {
  .consent__inner { flex-direction: column; align-items: stretch; text-align: left; }
  .consent__actions { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .consent { transition: opacity 200ms ease; transform: none; }
}
