/* ==========================================================================
   HURU LINEN: Responsive layer
   Breakpoints: 1280 (small desktop) · 1024 (tablet landscape) · 768 (tablet) · 480 (phone)
   Mobile layouts are composed on purpose, not just shrunk.
   ========================================================================== */

/* ---------- ≤ 1280px ---------- */
@media (max-width: 1280px) {
  .collection-card--men { grid-column: 9 / span 4; }
  .product-grid--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-index { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .category-index--six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- ≤ 1024px ---------- */
@media (max-width: 1024px) {
  :root { --header-height: 72px; }

  .site-nav { display: none; }
  .menu-toggle { display: block; }
  .site-header.is-solid { height: 64px; }
  .site-logo .logo-mark { width: 92px; }
  /* Keep the toggle legible when the menu covers an overlay header */
  .site-header.is-menu-open { color: var(--color-ink); }
  .site-header.is-menu-open::before { opacity: 0; }

  .collection-card--women { grid-column: 1 / span 7; }
  .collection-card--men { grid-column: 8 / span 5; }
  .collection-card--key { grid-column: 1 / -1; }

  .story-content__text { grid-column: 1 / span 6; }
  .story-content__image { grid-column: 8 / span 5; }

  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pillar:nth-child(3) { border-left: 0; padding-left: 0; }
  .pillar:nth-child(n + 3) { border-top: 1px solid var(--color-rule); }

  .tropics__media { grid-column: 1 / span 5; }
  .tropics__text { grid-column: 7 / span 6; }
  .quality-list li { grid-template-columns: 8rem 1fr; }

  .details-grid__intro { grid-column: 1 / -1; max-width: 36rem; }
  .details-grid__a { grid-column: 1 / span 4; }
  .details-grid__b { grid-column: 5 / span 5; }
  .details-grid__c { grid-column: 1 / span 6; }
  .details-grid__d { grid-column: 8 / span 5; }

  .packaging__images { grid-column: 1 / span 7; }
  .packaging__text { grid-column: 8 / span 5; }

  .editorial__large { grid-column: 1 / span 7; }
  .editorial__note { grid-column: 8 / span 5; }
  .editorial__detail { grid-column: 8 / span 5; }
  .editorial__pair-a { grid-column: 1 / span 5; }
  .editorial__pair-b { grid-column: 7 / span 6; }

  .follow__text { grid-column: 1 / -1; }
  .follow__images { grid-column: 1 / -1; }

  .split-hero__text { grid-column: 1 / -1; }
  .split-hero__media { grid-column: 1 / -1; }

  .chapter__label { grid-column: 1 / -1; }
  .chapter__body { grid-column: 1 / span 10; }

  .journal-feature__media { grid-column: 1 / -1; }
  .journal-feature__text { grid-column: 1 / span 10; }
  .journal-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .site-footer__brand { grid-column: 1 / -1; }
  .site-footer__col, .site-footer__col:first-of-type { grid-column: span 4; }
}

/* ---------- ≤ 768px ---------- */
@media (max-width: 768px) {
  :root { --section-space: clamp(88px, 20vw, 120px); }
  .grid-12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .grid-12 > * { grid-column: 1 / -1 !important; margin-top: 0; margin-bottom: 0; }

  /* Hero: a single, well-cropped photograph */
  .hero__media { grid-template-columns: 1fr; }
  .hero__panel--shadow { display: none; }
  .hero__panel--sea img { object-position: 44% 30%; }
  .scroll-cue { display: none; }
  .hero__scrim { background: linear-gradient(to top, rgba(28, 22, 16, 0.62) 0%, rgba(28, 22, 16, 0.14) 48%, rgba(28, 22, 16, 0.05) 70%); }

  .section-heading--split { grid-template-columns: 1fr; gap: 20px; }

  /* Collection: stack, but keep a gentle offset */
  .collection-card--men { width: 82%; margin-left: auto !important; }

  .story-band { height: 72vh; min-height: 440px; }
  .story-band img { object-position: 62% 50%; }
  .story-content__image { width: 72%; margin: 48px 0 0 auto !important; }

  .pillars { grid-template-columns: 1fr; }
  .pillar, .pillar + .pillar { border-left: 0; padding: 32px 0; border-top: 1px solid var(--color-rule); display: grid; grid-template-columns: 56px 1fr; column-gap: 20px; }
  .pillar__number { grid-row: 1 / span 3; padding-top: 4px; }
  .pillar__icon { margin: 0 0 18px; width: 34px; height: 34px; }
  .pillar p { max-width: none; }

  .tropics__media { width: 78%; margin-inline: auto !important; }
  .tropics__text { margin-top: 56px !important; }
  .quality-list li { grid-template-columns: 1fr; gap: 4px; }

  .details-grid { row-gap: 20px; }
  .details-grid__intro { margin-bottom: 28px !important; position: static; }
  .details-grid__a, .details-grid__b, .details-grid__c, .details-grid__d { grid-column: auto !important; }
  .details-grid { grid-template-columns: 1fr 1fr; }
  .details-grid__intro { grid-column: 1 / -1 !important; }
  .details-grid__b { margin-top: 36% !important; }

  .packaging__text { margin-top: 48px !important; }

  .editorial__detail { width: 64%; margin-left: auto !important; }
  .editorial__environment .media { aspect-ratio: 4 / 5; }
  .editorial__pair-b { width: 80%; margin-left: auto !important; }

  .product-grid, .product-grid--four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 14px; }
  .product-card__name { font-size: 1.25rem; }
  .product-card__meta { flex-direction: column; align-items: flex-start; gap: 4px; }

  .edit-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 56px 14px; }
  .edit-grid > :nth-child(n) { grid-column: span 3; margin-top: 0; }
  .edit-grid > :nth-child(3n + 1) { grid-column: 1 / -1; width: 86%; }
  .edit-grid > :nth-child(6n + 4) { margin-left: auto; }
  .edit-grid > :nth-child(3n + 3) { margin-top: 22%; }

  .category-index, .category-index--six { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .follow__images, .detail-row { grid-template-columns: repeat(2, 1fr); }

  .triptych { grid-template-columns: 1fr 1fr; }
  .triptych .media:nth-child(1) { display: none; }
  .triptych .media:nth-child(3) { margin-bottom: 18%; }
  .women-title { flex-direction: column; align-items: flex-start; gap: 20px; }

  .chapter-image-pair > :last-child { width: 70%; margin: 20px 0 0 auto !important; }

  .collection-row__index { margin-bottom: 12px !important; }
  .collection-row__media { margin-top: 36px !important; }
  .collection-row--reverse .collection-row__text, .collection-row--reverse .collection-row__index, .collection-row--reverse .collection-row__media { grid-row: auto; }

  .journal-list { grid-template-columns: 1fr; }
  .article-body figure.article-wide { margin-inline: calc(var(--gutter) * -1); }

  .contact-row { grid-template-columns: 1fr; gap: 10px; }
  .contact-aside__text { margin-top: 48px !important; }

  .site-footer__col, .site-footer__col:first-of-type { grid-column: span 3 !important; }
  .site-footer__brand { grid-column: 1 / -1 !important; }
  .site-footer__bottom { flex-direction: column; gap: 10px; }
}

/* ---------- ≤ 480px ---------- */
@media (max-width: 480px) {
  .hero { min-height: 600px; }
  .hero__mark { width: 190px; }
  .hero__cta { width: 100%; max-width: 320px; }

  .intro__title { max-width: 11ch; }

  .collection-card--men { width: 88%; }
  .story-content__image { width: 80%; }

  .details-grid__b { margin-top: 30% !important; }

  .product-grid, .product-grid--four { grid-template-columns: 1fr 1fr; }
  .product-card .link-arrow { font-size: 0.625rem; letter-spacing: 0.18em; }

  .edit-grid > :nth-child(n) { grid-column: 1 / -1; width: 100%; margin: 0; }
  .edit-grid > :nth-child(2n) { width: 78%; margin-left: auto; }

  .category-index__item { padding: 20px 8px; }

  .site-footer__col, .site-footer__col:first-of-type { grid-column: 1 / -1 !important; }
  .site-footer__top { row-gap: 40px; }

  .button { width: 100%; }
  .closing .button, .hero__cta { width: auto; }
}

/* Short landscape phones: keep the hero usable */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: 480px; }
  .hero__mark { width: 160px; }
  .hero__content { bottom: 32px; }
}

/* ==========================================================================
   Phone polish: layouts composed for the hand, not shrunk from desktop
   ========================================================================== */

/* Touch devices: no sticky hover states after a tap */
@media (hover: none) {
  .hover-zoom:hover .media img,
  .product-card:hover .plinth img { transform: none; }
  .link-arrow:hover::after { transform: none; }
  .link-arrow:hover .arrow, .button:hover .arrow { transform: none; }
  .product-card:hover .product-card__alt { opacity: 0; }
}

/* iPhone notch and home bar */
@supports (padding: max(0px)) {
  .container { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
  .site-footer { padding-bottom: max(36px, calc(env(safe-area-inset-bottom) + 20px)); }
  .mobile-menu { padding-bottom: max(40px, calc(env(safe-area-inset-bottom) + 24px)); }
}

@media (max-width: 768px) {
  html { -webkit-tap-highlight-color: transparent; }

  /* Hero: title block breathes above the home bar */
  .hero__content { bottom: max(44px, calc(env(safe-area-inset-bottom) + 32px)); }
  .hero__meta { margin-top: 14px; }

  .intro .leaf { margin-top: 40px; }

  /* Natural by nature: a compact 2 × 2 */
  .pillars { grid-template-columns: 1fr 1fr; }
  .pillar, .pillar + .pillar {
    display: block;
    padding: 28px 16px 30px 0;
    border-left: 0;
    border-top: 1px solid var(--color-rule);
  }
  .pillar:nth-child(even) { padding: 28px 0 30px 18px; border-left: 1px solid var(--color-rule); }
  .pillar__number { font-size: 0.875rem; }
  .pillar__icon { width: 32px; height: 32px; margin: 22px 0 18px; }
  .pillar__title { margin-bottom: 10px; }
  .pillar p { font-size: 0.875rem; line-height: 1.55; }

  /* Linen in the tropics: the video bleeds a little wider */
  .tropics__media { width: 86%; }

  /* Editorial pair: side by side, offset like a magazine spread */
  .editorial > .editorial__pair-a { grid-column: 1 / span 3 !important; width: 100%; }
  .editorial > .editorial__pair-b { grid-column: 4 / span 3 !important; width: 100%; margin-top: 34% !important; margin-left: 0 !important; }
  .editorial > .editorial__pair-a .media { aspect-ratio: 2 / 3; }
  .editorial { column-gap: 12px; }

  /* Selected pieces: a native swipe carousel, the next card peeking in */
  .product-grid--four {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
    padding-bottom: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .product-grid--four::-webkit-scrollbar { display: none; }
  .product-grid--four > * { flex: 0 0 74%; scroll-snap-align: start; }
  .product-grid--four > [data-reveal] { opacity: 1; transform: none; }
  .product-grid--four .product-card__meta { flex-direction: row; align-items: center; }
  .swipe-hint { display: flex; }

  /* Comfortable touch targets */
  .product-card .link-arrow { padding-block: 12px; }
  .site-footer__list { gap: 2px; }
  .site-footer__list a { display: inline-block; padding-block: 9px; }
  .breadcrumbs a { display: inline-block; padding-block: 8px; }
  .breadcrumbs { margin-bottom: 24px; }

  /* Footer: three quiet columns instead of one long list */
  .site-footer { padding-top: 72px; }
  .site-footer__brand .serif { font-size: 1.375rem; margin-top: 22px; }
  .site-footer__statement { margin-top: 64px; padding-block: 32px; font-size: clamp(1.625rem, 7.4vw, 2.25rem); letter-spacing: 0.06em; }
}

@media (max-width: 480px) {
  .site-footer__col, .site-footer__col:first-of-type { grid-column: span 2 !important; }
  .site-footer__top { row-gap: 48px; column-gap: 12px; }
  .site-footer__heading { margin-bottom: 10px; }
  .site-footer__list { font-size: 0.8125rem; }
  .button { width: auto; }
}

/* Short phones (iPhone SE, small Androids): keep the model visible above the title */
@media (max-width: 480px) and (max-height: 760px) {
  .hero__mark { width: 148px; }
  .hero__title { gap: 12px; }
  .hero__tagline { font-size: 1.3125rem; }
  .hero__meta { margin-top: 10px; font-size: 0.625rem; }
  .hero__cta { margin-top: 20px; min-height: 46px; padding: 12px 28px; }
  .hero__content { bottom: max(28px, calc(env(safe-area-inset-bottom) + 20px)); }
  .hero__panel--sea img { object-position: 44% 22%; }
}

/* Phones: women's edit as a two-up grid (like a fashion app), two full-width feature looks for rhythm.
   Element 7 is the statement between look 06 and look 07. */
@media (max-width: 600px) {
  .edit-grid { grid-template-columns: 1fr 1fr; gap: 40px 12px; }
  .edit-grid > :nth-child(n) { grid-column: auto; width: 100%; margin: 0; }
  .edit-grid > :nth-child(1), .edit-grid > :nth-child(6), .edit-grid > .edit-grid__wide { grid-column: 1 / -1; }
  .edit-grid > :nth-child(1) .media, .edit-grid > :nth-child(6) .media { aspect-ratio: 4 / 5; }
  .edit-grid .product-card__name { font-size: 1.125rem; }
  .edit-grid .product-card__desc { font-size: 0.8125rem; }
  .edit-grid .product-card__body { gap: 4px; margin-top: 14px; }
}

/* Phones: category index becomes a swipe row, so no item is left orphaned */
@media (max-width: 768px) {
  .category-index, .category-index--six {
    display: flex; gap: 10px;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 8px; scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .category-index::-webkit-scrollbar { display: none; }
  .category-index__item { flex: 0 0 42%; scroll-snap-align: start; }
  .category-index > [data-reveal] { opacity: 1; transform: none; }
  .category-index__item img { height: 120px; }
}

/* Phones: journal lead image runs edge to edge */
@media (max-width: 768px) {
  .article-hero-image { padding-inline: 0; margin-top: 44px; }
  .article-header .heading-1 { font-size: clamp(2.5rem, 11vw, 3.25rem); }
}

/* Tablets: two carousel cards per screen */
@media (min-width: 481px) and (max-width: 768px) {
  .product-grid--four > * { flex-basis: 46%; }
  .category-index__item { flex-basis: 28%; }
}

/* Founder on tablets and phones */
@media (max-width: 1024px) {
  .founder__portrait { grid-column: 1 / span 5; }
  .founder__text { grid-column: 7 / span 6; }
}
@media (max-width: 768px) {
  .founder__portrait { width: 78%; }
  .founder__portrait::before { inset: 20px -20px 52px 20px; }
  .founder__caption { margin-top: 40px; }
  .founder__name { font-size: clamp(2.75rem, 13vw, 3.5rem); }
  .founder__sign { font-size: 1.25rem; }
}
