/* =========================================================
   photography.css (FINAL POLISH v3 / COMPLETE)
   Scope: ONLY photography page via body.page-photography

   Adds / fixes:
   - ✅ Skip link styling (hidden until focus)
   - ✅ Toolbar button styling (Collapse all / Open first) + hint pill
   - ✅ Better header/toolbar layout on desktop + wraps clean on mobile
   - ✅ Stronger contrast + subtle “frame” around the whole photography container
   - ✅ Safer button resets for <button> tiles/cards (no default grey)
   - ✅ Small accessibility improvements (touch targets, focus, reduced motion)
   ========================================================= */

/* ---------- Page integration: use global tokens from style.css ---------- */
body.page-photography {
  /* Hook into the global background fader variables from style.css */
  --bg1: url("./backgrounds/portfolio.jpg");
  --bg2: url("./backgrounds/portfolio.jpg");

  /* Local aliases (use your site palette) */
  --p: var(--primary);
  --s: var(--secondary);
  --a: var(--accent);

  /* Gallery surface tokens */
  --panel: rgba(0, 0, 0, 0.68);
  --panel-2: rgba(0, 0, 0, 0.50);
  --border: rgba(255, 255, 255, 0.14);
  --border-2: rgba(255, 255, 255, 0.10);

  --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.40);

  --radius: 18px;
  --radius-sm: 14px;

  --max-width: 1120px;
  --page-pad: clamp(14px, 3vw, 32px);
  --card-pad: clamp(14px, 2.2vw, 22px);
  --gap: clamp(14px, 2vw, 22px);
  --gap-sm: clamp(10px, 1.6vw, 16px);

  --ease: cubic-bezier(.2,.8,.2,1);

  color: #fff;
  font-family: var(--font-body);
  line-height: 1.6;

  /* IMPORTANT: global fader draws the background on body::before/::after */
  background: transparent;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ---------- Hygiene / resets (scoped) ---------- */
body.page-photography *,
body.page-photography *::before,
body.page-photography *::after { box-sizing: border-box; }

body.page-photography img { display: block; max-width: 100%; height: auto; }

body.page-photography :focus-visible {
  outline: 2px solid rgba(255, 107, 0, 0.80);
  outline-offset: 3px;
  border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
  body.page-photography * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Remove default button styles for tiles/cards */
body.page-photography button {
  font: inherit;
  color: inherit;
}

/* ---------- Skip link (A11y) ---------- */
body.page-photography .skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 10000;

  background: rgba(0,0,0,0.86);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 10px 14px;

  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;

  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}

body.page-photography .skip-link:focus,
body.page-photography .skip-link:focus-visible {
  left: 12px;
}

/* ---------- Page wrapper + legibility overlay (NO body::before collision) ---------- */
body.page-photography .page-wrapper {
  position: relative;
  min-height: 100vh;
}

/* Vignette overlay lives on wrapper */
body.page-photography .page-wrapper::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1100px 700px at 50% 22%, rgba(0,0,0,0.42), transparent 70%),
    linear-gradient(to bottom, rgba(0,0,0,0.58), rgba(0,0,0,0.26));
}

/* Ensure real content sits above overlay */
body.page-photography header,
body.page-photography main,
body.page-photography footer {
  position: relative;
  z-index: 1;
}

/* Container */
body.page-photography .container {
  width: min(var(--max-width), calc(100% - (var(--page-pad) * 2)));
  margin: 0 auto;
}

/* ---------- Photography section surface (the “frame” that kills grey weirdness) ---------- */
body.page-photography #photography {
  margin: clamp(14px, 2.2vw, 26px) 0 clamp(18px, 3vw, 34px);
}

body.page-photography #photography .container {
  background: var(--dark-overlay); /* from style.css */
  border-radius: clamp(16px, 2vw, 22px);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: clamp(14px, 2.4vw, 24px);

  /* subtle inner highlight to feel “intentional” */
  position: relative;
}

body.page-photography #photography .container::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: calc(clamp(16px, 2vw, 22px) - 10px);
  border: 1px solid rgba(255,255,255,0.06);
  pointer-events: none;
}

/* ---------- Heading + toolbar ---------- */
body.page-photography .photo-header {
  display: grid;
  gap: 10px;
  align-items: start;
  text-align: left;
  padding-bottom: var(--gap);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  margin-bottom: var(--gap);
}

/* Title */
body.page-photography .photo-header h1,
body.page-photography .photo-header h2,
body.page-photography .photo-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.2vw, 56px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
  color: var(--p);
  text-shadow: 2px 2px 5px rgba(0,0,0,0.55);
}

body.page-photography .photo-subtitle {
  margin: 0;
  max-width: 62ch;
  opacity: 0.86;
  font-size: clamp(14px, 1.7vw, 16px);
}

/* Toolbar layout */
body.page-photography .photo-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* Toolbar buttons: match site nav pills */
body.page-photography .tool-btn {
  appearance: none;
  border: none;
  background: var(--a);
  color: var(--background); /* from style.css */
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  padding: 0.70rem 1.10rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s var(--fade-ease), transform 0.2s var(--fade-ease);
  box-shadow: 0 10px 24px rgba(0,0,0,0.30);
  min-height: 44px; /* touch target */
}

body.page-photography .tool-btn:hover {
  background: var(--s);
  transform: translateY(-3px);
}

body.page-photography .tool-btn:active { transform: translateY(-1px); }

body.page-photography .tool-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Hint pill */
body.page-photography .tool-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.35);

  font-size: 0.95rem;
  opacity: 0.85;
}

/* Better hierarchy on large screens: title/subtitle left, toolbar right (if you want it) */
@media (min-width: 980px) {
  body.page-photography .photo-header {
    grid-template-columns: 1fr auto;
    column-gap: 18px;
    row-gap: 10px;
    align-items: center;
  }
  body.page-photography .photo-subtitle {
    grid-column: 1 / 2;
  }
  body.page-photography .photo-toolbar {
    grid-column: 2 / 3;
    justify-content: flex-end;
    margin-top: 0;
  }
}

/* ---------- Album stack ---------- */
body.page-photography .album-stack {
  display: grid;
  gap: var(--gap);
}

body.page-photography .album {
  background: rgba(0,0,0,0.78);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border-left: 4px solid var(--p);
}

body.page-photography .album-head {
  padding: var(--card-pad);
  display: grid;
  gap: 10px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.04), rgba(255,255,255,0.00));
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

body.page-photography .album-title-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: baseline;
}

@media (max-width: 760px) {
  body.page-photography .album-title-row { grid-template-columns: 1fr; }
}

body.page-photography .album-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 36px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.05;
  color: #fff;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.55);
}

body.page-photography .album-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  opacity: 0.88;
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 520px) {
  body.page-photography .album-meta { white-space: normal; }
}

body.page-photography .album-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.35);
  display: inline-block;
}

body.page-photography .album-desc {
  margin: 0;
  max-width: 72ch;
  opacity: 0.86;
  font-size: 15px;
}

/* Actions */
body.page-photography .album-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 4px;
}

body.page-photography .btn {
  appearance: none;
  border: none;
  background: var(--a);
  color: var(--background);
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  padding: 0.75rem 1.15rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s var(--fade-ease), transform 0.2s var(--fade-ease);
  box-shadow: 0 10px 24px rgba(0,0,0,0.30);
  min-height: 44px;
}

body.page-photography .btn:hover {
  background: var(--s);
  transform: translateY(-3px);
}

body.page-photography .btn:active { transform: translateY(-1px); }

body.page-photography .btn.secondary { background: var(--p); }
body.page-photography .btn.secondary:hover { background: var(--s); }

body.page-photography .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Preview strip ---------- */
body.page-photography .preview-strip {
  padding: var(--card-pad);
  padding-top: calc(var(--card-pad) - 2px);
  display: grid;
  gap: var(--gap-sm);
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

/* Desktop rhythm */
body.page-photography .preview-strip .preview-tile:nth-child(1) { grid-column: span 3; }
body.page-photography .preview-strip .preview-tile:nth-child(2),
body.page-photography .preview-strip .preview-tile:nth-child(3),
body.page-photography .preview-strip .preview-tile:nth-child(4) { grid-column: span 1; }
body.page-photography .preview-strip .preview-tile:nth-child(5),
body.page-photography .preview-strip .preview-tile:nth-child(6) { grid-column: span 2; }

@media (max-width: 980px) {
  body.page-photography .preview-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.page-photography .preview-strip .preview-tile:nth-child(1) { grid-column: span 2; }
  body.page-photography .preview-strip .preview-tile:nth-child(n+2) { grid-column: span 1; }
  body.page-photography .preview-strip .preview-tile:nth-child(5),
  body.page-photography .preview-strip .preview-tile:nth-child(6) { grid-column: span 2; }
}

@media (max-width: 520px) {
  body.page-photography .preview-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.page-photography .preview-strip .preview-tile { grid-column: auto !important; }
}

body.page-photography .preview-tile {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.18);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-soft);
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), filter 220ms var(--ease);
}

body.page-photography .preview-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.24);
  filter: saturate(1.06);
}

body.page-photography .preview-tile img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transform: scale(1);
  transition: transform 520ms var(--ease);
}

body.page-photography .preview-tile:hover img { transform: scale(1.035); }

body.page-photography .preview-tile.more::after {
  content: "View all";
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.55);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ---------- Album body + grid ---------- */
body.page-photography .album-body {
  padding: var(--card-pad);
  border-top: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.40);
}

body.page-photography .album:not(.is-open) .album-body { display: none; }

body.page-photography .photo-grid {
  display: grid;
  gap: var(--gap-sm);
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

/* Desktop rhythm */
body.page-photography .photo-card { grid-column: span 4; }
body.page-photography .photo-card:nth-child(6n+1),
body.page-photography .photo-card:nth-child(6n+2) { grid-column: span 6; }

@media (max-width: 980px) {
  body.page-photography .photo-card { grid-column: span 6; }
  body.page-photography .photo-card:nth-child(6n+1),
  body.page-photography .photo-card:nth-child(6n+2) { grid-column: span 12; }
}

@media (max-width: 520px) {
  body.page-photography .photo-grid { grid-template-columns: 1fr; }
  body.page-photography .photo-card { grid-column: auto; }
}

body.page-photography .photo-card {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.18);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), filter 220ms var(--ease);
  text-align: left;
}

body.page-photography .photo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.24);
  filter: saturate(1.06);
}

body.page-photography .photo-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 520ms var(--ease);
}

body.page-photography .photo-card:hover img { transform: scale(1.035); }

body.page-photography .photo-caption {
  display: block;
  padding: 10px 12px;
  font-size: 13px;
  opacity: 0.88;
  border-top: 1px solid rgba(255,255,255,0.10);
}

/* ---------- No-JS note (if present) ---------- */
body.page-photography .noscript-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.42);
  opacity: 0.92;
}

/* ---------- Lightbox ---------- */
html.dk-scrolllock,
html.dk-scrolllock body { overflow: hidden; height: 100%; }

body.page-photography .dk-modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: clamp(12px, 2.2vw, 22px);
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
}

body.page-photography .dk-modal.is-open { display: grid; }

body.page-photography .dk-modal-content {
  width: min(1100px, 100%);
  max-height: min(86vh, 900px);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.90);
  box-shadow: 0 30px 90px rgba(0,0,0,0.72);
  overflow: hidden;
  position: relative;
}

body.page-photography .dk-close-btn {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: var(--a);
  color: var(--background);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s var(--fade-ease), transform 0.2s var(--fade-ease);
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

body.page-photography .dk-close-btn:hover {
  background: var(--s);
  transform: translateY(-3px);
}

body.page-photography .dk-lightbox-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 0 16px;
  gap: 12px;
  font-size: 13px;
  opacity: 0.92;
}

body.page-photography .lightbox-figure {
  margin: 0;
  padding: 0 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

body.page-photography #dkLightboxImg {
  width: 100%;
  height: auto;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.20);
}

body.page-photography #dkLightboxCaption {
  margin: 10px 16px 0;
  padding-bottom: 2px;
  font-size: 13px;
  opacity: 0.86;
  text-align: center;
  min-height: 18px;
}

body.page-photography .lightbox-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 16px;
}

body.page-photography .nav-btn {
  appearance: none;
  border: none;
  background: var(--a);
  color: var(--background);
  font-family: var(--font-display);
  font-size: 1.15rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s var(--fade-ease), transform 0.2s var(--fade-ease);
  box-shadow: 0 10px 24px rgba(0,0,0,0.30);
  min-height: 44px;
}

body.page-photography .nav-btn:hover {
  background: var(--s);
  transform: translateY(-3px);
}

body.page-photography .lightbox-hint {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 16px 16px;
  font-size: 12px;
  opacity: 0.65;
}

body.page-photography .lightbox-hint span {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
}

body.page-photography .ui-hidden .dk-lightbox-hud,
body.page-photography .ui-hidden .lightbox-controls,
body.page-photography .ui-hidden .lightbox-hint,
body.page-photography .ui-hidden #dkLightboxCaption { display: none; }

@media (max-width: 520px) {
  body.page-photography #dkLightboxImg { max-height: 56vh; }
  body.page-photography .dk-close-btn { right: 10px; top: 10px; }
  body.page-photography .tool-hint { width: 100%; justify-content: center; }
}
