/**
 * Directory Styles
 * Church Pictorial Directory - Public Directory Views
 *
 * Directory-specific styles for public-facing family photo directory.
 * Warm, paper-like aesthetic optimized for photo viewing.
 *
 * Dependencies:
 * - _variables.css (design tokens)
 * - _components.css (shared UI components)
 *
 * Architecture: Mobile-first responsive design, ITCSS pattern
 */

/* =========================
   Base Styles
   ========================= */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  margin: 0;
  padding: 0.125rem; /* Minimal padding for mobile (2px) */
  background: var(--directory-paper);
  color: var(--directory-ink);
  line-height: var(--line-height-normal);
}

/* Safe area support for notched devices */
@supports (padding: max(0px)) {
  body {
    padding-top: max(0.125rem, env(safe-area-inset-top));
    padding-bottom: max(0.125rem, env(safe-area-inset-bottom));
    padding-left: max(0.125rem, env(safe-area-inset-left));
    padding-right: max(0.125rem, env(safe-area-inset-right));
  }
}

/* Anchored detail below header */
#detail-panel {
  scroll-margin-top: var(--header-offset);
}

/* =========================
   Grid Layout
   ========================= */
.grid-wrap {
  max-width: var(--max-content-width);
  margin: 0 auto;
}

/* Mobile-first: 1 column by default */
.grid {
  display: grid;
  gap: 0.25rem; /* Minimal gap for mobile (4px) */
  grid-template-columns: 1fr;
}

/* Card wrapper for inline details */
.card-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* =========================
   Cards & Interactive Elements
   ========================= */
.card {
  background: var(--directory-card);
  color: var(--directory-ink);
  border: 1px solid var(--directory-rule);
  border-radius: var(--radius-xl);
  padding: 0.25rem; /* Reduced padding for mobile (4px) */
  min-height: 44px; /* Ensure tappable area */
  box-shadow: var(--shadow-directory);
  text-decoration: none;
  transition: box-shadow var(--transition-fast),
              filter var(--transition-fast),
              transform var(--transition-fast);
}

.card:hover {
  cursor: pointer;
  filter: brightness(0.99);
  box-shadow: var(--shadow-directory-hover);
  transform: translateY(-2px);
}

.card:active {
  transform: translateY(0);
}

.card:focus-visible {
  outline: none;
  box-shadow: var(--shadow-directory-focus);
}

/* Photo styling */
.photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--neutral-100);
  height: auto;
  cursor: zoom-in;
}

/* =========================
   Typography
   ========================= */
.name {
  margin: var(--space-sm) 0 var(--space-xs);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-tight);
  color: var(--directory-ink);
  text-align: center;
  /* Truncate long names on mobile */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.children,
.muted {
  color: var(--directory-muted);
  font-size: var(--font-size-base);
  text-align: center;
}

/* Children names - limit to 2 lines with ellipsis */
.children-names {
  color: var(--directory-muted);
  font-size: var(--font-size-sm);
  text-align: center;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* =========================
   Detail Views
   ========================= */
.inline-detail {
  background: transparent;
}

.detail-card {
  background: var(--directory-card);
  color: var(--directory-ink);
  border: 1px solid var(--directory-rule);
  border-radius: var(--radius-xl);
  padding: var(--space-md);
  max-width: var(--max-content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-directory);
  position: relative;
}

.detail-photo {
  width: 100%;
  max-width: var(--max-image-width);
  aspect-ratio: 4 / 3;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  display: block;
  margin: 0 auto;
}

.detail-photo.zoom-out {
  cursor: zoom-out;
}

/* =========================
   Header
   ========================= */
.directory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  padding-left: var(--space-xs); /* Body (0.125rem) + Card (0.375rem) = align with photo edge */
  padding-right: var(--space-xs);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.header-left {
  text-align: left;
}

.org-name {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--directory-ink);
  margin: 0;
  line-height: var(--line-height-tight);
}

.org-name a {
  color: inherit;
  text-decoration: none;
}

.org-name a:hover {
  text-decoration: underline;
}

.subtitle {
  font-size: var(--font-size-xl);
  color: var(--directory-muted);
  margin: 0;
}

.header-right {
  margin-top: var(--space-xs);
}

/* Breadcrumb navigation */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
  color: var(--directory-muted);
  margin-bottom: var(--space-xs);
}

.breadcrumb a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--brand-primary-dark);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--directory-muted);
  opacity: 0.5;
}

.breadcrumb-current {
  font-weight: var(--font-weight-medium);
  color: var(--directory-ink);
}

/* Directory CTA (Add Your Family button) */
.directory-cta {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.directory-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.directory-cta-btn svg {
  flex-shrink: 0;
}

/* Last updated timestamp in header */
.last-updated {
  font-size: var(--font-size-sm);
  opacity: 0.8;
}

/* =========================
   Form Elements (Directory-specific)
   ========================= */
.search-box {
  background: var(--directory-card);
  border: 1px solid var(--directory-rule);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  min-height: 44px; /* Touch-friendly */
  box-shadow: var(--shadow-directory);
  color: var(--directory-ink);
  transition: box-shadow var(--transition-fast),
              border-color var(--transition-fast);
  font-size: 16px; /* Prevent iOS zoom */
  width: 100%; /* Full width on mobile */
  max-width: 100%;
}

.search-box:focus {
  outline: none;
  border-color: var(--directory-rule);
  box-shadow: var(--shadow-directory-focus);
}

.search-box:focus:not(:focus-visible) {
  box-shadow: none;
}

/* Override component styles for directory-specific inputs */
.input,
textarea {
  background: var(--directory-card);
  border: 1px solid var(--directory-rule);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  box-shadow: var(--shadow-directory);
  color: var(--directory-ink);
  transition: box-shadow var(--transition-fast),
              border-color var(--transition-fast);
}

.input:focus,
textarea:focus {
  outline: none;
  border-color: var(--directory-rule);
  box-shadow: var(--shadow-directory-focus);
}

.input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  box-shadow: none;
}

/* =========================
   Pagination
   ========================= */
.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  background: var(--directory-card);
  border: 1px solid var(--directory-rule);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-directory);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.pagination-info {
  color: var(--directory-muted);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
}

.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: var(--space-xs);
}

.page-item {
  display: inline-block;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
  min-width: 44px; /* Touch-friendly */
  min-height: 44px;
  text-align: center;
  background: var(--directory-paper);
  border: 1px solid var(--directory-rule);
  color: var(--directory-ink);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-fast);
  font-size: var(--font-size-base);
}

.page-link:hover {
  background: var(--directory-card);
  border-color: var(--directory-rule);
  filter: brightness(0.98);
  box-shadow: var(--shadow-sm);
}

.page-link:focus {
  outline: none;
  box-shadow: var(--shadow-directory-focus);
}

.page-link:focus:not(:focus-visible) {
  box-shadow: none;
}

.page-link.current {
  background: var(--directory-ink);
  color: var(--directory-card);
  border-color: var(--directory-ink);
  cursor: default;
  font-weight: var(--font-weight-semibold);
}

.page-link.current:hover {
  background: var(--directory-ink);
  filter: none;
}

/* =========================
   Lightbox Overlay
   ========================= */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow),
              visibility var(--transition-slow);
}

#lightbox:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

#lightbox .detail-card {
  max-width: min(1200px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: var(--space-md);
}

#lightbox .detail-photo {
  max-width: min(900px, 90vw);
  max-height: 75vh;
  cursor: zoom-out;
  opacity: 0;
  transform: scale(0.985);
  will-change: opacity, transform;
}

#lightbox:not(.hidden) .detail-photo {
  animation: photoIn 0.25s ease 0.08s forwards;
}

@keyframes photoIn {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Lightbox close button */
.lightbox-close-btn {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  z-index: 20;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-full);
  cursor: pointer;
  opacity: 0.6;
  transition: background var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  opacity: 1;
  transform: scale(1.05);
}

.lightbox-close-btn:active {
  transform: scale(0.95);
}

.lightbox-close-btn:focus {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.lightbox-close-btn:focus:not(:focus-visible) {
  box-shadow: none;
}

.lightbox-close-btn svg {
  color: var(--directory-ink);
}

/* Lightbox navigation buttons (prev/next) */
.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  opacity: 0.6;
  transition: background var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.lightbox-nav-btn.prev {
  left: var(--space-sm);
}

.lightbox-nav-btn.next {
  right: var(--space-sm);
}

.lightbox-nav-btn:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.9);
  opacity: 1;
  transform: translateY(-50%) scale(1.05);
}

.lightbox-nav-btn:active:not(.disabled) {
  transform: translateY(-50%) scale(0.95);
}

.lightbox-nav-btn:focus {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.lightbox-nav-btn:focus:not(:focus-visible) {
  box-shadow: none;
}

.lightbox-nav-btn svg {
  color: var(--directory-ink);
}

.lightbox-nav-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Hide nav buttons on mobile - too crowded */
@media (max-width: 600px) {
  .lightbox-nav-btn {
    display: none;
  }
}

/* Full-screen button on image */
.family-hero {
  position: relative;
}

.fullscreen-btn {
  position: absolute;
  bottom: var(--space-xs);
  right: var(--space-xs);
  z-index: 10;
  background: rgba(0, 0, 0, 0.15);
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--space-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  transition: background var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}

.fullscreen-btn:hover {
  background: rgba(0, 0, 0, 0.3);
}

.fullscreen-btn:active {
  background: rgba(0, 0, 0, 0.7);
}

.fullscreen-btn svg {
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* =========================
   Utility Classes
   ========================= */
.hidden {
  display: none !important;
}

.mt-3 {
  margin-top: var(--space-sm);
}

/* Directory Editions Page */
.directory-editions-header {
  text-align: center;
  padding: var(--space-xl) var(--space-md) var(--space-md);
}

.directory-editions-header .directory-header {
  max-width: 600px;
  margin: 0 auto;
}

.directory-editions-header .org-name {
  margin: 0 0 var(--space-xs) 0;
  font-size: var(--font-size-3xl);
  color: var(--directory-ink);
}

.directory-editions-header .subtitle {
  color: var(--directory-muted);
  font-size: var(--font-size-base);
  margin: 0;
}

.edition-list {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-lg);
  list-style: none;
  justify-content: center;
}

/* Directory cards (year selection) */
.directory-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--directory-card);
  border: 1px solid var(--directory-rule);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-directory);
  transition: all var(--transition-base);
  cursor: pointer;
  text-align: center;
}

.directory-card:hover {
  box-shadow: var(--shadow-directory-hover);
  transform: translateY(-4px);
  border-color: var(--brand-primary);
}

.directory-card:active {
  transform: translateY(0);
  box-shadow: var(--shadow-directory);
}

.directory-card:focus-visible {
  outline: none;
  box-shadow: var(--shadow-directory-focus);
}

/* 3D Book Icon */
.book-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.book-3d {
  position: relative;
  width: 130px;
  height: 163px;
  flex-shrink: 0;
  perspective: 600px;
}

.book-transform {
  position: relative;
  width: 100%;
  height: 100%;
  transform: rotateY(-15deg);
  transform-style: preserve-3d;
}

.book-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 18px;
  background: linear-gradient(to right, var(--brand-primary-darker), var(--brand-primary-dark));
  transform: rotateY(-90deg);
  transform-origin: left;
  box-shadow: -2px 0 4px rgba(0, 0, 0, 0.25);
}

.book-cover {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
  border-radius: 2px;
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.book-year {
  color: white;
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: var(--space-xs);
}

.book-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.book-pages {
  position: absolute;
  right: -6px;
  top: 3px;
  bottom: 3px;
  width: 6px;
  background: white;
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.15);
  border-radius: 0 1px 1px 0;
}

.book-page-lines {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.05) 2px,
    rgba(0, 0, 0, 0.05) 3px
  );
}

.family-count-badge {
  display: inline-flex;
  align-items: center;
  background: var(--brand-primary-light);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--brand-primary-dark);
  border: 1px solid rgba(65, 118, 144, 0.2);
}

.family-count-badge svg {
  margin-right: var(--space-xs);
  color: var(--brand-primary);
}

.no-editions {
  text-align: center;
  color: var(--directory-muted);
}

/* =========================
   Empty States
   ========================= */
.directory-empty-state {
  text-align: center;
  padding: var(--space-xl);
  color: var(--directory-muted);
  font-size: var(--font-size-lg);
  background: var(--directory-card);
  border: 1px solid var(--directory-rule);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-directory);
}

.directory-empty-state p {
  margin: 0;
}

/* =========================
   Directory Form Elements
   ========================= */
.directory-select {
  background: var(--directory-card);
  border: 1px solid var(--directory-rule);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  color: var(--directory-ink);
  font-size: var(--font-size-base);
  min-height: 44px;
  box-shadow: var(--shadow-directory);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.directory-select:focus {
  outline: none;
  border-color: var(--directory-ink);
  box-shadow: var(--shadow-directory-focus);
}

.directory-select:focus:not(:focus-visible) {
  box-shadow: none;
}

.directory-select:hover {
  border-color: var(--directory-ink);
}

/* =========================
   Responsive Design (Mobile-First)
   =========================

   NOTE: The .name and .card margins/padding below use intentionally
   tight values to maximize photo display area ("photo-first" design).
   These are calibrated per breakpoint for optimal visual density and
   are kept as hardcoded values rather than tokens to allow fine-tuning.
   ========================= */

/* Mobile-specific optimizations (< 600px) - Maximize image view */
@media (max-width: 599px) {
  .name {
    margin: var(--space-xs) 0 0; /* Tight spacing for photo-first layout */
    font-size: var(--font-size-md);
  }

  .children,
  .muted {
    font-size: var(--font-size-sm); /* Slightly smaller */
  }

  .directory-header {
    margin-bottom: var(--space-md); /* Reduced from 2rem */
  }

  .grid-wrap {
    padding: 0; /* Remove any extra padding */
  }

  /* Lightbox: Maximize image size on mobile */
  #lightbox {
    padding: 0.25rem; /* Minimal padding for close tap area */
  }

  #lightbox .detail-card {
    max-width: 100vw;
    max-height: 96vh;
    padding: 0.25rem; /* Minimal padding */
  }

  #lightbox .detail-photo {
    max-width: 98vw; /* Use almost full screen width */
    max-height: 85vh; /* Taller on mobile for better viewing */
  }
}

/* Large phones / Small tablets (600px+) */
@media (min-width: 600px) {
  body {
    padding: var(--space-md);
  }

  .directory-header {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .card {
    padding: 0.375rem;
  }

  .search-box {
    width: 300px;
  }
}

/* Tablets (768px+) - 3 columns, minimal padding for maximum photo size */
@media (min-width: 768px) {
  body {
    padding: var(--space-xs); /* Minimal padding for tablets - maximize space */
  }

  .directory-header {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .grid {
    grid-template-columns: repeat(3, 1fr); /* 3 columns: perfect for tablets */
    gap: var(--space-xs); /* Tight gaps for more photo space */
  }

  .card {
    padding: 0.25rem; /* Minimal card padding - focus on photos */
  }

  .name {
    font-size: var(--font-size-base);
    line-height: var(--line-height-tight);
    margin: var(--space-xs) 0 0;
  }

  .children-names,
  .parent-first-names {
    font-size: var(--font-size-sm); /* Proportionally smaller for tablet layout */
  }

  .detail-card {
    max-width: 800px;
  }
}

/* iPad Pro / Large tablets (1024px+) - Keep 3 columns, minimal padding */
@media (min-width: 1024px) {
  body {
    padding: 0.625rem; /* Minimal padding for tablets */
  }

  .directory-header {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }

  .grid {
    grid-template-columns: repeat(3, 1fr); /* Stay at 3 columns */
    gap: 0.625rem; /* Tight gaps for maximum photos */
  }

  .card {
    padding: 0.375rem; /* Minimal card padding */
  }

  .name {
    font-size: var(--font-size-md);
    line-height: var(--line-height-tight);
    margin: var(--space-xs) 0 0;
  }

  .children-names,
  .parent-first-names {
    font-size: var(--font-size-base); /* Proportionally smaller for iPad Pro */
  }

  .detail-card {
    max-width: 900px;
  }
}

/* Large desktop (1280px+) - 4 columns for wide screens */
@media (min-width: 1280px) {
  body {
    padding: var(--space-xl); /* Maximum comfort on large screens */
  }

  .directory-header {
    padding-left: var(--space-2xl);
    padding-right: var(--space-2xl);
  }

  .grid {
    grid-template-columns: repeat(4, 1fr); /* Dense grid for large monitors */
    gap: var(--space-lg); /* Generous spacing on wide screens */
  }

  .card {
    padding: 0.375rem; /* Minimal card padding for desktop */
  }

  .name {
    font-size: var(--font-size-xl);
    margin: var(--space-sm) 0 var(--space-xs);
  }

  .children-names,
  .parent-first-names {
    font-size: var(--font-size-md); /* Larger children names for desktop */
  }

  .org-name {
    font-size: var(--font-size-4xl); /* Larger organization name for desktop */
  }

  .subtitle {
    font-size: var(--font-size-lg); /* Larger subtitle for desktop */
  }
}

/* Mobile pagination adjustments */
@media (max-width: 600px) {
  .pagination-wrapper {
    flex-direction: column;
    text-align: center;
    padding: var(--space-md);
    gap: var(--space-sm);
  }

  .pagination {
    justify-content: center;
    flex-wrap: wrap;
  }

  .pagination-info {
    margin-bottom: 0;
  }
}

/* Accessibility: Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .card:hover,
  .btn:hover {
    transform: none;
  }

  .card:active,
  .btn:active {
    transform: none;
  }

  #lightbox .detail-photo {
    opacity: 1;
    transform: none;
  }
}
