/* ==========================================================================
   CSS Design Token Foundations (Apple Minimalist Aesthetic)
   ========================================================================== */
:root {
  /* This dynamic value is overwritten on initialization inside script.js */
  --card-aspect-ratio: 1.43; 
  
  --bg-color: #F5F5F7;
  --panel-bg: #FFFFFF;
  --text-primary: #1D1D1F;
  --text-secondary: #86868B;
  --accent-blue: #0071E3;
  --accent-blue-hover: #0077ED;
  --border-light: #E8E8ED;
  --border-hover: #D2D2D7;
  --modal-overlay: rgba(0, 0, 0, 0.4);
  --lightbox-overlay: rgba(0, 0, 0, 0.95);
  --system-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-card: 16px;
  --radius-button: 12px;
  --radius-badge: 6px;
  --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-elevated: 0 20px 40px rgba(0, 0, 0, 0.12);
  --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--system-font);
  background-color: var(--bg-color);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-y: scroll;
}

/* ==========================================================================
   Navigation Header
   ========================================================================== */
.app-header {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #0071E3;
  
}

.top-nav {
  display: flex;
  gap: 8px;
}

.nav-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
  display: inline-block;
}

.nav-btn:hover {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.04);
}

.nav-btn.active {
  color: var(--accent-blue);
  background-color: rgba(0, 113, 227, 0.08);
}

/* ==========================================================================
   Keyboard Optimized Search Layout
   ========================================================================== */
.controls-bar {
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 0 24px;
}

.controls-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.search-form {
  flex: 1;
  min-width: 280px;
}

.search-wrapper {
  position: relative;
  display: flex;
  gap: 8px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  pointer-events: none;
}

#searchInput {
  flex: 1;
  padding: 12px 16px 12px 42px;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-button);
  background-color: var(--panel-bg);
  color: var(--text-primary);
  outline: none;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition-smooth);
}

#searchInput:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

/* Chrome clear search default removal button override */
#searchInput::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-action-btn {
  background-color: var(--accent-blue);
  color: #FFFFFF;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0 20px;
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-subtle);
}

.search-action-btn:hover {
  background-color: var(--accent-blue-hover);
}

.filter-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--panel-bg);
  border: 1px solid var(--border-light);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-subtle);
}

.filter-badge button {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.filter-badge button:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   Primary Views Mechanics
   ========================================================================== */
.app-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.view-section {
  animation: fadeIn 0.3s ease;
}

.view-header {
  margin-bottom: 32px;
}

.view-header h2 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.view-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Option 1 Category Headers Styling
   ========================================================================== */
.category-header-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-light);
  animation: fadeIn 0.3s ease;
}

.category-header-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.category-header-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 800px;
}

/* ==========================================================================
   VIEW 1: HOME PAGE (Split Card, Auto-Adjust Height)
   ========================================================================== */
.grid-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
}

.sidebar-categories {
  position: sticky;
  top: 86px;
  align-self: start;
}

.sidebar-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-left: 12px;
}

.sidebar-list {
  list-style: none;
}

.sidebar-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-badge);
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
  display: block;
}

.sidebar-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

.sidebar-item.active {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

/* Dynamic Grid Card Layout */
.planner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.planner-card {
  background-color: var(--panel-bg);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.planner-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevated);
  border-color: var(--border-hover);
}

/* Card Top Half: Auto-adjust Height (No-Crop Framework) */
.card-img-wrapper {
  position: relative;
  width: 100%;
  background-color: #FAFAFA;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px; /* Frame padding around the landscape preview */
  overflow: hidden;
}

/* Scale naturally to landscape height without clipping */
.card-img-wrapper img {
  width: 100%;
  height: auto;
  max-height: 450px; /* Preserves clean grid alignment */
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); /* Shadow mirroring real iPad bounds */
  transition: var(--transition-smooth);
}

.planner-card:hover .card-img-wrapper img {
  transform: scale(1.02);
}

.card-price-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 10;
}

/* Card Bottom Half: descriptive info section */
.card-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  background-color: var(--panel-bg);
}

.card-categories-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.card-category-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-secondary);
}

.card-category-tag:not(:last-child)::after {
  content: "•";
  margin-left: 4px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  margin-bottom: 12px;
  flex-grow: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-tag {
  background-color: var(--bg-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-badge);
}

.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.load-more-btn {
  background-color: var(--panel-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius-button);
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition-smooth);
  text-decoration: none;
  display: inline-block;
}

.load-more-btn:hover {
  background-color: var(--bg-color);
  border-color: var(--border-hover);
}

.empty-state {
  text-align: center;
  padding: 64px 24px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.action-btn {
  background-color: var(--accent-blue);
  color: #FFFFFF;
  border: none;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.action-btn:hover {
  background-color: var(--accent-blue-hover);
}

/* ==========================================================================
   VIEW 2: CATEGORIES PAGE (Dynamic Auto-Adjust Height)
   ========================================================================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.category-card {
  background-color: var(--panel-bg);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-subtle);
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
  color: inherit;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevated);
  border-color: var(--border-hover);
}

/* Category Top Image Area: Height adjusts to category cover naturally */
.category-card-img {
  width: 100%;
  background-color: #FAFAFA;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px; /* Frame space around category cover */
  overflow: hidden;
}

/* Fully visible contain scaling without distortion or cropping */
.category-card-img img {
  width: 100%;
  height: auto;
  max-height: 450px;
  display: block;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: var(--transition-smooth);
}

.category-card:hover .category-card-img img {
  transform: scale(1.02);
}

.category-card-info {
  padding: 16px;
}

.category-card-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================================================
   VIEW 3: ABOUT US PAGE
   ========================================================================== */
.about-container {
  max-width: 900px;
  margin: 0 auto;
}

.about-hero {
  text-align: center;
  margin-bottom: 48px;
}

.about-hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.about-hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.about-card {
  background-color: var(--panel-bg);
  padding: 24px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-subtle);
}

.about-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.about-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ==========================================================================
   VIEW 4: BLOG INDEX (Card Date & Category tags)
   ========================================================================== */
.blog-card-date {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 4px;
  display: block;
}

.blog-modal-container {
  max-width: 800px;
}

.blog-modal-body {
  padding: 48px;
  overflow-y: auto;
  max-height: 90vh;
}

.blog-modal-date {
  font-size: 0.85rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 8px;
  display: block;
}

.blog-modal-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.blog-modal-divider {
  border-top: 1px solid var(--border-light);
  margin-bottom: 32px;
}

/* Immersive Typography layout optimized for iPad reading */
.blog-modal-content {
  font-size: 1.1rem;
  color: var(--text-primary);
  line-height: 1.7;
}

.blog-modal-content p {
  margin-bottom: 24px;
}

.blog-modal-content h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--text-primary);
}

.blog-modal-content strong {
  font-weight: 700;
}

@media (max-width: 480px) {
  .blog-modal-body {
    padding: 24px;
  }
  .blog-modal-title {
    font-size: 1.65rem;
  }
}

/* ==========================================================================
   MODAL OVERLAYS (Quick View)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease-out;
}

.modal-container {
  background-color: var(--panel-bg);
  border-radius: 20px;
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  box-shadow: var(--shadow-elevated);
  position: relative;
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  background-color: var(--border-light);
}

.modal-body {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  height: 100%;
  max-height: 90vh;
}

.modal-gallery {
  background-color: #FAFAFA;
  padding: 32px;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.gallery-showcase {
  position: relative;
  width: 100%;
  aspect-ratio: var(--card-aspect-ratio);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  border: 1px solid var(--border-light);
  cursor: zoom-in;
}

.gallery-main-preview {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: var(--transition-smooth);
}

.gallery-showcase:hover .gallery-main-preview {
  transform: scale(1.01);
}

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-light);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-subtle);
  z-index: 10;
}

.gallery-nav-btn:hover {
  background-color: #FFFFFF;
  transform: translateY(-50%) scale(1.05);
}

.gallery-nav-btn.prev { left: 16px; }
.gallery-nav-btn.next { right: 16px; }

.lightbox-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.6);
  color: #FFFFFF;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  pointer-events: none;
  opacity: 0;
  transition: var(--transition-smooth);
}

.gallery-showcase:hover .lightbox-hint {
  opacity: 1;
}

.gallery-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
  justify-content: center;
}

.thumb-item {
  width: 60px;
  aspect-ratio: var(--card-aspect-ratio);
  border-radius: 8px;
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  background-color: #FFFFFF;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-item:hover {
  border-color: var(--border-hover);
}

.thumb-item.active {
  border-color: var(--accent-blue);
}

.modal-details {
  padding: 40px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 90vh;
}

.detail-badge {
  align-self: start;
  background-color: var(--bg-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.detail-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 12px;
}

.detail-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 16px;
}

.detail-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.detail-divider {
  border-top: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.detail-description-container {
  flex-grow: 1;
  margin-bottom: 32px;
}

.detail-description-container h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.detail-description {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.detail-footer {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, #FFFFFF 80%, rgba(255, 255, 255, 0));
  padding-top: 20px;
}

.cta-btn {
  display: block;
  width: 100%;
  text-align: center;
  background-color: var(--accent-blue);
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 16px;
  border-radius: var(--radius-button);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
  transition: var(--transition-smooth);
}

.cta-btn:hover {
  background-color: var(--accent-blue-hover);
  box-shadow: 0 6px 16px rgba(0, 113, 227, 0.35);
}

/* ==========================================================================
   LIGHTBOX OVERLAY (Fullscreen Zoom & Swipe Controller)
   ========================================================================== */
.lightbox-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease-out;
}

.lightbox-content {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-touch-zone {
  width: 90vw;
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none; /* Let script handle touch actions exclusively */
}

.lightbox-active-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  /* origin updates dynamically under fingers in script.js */
  transform-origin: center center; 
  transition: transform 0.1s ease-out; /* Smooth responsive feedback for zoom/panning */
  will-change: transform;
}

.lightbox-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 320;
  opacity: 0.7;
  transition: var(--transition-smooth);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close-btn:hover {
  opacity: 1;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: none;
  color: #FFFFFF;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: var(--transition-smooth);
  z-index: 310;
}

.lightbox-nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.05);
}

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

/* ==========================================================================
   Responsive Adaptations & Custom Mobile Scrollbars (Tablet / Phone)
   ========================================================================== */
@media (max-width: 860px) {
  .grid-layout {
    /* minmax(0, 1fr) strictly forces the layout to stay within the viewport */
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    width: 100%;
    overflow: hidden;
  }
  
  .sidebar-categories {
    position: static;
    width: 100%;
    overflow: hidden;
  }
  
  .sidebar-title {
    display: none;
  }
  
  .sidebar-list {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    width: 100%;
    padding: 4px 0 12px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    
    /* Hide scrollbars on Firefox and Internet Explorer */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  /* Hide scrollbars on Chrome, Safari, Opera, and WebView */
  .sidebar-list::-webkit-scrollbar {
    display: none;
  }
  
  .sidebar-item {
    white-space: nowrap;
    width: auto;
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-light);
    scroll-snap-align: start;
  }
  
  .sidebar-item.active {
    background-color: var(--text-primary);
    color: #FFFFFF;
    border-color: var(--text-primary);
  }
  
  .modal-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  
  .modal-gallery {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding: 24px;
  }
  
  .modal-details {
    padding: 24px;
    max-height: none;
    overflow-y: visible;
  }
  
  .lightbox-nav-btn {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
  
  .lightbox-nav-btn.prev { left: 8px; }
  .lightbox-nav-btn.next { right: 8px; }
}

@media (max-width: 480px) {
  .app-header {
    position: static;
  }
  
  .header-container {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }
  
  .logo {
    font-size: 1.15rem;
  }
  
  .controls-bar {
    margin-top: 12px;
    padding: 0 12px;
    width: 100%;
  }
  
  .app-content {
    padding: 12px 12px 48px;
    width: 100%;
    overflow: hidden;
  }
  
  .planner-grid {
    /* minmax(0, 1fr) collapses card widths to match the phone display minus padding */
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .planner-card {
    width: 100%;
  }
  
  .category-grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }
  
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }
   }
