/* ============================================================
   main.css
   Palette: blush paper bg, vivid rose accent, warm gold detail
   Type: Fraunces (display) + Manrope (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500;1,9..144,600&family=Manrope:wght@400;500;600;700;800&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { scroll-margin-top: 0 !important; scroll-margin-bottom: 0 !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

:root {
  /* surfaces */
  --paper:        #fff6f8;
  --surface:      #ffffff;
  --surface-alt:  #fdebf1;
  --surface-deep: #fbe0ea;

  /* accent */
  --rose:         #e0527a;
  --rose-deep:    #c13860;
  --rose-pale:    #f6c9d6;
  --rose-glow:    rgba(224, 82, 122, 0.32);
  --gold:         #cba35c;

  /* text */
  --ink:          #3b2430;
  --ink-soft:     #8b6b76;
  --ink-faint:    #c79cab;

  /* lines */
  --line:         #f1d9e1;
  --line-strong:  #e7b9c9;

  /* system */
  --radius-s:     10px;
  --radius-m:     18px;
  --ease:         0.25s cubic-bezier(.4,0,.2,1);
  --viewer-cap:   1120px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--rose-deep); text-decoration: none; }
a:hover { color: var(--rose); }

img { display: block; max-width: 100%; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--rose-pale); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--rose); }

/* ── Topbar ───────────────────────────────────────────────── */
.fg-topbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 28px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(224, 82, 122, 0.04);
}

.fg-brand-link { text-decoration: none; }

.fg-brand {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}

.fg-brand em {
  font-style: italic;
  color: var(--rose);
}

.fg-tagline {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.3;
  white-space: nowrap;
  position: relative;
  padding-top: 6px;
}

.fg-tagline::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 1px;
  background: var(--line-strong);
}

/* ── Main container ───────────────────────────────────────── */
.fg-main {
  flex: 1;
  padding: 32px 22px 52px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* ── Section eyebrow label ────────────────────────────────── */
.fg-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--rose-deep);
  margin-bottom: 20px;
}

.fg-eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* ── Gallery grid ─────────────────────────────────────────── */
.fg-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

@media (max-width: 1280px) { .fg-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 960px)  { .fg-grid { grid-template-columns: repeat(4, 1fr); gap: 11px; } }
@media (max-width: 640px)  { .fg-grid { grid-template-columns: repeat(3, 1fr); gap: 9px; } }
@media (max-width: 380px)  { .fg-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; } }
@media (max-width: 300px)  { .fg-grid { grid-template-columns: 1fr; } }

/* ── Gallery tile ─────────────────────────────────────────── */
.fg-tile {
  position: relative;
  display: block;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--surface-alt);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(59, 36, 48, 0.06);
  transition: box-shadow var(--ease), transform var(--ease);
}

.fg-tile:hover {
  box-shadow: 0 14px 32px -8px var(--rose-glow);
  transform: translateY(-3px);
}

.fg-tile__figure {
  display: flex;
  flex-direction: column;
}

/* label plaque sits above the image */
.fg-tile__tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--line);
}

.fg-tile__dot {
  width: 5px;
  height: 5px;
  min-width: 5px;
  border-radius: 50%;
  background: var(--rose);
}

.fg-tile__frame {
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  position: relative;
}

.fg-tile__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease), filter var(--ease);
}

.fg-tile:hover .fg-tile__frame img {
  transform: scale(1.05);
}

.fg-tile__frame::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--rose));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ease);
}

.fg-tile:hover .fg-tile__frame::after { transform: scaleX(1); }

/* ── Filmstrip (in-gallery thumbnails) ────────────────────── */
.fg-filmstrip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 44px;
}

@media (max-width: 1280px) { .fg-filmstrip { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 960px)  { .fg-filmstrip { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 640px)  { .fg-filmstrip { grid-template-columns: repeat(4, 1fr); gap: 6px; } }
@media (max-width: 420px)  { .fg-filmstrip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 320px)  { .fg-filmstrip { grid-template-columns: repeat(2, 1fr); } }

.fg-frame {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-s);
  aspect-ratio: 2 / 3;
  background: var(--surface-alt);
  border: 2px solid transparent;
  transition: border-color var(--ease);
}

.fg-frame.is-active,
.fg-frame:hover {
  border-color: var(--rose);
}

.fg-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter var(--ease);
}

.fg-frame:hover img { filter: brightness(0.88); }
.fg-frame.is-active img { filter: brightness(0.8); }

.fg-navctl { scroll-margin: 0; }
.fg-navctl:focus { outline: none; }

/* ── Viewer ───────────────────────────────────────────────── */
.fg-viewer { margin-bottom: 40px; }

.fg-viewer__shell {
  max-width: var(--viewer-cap);
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px -12px rgba(193, 56, 96, 0.18);
}

.fg-viewer__stage {
  width: 100%;
  height: 75vh;
  min-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fbeef2;
  position: relative;
}

.fg-viewer__stage img {
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.fg-viewer__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 16px 10px;
  flex-wrap: wrap;
}

.fg-viewer__count {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--rose-deep);
  font-weight: 500;
}

.fg-viewer__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.fg-navctl {
  background: var(--surface);
  border: none;
  color: var(--ink);
  padding: 14px 16px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: inherit;
  text-align: center;
  transition: background var(--ease), color var(--ease);
}

.fg-viewer__nav .fg-navctl:first-child {
  border-right: 1px solid var(--line);
}

.fg-navctl:hover { background: var(--rose-pale); color: var(--rose-deep); }
.fg-navctl:disabled { opacity: 0.35; cursor: default; background: var(--surface); color: var(--ink); }

.fg-btn-solid {
  background: var(--rose);
  border: none;
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--radius-s);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background var(--ease), box-shadow var(--ease);
  text-decoration: none;
  display: inline-block;
}

.fg-btn-solid:hover {
  background: var(--rose-deep);
  color: #fff;
  box-shadow: 0 6px 18px -4px var(--rose-glow);
}

/* ── Recent / more galleries section ──────────────────────── */
.fg-section-recent { margin-top: 48px; }

/* ── Footer ───────────────────────────────────────────────── */
.fg-footer {
  border-top: 1px solid var(--line);
  padding: 20px 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 20px;
  background: var(--surface);
}

.fg-footer a {
  color: var(--ink-soft);
  font-weight: 600;
  transition: color var(--ease);
}

.fg-footer a:hover { color: var(--rose-deep); }

.fg-footer__sep {
  color: var(--ink-faint);
  user-select: none;
}

/* ── Dialog (generic modal) ───────────────────────────────── */
.fg-dialog {
  position: fixed;
  inset: 0;
  background: rgba(59, 36, 48, 0.45);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.fg-dialog.is-open {
  opacity: 1;
  pointer-events: all;
}

.fg-dialog__panel {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 30px 30px 26px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px -12px rgba(59, 36, 48, 0.3);
}

.fg-dialog__close {
  position: absolute;
  top: 12px; right: 14px;
  background: var(--surface-alt);
  border: none;
  color: var(--ink-soft);
  font-size: 1.1rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition: background var(--ease), color var(--ease);
}

.fg-dialog__close:hover { background: var(--rose-pale); color: var(--rose-deep); }

.fg-dialog__title {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
  padding-right: 26px;
}

.fg-dialog__body {
  font-size: 0.87rem;
  color: var(--ink-soft);
  line-height: 1.8;
}

/* ── Age gate ─────────────────────────────────────────────── */
.fg-gate {
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.fg-gate__panel {
  background: linear-gradient(160deg, #ffffff 0%, #fdeef2 100%);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 44px 34px 34px;
  width: 100%;
  max-width: 410px;
  text-align: center;
  box-shadow: 0 24px 70px -16px rgba(193, 56, 96, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}

.fg-gate__mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--rose-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--rose-deep);
}

.fg-gate__panel h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}

.fg-gate__panel p {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.75;
}

.fg-gate__terms {
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 12px 16px;
  line-height: 1.7;
  width: 100%;
  text-align: left;
}

.fg-gate__cta {
  background: var(--rose);
  color: #fff;
  border: none;
  padding: 14px 0;
  width: 100%;
  border-radius: var(--radius-s);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--ease), box-shadow var(--ease), transform var(--ease);
}

.fg-gate__cta:hover {
  background: var(--rose-deep);
  box-shadow: 0 10px 26px -6px var(--rose-glow);
  transform: translateY(-1px);
}

.fg-gate__legal {
  font-size: 0.7rem;
  color: var(--ink-faint);
  line-height: 1.5;
}

/* ── Load more ────────────────────────────────────────────── */
.fg-loadmore-wrap {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  margin-bottom: 12px;
}

.fg-btn-ghost {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  padding: 13px 50px;
  border-radius: var(--radius-s);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
  min-width: 210px;
}

.fg-btn-ghost:hover { border-color: var(--rose); color: var(--rose-deep); background: var(--rose-pale); }
.fg-btn-ghost:disabled { opacity: 0.45; cursor: default; }

/* ── Utility ──────────────────────────────────────────────── */
.fg-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}

.fg-skeleton {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(110deg, var(--surface-alt) 30%, var(--surface-deep) 50%, var(--surface-alt) 70%);
  background-size: 200% 100%;
  animation: fg-shimmer 1.4s infinite;
  border-radius: var(--radius-m);
}

@keyframes fg-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.fg-empty {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  .fg-topbar { padding: 11px 16px; gap: 10px; }
  .fg-brand { font-size: 1.3rem; }
  .fg-tagline { font-size: 0.64rem; padding-left: 10px; }
  .fg-main { padding: 20px 12px 44px; }
  .fg-dialog__panel { padding: 24px 20px 20px; }
  .fg-gate__panel { padding: 32px 22px 26px; }
}