/* Mobile layout guard: 2026-10-30
   All rules are scoped to small viewports so desktop presentation remains intact. */
@media (max-width: 820px), (pointer:coarse) and (hover:none) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  body, main, section, article, .container, .header-inner,
  .hero-grid, .intro-grid, .story-grid, .contact-grid,
  .project-hero, .project-story, .project-story-copy,
  .project-category-heading, .category-projects,
  .content-stack, .projects-footer-main, .projects-footer-bottom,
  .domain-grid, .help-grid {
    min-width: 0 !important;
  }

  body .container {
    width: min(calc(100% - 28px), 1180px) !important;
    max-width: calc(100% - 28px) !important;
  }

  .hero-grid, .intro-grid, .story-grid, .contact-grid,
  .project-hero, .project-category-heading, .domain-grid,
  .help-grid, .projects-footer-main {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .hero-grid > *, .intro-grid > *, .story-grid > *,
  .contact-grid > *, .project-hero > *,
  .project-category-heading > *, .domain-grid > *,
  .help-grid > *, .projects-footer-main > * {
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
  }

  img, video, iframe, canvas, svg {
    max-width: 100%;
  }

  main img, main video {
    height: auto;
  }

  h1, h2, h3, h4, p, a, span, address, li, label,
  .lead, .content-stack, .project-story-copy {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: manual;
  }

  body :where(input, select, textarea, button) {
    max-width: 100%;
    box-sizing: border-box;
  }

  body :where(input, select, textarea) {
    font-size: 16px;
  }

  body :where(button, a.btn, .actions a, .actions button,
      .project-story-cta, .header-cta) {
    min-height: 44px;
  }

  .actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .actions > * {
    max-width: 100%;
    white-space: normal;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
  }

  .projects-footer-bottom {
    align-items: flex-start !important;
    flex-wrap: wrap;
  }
}

@media (max-width: 620px), (pointer:coarse) and (hover:none) {
  body .container {
    width: min(calc(100% - 24px), 1180px) !important;
    max-width: calc(100% - 24px) !important;
  }

  body :where(h1) {
    font-size: clamp(2rem, 9vw, 3.2rem);
    line-height: 1.04;
  }

  body :where(h2) {
    max-width: 100%;
    overflow-wrap: normal;
  }

  body :where(p, li) {
    line-height: 1.6;
  }

  .projects-footer-main {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 380px), (max-device-width:380px) {
  body .container {
    width: min(calc(100% - 20px), 1180px) !important;
    max-width: calc(100% - 20px) !important;
  }
}

/* The projects page previously kept alternating desktop column assignments
   after switching the grid to one column. Override every alternating selector. */
@media (max-width: 820px), (pointer:coarse) and (hover:none) {
  body.samaki-art-v4.page-projects
  .project-category-block:nth-child(n)
  .category-projects
  .project-story:nth-child(n) {
    display: grid !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 0 !important;
    overflow: visible !important;
  }

  body.samaki-art-v4.page-projects
  .project-category-block:nth-child(n)
  .category-projects
  .project-story:nth-child(n) > .project-story-media {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: clamp(230px, 68vw, 360px) !important;
    height: auto !important;
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    margin: 0 !important;
  }

  body.samaki-art-v4.page-projects
  .project-category-block:nth-child(n)
  .category-projects
  .project-story:nth-child(n) > .project-story-copy {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    margin: 0 !important;
    padding: clamp(22px, 6vw, 34px) !important;
    box-sizing: border-box !important;
    overflow-wrap: anywhere !important;
  }

  body.samaki-art-v4.page-projects
  .project-category-block:nth-child(n)
  .category-projects
  .project-story.solidarity:nth-child(n) {
    grid-template-rows: auto !important;
  }

  body.samaki-art-v4.page-projects
  .project-category-block:nth-child(n)
  .category-projects
  .project-story.solidarity:nth-child(n) > .project-story-copy {
    grid-row: 1 !important;
  }

  body.samaki-art-v4.page-projects .project-category-block h2 {
    max-width: 100% !important;
    font-size: clamp(2.5rem, 11vw, 4rem) !important;
    line-height: .98 !important;
    overflow-wrap: normal !important;
  }

  body.samaki-art-v4.page-projects .project-category-heading p {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
  }
}


/* Phone-only editorial layout consolidation, 2026-11-02.
   The desktop layout and visual identity are intentionally unchanged. */
@media screen and (max-width:700px) {
  html { scroll-padding-top: 76px; }
  body.samaki-art-v4 { overflow-x: clip !important; }
  body.samaki-art-v4 .container, body.samaki-art-v4 main .container {
    width: calc(100% - 32px) !important; max-width: calc(100% - 32px) !important;
    margin-inline: auto !important; min-width: 0 !important;
  }
  body.samaki-art-v4 .site-header .header-inner { min-height: 68px !important; gap: 8px !important; }
  body.samaki-art-v4 .site-header .nav.open {
    top: 68px !important; max-height: calc(100dvh - 68px) !important; overflow-y:auto !important;
  }
  body.samaki-art-v4 main :is(h1,h2,h3,p,.lead,.tagline,.stat,li) {
    min-width:0 !important; word-break:normal !important; overflow-wrap:break-word !important; hyphens:none !important;
  }
  body.samaki-art-v4 main :is(p,.lead) { line-height:1.55 !important; }
  body.samaki-art-v4 .section-title, body.samaki-art-v4 .section-title.small {
    margin:8px 0 16px !important; font-size:clamp(2rem,8vw,2.9rem) !important;
    line-height:1.08 !important; letter-spacing:-.035em !important;
    white-space:normal !important; text-wrap:balance !important;
  }
  body.samaki-art-v4 main > section.section,
  body.samaki-art-v4 main > section.section-sm,
  body.samaki-art-v4 main > section:not(.hero):not(.page-hero):not(.project-hero) {
    min-height:0 !important; padding-top:36px !important; padding-bottom:38px !important;
  }
  body.samaki-art-v4 main .actions { gap:10px !important; margin-top:16px !important; }
  body.samaki-art-v4 main .btn {
    min-height:44px !important; padding:10px 17px !important; font-size:.94rem !important; line-height:1.3 !important;
  }
  body.samaki-art-v4 :is(.human-note,.quote) {
    margin:18px 0 12px !important; padding:24px 19px 22px 24px !important;
    font-size:1.1rem !important; line-height:1.42 !important;
    box-shadow:7px 8px 0 rgba(185,153,94,.2) !important;
  }

  /* Inner-page hero: remove fixed desktop height and large empty footer. */
  body.samaki-art-v4:not(.page-home) main .page-hero {
    min-height:0 !important; height:auto !important; padding:24px 0 28px !important; align-items:flex-start !important;
  }
  body.samaki-art-v4:not(.page-home) main .page-hero > .container {
    display:flex !important; flex-direction:column !important; align-items:stretch !important;
    justify-content:flex-start !important; gap:10px !important;
    grid-template-columns:minmax(0,1fr) !important; grid-template-rows:auto !important;
    width:calc(100% - 36px) !important; max-width:calc(100% - 36px) !important;
    min-height:0 !important; margin:0 auto !important; padding:0 !important;
  }
  body.samaki-art-v4:not(.page-home) main .page-hero > .container > :is(.eyebrow,h1,.lead,p,.actions) {
    grid-column:auto !important; grid-row:auto !important; width:100% !important;
    min-width:0 !important; max-width:100% !important; margin:0 !important;
  }
  body.samaki-art-v4:not(.page-home) main .page-hero h1 {
    font-size:clamp(2.15rem,9vw,3.1rem) !important;
    line-height:1.08 !important; letter-spacing:-.04em !important;
  }
  body.samaki-art-v4:not(.page-home) main .page-hero .lead { font-size:.98rem !important; line-height:1.52 !important; }
  body.samaki-art-v4:not(.page-home) main .page-hero .page-hero-photo.samaki-polaroid {
    display:block !important; position:relative !important;
    grid-column:auto !important; grid-row:auto !important;
    align-self:center !important; justify-self:center !important;
    width:min(100%,330px) !important; max-width:330px !important;
    min-width:0 !important; min-height:0 !important; height:auto !important;
    margin:6px auto 4px !important; transform:none !important; translate:none !important;
  }
  body.samaki-art-v4:not(.page-home) main > .page-hero + section {
    margin-top:0 !important; border-radius:22px 22px 0 0 !important;
  }

  /* Projects: reduce the white gulf after the hero and avoid cropped photos. */
  body.samaki-art-v4.page-projects main > .page-hero + .section {
    padding-top:20px !important; padding-bottom:30px !important;
  }
  body.samaki-art-v4.page-projects main .project-categories {
    display:grid !important; grid-template-columns:minmax(0,1fr) !important;
    gap:18px !important; margin:0 !important;
  }
  body.samaki-art-v4.page-projects main .project-category-block {
    box-sizing:border-box !important; width:100% !important; min-width:0 !important;
    min-height:0 !important; margin:0 !important; padding:18px 14px 16px !important;
    border-radius:20px !important;
  }
  body.samaki-art-v4.page-projects main .project-category-heading,
  body.samaki-art-v4.page-projects main .project-category-block.local .project-category-heading {
    display:block !important; width:100% !important; min-height:0 !important;
    margin:0 0 14px !important; padding:0 0 12px 12px !important;
    border-left-width:4px !important; grid-template-columns:minmax(0,1fr) !important; gap:0 !important;
  }
  body.samaki-art-v4.page-projects main .project-category-heading h2,
  body.samaki-art-v4.page-projects main .project-category-block.local .project-category-heading h2 {
    width:100% !important; max-width:100% !important; margin:0 0 8px !important;
    font-size:clamp(2rem,8.4vw,2.8rem) !important; line-height:1.06 !important;
    letter-spacing:-.035em !important;
  }
  body.samaki-art-v4.page-projects main .project-category-heading p {
    width:100% !important; max-width:100% !important; margin:0 !important; padding:0 !important;
    font-size:.96rem !important; line-height:1.5 !important;
  }
  body.samaki-art-v4.page-projects main .category-projects {
    display:grid !important; grid-template-columns:minmax(0,1fr) !important;
    min-height:0 !important; gap:0 !important; margin:0 !important;
  }
  body.samaki-art-v4.page-projects main .category-projects .project-story {
    display:grid !important; grid-template-columns:minmax(0,1fr) !important;
    grid-template-rows:auto auto !important; align-items:stretch !important;
    min-height:0 !important; width:100% !important; margin:0 !important; gap:0 !important;
  }
  body.samaki-art-v4.page-projects main .category-projects .project-story::before {
    display:none !important; content:none !important;
  }
  body.samaki-art-v4.page-projects main .category-projects .project-story:nth-child(n) > .project-story-media {
    display:block !important; grid-column:1 / -1 !important; grid-row:1 !important;
    width:100% !important; height:auto !important; min-height:0 !important;
    max-height:none !important; margin:0 !important; aspect-ratio:auto !important;
    overflow:hidden !important; box-shadow:none !important; background:#f0e7d8 !important;
  }
  body.samaki-art-v4.page-projects main .category-projects .project-story .project-story-media > img {
    display:block !important; position:static !important;
    width:100% !important; height:auto !important; min-height:0 !important; max-height:none !important;
    object-fit:contain !important; object-position:center !important; transform:none !important;
  }
  body.samaki-art-v4.page-projects main .category-projects .project-story:nth-child(n) > .project-story-copy {
    display:block !important; grid-column:1 / -1 !important; grid-row:2 !important;
    width:100% !important; height:auto !important; min-height:0 !important;
    margin:0 !important; padding:18px 17px 20px !important; border-top-width:5px !important;
    box-shadow:0 8px 20px rgba(41,73,101,.08) !important;
  }
  body.samaki-art-v4.page-projects main .category-projects .project-story.solidarity > .project-story-copy {
    grid-row:1 !important;
  }
  body.samaki-art-v4.page-projects main .project-story h3 {
    margin:8px 0 12px !important; font-size:clamp(1.6rem,7vw,2.2rem) !important; line-height:1.13 !important;
  }
  body.samaki-art-v4.page-projects main .project-story p {
    margin:0 0 12px !important; font-size:.96rem !important; line-height:1.52 !important;
  }
  body.samaki-art-v4.page-projects main .project-story .stat {
    margin:6px 0 12px !important; padding:8px 11px !important; font-size:.88rem !important;
  }
  body.samaki-art-v4.page-projects main .project-story .project-story-cta {
    display:inline-flex !important; align-items:center !important; justify-content:space-between !important;
    width:100% !important; min-height:44px !important; margin:6px 0 0 !important;
    padding:10px 13px !important; box-sizing:border-box !important; font-size:.92rem !important;
  }

  /* Global phone rhythm: homepage, detail pages, sponsorship and forms. */
  body.samaki-art-v4.page-home :is(.hero,.hero-grid) { min-height:0 !important; height:auto !important; }
  body.samaki-art-v4.page-home .hero-photo {
    order:1 !important; height:clamp(185px,52vw,275px) !important;
    min-height:0 !important; overflow:hidden !important;
  }
  body.samaki-art-v4.page-home .hero-photo img {
    position:absolute !important; inset:0 !important; width:100% !important; height:100% !important;
    min-height:0 !important; object-fit:cover !important;
  }
  body.samaki-art-v4.page-home .hero-copy {
    order:2 !important; min-height:0 !important; padding:56px 22px 28px !important;
  }
  body.samaki-art-v4.page-home .hero-copy::before { top:24px !important; left:22px !important; }
  body.samaki-art-v4.page-home .hero h1 {
    margin:8px 0 12px !important; font-size:clamp(2.9rem,12vw,4.5rem) !important; line-height:.95 !important;
  }
  body.samaki-art-v4.page-home .hero .tagline {
    font-size:clamp(1.25rem,5vw,1.7rem) !important; line-height:1.16 !important; margin:0 0 12px !important;
  }
  body.samaki-art-v4.page-home .hero + .section { padding-top:36px !important; padding-bottom:38px !important; }
  body.samaki-art-v4.page-home :is(.intro-grid,.domain-grid,.help-grid) {
    display:grid !important; grid-template-columns:minmax(0,1fr) !important;
    gap:14px !important; margin-top:18px !important;
  }
  body.samaki-art-v4.page-home .hero + .section .photo-card {
    width:min(100%,320px) !important; margin:18px auto 0 !important;
  }
  body.samaki-art-v4.page-home .domain-card { min-height:0 !important; margin:0 !important; padding:18px !important; }
  body.samaki-art-v4.page-home .domain-card h3 {
    font-size:clamp(1.5rem,6vw,2rem) !important; line-height:1.15 !important;
  }
  body.samaki-art-v4.page-home .domain-card p { margin:8px 0 12px !important; font-size:.95rem !important; }
  body.samaki-art-v4.page-home .help-grid > .help-card:nth-child(n) {
    grid-column:auto !important; min-height:0 !important; margin:0 !important;
    padding:22px 19px !important; transform:none !important;
  }
  body.samaki-art-v4.page-home .help-card h3 {
    min-height:0 !important; margin:8px 0 12px !important; font-size:1.65rem !important;
  }
  body.samaki-art-v4 :is(.content-stack,.story-grid) { gap:16px !important; }
  body.samaki-art-v4 .content-stack > div,
  body.samaki-art-v4.page-association .content-stack > div:nth-child(3) {
    min-height:0 !important; margin:0 !important; padding:24px 14px 24px 22px !important;
  }
  body.samaki-art-v4 .sticky, body.samaki-art-v4.page-association .sticky,
  body.samaki-art-v4.page-sponsor .sticky {
    position:static !important; top:auto !important; margin-bottom:18px !important;
  }
  body.samaki-art-v4 main .project-hero {
    min-height:0 !important; height:auto !important;
  }
  body.samaki-art-v4 main .project-hero > .visual {
    min-height:0 !important; height:auto !important; max-height:none !important;
  }
  body.samaki-art-v4 main .project-hero > .visual > img:not(.samaki-polaroid-photo):not(.samaki-polaroid-frame) {
    display:block !important; width:100% !important; height:auto !important; max-height:none !important;
    object-fit:contain !important;
  }
  body.samaki-art-v4 main .project-hero > .text {
    min-height:0 !important; height:auto !important; padding:25px 20px 28px !important;
  }
  body.samaki-art-v4.page-project-detail #project-detail > .hero {
    min-height:0 !important; height:auto !important; padding:28px 0 !important;
  }
  body.samaki-art-v4.page-project-detail #project-detail > .hero .hero-grid { gap:16px !important; }
  body.samaki-art-v4.page-support :is(.support-path,.support-box) {
    min-height:0 !important; padding:24px 18px 28px !important;
  }
  body.samaki-art-v4.page-contact :is(.contact-grid > div:first-child,.contact-grid > .contact-card:first-child,form.contact-card) {
    padding:24px 18px !important;
  }
  body.samaki-art-v4 .site-footer { min-height:0 !important; height:auto !important; }
  body.samaki-art-v4 :is(.projects-footer-main,.home-footer-main) {
    gap:16px !important; padding:24px 0 16px !important;
  }
  body.samaki-art-v4 :is(.projects-footer-bottom,.home-footer-bottom) {
    gap:8px !important; margin-top:0 !important; padding:12px 0 16px !important;
  }
}
