/* ==========================================================================
   Salaroma PHOTOGRAPHY — RESPONSIVE STYLESHEET
   Breakpoints: 1200px (laptop), 992px (tablet landscape),
                768px (tablet), 480px (mobile)

   NOTE: This file loads LAST on every page (after style.css / gallery.css /
   lightbox.css / about.css), so it is the safe place for mobile overrides —
   nothing here touches those files, and none of it applies above 992px,
   so desktop is untouched.
   ========================================================================== */

/* ---------- Laptop / small desktop ---------- */
@media (max-width: 1200px) {
  :root {
    --space-xl: 6rem;
  }

  .navbar__links {
    gap: 1.8rem;
  }
}

/* ---------- Tablet landscape ---------- */
@media (max-width: 992px) {
  .navbar {
    padding-inline: var(--space-sm);
  }

  .navbar__cta {
    display: none;
  }

  .hero__title {
    letter-spacing: 0;
  }
}

/* ---------- Tablet / mobile menu breakpoint ---------- */
@media (max-width: 860px) {
  .navbar__toggle {
    display: flex;
  }

  .navbar__links {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(78vw, 360px);
    height: 100svh;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-xl) var(--space-lg);
    background: var(--color-white);
    box-shadow: -20px 0 60px -20px var(--shadow-medium);
    transform: translateX(100%);
    transition: transform var(--transition-medium);
    z-index: 500;
  }

  .navbar__links.is-open {
    transform: translateX(0);
  }

  .navbar__link {
    font-size: 1.1rem;
    color: var(--color-text) !important;
  }

  /* Backdrop behind the mobile drawer */
  .navbar__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-medium);
    z-index: 499;
  }

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

  body.nav-open {
    overflow: hidden;
  }

  /* --- NEW: bigger, easier-to-tap touch targets in the mobile drawer --- */
  .navbar__toggle {
    width: 44px;
    height: 44px;
  }

  .navbar__links .navbar__link {
    padding-block: 0.6rem;
    display: inline-block;
  }
}

/* ---------- Tablet portrait ---------- */
@media (max-width: 768px) {
  :root {
    --space-lg: 3rem;
    --space-xl: 4.5rem;
    --nav-height: 76px;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .statement {
    padding-block: var(--space-xl);
  }

  /* --- NEW: reduce oversized hero on tablets/phones (albums + home) ---
     Desktop keeps height:100svh from style.css untouched; this only
     fires at <=768px. Lands the hero around the requested 55-60vh
     across common phone heights (568px-926px). */
  .hero {
    height: 58svh;
    min-height: 320px;
  }

  .hero__title {
    font-size: clamp(2.1rem, 8vw, 3rem);
  }

  /* --- NEW: keep the category filter bar on one scrollable row instead
     of wrapping to multiple rows between 520px-768px, and guarantee it
     never causes horizontal page overflow. Filter click logic in
     gallery.js is untouched — only visual layout changes. --- */
  .filter-bar__inner {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .filter-bar__inner::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex-shrink: 0;
    padding: 0.7rem 1.3rem; /* slightly larger tap target on touch screens */
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
  :root {
    /* Tightens the horizontal/vertical rhythm used by .container,
       .gallery, .gallery-intro, .albums, .albums-cta, .statement,
       .about__container, and .filter-bar__inner — all of which use
       these same tokens. Only active <=480px, so desktop is unaffected. */
    --space-md: 1.25rem;
    --space-lg: 2.5rem;
    --space-xl: 3.5rem;
  }

  .navbar__logo {
    font-size: 1.35rem;
  }

  .hero {
    height: 56svh;
    min-height: 300px;
  }

  .hero__content {
    padding-inline: var(--space-sm);
  }

  .hero__eyebrow {
    letter-spacing: 0.22em;
    font-size: 0.7rem;
  }

  .hero__actions .btn {
    width: 100%;
    padding-inline: var(--space-sm);
    /* Slightly smaller, more refined pill on phones — desktop keeps
       the base 1rem vertical padding / 0.875rem font from .btn in
       style.css untouched. */
    padding-block: 0.7rem;
    font-size: 0.78rem;
  }

  .hero__scroll {
    bottom: var(--space-sm);
  }

  .hero__scroll-line {
    height: 38px;
  }

  .statement__text {
    font-size: 1.35rem;
  }

  /* ======================================================================
     NEW: GALLERY — MASONRY ON PHONES
     gallery.css already handles 3 cols (<=1100px) and 2 cols (<=768px),
     but it drops to a single column at <=520px. Since responsive.css
     loads after gallery.css, this section wins the cascade and keeps
     the Pinterest-style 2-column layout all the way down to 320px, per
     the "2 columns on phones" requirement. Aspect ratios are already
     preserved by gallery.css (.gallery__img uses height:auto), so
     nothing here can stretch or crop an image.
     ====================================================================== */
  .gallery__grid {
    column-count: 2;
    column-gap: 0.85rem;
  }

  .gallery__item {
    margin-bottom: 0.85rem;
  }

  .gallery__overlay {
    padding: 1rem;
  }

  .gallery__category {
    font-size: 0.6rem;
    letter-spacing: 0.16em;
  }

  .gallery__view {
    font-size: 0.95rem;
    gap: 0.35rem;
  }

  .gallery__view svg {
    width: 14px;
    height: 14px;
  }

  /* NEW: bigger tap target for filter chips on small phones */
  .filter-btn {
    padding: 0.65rem 1.15rem;
    font-size: 0.75rem;
  }
}

/* ---------- NEW: Small phones (390px / 375px / 360px) ---------- */
@media (max-width: 390px) {
  .gallery__grid {
    column-gap: 0.65rem;
  }

  .gallery__item {
    margin-bottom: 0.65rem;
  }

  .gallery__overlay {
    padding: 0.8rem;
  }

  .hero__title {
    font-size: clamp(1.9rem, 8.5vw, 2.5rem);
  }

  .hero__subtitle {
    margin-top: var(--space-sm);
    font-size: 0.9rem;
  }

  /* The lightbox's two action buttons (view / download) can get tight
     next to each other on very narrow screens — let them wrap instead
     of overflowing the viewport. Functionality (open/download) is
     untouched, this is layout-only. */
  .lightbox__actions {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.5rem;
  }

  .lightbox__action {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }
}

/* ---------- NEW: Extra-small phones (320px) ---------- */
@media (max-width: 340px) {
  :root {
    --space-md: 1rem;
  }

  .gallery__grid {
    column-gap: 0.5rem;
  }

  .gallery__item {
    margin-bottom: 0.5rem;
  }

  .hero__title {
    font-size: clamp(1.75rem, 9vw, 2.25rem);
  }

  .navbar__logo {
    font-size: 1.2rem;
  }
}

/* ---------- Short viewports (landscape phones) ---------- */
@media (max-height: 560px) and (orientation: landscape) {
  .hero {
    height: auto;
    min-height: 100svh;
    padding-block: calc(var(--nav-height) + var(--space-md)) var(--space-md);
  }

  .hero__scroll {
    display: none;
  }
}
