/* โรงเรียนอัชชีฟาอ์ การบริบาล — Yanhee-style structure, navy+gold palette. Tokens live in :root */
:root {
  --navy: #0b1f4d;
  --navy-2: #14306e;
  --gold: #c9a24b;
  --gold-dark: #a8832f;
  --gold-soft: #f4e7c4;
  --sky: #eaf0fb;
  --sky-2: #a9bde8;
  --ink: #1a2238;
  --muted: #5b6480;
  --bg: #ffffff;
  --card: #ffffff;
  --line: #e1e6f0;
  --danger: #c62828;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .08);
  --maxw: 1140px;
  --font: "Prompt", "Noto Sans Thai", "Sarabun", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 16px; letter-spacing: .2px; color: var(--ink); background: var(--bg); line-height: 1.75; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-2); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }

/* utility strip */
.topbar { background: var(--sky); color: var(--navy); font-size: 14px; border-top: 3px solid var(--navy-2); }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 4px 20px; justify-content: space-between; padding-top: 8px; padding-bottom: 8px; }
.topbar a { color: var(--navy); font-weight: 500; text-decoration: none; }

/* compact sticky header: brand left, menu right */
.header { background: #fff; position: sticky; top: 0; z-index: 50; border-bottom: 3px solid var(--gold); }
.header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.brand img { height: 52px; width: auto; }
.brand b { display: block; font-size: 19px; line-height: 1.25; font-weight: 600; }
.brand small { color: var(--muted); font-size: 12px; }
.nav { display: flex; gap: 2px; align-items: center; justify-content: flex-end; }
.nav a { padding: 7px 14px; text-decoration: none; color: var(--navy); font-weight: 500; font-size: 16px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { background: var(--sky); }
.nav a[aria-current="page"] { background: var(--navy); color: #fff; }
.nav .cta { background: var(--gold); color: var(--navy); font-weight: 600; margin-left: 6px; padding: 7px 20px; }
.nav .cta:hover { background: #d8b45d; }
.burger { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; font-size: 22px; padding: 4px 12px; color: var(--navy); cursor: pointer; }

/* banner slider */
.banner { position: relative; height: clamp(300px, 40vw, 440px); overflow: hidden; background: var(--navy); color: #fff; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s; display: flex; align-items: center; }
.slide.on { opacity: 1; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(11,31,77,.8) 0%, rgba(11,31,77,.55) 55%, rgba(11,31,77,.15) 100%); }
.slide.plain { background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.slide.plain::before { display: none; }
.slide .photo { position: absolute; right: max(16px, calc((100% - var(--maxw)) / 2 + 16px)); top: 0; bottom: 0; width: 360px; z-index: 1; }
.slide .photo img { object-position: 40% 8%; }
.slide.plain .wrap > * { max-width: calc(100% - 400px); }
.slide.plain .wrap > .btns { max-width: none; }
.slide .wrap { position: relative; z-index: 2; width: 100%; }
.eyebrow { display: inline-block; background: var(--gold); color: var(--navy); font-weight: 600; padding: 3px 16px; border-radius: 999px; font-size: 14px; }
.slide h1, .slide h2 { font-size: clamp(26px, 4vw, 44px); line-height: 1.3; margin: 12px 0 10px; font-weight: 600; }
.slide p { color: #e3e9f8; max-width: 52ch; margin: 0 0 20px; }
.dots { position: absolute; bottom: 12px; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; gap: 8px; }
.dots button { width: 11px; height: 11px; border-radius: 50%; border: 0; background: rgba(255,255,255,.55); cursor: pointer; padding: 0; }
.dots button.on { background: var(--gold); }

/* auto-advancing photo carousel (no controls other than dots) */
.carousel { position: relative; aspect-ratio: 4 / 3; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); background: var(--sky-2); }
.cslide { position: absolute; inset: 0; opacity: 0; transition: opacity .9s; }
.cslide.on { opacity: 1; }
.cslide img { width: 100%; height: 100%; object-fit: cover; }
.carousel .dots { bottom: 10px; }

/* one big clickable course card: poster + text */
.course-link { display: grid; grid-template-columns: minmax(0, 440px) 1fr; gap: 0; background: #fff; border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); text-decoration: none; color: inherit; transition: transform .25s; }
.course-link:hover { transform: translateY(-3px); }
.course-link img { width: 100%; height: 100%; object-fit: cover; }
.course-link .body { padding: 32px 36px; align-self: center; }
.course-link h3 { margin: 0 0 10px; color: var(--navy); font-size: 26px; font-weight: 600; }
.course-link p { margin: 0 0 18px; color: var(--muted); }
.course-link .go { display: inline-block; background: var(--navy); color: #fff; font-weight: 600; padding: 10px 26px; border-radius: 999px; }
.course-link:hover .go { background: var(--navy-2); }

/* three course cards (each is a link to the courses page) */
.ccards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ccard { display: flex; flex-direction: column; background: #fff; border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); text-decoration: none; color: inherit; transition: transform .25s; }
.ccard:hover { transform: translateY(-3px); }
.ccard img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.ccard .body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ccard h2, .ccard h3 { margin: 0; color: var(--navy); font-size: 20px; font-weight: 600; }
.ccard .meta { color: var(--muted); font-size: 15px; margin: 0; }
.ccard .price { color: var(--navy); font-weight: 600; font-size: 18px; margin: 0; }
.ccard .go { margin-top: auto; padding-top: 8px; color: var(--gold-dark); font-weight: 600; }

/* poster beside text */
.posterrow { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 36px; align-items: center; }
.posterrow > a, .posterrow > img { display: block; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.posterrow img { width: 100%; height: auto; border-radius: 18px; }

/* buttons */
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-block; padding: 11px 28px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 2px solid transparent; cursor: pointer; font: inherit; font-weight: 600; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #d8b45d; }
.btn-ghost { border-color: rgba(255,255,255,.7); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.14); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-line { border-color: var(--navy-2); color: var(--navy-2); background: #fff; }
.btn-line:hover { background: var(--sky); }

/* sections */
.section { padding-top: 64px; padding-bottom: 8px; }
.tint { background: var(--sky); padding: 24px 0 56px; margin-top: 56px; }
.stitle { text-align: center; font-size: 30px; font-weight: 600; color: var(--navy); margin: 0 0 8px; display: flex; align-items: center; justify-content: center; gap: 16px; }
.stitle::before, .stitle::after { content: ""; width: 48px; height: 4px; background: var(--gold); border-radius: 2px; }
.section h2:not(.stitle) { font-size: 28px; color: var(--navy); margin: 0 0 6px; }
.lead { color: var(--muted); margin: 10px 0 24px; max-width: 70ch; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.grid { display: grid; gap: 20px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; border: 1px solid var(--line); }
.card h2, .card h3 { margin: 0 0 6px; color: var(--navy); font-size: 18px; font-weight: 600; }
.card p { margin: 0; color: var(--muted); }
.card .ico { font-size: 28px; }

/* two big course cards */
.course-card { background: #fff; border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); transition: transform .25s; }
.course-card:hover { transform: scale(1.01); }
.course-card .pic { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; display: flex; align-items: center; justify-content: center; height: 150px; font-size: 64px; }
.course-card .body { padding: 22px 26px 26px; }
.course-card h3 { margin: 0 0 6px; color: var(--navy); font-size: 22px; font-weight: 600; }
.course-card p { margin: 0; color: var(--muted); }

/* horizontal course cards with photo */
.course-h { display: grid; grid-template-columns: 210px 1fr; background: #fff; border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); }
.course-h img { width: 100%; height: 100%; min-height: 210px; object-fit: cover; }
.course-h .body { padding: 26px 28px; align-self: center; }
.course-h h3 { margin: 0 0 8px; color: var(--navy); font-size: 22px; font-weight: 600; }
.course-h p { margin: 0; color: var(--muted); }

/* photo blocks */
.photo-rounded { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 22px; box-shadow: var(--shadow); }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 18px; box-shadow: var(--shadow); }
.caption { text-align: center; color: var(--muted); font-size: 13px; margin-top: 10px; }
.person { display: flex; gap: 18px; align-items: center; }
.person img { width: 112px; height: 140px; object-fit: cover; object-position: center top; border-radius: 14px; flex: none; }
.triple { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.triple img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }

/* closing call-to-action band */
.ctaband { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; text-align: center; padding: 48px 16px; margin-top: 64px; }
.ctaband h2 { margin: 0 0 8px; font-size: 28px; font-weight: 600; }
.ctaband p { margin: 0 0 20px; color: #d3dcf3; }
.ctaband .btns { justify-content: center; }

/* know-before-you-apply icon grid */
.know { text-align: center; padding: 10px 14px; }
.know .circle { width: 84px; height: 84px; border-radius: 50%; background: var(--sky); display: flex; align-items: center; justify-content: center; font-size: 36px; margin: 0 auto 12px; }
.know b { display: block; color: var(--navy); font-size: 18px; font-weight: 600; }
.know span { color: var(--muted); font-size: 14px; }

/* tuition block */
.tuition { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; }
.tuition h2 { font-size: 32px; margin: 0 0 14px; color: var(--navy); font-weight: 600; }
.dotlist { list-style: none; margin: 0 0 16px; padding: 0; }
.dotlist li { position: relative; padding: 8px 0 8px 22px; border-bottom: 1px dashed var(--sky-2); }
.dotlist li:last-child { border-bottom: 0; }
.dotlist li::before { content: ""; position: absolute; left: 0; top: 17px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }

/* calendar cards */
.round { background: #fff; border-radius: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); padding: 26px 20px; text-align: center; }
.round .badge { display: inline-block; background: linear-gradient(90deg, var(--navy), var(--navy-2)); color: #fff; border-radius: 999px; padding: 3px 20px; font-size: 14px; font-weight: 600; }
.round b { display: block; margin: 12px 0 2px; font-size: 22px; color: var(--navy); font-weight: 600; }
.round span { color: var(--muted); font-size: 14px; }

/* news */
.news-list { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.news-list li { display: flex; gap: 12px; align-items: baseline; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.news-list li:last-child { border-bottom: 0; }
.news-list a { color: var(--ink); text-decoration: none; flex: 1; }
.news-list a:hover { color: var(--navy-2); text-decoration: underline; }
.news-list time { color: var(--muted); font-size: 13px; white-space: nowrap; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; color: #fff; background: var(--danger); }
.tag.new { background: #1b7f3b; }
.tag.hot { background: var(--danger); }
.more { display: inline-block; margin-top: 12px; font-weight: 600; color: var(--gold-dark); text-decoration: none; }

/* split blocks */
.split { display: grid; grid-template-columns: 340px 1fr; gap: 28px; align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* page head (inner pages) */
.pagehead { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; padding: 36px 0; }
.pagehead h1 { margin: 0; font-size: 32px; font-weight: 600; }
.pagehead p { margin: 6px 0 0; color: #d3dcf3; }
.prose { padding: 32px 0 8px; max-width: 80ch; }
.prose h2 { color: var(--navy); }
.notice { background: var(--gold-soft); border: 1px solid var(--gold); padding: 12px 16px; border-radius: 8px; margin: 16px 0; }

/* forms */
.form { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; border: 1px solid var(--line); max-width: 640px; }
.form label { display: block; font-weight: 500; margin: 14px 0 4px; }
.form input, .form select, .form textarea { width: 100%; padding: 11px 12px; border: 1px solid #c5cde0; border-radius: 10px; font: inherit; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 3px solid rgba(201,162,75,.45); border-color: var(--gold); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-top: 18px; }
.form .check input { width: auto; margin-top: 6px; }
.form button { margin-top: 20px; cursor: pointer; font: inherit; font-weight: 600; }
.form .qwrap { margin-bottom: 6px; }
.form .qwrap > label:not(.check) { margin-top: 20px; }
.form .qwrap .check { margin-top: 8px; }
.form .other { margin: 6px 0 0 28px; width: calc(100% - 28px); }
.msg { margin-top: 14px; padding: 12px; border-radius: 10px; display: none; }
.msg.ok { display: block; background: #e6f4ea; color: #14602a; }
.msg.err { display: block; background: #fdecea; color: var(--danger); }

/* footer */
.footer { background: var(--navy); color: #cfd8ee; margin-top: 72px; }
.footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; padding-top: 40px; padding-bottom: 28px; }
.footer h4 { color: #fff; margin: 0 0 10px; font-weight: 600; font-size: 18px; }
.footer a, .footer span { color: #cfd8ee; text-decoration: none; display: block; padding: 3px 0 3px 18px; position: relative; }
.footer a::before, .footer span::before { content: ""; position: absolute; left: 0; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.footer a:hover { color: var(--gold); }
.footer p { margin: 0; }
.home .footer { margin-top: 0; }
.copy { border-top: 1px solid rgba(255,255,255,.12); text-align: center; padding: 14px; font-size: 13px; }

/* floating LINE + mobile call bar */
.linefab { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 92px; height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: #06c755; color: #fff; font-weight: 600; font-size: 13px; line-height: 1.2; text-decoration: none; border-radius: 20px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.linefab:hover { background: #05b34c; }
.linefab img { width: 46px; height: 46px; }
.callbar { display: none; }

@media (max-width: 860px) {
  .header .wrap { flex-wrap: wrap; }
  .brand img { height: 42px; }
  .brand b { font-size: 16px; }
  .brand small { font-size: 11px; }
  .burger { display: block; }
  .nav { display: none; flex-direction: column; align-items: stretch; width: 100%; order: 3; padding-bottom: 8px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: 10px; }
  .nav .cta { margin: 8px 0 0; text-align: center; }
  .split, .footer .wrap, .tuition, .posterrow, .course-link { grid-template-columns: 1fr; }
  .posterrow > a, .posterrow > img { max-width: 420px; margin: 0 auto; }
  .course-link .body { padding: 20px 22px 24px; }
  .triple, .ccards { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: 1fr; }
  .g2, .form .row { grid-template-columns: 1fr; }
  .tuition .g2 { grid-template-columns: repeat(2, 1fr); }
  .slide .photo { display: none; }
  .slide.plain .wrap > * { max-width: none; }
  .banner { height: 360px; }
  .slide .wrap { padding-bottom: 28px; }
  .course-h { grid-template-columns: 120px 1fr; }
  .course-h img { min-height: 140px; }
  .course-h .body { padding: 16px 18px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .home .footer { margin-top: 0; }
  .stitle { font-size: 24px; }
  .stitle::before, .stitle::after { width: 24px; }
  .linefab { display: none; }
  .callbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: #fff; border-top: 2px solid var(--gold); }
  .callbar a { flex: 1; text-align: center; padding: 12px 6px; font-weight: 600; text-decoration: none; color: var(--navy); }
  .callbar a.apply { background: var(--gold); }
  .callbar a.line { background: #06c755; color: #fff; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; }
  .callbar a.line img { width: 28px; height: 28px; }
  body { padding-bottom: 52px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .card, .course-link { transition: none; } }
