/* ================================================================
   portfolio.css — Three-section portfolio page
   Sections: Portraits (albums), Film (YouTube), ceremony (grid)
   Requires CSS variables from global.css
   ================================================================ */


/* ════════════════════════════════════════════════════════════════
   1.  SECTION TABS
   ════════════════════════════════════════════════════════════════ */

.pf-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--warm);
  border-bottom: 1px solid var(--warm);
  padding: 3px;
}

.pf-tab {
  flex: 0 0 auto;
  min-width: 160px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mist);
  background: var(--ivory);
  border: none;
  padding: 18px 40px;
  cursor: pointer;
  position: relative;
  transition: color 0.25s ease, background 0.25s ease;
  margin: 0 1.5px;
}

.pf-tab::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: var(--accent);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.pf-tab:hover { color: var(--charcoal); }
.pf-tab.active {
  color: var(--charcoal);
  background: var(--white);
}
.pf-tab.active::after { width: 60%; }


/* ════════════════════════════════════════════════════════════════
   2.  SECTION WRAPPER
   ════════════════════════════════════════════════════════════════ */

.pf-section {
  display: none;
  animation: sectionIn 0.4s ease both;
}
.pf-section.active { display: block; }

@keyframes sectionIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pf-section-header {
  text-align: center;
  padding: 72px var(--gap-lg) 12px;
}

.pf-section-eyebrow {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.pf-section-title {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 300;
  color: var(--charcoal);
  line-height: 1.15;
  margin-bottom: 14px;
}
.pf-section-title em { font-style: italic; color: var(--accent); }

.pf-section-sub {
  font-size: 13px;
  color: var(--mist);
  letter-spacing: 0.06em;
  margin-bottom: 0;
}


/* ════════════════════════════════════════════════════════════════
   3.  PORTRAIT ALBUMS GRID
   ════════════════════════════════════════════════════════════════ */

.albums-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 40px var(--gap-lg) 72px;
  background: var(--ivory);
}

.album-card {
  cursor: pointer;
  overflow: hidden;
  background: var(--warm);
  position: relative;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.album-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(42, 40, 38, 0.14);
  z-index: 1;
}

.album-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.album-card:hover .album-cover { transform: scale(1.04); }

.album-cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28, 26, 24, 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.35s ease;
}
.album-card:hover .album-cover-overlay { background: rgba(28, 26, 24, 0.48); }

.album-count {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.album-open-hint {
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  color: var(--white);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease 0.05s, transform 0.3s ease 0.05s;
}

.album-card:hover .album-count,
.album-card:hover .album-open-hint {
  opacity: 1;
  transform: translateY(0);
}

.album-info {
  padding: 18px 20px 22px;
  background: var(--ivory);
  border-top: 1px solid var(--warm);
}

.album-couple {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 300;
  color: var(--charcoal);
  margin: 0 0 6px;
  line-height: 1.2;
}

.album-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mist);
}
.album-location svg { color: var(--accent); flex-shrink: 0; }


/* ════════════════════════════════════════════════════════════════
   4.  ALBUM LIGHTBOX (slide-up panel)
   ════════════════════════════════════════════════════════════════ */

#album-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 8000;
  align-items: flex-end;
  justify-content: center;
}
#album-lightbox.open {
  display: flex;
  animation: lbFadeIn 0.25s ease both;
}

.alb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 16, 14, 0.7);
  cursor: zoom-out;
}

.alb-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 90vh;
  background: var(--ivory);
  overflow-y: auto;
  animation: panelUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes panelUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.alb-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: var(--ivory);
  border-bottom: 1px solid var(--warm);
}

.alb-meta { display: flex; flex-direction: column; gap: 3px; }

.alb-couple {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 300;
  color: var(--charcoal);
}

.alb-location {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mist);
}

.alb-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--mist);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}
.alb-close:hover { color: var(--accent); }

.alb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 3px;
  background: var(--warm);
}

.alb-photo-cell {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--warm);
}
.alb-photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}
.alb-photo-cell:hover img { transform: scale(1.06); }


/* ════════════════════════════════════════════════════════════════
   5.  PHOTO VIEWER (fullscreen inside album)
   ════════════════════════════════════════════════════════════════ */

.alb-photo-viewer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
.alb-photo-viewer.open {
  display: flex;
  animation: lbFadeIn 0.2s ease both;
}

.apv-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 9, 0.97);
  cursor: zoom-out;
}

.apv-close {
  position: absolute;
  top: 18px; right: 22px;
  background: none; border: none;
  font-size: 30px; line-height: 1;
  color: rgba(240,235,228,0.55);
  cursor: pointer; z-index: 2;
  transition: color 0.2s;
}
.apv-close:hover { color: var(--accent); }

.apv-prev,
.apv-next {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(240,235,228,0.5);
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer; z-index: 2;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.apv-prev { left: 20px; }
.apv-next { right: 20px; }
.apv-prev:hover,
.apv-next:hover {
  color: var(--white);
  border-color: var(--accent);
  background: rgba(184,149,106,0.12);
}

.apv-img-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.apv-img-wrap img {
  max-width: 88vw;
  max-height: 86vh;
  object-fit: contain;
  display: block;
  box-shadow: 0 16px 80px rgba(0,0,0,0.7);
  animation: lbImageIn 0.25s ease both;
}

.apv-counter {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-size: 13px; font-weight: 300;
  color: rgba(180,170,160,0.45);
  letter-spacing: 0.14em;
  z-index: 2;
}


/* ════════════════════════════════════════════════════════════════
   6.  FILM GRID
   ════════════════════════════════════════════════════════════════ */

.films-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 40px var(--gap-lg) 72px;
  background: var(--ivory);
}

.film-card {
  cursor: pointer;
  overflow: hidden;
  background: var(--charcoal);
  position: relative;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.film-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 56px rgba(0,0,0,0.25);
  z-index: 1;
}

.film-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1a1816;
}

.film-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s ease, opacity 0.3s ease;
  opacity: 0.85;
}
.film-card:hover .film-thumb { transform: scale(1.04); opacity: 0.65; }

.film-play-btn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 64px; height: 64px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  opacity: 0.8;
  pointer-events: none;
}
.film-card:hover .film-play-btn {
  transform: translate(-50%, -50%) scale(1.15);
  opacity: 1;
}
.film-play-btn svg { width: 100%; height: 100%; }

.film-info {
  padding: 22px 24px 26px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.film-couple {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 300;
  color: var(--white);
  margin: 0 0 6px;
}

.film-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.film-location svg { flex-shrink: 0; }

.film-desc {
  font-size: 13px;
  color: rgba(200,190,180,0.65);
  line-height: 1.7;
  margin: 0;
  font-style: italic;
}


/* ════════════════════════════════════════════════════════════════
   7.  YOUTUBE MODAL
   ════════════════════════════════════════════════════════════════ */

#yt-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
#yt-modal.open {
  display: flex;
  animation: lbFadeIn 0.22s ease both;
}

.yt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 9, 8, 0.97);
  cursor: zoom-out;
}

.yt-content {
  position: relative;
  z-index: 1;
  width: 92vw;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.yt-close {
  position: absolute;
  top: -44px; right: 0;
  background: none; border: none;
  font-size: 30px; line-height: 1;
  color: rgba(240,235,228,0.55);
  cursor: pointer;
  transition: color 0.2s;
}
.yt-close:hover { color: var(--accent); }

.yt-embed-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.yt-embed-wrap iframe {
  width: 100%; height: 100%;
  border: none;
  display: block;
}

.yt-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 4px;
}

.yt-modal-couple {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 300;
  color: var(--white);
}

.yt-modal-loc {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}


/* ════════════════════════════════════════════════════════════════
   8.  ceremony GRID (CSS grid masonry)
   ════════════════════════════════════════════════════════════════ */

.ceremony-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: 3px;
  padding: 40px var(--gap-lg) 72px;
  background: var(--ivory);
}

.ceremony-item {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--warm);
  grid-row: span 1;
}

.ceremony-item.landscape { grid-column: span 2; grid-row: span 1; }
.ceremony-item.portrait  { grid-column: span 1; grid-row: span 2; }
.ceremony-item.square    { grid-column: span 1; grid-row: span 1; }

.ceremony-img-wrap {
  width: 100%; height: 100%;
}
.ceremony-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.ceremony-item:hover .ceremony-img-wrap img { transform: scale(1.07); }

.ceremony-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28, 26, 24, 0);
  display: flex;
  align-items: flex-end;
  padding: 16px;
  transition: background 0.35s ease;
}
.ceremony-item:hover .ceremony-overlay { background: rgba(28, 26, 24, 0.52); }

.ceremony-caption {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--white);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  line-height: 1.5;
}
.ceremony-item:hover .ceremony-caption {
  opacity: 1;
  transform: translateY(0);
}


/* ════════════════════════════════════════════════════════════════
   9.  ceremony LIGHTBOX
   ════════════════════════════════════════════════════════════════ */

#ceremony-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
#ceremony-lightbox.open {
  display: flex;
  animation: lbFadeIn 0.22s ease both;
}

.cl-backdrop {
  position: absolute; inset: 0;
  background: rgba(12, 10, 9, 0.96);
  cursor: zoom-out;
}

.cl-content {
  position: relative; z-index: 1;
  width: 92vw; max-width: 1100px;
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
  padding: 20px 60px;
  box-sizing: border-box;
}

.cl-img-wrap { width: 100%; display: flex; justify-content: center; }
#cl-img {
  max-width: 100%; max-height: 78vh;
  object-fit: contain; display: block;
  box-shadow: 0 12px 60px rgba(0,0,0,0.6);
  animation: lbImageIn 0.28s ease both;
}

.cl-caption {
  font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(220,210,200,0.65);
  text-align: center;
}

.cl-counter {
  font-family: var(--serif);
  font-size: 13px; font-weight: 300;
  color: rgba(180,170,160,0.4);
  letter-spacing: 0.14em;
}

.cl-close {
  position: absolute; top: 0; right: 0;
  background: none; border: none;
  color: rgba(240,235,228,0.55);
  font-size: 28px; line-height: 1;
  cursor: pointer; padding: 6px 10px;
  transition: color 0.2s;
}
.cl-close:hover { color: var(--accent); }

.cl-prev,
.cl-next {
  position: fixed; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(240,235,228,0.5);
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; z-index: 2;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.cl-prev { left: 20px; }
.cl-next { right: 20px; }
.cl-prev:hover, .cl-next:hover {
  color: var(--white);
  border-color: var(--accent);
  background: rgba(184,149,106,0.12);
}


/* ════════════════════════════════════════════════════════════════
   10.  SHARED KEYFRAMES
   ════════════════════════════════════════════════════════════════ */

@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes lbImageIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}


/* ════════════════════════════════════════════════════════════════
   11.  GALLERY CTA
   ════════════════════════════════════════════════════════════════ */

.gallery-cta {
  padding: 72px var(--gap-lg);
  text-align: center;
  border-top: 1px solid var(--warm);
  background: var(--ivory);
}
.gallery-cta p {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 300;
  font-style: italic;
  color: var(--mist);
  margin-bottom: 32px;
  letter-spacing: 0.01em;
}


/* ════════════════════════════════════════════════════════════════
   12.  RESPONSIVE
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
  .ceremony-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 180px;
  }
}

@media (max-width: 960px) {
  .pf-tab { min-width: auto; padding: 16px 24px; font-size: 13px; }

  .albums-grid  { grid-template-columns: repeat(2, 1fr); padding: 32px 24px 56px; }
  .films-grid   { grid-template-columns: 1fr; padding: 32px 24px 56px; }

  .ceremony-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
    padding: 32px 24px 56px;
  }

  .alb-grid { grid-template-columns: repeat(3, 1fr); }

  .cl-content { padding: 20px 52px; }
  .cl-prev    { left: 8px; }
  .cl-next    { right: 8px; }
  .apv-prev   { left: 8px; }
  .apv-next   { right: 8px; }

  .pf-section-header { padding: 52px 24px 10px; }
}

@media (max-width: 600px) {
  .pf-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 3px 0;
    -webkit-overflow-scrolling: touch;
  }
  .pf-tab { min-width: 120px; padding: 14px 18px; font-size: 12px; flex-shrink: 0; }

  .albums-grid {
    grid-template-columns: 1fr;
    padding: 24px 16px 48px;
    gap: 24px;
    background: var(--ivory);
  }
  .album-cover { aspect-ratio: 3 / 4; }

  .films-grid { padding: 24px 16px 48px; }

  .ceremony-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 130px;
    padding: 24px 16px 48px;
  }
  /* flatten masonry spans on mobile */
  .ceremony-item.landscape,
  .ceremony-item.portrait,
  .ceremony-item.square {
    grid-column: span 1;
    grid-row: span 1;
  }

  .alb-grid   { grid-template-columns: repeat(2, 1fr); }
  .alb-header { padding: 16px 20px; }

  .cl-content { width: 100vw; padding: 16px 44px; }
  #cl-img     { max-height: 64vh; }
  .cl-prev    { left: 4px; width: 40px; height: 40px; font-size: 14px; }
  .cl-next    { right: 4px; width: 40px; height: 40px; font-size: 14px; }

  .apv-img-wrap img { max-height: 70vh; }
  .apv-prev   { left: 4px; width: 40px; height: 40px; }
  .apv-next   { right: 4px; width: 40px; height: 40px; }

  .yt-content { width: 100vw; }
  .yt-close   { top: -38px; }

  .gallery-cta { padding: 52px 20px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pf-section, .alb-panel,
  #album-lightbox.open, .alb-photo-viewer.open,
  #yt-modal.open, #ceremony-lightbox.open,
  .apv-img-wrap img, #cl-img { animation: none; }

  .album-cover, .film-thumb,
  .ceremony-img-wrap img,
  .alb-photo-cell img { transition: none; }
}