/* page-business.php — content exclusive to the 事業一覧 page template. */

/* .business-point (page-business.php's 6 事業一覧 sections) — the title
   block, photo, body paragraph(s) and button div (".business-point-cta") are
   flat direct children (no wrapping "copy" div any more), all in the SAME
   source order on every section: title → photo → body(2) → cta. That fixed
   order is what phones display as-is once grid-template-areas is cleared at
   the mobile breakpoint below (auto-placement then just stacks the flat
   children in source order) — no per-section override needed there, and no
   risk of drifting out of sync again.

   Desktop's alternating zigzag is explicit grid-template-areas, not DOM
   order or auto-placement — deliberately avoiding an earlier version of
   this rule that pinned the photo with grid-row: 1 / span 10 and left the
   text children to auto-place around it: that relied on the auto-placement
   algorithm correctly skipping the photo's spanned rows, which didn't
   render the zigzag correctly in practice. Named areas remove that
   ambiguity — every child maps to one named cell, so there's nothing left
   for a placement algorithm to get wrong. ".reverse" (media / materials /
   global — the three sections whose photo used to come first in the DOM)
   swaps which column "photo" is in; ".has-two-body" (Salon only, which has
   an extra intro sentence before its main paragraph) adds the second body
   row. */
.business-point {
  row-gap: 0; column-gap: 28px;
  grid-template-areas: "title photo" "body photo" "cta photo";
}
.business-point.reverse { grid-template-areas: "photo title" "photo body" "photo cta"; }
.business-point.has-two-body { grid-template-areas: "title photo" "body photo" "body2 photo" "cta photo"; }
.business-point.has-two-body.reverse { grid-template-areas: "photo title" "photo body" "photo body2" "photo cta"; }
.business-point > .business-point-title { grid-area: title; }
.business-point > .section-photo { grid-area: photo; }
.business-point > p:first-of-type { grid-area: body; }
.business-point.has-two-body > p:nth-of-type(2) { grid-area: body2; }
.business-point > .business-point-cta { grid-area: cta; }
@media (max-width: 620px) {
  /* Bug fix ("大幅に崩れています" — title/photo/body/button all rendering on
     top of each other): grid-template-areas:none here was meant to let each
     child's grid-area fall back to auto-placement, but real Chrome/Edge
     don't drop the child's own grid-area assignment along with it — every
     child keeps trying to resolve its now-nonexistent named line and they
     all collapse into the same implicit cell instead of stacking. Defining
     an explicit single-column area list (matching each child's existing
     grid-area) is unambiguous: every child still resolves to a real area,
     just one stacked on top of the next, in the same title→photo→body(2)→cta
     order every section already uses. grid-template-columns is set here too
     instead of relying on .grid-2's own mobile collapse (a different
     stylesheet) — this component no longer depends on cascade order between
     the two files to lay out correctly. */
  .business-point,
  .business-point.reverse {
    grid-template-columns: 1fr;
    grid-template-areas: "title" "photo" "body" "cta";
  }
  .business-point.has-two-body,
  .business-point.has-two-body.reverse {
    grid-template-columns: 1fr;
    grid-template-areas: "title" "photo" "body" "body2" "cta";
  }
}
