/* ============================================================
   STYLE.CSS — Sandra Gatica Morales Portfolio
   All styles for all 4 pages live here. Zero page-specific files.
   ============================================================ */

/* === RESET & BASE === */

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

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

body {
  font-family: var(--font-base);
  font-size: var(--size-body);
  font-weight: 400;
  color: var(--color-text);
  line-height: var(--line-height);
  background-color: transparent;
  min-height: 100vh;
  /* Layout: vertical centering of the card in the viewport */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px;
}

/* === CSS VARIABLES === */

:root {
  /* Typography */
  --font-base:        'Inter', sans-serif;
  --size-name:        2rem;
  --size-h2:          1.1rem;
  --size-body:        0.95rem;
  --size-meta:        0.8rem;
  --line-height:      1.75;

  /* Colors */
  --color-text:         #1a1a1a;
  --color-muted:        #8a8a8a;
  --color-link:         #1a1a1a;
  --color-card:         #ffffff;
  --color-divider:      #ebebeb;
  --color-nav-hover:    #1a1a1a;
  --color-toggle-border:#d8d8d8;
  --color-bg-fallback:  #2d2d2d;
  --color-avatar-bg:    #e0dcd8;
  --color-hero-bg:      #f0ede8;

  /* Card */
  --card-maxwidth:      640px;
  --card-radius:        20px;
  --card-shadow:        0 8px 48px rgba(0,0,0,0.13), 0 2px 8px rgba(0,0,0,0.07);

  /* Mood toggle */
  --color-toggle-bg:       #EBE6DC;

  /* Projects hover preview */
  --color-preview-bg:      #e8e4df;

  /* Card avatar (homepage) */
  --color-card-avatar-bg:  #e8e6ee;

  /* Case study pages */
  --color-case-divider:    #e0e0da;
  --color-case-image-bg:   #f5f5f3;
  --color-case-muted:      #868686;
  --color-case-text:       #525252;

  /* Breadcrumb */
  --color-breadcrumb-link: #aaaaaa;
  --color-breadcrumb-sep:  #555555;
}

/* === LAYOUT — CARD & BACKGROUND === */

.bg-photo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  filter: brightness(0.88);
  transition: opacity 0.6s ease;
}

.bg-work {
  opacity: 1;
}

.bg-mood {
  opacity: 0;
}

body.mood-active .bg-work {
  opacity: 0;
}

body.mood-active .bg-mood {
  opacity: 1;
}

.card {
  position: relative;
  z-index: 1;
  background: var(--color-card);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 48px 64px;
  width: calc(100% - 80px);
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

/* === NAVIGATION === */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--color-divider);
  padding-bottom: 20px;
  margin-bottom: 28px;
}

.site-nav a {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--color-nav-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-nav a.active {
  color: var(--color-text);
  font-weight: 500;
}

/* Nav link groups — work/mood switching */
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links--mood {
  display: none;
}

body.mood-active .nav-links--work {
  display: none;
}

body.mood-active .nav-links--mood {
  display: flex;
}

/* === MOOD TOGGLE === */

.mood-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.mood-toggle__word {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--color-muted);
  white-space: nowrap;
  user-select: none;
}

.mood-toggle {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: block;
}

.mood-toggle__pill {
  position: relative;
  display: flex;
  align-items: center;
  width: 88px;
  height: 44px;
  border-radius: 999px;
  background-color: var(--color-toggle-bg);
  overflow: hidden;
  flex-shrink: 0;
}

/* White sliding thumb */
.mood-toggle__thumb {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.12);
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

/* State 2: thumb slides right */
body.mood-active .mood-toggle__thumb {
  left: 49px;
}

/* Emoji slots */
.mood-toggle__emoji {
  position: absolute;
  font-size: 22px;
  line-height: 1;
  top: 50%;
  transform: translateY(-50%);
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  pointer-events: none;
  user-select: none;
}

/* State 1: laptop centered over left thumb, paintbrush bleeds right */
.mood-toggle__emoji--left  { left: 11px; }
.mood-toggle__emoji--right { left: 68px; }

/* State 2: paintbrush slides in over right thumb, laptop bleeds left */
body.mood-active .mood-toggle__emoji--left  { left: -16px; }
body.mood-active .mood-toggle__emoji--right { left: 53px; }

/* Content container: wraps both work and mood blocks */
.content-container {
  position: relative;
  overflow: hidden;
}

/* Both content blocks share the same transition */
.content-work,
.content-mood {
  transition: opacity 0.4s ease;
}

/* Mood block is stacked absolutely on top of work block */
.content-mood {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

/* Default state (Work mode) */
body:not(.mood-active) .content-work {
  opacity: 1;
  pointer-events: auto;
}

body:not(.mood-active) .content-mood {
  opacity: 0;
  pointer-events: none;
}

/* Mood mode */
body.mood-active .content-work {
  opacity: 0;
  pointer-events: none;
}

body.mood-active .content-mood {
  opacity: 1;
  pointer-events: auto;
}

/* === TYPOGRAPHY === */

h1.site-name {
  font-size: var(--size-name);
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 4px;
}

h1.site-name + .site-title {
  font-size: var(--size-body);
  font-weight: 300;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

h2.section-label {
  font-size: var(--size-h2);
  font-weight: 500;
  color: var(--color-text);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

/* Taglines — italic intro lines on homepage */
.taglines {
  font-size: 0.9rem;
  font-weight: 300;
  font-style: italic;
  color: var(--color-muted);
  line-height: 1.9;
  margin-top: 0.75rem;
  margin-bottom: 2rem;
}

.taglines p {
  margin: 0;
}

/* Body paragraphs */
.body-text p {
  font-size: var(--size-body);
  font-weight: 400;
  color: var(--color-text);
  line-height: var(--line-height);
  margin-bottom: 1.2rem;
}

.body-text p:last-child {
  margin-bottom: 0;
}

/* "A bit about me:" lead-in line in mood mode */
.mood-lead-in {
  margin-top: 1.5rem;
  font-weight: 500;
  color: var(--color-text);
}

/* Global link style */
a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* CTA link — "→ See selected work" */
.cta-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text);
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

/* Contact block inside homepage */
.contact-block {
  margin-top: 2rem;
}

.contact-block p {
  font-size: var(--size-body);
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.contact-block .social-links {
  font-size: var(--size-meta);
  color: var(--color-muted);
  margin-top: 0.4rem;
}

.contact-block .social-links a {
  color: var(--color-muted);
}

.contact-block .social-links a:hover {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Middot separator */
.sep {
  margin: 0 4px;
  user-select: none;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-divider);
  font-size: var(--size-meta);
  color: var(--color-muted);
  flex-wrap: wrap;
  gap: 6px;
}

/* === PROJECTS PAGE === */

.projects-list {
  margin-top: 0.5rem;
}

.project-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-divider);
  cursor: pointer;
  transition: background 0.1s ease;
  /* Slight indent on hover is handled below */
}

.project-row:first-child {
  border-top: 1px solid var(--color-divider);
}

.project-row:hover .project-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-name {
  font-size: var(--size-body);
  font-weight: 400;
  color: var(--color-text);
}

.project-label {
  font-size: var(--size-meta);
  color: var(--color-muted);
  text-align: right;
  flex-shrink: 0;
  margin-left: 16px;
}

/* === PROJECTS PAGE — hover preview === */

#project-preview {
  position: fixed;
  width: 366px;
  height: 366px;
  border-radius: 10px;
  overflow: hidden;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 150ms ease;
  background: var(--color-preview-bg);
}

/* Hide preview on touch devices */
@media (hover: none) {
  #project-preview {
    display: none;
  }
}

/* === PROJECTS PAGE — modal === */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.is-open {
  display: flex;
}

.modal-box {
  background: var(--color-card);
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 16px;
  padding: 40px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-family: var(--font-base);
  font-size: 1.2rem;
  color: var(--color-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: var(--color-text);
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
  /* leave room for the close button */
  padding-right: 40px;
}

.modal-descriptor {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.modal-hero {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  background: var(--color-hero-bg);
  display: block;
}

.modal-description {
  font-size: 0.92rem;
  line-height: var(--line-height);
  color: var(--color-text);
}

/* === HOMEPAGE CONTENT === */

.card-avatar {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 20px;
  object-fit: cover;
  object-position: center top;
  background-color: var(--color-card-avatar-bg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10),
              0 1px 3px  rgba(0, 0, 0, 0.07);
  margin-bottom: 20px;
}

/* === ABOUT PAGE === */

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 1.5rem;
  /* Fallback background if avatar.jpg has not been supplied yet */
  background-color: var(--color-avatar-bg);
}

/* === ABOUT PAGE — experience & education === */

.cv-list {
  margin-top: 0.5rem;
}

.cv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-divider);
  gap: 16px;
}

.cv-role {
  font-size: 0.9rem;
  color: var(--color-text);
  font-weight: 400;
}

.cv-year {
  font-size: var(--size-meta);
  color: var(--color-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* === CONTACT PAGE === */

.contact-intro {
  font-size: var(--size-body);
  color: var(--color-text);
  margin-bottom: 2rem;
  line-height: var(--line-height);
}

.contact-grid {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px 0;
  margin-top: 0.5rem;
}

.contact-label {
  font-size: var(--size-meta);
  color: var(--color-muted);
  font-weight: 400;
  padding: 2px 0;
}

.contact-value {
  font-size: 0.9rem;
  color: var(--color-text);
  padding: 2px 0;
}

.contact-value a {
  color: var(--color-text);
}

/* === RESPONSIVE — MAIN PAGES === */

/* Tablet — below 900px */
@media (max-width: 899px) {
  .card {
    width: calc(100% - 48px);
    padding: 40px 40px;
  }
}

/* Mobile — below 640px */
@media (max-width: 639px) {
  body {
    align-items: flex-start;
    padding: 24px 16px;
  }

  .card {
    width: calc(100% - 32px);
    max-width: 100%;
    padding: 28px 20px;
    border-radius: 14px;
  }

  /* Navigation — wrap on small screens */
  .site-nav {
    gap: 16px;
    flex-wrap: wrap;
  }

  .site-nav a {
    font-size: 0.78rem;
  }

  .nav-links--work,
  .nav-links--mood {
    gap: 16px;
    flex-wrap: wrap;
  }

  /* Mood toggle — stays right-aligned even when nav wraps */
  .mood-toggle-wrap {
    margin-left: auto;
  }

  /* Homepage H1 */
  h1.site-name {
    font-size: 1.4rem;
  }

  /* Projects list rows */
  .project-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 0;
  }

  .project-label {
    font-size: 0.75rem;
    margin-left: 0;
  }

  /* About page avatar */
  .card-avatar {
    width: 44px;
    height: 44px;
  }

  /* Contact page grid */
  .contact-grid {
    grid-template-columns: 60px 1fr;
  }

  /* Footer */
  .site-footer {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }
}

/* Very small — below 380px */
@media (max-width: 379px) {
  body {
    padding: 16px 12px;
  }

  .card {
    width: calc(100% - 24px);
    padding: 20px 16px;
  }

  h1.site-name {
    font-size: 1.2rem;
  }
}

/* === CASE STUDY PAGES === */

body.case-page {
  background-color: #ffffff;
  padding-top: 0;
  margin-top: 0;
}
body.case-page .bg-photo {
  display: none;
}

.case-wrap {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 234px;
  grid-template-areas: "left center right";
  column-gap: 40px;
  width: calc(100% - 80px);
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 25px;
  padding-bottom: 120px;
  align-items: start;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.case-col--left {
  grid-area: left;
  align-self: start;
  width: 264px;
  min-width: 0;
  position: sticky;
  top: 25px;
  max-height: calc(100vh - 50px);
  overflow-y: auto;
}

.case-col--center {
  grid-area: center;
  align-self: start;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-col--right {
  grid-area: right;
  width: 234px;
  min-width: 0;
  position: sticky;
  top: auto;
  bottom: 48px;
  align-self: end;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}

/* Image containers */
.case-image-wrap {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-case-divider);
  background: var(--color-case-image-bg);
}
.case-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* Left column typography */
.case-title {
  font-family: var(--font-base);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 2px 0;
}
.case-subtitle {
  font-family: var(--font-base);
  font-size: 12px;
  font-weight: 400;
  color: var(--color-case-muted);
  margin: 0 0 20px 0;
}
.case-description {
  font-family: var(--font-base);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-case-text);
  line-height: 17px;
  margin-bottom: 24px;
}
.case-description p {
  margin-bottom: 0.9rem;
}

/* Metadata table */
.case-meta {
  width: 100%;
  border-top: 1px dashed var(--color-case-divider);
}
.case-meta-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--color-case-divider);
}
.case-meta-label {
  font-family: var(--font-base);
  font-size: 11px;
  font-weight: 500;
  color: var(--color-case-muted);
  line-height: 13px;
}
.case-meta-value {
  font-family: var(--font-base);
  font-size: 11px;
  font-weight: 500;
  color: var(--color-case-text);
  line-height: 13px;
}
.case-meta-value ul {
  margin: 0;
  padding-left: 14px;
}
.case-meta-value li {
  margin-bottom: 2px;
  line-height: 13px;
}

/* Right column */
.case-detail-block {
  padding: 12px 0;
  border-bottom: 1px dashed var(--color-case-divider);
}
.case-detail-block:first-child {
  border-top: 1px dashed var(--color-case-divider);
}
.case-detail-block:last-child {
  border-bottom: none;
}
.case-detail-label {
  font-family: var(--font-base);
  font-size: 11px;
  font-weight: 500;
  color: var(--color-case-muted);
  line-height: 13px;
  margin-bottom: 6px;
  text-transform: none;
}
.case-detail-value {
  font-family: var(--font-base);
  font-size: 11px;
  font-weight: 500;
  color: var(--color-case-text);
  line-height: 13px;
}
.case-detail-value a {
  color: var(--color-case-text);
  word-break: break-all;
}
.case-detail-value a:hover {
  text-decoration: underline;
}

/* Floating breadcrumb */
.breadcrumb-nav {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-base);
  font-size: 0.82rem;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  white-space: nowrap;
}
.breadcrumb-nav a {
  color: var(--color-breadcrumb-link);
  text-decoration: none;
}
.breadcrumb-nav a:hover { color: #ffffff; }
.breadcrumb-current { color: #ffffff; font-weight: 500; }
.breadcrumb-nav span:not(.breadcrumb-current) { color: var(--color-breadcrumb-sep); }

/* === RESPONSIVE — CASE STUDY PAGES === */

/* 1280px to 1100px — shrink side columns proportionally */
@media (max-width: 1280px) {
  .case-wrap {
    grid-template-columns: 220px minmax(0, 1fr) 200px;
    column-gap: 32px;
    width: calc(100% - 64px);
  }
  .case-col--left  { width: 220px; }
  .case-col--right { width: 200px; }
}

/* 1100px to 900px — shrink further */
@media (max-width: 1100px) {
  .case-wrap {
    grid-template-columns: 180px minmax(0, 1fr) 170px;
    column-gap: 24px;
    width: calc(100% - 48px);
  }
  .case-col--left  { width: 180px; }
  .case-col--right { width: 170px; }
}

/* Below 900px — right column drops below center
   Left stays sticky, center and right share the right half */
@media (max-width: 899px) {
  .case-wrap {
    grid-template-columns: 180px minmax(0, 1fr);
    grid-template-areas:
      "left center"
      "left right";
    column-gap: 24px;
    row-gap: 24px;
    width: calc(100% - 40px);
  }
  .case-col--left {
    grid-area: left;
    grid-row: 1 / 3;
    width: 180px;
  }
  .case-col--center {
    grid-area: center;
  }
  .case-col--right {
    grid-area: right;
    position: static;
    max-height: none;
    width: 100%;
  }
}

/* Below 640px — full stack, all columns 100% width */
@media (max-width: 639px) {
  .case-wrap {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "center"
      "right";
    column-gap: 0;
    row-gap: 28px;
    width: calc(100% - 32px);
    padding-top: 20px;
    padding-bottom: 80px;
  }
  .case-col--left {
    grid-area: left;
    position: static;
    max-height: none;
    width: 100%;
    grid-row: auto;
  }
  .case-col--center {
    grid-area: center;
  }
  .case-col--right {
    grid-area: right;
    position: static;
    max-height: none;
    width: 100%;
  }
  .case-title { font-size: 1rem; }
  .breadcrumb-nav {
    bottom: 16px;
    padding: 8px 14px;
    font-size: 0.75rem;
    gap: 8px;
  }
}

/* Below 380px */
@media (max-width: 379px) {
  .case-wrap {
    width: calc(100% - 24px);
  }
}

/* === PHOTOGRAPHY PAGE === */

.photography-page {
  background-color: #ECEBE5;
  min-height: 100vh;
}

.photo-wrap {
  max-width: 1400px;
  width: calc(100% - 80px);
  margin: 0 auto;
  padding: 40px 0 100px;
}

.photo-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 32px;
}

/* Grid — CSS columns masonry */
.photo-grid {
  columns: 4;
  column-gap: 8px;
}

.photo-item {
  break-inside: avoid;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  background: #e8e6e0;
  display: block;
}

.photo-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.photo-item:hover img {
  transform: scale(1.02);
  opacity: 0.88;
}

.photo-item:focus {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

/* Modal */
.photo-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.photo-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.photo-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: #1a1a1a;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  z-index: 10;
}

.photo-modal__close:hover { opacity: 0.5; }

.photo-modal__inner {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  padding: 48px 24px 24px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 92vw;
  max-height: 92vh;
}

/* Vertical photo in modal — portrait */
img.photo-modal__img--vertical {
  max-height: calc(88vh - 48px);
  max-width: calc(55vw - 48px);
  width: auto;
  height: auto;
  border-radius: 4px;
  display: block;
}

/* Horizontal photo in modal — landscape */
img.photo-modal__img--horizontal {
  max-width: calc(88vw - 48px);
  max-height: calc(80vh - 48px);
  width: auto;
  height: auto;
  border-radius: 4px;
  display: block;
}

/* Responsive grid */
@media (max-width: 1024px) {
  .photo-grid { columns: 3; }
  .photo-wrap { width: calc(100% - 64px); }
}

@media (max-width: 640px) {
  .photo-grid { columns: 2; column-gap: 6px; }
  .photo-item { margin-bottom: 6px; }
  .photo-wrap { width: calc(100% - 32px); padding: 28px 0 80px; }
  img.photo-modal__img--vertical { max-width: 90vw; max-height: 85vh; }
  img.photo-modal__img--horizontal { max-width: 95vw; max-height: 60vh; }
}

@media (max-width: 380px) {
  .photo-grid { columns: 1; }
}
