/* ============================================================
   SUBPAGE BITS — moved from styles.css (PageSpeed 3b, 2569-08-27)
   Rules used only on subpages (gallery/staff/timeline/contact/
   accordion/steps/breadcrumb chrome etc) — never on index.html.
   Loaded on all pages except index.html. See BACKLOG.md.
   ============================================================ */

.page-hero { padding: clamp(48px,6vw,90px) 0 clamp(40px,5vw,64px); background: var(--bg-warm); position: relative; overflow: hidden; }
.crumb { font-size: 14.5px; color: var(--ink-3); font-weight: 600; display: flex; gap: 8px; align-items: center; }
.crumb a:hover { color: var(--yellow-deep); }
.page-hero h1 { font-size: clamp(32px,4.6vw,56px); margin-top: 16px; max-width: 18ch; text-wrap: balance; }
.page-hero p { margin-top: 18px; color: var(--ink-2); font-size: 18px; max-width: 56ch; text-wrap: pretty; }

.prose-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(28px,4vw,48px); box-shadow: var(--sh-sm); }

.pillars { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
.pillar { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s var(--ease); }
.pillar:hover { transform: translateY(-6px); box-shadow: var(--sh-md); border-color: transparent; }
.pillar__n { font-size: 14px; font-weight: 800; color: var(--yellow); letter-spacing: .1em; }
.pillar__ic {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--yellow-tint); color: var(--yellow-deep); margin-bottom: 18px;
  transition: transform .4s var(--ease), background .3s, color .3s;
}
.pillar:hover .pillar__ic { transform: scale(1.08) rotate(-5deg); background: var(--yellow); color: #2A2200; }
.pillar__ic svg { width: 30px; height: 30px; }
.pillar h3 { font-size: 21px; margin-top: 10px; }
.pillar p { margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.pillars--compact .pillar h3 { font-size: 19px; }

/* accordion */
.acc { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.acc + .acc { margin-top: 14px; }
.acc__head {
  width: 100%; text-align: left; font-family: inherit; cursor: pointer; border: 0; background: none;
  padding: 22px 26px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-weight: 700; font-size: 18px; color: var(--ink);
}
.acc__head .pm { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--yellow-tint);
  display: grid; place-items: center; color: var(--yellow-deep); transition: .3s var(--ease); }
.acc.open .acc__head .pm { background: var(--yellow); color: #2A2200; transform: rotate(135deg); }
.acc__body { max-height: 0; overflow: hidden; transition: max-height .4s var(--ease); }
.acc__body > div { padding: 0 26px 24px; color: var(--ink-2); font-size: 15.5px; line-height: 1.75; }

.steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; counter-reset: s; }
.step { position: relative; padding-top: 20px; }
.step__n {
  width: 50px; height: 50px; border-radius: 16px; background: var(--charcoal); color: var(--yellow);
  display: grid; place-items: center; font-weight: 800; font-size: 22px; margin-bottom: 16px;
}
.step h3 { font-size: 18px; }
.step p { margin-top: 8px; color: var(--ink-2); font-size: 14.5px; }

/* ---------- Values (vision / mission) ---------- */
.vcard {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(28px,3.5vw,42px);
  position: relative; overflow: hidden;
}
.vcard--accent { background: linear-gradient(155deg, #FBF3DC 0%, #F3E2B0 100%); border: 1px solid var(--yellow-soft); color: #7A6212; }
.vcard--accent h3 { color: #5A4509; }
.vcard--accent p, .vcard--accent li { color: #7A6212; }
.vcard__k { font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--yellow-deep); }
.vcard--accent .vcard__k { color: var(--yellow-deep); }
.vcard h3 { font-size: clamp(22px,2.6vw,30px); margin-top: 10px; }
.vcard p { margin-top: 14px; color: var(--ink-2); font-size: 16px; line-height: 1.8; text-wrap: pretty; }
.mission-list { margin: 16px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.mission-list li { display: flex; gap: 14px; color: var(--ink-2); font-size: 15.5px; line-height: 1.7; }
.mission-list li b { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--yellow-tint);
  color: var(--yellow-deep); display: grid; place-items: center; font-size: 14px; font-weight: 800; }

/* ---------- Staff / personnel ---------- */
.staff-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.staff-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s;
}
.staff-card:hover { transform: translateY(-6px); box-shadow: var(--sh-md); border-color: transparent; }
.staff-card__photo {
  aspect-ratio: 1/1; position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--yellow-tint), var(--bg-soft));
  display: grid; place-items: center; color: var(--yellow-deep);
}
.staff-card__photo .avatar { width: 46%; height: 46%; opacity: .55; }
.staff-card__photo .mock { position: absolute; inset: 0; }
.staff-card__body { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; }
.staff-card__name { font-size: 17px; font-weight: 800; line-height: 1.3; }
.staff-card__role { margin-top: 7px; font-size: 14px; color: var(--ink-2); font-weight: 600; line-height: 1.45; }
.staff-card__tag {
  display: inline-block; margin-top: auto; padding-top: 12px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--yellow-deep);
}

/* leadership — larger, horizontal */
.leaders { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 26px; }
.leader-card {
  display: grid; grid-template-columns: 168px 1fr; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s var(--ease);
}
.leader-card:hover { transform: translateY(-6px); box-shadow: var(--sh-md); border-color: transparent; }
.leader-card__photo {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--yellow-soft), var(--yellow-tint));
  display: grid; place-items: center; color: var(--yellow-deep);
}
.leader-card__photo .avatar { width: 52%; height: 52%; opacity: .6; }
.leader-card__photo .mock { position: absolute; inset: 0; }
.leader-card__body { padding: 26px 28px; display: flex; flex-direction: column; justify-content: center; }
.leader-card__k { font-size: 12.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--yellow-deep); }
.leader-card__name { font-size: clamp(20px, 2.3vw, 25px); margin-top: 8px; }
.leader-card__role { margin-top: 8px; color: var(--ink-2); font-size: 15.5px; font-weight: 600; }

@media (max-width: 1100px) { .staff-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) {
  .staff-grid { grid-template-columns: repeat(2, 1fr); }
  .leaders { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .leader-card { grid-template-columns: 120px 1fr; }
  .leader-card__body { padding: 20px 20px; }
}

/* ---------- Timeline ---------- */
.timeline { position: relative; margin-top: 8px; padding-left: 36px; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--yellow), var(--line-2)); }
.tl-item { position: relative; padding-bottom: 38px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -33px; top: 4px; width: 18px; height: 18px;
  box-sizing: border-box; border-radius: 50%; background: #fff; border: 4px solid var(--yellow); box-shadow: 0 0 0 4px var(--yellow-tint);
  transition: transform .3s var(--ease); }
.tl-item:hover::before { transform: scale(1.18); }
.tl-year { font-size: 15px; font-weight: 800; color: var(--yellow-deep); letter-spacing: .02em; }
.tl-item h3 { font-size: 19px; margin-top: 4px; }
.tl-item p { margin-top: 7px; color: var(--ink-2); font-size: 15.5px; line-height: 1.7; }

/* ---------- Gallery grid + filter ---------- */
.gallery-heading { font-size: clamp(24px, 3vw, 34px); margin: 0 0 22px; text-wrap: balance; }
.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.filterbar { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  padding: 10px 20px; border-radius: 100px; border: 1.5px solid var(--line-2); background: #fff; color: var(--ink-2);
  transition: .22s var(--ease);
  min-height: 44px; /* M-06: มาตรฐาน touch target */
}
.chip:hover { border-color: var(--yellow); color: var(--ink); transform: translateY(-2px); }
.chip.active { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.gallery-search {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid var(--line-2); border-radius: 100px;
  padding: 9px 16px; min-width: 240px; flex: 0 1 300px;
}
.gallery-search__ic { width: 17px; height: 17px; color: var(--ink-3); flex: none; }
.gallery-search__input {
  border: 0; outline: 0; background: transparent; font-family: inherit;
  font-size: 16px; color: var(--ink); width: 100%;
}
.gallery-search__input::placeholder { color: var(--ink-3); }
.gallery-meta { margin: -4px 0 26px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); line-height: 1.6; }
.gallery-meta[hidden] { display: none; }
@media (max-width: 640px) {
  .gallery-toolbar { flex-direction: column; align-items: stretch; }
  .gallery-search { min-width: 0; flex: 1 1 auto; }
}
.gallery { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
.gitem {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), opacity .35s, border-color .3s;
}
.gitem:hover { transform: translateY(-6px); box-shadow: var(--sh-md); border-color: transparent; }
.gitem__media { aspect-ratio: 4/3; position: relative; }
.gitem__media .date { position: absolute; top: 14px; left: 14px; background: var(--yellow); color: #2A2200;
  font-weight: 700; font-size: 12.5px; padding: 5px 13px; border-radius: 100px; z-index: 2; }
.gitem__body { padding: 22px 24px 26px; flex: 1; display: flex; flex-direction: column; }
.gitem__date { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700;
  color: var(--yellow-deep); letter-spacing: .02em; margin-bottom: 10px; }
.gitem__date svg { width: 15px; height: 15px; }
.gitem__cat { font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--yellow-deep); }
.gitem__body h3 { font-size: 19px; margin-top: 8px; line-height: 1.3; }
.gallery .gitem__body h3 { color: #211e18; margin-top: 0; }
.gitem__body p { margin-top: 10px; color: var(--ink-2); font-size: 14.5px; flex: 1; }
.gitem__more { margin-top: 16px; font-weight: 700; font-size: 14.5px; color: var(--yellow-deep);
  display: inline-flex; align-items: center; gap: 7px; }
.gitem__more .arr { transition: transform .3s var(--ease); }
.gitem:hover .gitem__more .arr { transform: translateX(5px); }
.gitem.hide { display: none; }

/* ---------- Gallery lightbox (M-05) ---------- */
.gallery article.gitem { cursor: zoom-in; }
.glb {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20,17,12,.92);
  padding: 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom));
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .25s var(--ease), visibility .25s;
}
.glb.show { opacity: 1; visibility: visible; pointer-events: auto; }
.glb__box {
  position: relative; max-width: min(1100px,92vw); max-height: 88vh;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.glb__img {
  max-width: 100%; max-height: 76vh; width: auto; height: auto;
  object-fit: contain; border-radius: var(--r); box-shadow: var(--sh-lg); background: #000;
}
.glb__cap { color: #fff; font-weight: 700; font-size: 15.5px; text-align: center; margin: 0; max-width: 90vw; }
.glb__close {
  position: absolute; top: -18px; right: -18px; width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  border-radius: 50%; border: 0; background: var(--charcoal); color: #fff; font-size: 26px; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.glb__close:hover { background: var(--yellow); color: #2A2200; transform: rotate(90deg); }
@media (max-width: 560px) {
  .glb__close { top: -54px; right: 0; }
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.info-list { display: grid; gap: 16px; }
.info {
  display: flex; gap: 18px; align-items: flex-start; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); padding: 22px 24px; transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.info:hover { transform: translateY(-4px); box-shadow: var(--sh); }
.info__ic { width: 50px; height: 50px; flex: none; border-radius: 14px; background: var(--yellow-tint);
  color: var(--yellow-deep); display: grid; place-items: center; }
.info__ic svg { width: 24px; height: 24px; }
.info__k { font-size: 13px; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; }
.info__v { font-size: 17px; font-weight: 600; margin-top: 3px; }
.info__v a:hover { color: var(--yellow-deep); }
.map { border-radius: var(--r-lg); overflow: hidden; height: 100%; min-height: 360px; border: 1px solid var(--line); }
.social-row { display: flex; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.social-pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 11px 18px; border-radius: 100px;
  background: #fff; border: 1px solid var(--line); font-weight: 700; font-size: 14.5px; color: var(--ink);
  transition: .22s var(--ease);
}
.social-pill:hover { background: var(--yellow); border-color: var(--yellow); transform: translateY(-3px); color: #2A2200; }
.social-pill svg { width: 18px; height: 18px; }

/* ============================================================
   RESPONSIVE (subpage-only rules, split out of styles.css)
   ============================================================ */
@media (max-width: 1200px) {
  .hero__grid { grid-template-columns: 1fr; }
  .levels, .pillars { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2,1fr); }
  .gallery { grid-template-columns: repeat(2,1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .map { min-height: 300px; }
  .nrow { grid-template-columns: 1fr; }
  .nrow__media { aspect-ratio: 4/3; }
}
@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr; }
}
