/* ==========================================================================
   Tran Family Album — Design System
   Phase 1: Global tokens & base styles only.
   Component styles below still use legacy class names — restyled in phase 2.
   ========================================================================== */

/* -------------------------------------------------------------------------- */
/* Design tokens                                                              */
/* Edit values here to change the look app-wide.                               */
/* -------------------------------------------------------------------------- */

:root {
  /* Backgrounds */
  --bg-page: #f7f6f2;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;

  /* Brand (Tran teal) */
  --brand-primary: #01696f;
  --brand-hover: #0c4e54;
  --brand-muted: #e6f2f2;

  /* Text — reference palette */
  --text-primary: #1a1a1a;
  --text-secondary: #757575;
  --text-inverse: #ffffff;

  /* UI chrome — deep teal-charcoal (reference-style buttons, softer than black) */
  --chrome: #1e3334;
  --chrome-hover: #0c4e54;

  /* Borders & grid */
  --border-subtle: #dcd9d5;
  --grid-gap-color: #f7f6f2;
  --photo-grid-gap: 3px;

  /* Overlays (lightbox, scrims) */
  --overlay-dark: rgba(0, 0, 0, 0.55);
  --overlay-backdrop: rgba(0, 0, 0, 0.92);
  --overlay-scrim: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.25) 35%,
    transparent 55%
  );
  --shadow-card: 0 2px 16px rgba(40, 37, 29, 0.08);

  /* Spacing — 4px scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --touch-min: 52px;

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --radius-pill: 9999px;

  /* Typography — families (reference: geometric sans, Poppins) */
  --font-display: "Poppins", system-ui, -apple-system, sans-serif;
  --font-body: "Poppins", system-ui, -apple-system, sans-serif;

  /* Typography — sizes (reference mockup scale) */
  --text-display: 1.75rem;    /* 28px — lightbox title */
  --text-title: 1.375rem;     /* 22px — screen titles e.g. "My Albums" */
  --text-heading: 1.25rem;    /* 20px — album card / section titles */
  --text-subheading: 1.125rem; /* 18px — secondary headings */
  --text-body: 1rem;          /* 16px — body (reference base) */
  --text-caption: 0.9375rem;  /* 15px — photo counts, metadata */

  --weight-title: 600;        /* screen titles */
  --weight-heading: 700;      /* album names */
  --weight-body: 400;         /* counts, captions */

  --line-height-heading: 1.3;
  --line-height-body: 1.5;

  /* Motion */
  --transition-fast: 0.1s ease;
  --transition-view: 0.25s ease;
  --transition-lightbox: 0.2s ease;

  /* ------------------------------------------------------------------------ */
  /* Legacy aliases — used by component styles until phase 2 restyle          */
  /* ------------------------------------------------------------------------ */
  --color-bg: var(--bg-page);
  --color-surface: var(--bg-surface);
  --color-primary: var(--brand-primary);
  --color-primary-hover: var(--brand-hover);
  --color-text: var(--text-primary);
  --color-text-muted: var(--text-secondary);
  --color-border: var(--border-subtle);
}

/* -------------------------------------------------------------------------- */
/* Reset & box model                                                          */
/* -------------------------------------------------------------------------- */

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

/* -------------------------------------------------------------------------- */
/* Root typography & page defaults                                            */
/* -------------------------------------------------------------------------- */

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--line-height-body);
  color: var(--text-primary);
  background-color: var(--bg-page);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Main headings — reference hierarchy */
h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: var(--line-height-heading);
  color: var(--text-primary);
  margin: 0;
}

h1 {
  font-size: var(--text-title);
  font-weight: var(--weight-title);
}

h2 {
  font-size: var(--text-heading);
  font-weight: var(--weight-heading);
}

h3 {
  font-size: var(--text-subheading);
  font-weight: var(--weight-heading);
}

p {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* -------------------------------------------------------------------------- */
/* Interactive elements — shared base                                         */
/* -------------------------------------------------------------------------- */

button {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--line-height-body);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

button:active {
  transition: transform var(--transition-fast);
}

/* Minimum touch target helper (apply to buttons in component styles) */
.touch-target {
  min-height: var(--touch-min);
  min-width: var(--touch-min);
}

/* Visible focus ring on all interactive elements */
a:focus-visible,
button:focus-visible,
.header-pill:focus-visible,
.album-card:focus-visible,
.photo-tile:focus-visible {
  outline: 3px solid var(--brand-primary);
  outline-offset: 3px;
}

/* -------------------------------------------------------------------------- */
/* Typography utility classes (optional — use in HTML when restyling)         */
/* -------------------------------------------------------------------------- */

.text-display {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: var(--weight-heading);
  line-height: var(--line-height-heading);
  color: var(--text-primary);
}

.text-title {
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: var(--weight-title);
  line-height: var(--line-height-heading);
  color: var(--text-primary);
}

.text-heading {
  font-family: var(--font-display);
  font-size: var(--text-heading);
  font-weight: var(--weight-heading);
  line-height: var(--line-height-heading);
  color: var(--text-primary);
}

.text-subheading {
  font-family: var(--font-display);
  font-size: var(--text-subheading);
  font-weight: var(--weight-heading);
  line-height: var(--line-height-heading);
  color: var(--text-primary);
}

.text-body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  line-height: var(--line-height-body);
  color: var(--text-primary);
}

.text-caption {
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: var(--weight-body);
  line-height: var(--line-height-body);
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-secondary);
}

.text-inverse {
  color: var(--text-inverse);
}

/* -------------------------------------------------------------------------- */
/* Reduced motion                                                             */
/* -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* -------------------------------------------------------------------------- */
/* App Shell                                                                  */
/* -------------------------------------------------------------------------- */

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

/* View transitions: opacity fade */
.view {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  position: absolute;
  width: 100%;
  left: 0;
  top: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.view--active {
  opacity: 1;
  visibility: visible;
  position: relative;
  height: auto;
  overflow: visible;
  pointer-events: auto;
}

.view-container {
  position: relative;
}

/* -------------------------------------------------------------------------- */
/* View 1: Album List (reference layout)                                      */
/* -------------------------------------------------------------------------- */

#view-album-list {
  margin-left: calc(-1 * var(--space-4));
  margin-right: calc(-1 * var(--space-4));
  width: calc(100% + 2 * var(--space-4));
}

.album-list-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  background: var(--bg-surface);
  padding: var(--space-5) var(--space-4);
  margin-bottom: var(--space-5);
}

.album-list-title {
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: var(--weight-title);
  margin: 0;
  color: var(--text-primary);
  text-align: center;
}

.header-pill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  background: var(--chrome);
  color: var(--text-inverse);
  transition: background-color 0.15s ease, transform var(--transition-fast);
}

.header-pill:active {
  transform: translateY(-50%) scale(0.98);
  background: var(--chrome-hover);
}

.header-pill--left {
  left: 0;
  padding: 0 var(--space-5) 0 var(--space-4);
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
}

.header-pill--right {
  right: 0;
  padding: 0 var(--space-4) 0 var(--space-5);
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
}

.header-pill-icon {
  display: block;
  flex-shrink: 0;
}

.album-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: 0 var(--space-4);
}

.album-card {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  color: inherit;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

/* Single child stretches full button width (Safari-safe phrasing content) */
.album-card-inner {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.album-card:active {
  transform: scale(0.98);
}

/* Collage: 1 large + 2 stacked, tight gutters */
.album-card-collage {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3px;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--grid-gap-color);
  overflow: hidden;
}

/* Absolute-fill images: Safari % heights in grid rows overflow the title strip */
.album-card-collage-main,
.album-card-collage-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.album-card-collage-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.album-card-collage-main img,
.album-card-collage-cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.album-card-info {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: var(--space-1) var(--space-3);
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-4);
  background: var(--bg-surface);
}

.album-card-name {
  display: block;
  grid-column: 1;
  grid-row: 1;
  font-family: var(--font-display);
  font-size: var(--text-heading);
  font-weight: var(--weight-heading);
  color: var(--text-primary);
  margin: 0;
}

.album-card-chevron {
  grid-column: 2;
  grid-row: 1;
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
  color: var(--text-primary);
}

.album-card-count {
  display: block;
  grid-column: 1;
  grid-row: 2;
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: var(--weight-body);
  color: var(--text-secondary);
  margin: 0;
}

/* -------------------------------------------------------------------------- */
/* View 2: Photo Grid (reference layout)                                      */
/* -------------------------------------------------------------------------- */

#view-photo-grid {
  margin-left: calc(-1 * var(--space-4));
  margin-right: calc(-1 * var(--space-4));
  width: calc(100% + 2 * var(--space-4));
}

.photo-grid-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  background: var(--bg-surface);
  padding: var(--space-5) var(--space-4) var(--space-4);
}

.photo-grid-header-text {
  text-align: center;
  padding: 0 calc(var(--touch-min) + var(--space-2));
}

.photo-grid-title {
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: var(--weight-title);
  color: var(--text-primary);
  margin: 0;
  text-align: center;
}

.photo-grid-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: var(--weight-body);
  color: var(--text-secondary);
  margin: var(--space-1) 0 0;
  text-align: center;
}

/* Grid panel — flush below header, square corners */
.photo-grid-panel {
  background: var(--grid-gap-color);
  overflow: hidden;
}

/* Varied row layouts — alternating large/small combinations */
.photo-grid {
  display: flex;
  flex-direction: column;
  gap: var(--photo-grid-gap);
  padding: calc(var(--photo-grid-gap) / 2);
}

.photo-grid-row {
  display: grid;
  gap: var(--photo-grid-gap);
  min-height: 0;
}

/* Row 1 & 4: large + two stacked (or inverse) */
.photo-grid-row--large-stack-left,
.photo-grid-row--stack-large-right {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 3 / 2;
}

.photo-grid-row--large-stack-left .photo-tile--large {
  grid-column: 1;
  grid-row: 1 / 3;
}

.photo-grid-row--large-stack-left .photo-tile--small:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

.photo-grid-row--large-stack-left .photo-tile--small:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.photo-grid-row--stack-large-right .photo-tile--small:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.photo-grid-row--stack-large-right .photo-tile--small:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.photo-grid-row--stack-large-right .photo-tile--large {
  grid-column: 2;
  grid-row: 1 / 3;
}

/* Row 2 & 3: tall + wide (or inverse) */
.photo-grid-row--tall-large,
.photo-grid-row--wide-tall {
  grid-template-columns: 1fr 2fr;
  grid-template-rows: 1fr;
  aspect-ratio: 9 / 4;
}

.photo-grid-row--wide-tall {
  grid-template-columns: 2fr 1fr;
}

.photo-grid-row--tall-large .photo-tile--tall {
  grid-column: 1;
  grid-row: 1;
}

.photo-grid-row--tall-large .photo-tile--wide {
  grid-column: 2;
  grid-row: 1;
}

.photo-grid-row--wide-tall .photo-tile--wide {
  grid-column: 1;
  grid-row: 1;
}

.photo-grid-row--wide-tall .photo-tile--tall {
  grid-column: 2;
  grid-row: 1;
}

/* Fallback rows for trailing photos */
.photo-grid-row--pair {
  grid-template-columns: 1fr 1fr;
  aspect-ratio: 2 / 1;
}

.photo-grid-row--single {
  grid-template-columns: 1fr;
  aspect-ratio: 3 / 2;
}

.photo-tile {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  padding: 0;
  border: none;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  margin: 0;
  background: var(--grid-gap-color);
  transition: opacity 0.15s ease;
}

.photo-tile:active {
  opacity: 0.85;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.photo-grid-section-heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  text-align: left;
  margin: 0;
  padding: var(--space-5) var(--space-4) var(--space-2);
  background: var(--bg-surface);
}

.photo-grid-section-heading-title {
  font-family: var(--font-display);
  font-size: var(--text-subheading);
  font-weight: var(--weight-heading);
  color: var(--text-primary);
  line-height: var(--line-height-heading);
}

.photo-grid-section-heading-count {
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: var(--weight-body);
  color: var(--text-secondary);
  line-height: var(--line-height-body);
}

/* -------------------------------------------------------------------------- */
/* Navigation menu                                                            */
/* -------------------------------------------------------------------------- */

.nav-menu {
  position: fixed;
  inset: 0;
  z-index: 900;
  visibility: hidden;
  pointer-events: none;
}

.nav-menu--open {
  visibility: visible;
  pointer-events: auto;
}

.nav-menu-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: var(--overlay-dark);
  opacity: 0;
  transition: opacity var(--transition-view);
  cursor: default;
}

.nav-menu--open .nav-menu-backdrop {
  opacity: 1;
}

.nav-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(320px, 88vw);
  background: var(--bg-surface);
  box-shadow: -4px 0 24px rgba(40, 37, 29, 0.12);
  transform: translateX(100%);
  transition: transform var(--transition-view);
}

.nav-menu--open .nav-menu-panel {
  transform: translateX(0);
}

.nav-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-shrink: 0;
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-menu-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-subheading);
  font-weight: var(--weight-title);
  color: var(--text-primary);
}

.nav-menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  margin: calc(-1 * var(--space-2));
  color: var(--text-secondary);
  font-size: 1.25rem;
  border-radius: var(--radius-full);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-menu-close:active {
  background: var(--brand-muted);
  color: var(--text-primary);
}

.nav-menu-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-2) 0 var(--space-5);
}

.nav-menu-group + .nav-menu-group {
  margin-top: var(--space-1);
  padding-top: var(--space-1);
  border-top: 1px solid var(--border-subtle);
}

.nav-menu-item,
.nav-menu-subitem {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: none;
  background: transparent;
  text-align: left;
  font-family: var(--font-body);
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.nav-menu-item {
  font-size: var(--text-body);
  font-weight: var(--weight-heading);
  line-height: var(--line-height-heading);
}

.nav-menu-item:active,
.nav-menu-subitem:active {
  background: var(--brand-muted);
}

.nav-menu-item--active {
  color: var(--brand-primary);
}

.nav-menu-subsections {
  list-style: none;
  margin: 0;
  padding: 0 0 var(--space-1);
}

.nav-menu-subitem {
  padding-left: calc(var(--space-4) + var(--space-3));
  font-size: var(--text-caption);
  font-weight: var(--weight-body);
  color: var(--text-secondary);
  line-height: var(--line-height-body);
}

.nav-menu-subitem--active {
  color: var(--brand-primary);
  font-weight: var(--weight-title);
}

/* -------------------------------------------------------------------------- */
/* PIN lock                                                                   */
/* -------------------------------------------------------------------------- */

html:not(.unlocked) .app,
html:not(.unlocked) .nav-menu,
html:not(.unlocked) .lightbox {
  display: none !important;
}

.pin-lock {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(1, 105, 111, 0.18), transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(12, 78, 84, 0.12), transparent 50%),
    var(--bg-page);
}

html.unlocked .pin-lock {
  display: none;
}

.pin-lock-panel {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
}

.pin-lock-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: var(--weight-title);
  line-height: var(--line-height-heading);
  color: var(--brand-primary);
  text-align: center;
}

.pin-lock-hint {
  margin: 0 0 var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: var(--weight-body);
  line-height: var(--line-height-body);
  color: var(--text-secondary);
  text-align: center;
}

.pin-lock-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pin-lock-input {
  width: 100%;
  min-height: var(--touch-min);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-align: center;
  box-sizing: border-box;
}

.pin-lock-input:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-color: var(--brand-primary);
}

.pin-lock-input[aria-invalid="true"] {
  border-color: #b42318;
}

.pin-lock-error {
  margin: 0;
  min-height: 1.25em;
  font-family: var(--font-body);
  font-size: var(--text-caption);
  color: #b42318;
  text-align: center;
}

.pin-lock-submit {
  min-height: var(--touch-min);
  margin-top: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: none;
  border-radius: var(--radius-md);
  background: var(--brand-primary);
  color: var(--text-inverse);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.pin-lock-submit:hover {
  background: var(--brand-hover);
}

.pin-lock-submit:active {
  transform: scale(0.98);
}

.pin-lock-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* -------------------------------------------------------------------------- */
/* Lightbox                                                                   */
/* -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.lightbox--open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.lightbox--open .lightbox-content {
  transform: scale(1);
}

.lightbox-image {
  max-height: 100dvh;
  max-width: 100vw;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  min-width: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 28px;
  border-radius: var(--radius-full);
  transition: transform 0.1s ease, background-color 0.15s ease;
}

.lightbox-close:active {
  transform: scale(0.98);
  background-color: rgba(255, 255, 255, 0.15);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  min-width: 52px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  transition: transform 0.1s ease, background-color 0.15s ease;
}

.lightbox-nav:active {
  transform: translateY(-50%) scale(0.98);
  background-color: rgba(255, 255, 255, 0.35);
}

.lightbox-nav--prev {
  left: 8px;
}

.lightbox-nav--next {
  right: 8px;
}

/* -------------------------------------------------------------------------- */
/* iPad (768px+)                                                              */
/* -------------------------------------------------------------------------- */

@media (min-width: 768px) {
  .app {
    padding: 32px;
  }

  #view-album-list {
    margin-left: calc(-1 * var(--space-6));
    margin-right: calc(-1 * var(--space-6));
    width: calc(100% + 2 * var(--space-6));
  }

  .album-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
    padding: 0 var(--space-6);
  }

  .album-list-header {
    padding: var(--space-5) var(--space-6);
  }

  #view-photo-grid {
    margin-left: calc(-1 * var(--space-6));
    margin-right: calc(-1 * var(--space-6));
    width: calc(100% + 2 * var(--space-6));
  }

  .photo-grid-header {
    padding: var(--space-5) var(--space-6) var(--space-4);
  }

  .photo-grid {
    --photo-grid-gap: 4px;
  }

  .lightbox-nav--prev {
    left: 24px;
  }

  .lightbox-nav--next {
    right: 24px;
  }

  .lightbox-close {
    top: 16px;
    right: 16px;
  }
}

