/* =========================================================
   pages.css — halaman dalam (berita, galeri, tenaga pendidik, halaman statis)
   ========================================================= */
.pagehead {
  position: relative; overflow: hidden; color: #fff;
  padding: calc(var(--hero-top) + 24px) 0 clamp(36px, 6vw, 64px);
  background: linear-gradient(120deg, #24691a, #2f7d20 55%, #37892a 135%);
}
.pagehead::after { content: ""; position: absolute; inset: 0; opacity: .09; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96' fill='none' stroke='%23a9de8a' stroke-width='1.2'%3E%3Crect x='24' y='24' width='48' height='48'/%3E%3Crect x='24' y='24' width='48' height='48' transform='rotate(45 48 48)'/%3E%3C/svg%3E"); -webkit-mask-image: linear-gradient(to left, #000, transparent 70%); mask-image: linear-gradient(to left, #000, transparent 70%); }
.pagehead > .container { position: relative; z-index: 1; }
.pagehead :focus-visible { --focus: #fff; }
.pagehead h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.1; letter-spacing: -.01em; max-width: 24ch; text-wrap: balance; }
.pagehead p { margin-top: 12px; max-width: 56ch; color: rgba(255, 255, 255, .96); }
[data-theme="dark"] .pagehead { background: linear-gradient(120deg, #0f2d13, #16391a 55%, #1c4620); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-size: .8125rem; color: rgba(255, 255, 255, .92); }
.crumbs a:hover { color: var(--accent-light); text-decoration: underline; }

.prose { max-width: none; }
.prose > * { max-width: 720px; }
.prose p { margin-bottom: 1.1em; font-size: 1.0625rem; line-height: 1.75; }
.prose h2 { margin: 1.8em 0 .6em; font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; line-height: 1.25; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .55em; padding-left: .25em; font-size: 1.0625rem; line-height: 1.7; }
.prose li::marker { color: var(--secondary); font-weight: 700; }
[data-theme="dark"] .prose li::marker { color: var(--accent-light); }
/* ---------- Halaman jenjang: foto sampul + galeri di samping isi ---------- */
.jpage { display: grid; gap: 32px 40px; align-items: start; }
.jpage__media { display: flex; flex-direction: column; gap: 20px; }
.jpage__cover { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); overflow: hidden; object-fit: cover; aspect-ratio: 4 / 3; box-shadow: var(--shadow-sm); background: var(--primary-dark); }
.jpage__body { min-width: 0; }
.jpage__gallery { margin: 0; }
.jgal__label { margin-bottom: 12px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--secondary); }
[data-theme="dark"] .jgal__label { color: var(--accent-light); }
.jgal__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.jgal__grid a { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--radius-sm); background: var(--primary-dark); }
.jgal__grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.jgal__grid a:hover img { transform: scale(1.06); }
@media (min-width: 1024px) {
  .jpage:not(.jpage--nomedia) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .jpage__media { order: 2; position: sticky; top: 100px; align-self: start; }
  .jpage__cover { aspect-ratio: 4 / 5; max-height: 520px; }
  .jpage__body { order: 1; }
}

/* ---------- Lightbox: pratinjau foto galeri (perjenjang & galeri utama) ---------- */
.lightbox { padding: 0; border: 0; max-width: min(94vw, 1100px); width: auto; background: transparent; }
.lightbox::backdrop { background: rgba(8, 20, 10, .86); }
.lightbox[open] { animation: lightbox-in .25s var(--ease); }
.lightbox[open]::backdrop { animation: fade-in .25s ease; }
@keyframes lightbox-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.lightbox__box { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox__img { display: block; max-width: min(94vw, 1100px); max-height: 80vh; width: auto; height: auto; border-radius: 14px; box-shadow: 0 30px 60px rgba(0, 0, 0, .5); background: #0e1f11; }
.lightbox__caption { margin: 0; padding: 0 8px; color: #fff; font-size: .875rem; text-align: center; max-width: 70ch; }
.lightbox__close, .lightbox__nav { position: absolute; border: 0; border-radius: 50%; background: rgba(10, 20, 12, .55); color: #fff; cursor: pointer; display: grid; place-items: center; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background-color .2s; }
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(10, 20, 12, .82); }
.lightbox__close { top: 10px; right: 10px; width: 38px; height: 38px; }
.lightbox__close .ic { width: 18px; height: 18px; }
.lightbox__nav { top: 50%; translate: 0 -50%; width: 44px; height: 44px; }
.lightbox__prev { left: 10px; }
.lightbox__next { right: 10px; }
.lightbox__prev .ic { transform: rotate(180deg); }
@media (max-width: 640px) {
  .lightbox__close { top: 6px; right: 6px; }
  .lightbox__prev { left: 6px; }
  .lightbox__next { right: 6px; }
}

.prose__lead { font-size: 1.1875rem !important; color: var(--text-muted); }
.prose .meta { font-size: .8125rem; font-weight: 600; color: var(--secondary); margin-bottom: 1rem; }
[data-theme="dark"] .prose .meta { color: var(--accent-light); }

/* ---------- Bungkus halaman statis: lebar wajar + navigasi "Di halaman ini" ---------- */
.pwrap { display: grid; gap: 40px; }
.pwrap--narrow { max-width: 760px; margin-inline: auto; }
.pwrap:not(.pwrap--narrow) { max-width: 1040px; margin-inline: auto; }
@media (min-width: 1100px) {
  .pwrap:not(.pwrap--narrow) { grid-template-columns: minmax(0, 1fr) 220px; align-items: start; }
}
.ptoc { display: none; }
@media (min-width: 1100px) {
  .ptoc { display: block; position: sticky; top: 100px; }
}
.ptoc__label { margin-bottom: 12px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--secondary); }
[data-theme="dark"] .ptoc__label { color: var(--accent-light); }
.ptoc ul { display: grid; gap: 9px; border-left: 2px solid var(--border); padding-left: 14px; }
.ptoc a { display: block; font-size: .8125rem; line-height: 1.5; color: var(--text-muted); transition: color .2s; }
.ptoc a:hover { color: var(--primary); }

/* ---------- Halaman fitur kartu (mis. Fasilitas): kartu ikon + judul + teks ---------- */
.fpage { max-width: 1040px; margin-inline: auto; }
.fpage__intro { margin-bottom: 32px; }
.fpage__intro > * { max-width: 100%; }
.fac-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.fac-card { padding: 26px 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); transition: border-color .25s, transform .25s var(--ease), box-shadow .25s var(--ease); scroll-margin-top: 100px; }
.fac-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.fac-card__icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 16px; border-radius: 14px; background: var(--primary); color: #fff; }
[data-theme="dark"] .fac-card__icon { color: var(--primary-dark); }
.fac-card__title { font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; line-height: 1.3; margin-bottom: 8px; color: var(--text); }
.fac-card__text p { margin: 0; color: var(--text-muted); font-size: .9375rem; line-height: 1.65; }
.fac-card--photo { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.fac-card--photo .fac-card__media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--primary-dark); }
.fac-card--photo .fac-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.fac-card--photo:hover .fac-card__media img { transform: scale(1.05); }
.fac-card--photo .fac-card__body { padding: 20px 22px 24px; }
.fac-card--photo .fac-card__title { margin-top: 0; }

.fpage__attach { margin-top: 28px; }



.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.chipl { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--border); border-radius: 99px; font-size: .875rem; font-weight: 600; color: var(--text-muted); transition: border-color .2s, color .2s; }
.chipl:hover { border-color: var(--accent); color: var(--text); }
.chipl[aria-current="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-theme="dark"] .chipl[aria-current="true"] { color: var(--primary-dark); }

.ncards { display: grid; gap: 20px; }
.ncard { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); transition: border-color .25s, transform .25s var(--ease); }
.ncard:hover { border-color: var(--accent); transform: translateY(-3px); }
.ncard .meta { font-size: .8125rem; font-weight: 600; color: var(--secondary); }
[data-theme="dark"] .ncard .meta { color: var(--accent-light); }
.ncard h2 { margin-top: 6px; font-family: var(--font-display); font-weight: 500; font-size: 1.375rem; line-height: 1.25; }
.ncard h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.ncard p:last-child { margin-top: 10px; color: var(--text-muted); }
.pager2 { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.pager2 a { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border: 1px solid var(--border); border-radius: 12px; font-weight: 600; }
.pager2 a[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-theme="dark"] .pager2 a[aria-current="page"] { color: var(--primary-dark); }

.galgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.galgrid a { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-md); background: var(--primary-dark); }
.galgrid img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.galgrid a:hover img { transform: scale(1.05); }
.galgrid span { position: absolute; inset: auto 0 0 0; padding: 30px 14px 12px; background: linear-gradient(to top, rgba(8, 44, 18, .85), transparent); color: #fff; font-size: .875rem; font-weight: 600; }
.galgrid small { display: block; font-weight: 400; opacity: .8; font-size: .75rem; }

.stafflvl + .stafflvl { margin-top: 48px; }
.stafflvl h2 { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; margin-bottom: 18px; }
.staffgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.staffgrid li { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); transition: border-color .25s, transform .25s var(--ease), box-shadow .25s var(--ease); }
.staffgrid li:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.staffgrid .av { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: .9375rem; box-shadow: var(--shadow-sm); }
[data-theme="dark"] .staffgrid .av { color: var(--primary-dark); }
.staffgrid b { display: block; font-weight: 700; line-height: 1.3; }
.staffgrid small { color: var(--text-muted); }

/* Gambar sampul berita, foto tenaga pendidik, lampiran */
.nfeat__media { overflow: hidden; }
.nfeat__media img { width: 100%; height: 100%; object-fit: cover; }
.ncard__cover { display: block; margin: -24px -24px 18px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--primary-dark); }
.ncard__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.ncard:hover .ncard__cover img { transform: scale(1.04); }
.cover { margin: 0 0 28px; border-radius: var(--radius-lg); overflow: hidden; background: var(--primary-dark); }
.cover img { width: 100%; height: auto; max-height: 460px; object-fit: cover; }

/* ---------- Berita: 70/30 dengan sidebar "Berita Terbaru" ---------- */
.bpage { display: grid; gap: 40px; align-items: start; }
.bpage__main { min-width: 0; }
.bpage__main .prose > * { max-width: 100%; }
.npage__cover { margin: 0 0 28px; border-radius: var(--radius-lg); overflow: hidden; background: var(--primary-dark); }
.npage__cover img { width: 100%; height: auto; max-height: 460px; object-fit: cover; display: block; }
.npage__cover a { display: block; }
.bpage__justify p { text-align: justify; text-justify: inter-word; }
.bpage__gallery { margin-top: 32px; }
@media (min-width: 1024px) {
  .bpage { grid-template-columns: 8fr 2fr; }
}

/* ---------- Galeri berita: tampil 3, sisanya auto-slide ---------- */
.bgal { position: relative; }
.bgal__track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -ms-overflow-style: none; }
.bgal__track::-webkit-scrollbar { display: none; }
.bgal__item { flex: 0 0 calc((100% - 2 * 16px) / 3); scroll-snap-align: start; position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-md); background: var(--primary-dark); }
.bgal__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.bgal__item:hover img { transform: scale(1.06); }
.bgal__nav { position: absolute; top: 50%; translate: 0 -50%; z-index: 2; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--glass-solid); color: var(--text); box-shadow: var(--shadow-sm); cursor: pointer; }
.bgal__nav:hover { background: var(--primary); color: #fff; }
.bgal__prev { left: -14px; }
.bgal__next { right: -14px; }
.bgal__prev .ic { transform: rotate(180deg); }
@media (max-width: 640px) {
  .bgal__item { flex-basis: calc((100% - 16px) / 2); }
  .bgal__prev { left: 2px; }
  .bgal__next { right: 2px; }
}

/* ---------- Sidebar "Berita Terbaru" ---------- */
.bpage__side-title { font-family: var(--font-display); font-weight: 600; font-size: 1.375rem; margin-bottom: 20px; }
.brecent-list { display: grid; gap: 16px; }
@media (min-width: 1024px) { .bpage__side { position: sticky; top: 100px; } }
.brecent { display: flex; flex-direction: column; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); transition: border-color .25s, transform .25s var(--ease); }
.brecent:hover { border-color: var(--accent); transform: translateY(-2px); }
.brecent__img { display: block; margin: -14px -14px 12px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-md) var(--radius-md) 0 0; background: var(--primary-dark); }
.brecent__img img { width: 100%; height: 100%; object-fit: cover; }
.brecent__body { display: flex; flex-direction: column; gap: 4px; }
.brecent__body .meta { font-size: .75rem; }
.brecent__body strong { font-family: var(--font-display); font-weight: 600; font-size: 1rem; line-height: 1.35; color: var(--text); }
.brecent:hover .brecent__body strong { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.brecent__ex { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .8125rem; color: var(--text-muted); }

/* ---------- Bagikan berita ---------- */
.bshare { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.bshare__label { font-size: .8125rem; font-weight: 700; color: var(--text-muted); }
.bshare__btn { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease); }
.bshare__btn .ic { width: 18px; height: 18px; }
.bshare__btn:hover { transform: translateY(-2px); border-color: transparent; }
.bshare__wa:hover { background: #25d366; color: #fff; }
.bshare__fb:hover { background: #1877f2; color: #fff; }
.bshare__x:hover { background: #000; color: #fff; }
.bshare__copy:hover { background: var(--primary); color: #fff; }
.bshare__copy.is-copied { background: var(--accent); border-color: transparent; color: var(--on-accent); }


.staffgrid .av { overflow: hidden; }
.staffgrid .av img { width: 100%; height: 100%; object-fit: cover; }
.attach { display: inline-flex; align-items: center; gap: 14px; margin-top: 8px; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); transition: border-color .25s, transform .25s var(--ease); }
.attach:hover { border-color: var(--accent); transform: translateY(-2px); }
.attach .ic { width: 28px; height: 28px; color: var(--primary); }
.attach b { display: block; font-weight: 700; }
.attach small { color: var(--text-muted); }

/* ---------- Bungkus halaman Tenaga Pendidik agar tidak lengang di layar lebar ---------- */
.staffwrap { max-width: 920px; margin-inline: auto; }

/* Foto asli pada tile galeri beranda */
.gal__tile--photo::before { display: none; }
.gal__tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gal__tile--photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8, 44, 18, .75), transparent 55%); }
.gal__tile span { z-index: 1; }

@media (min-width: 768px) { .ncards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .ncards { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Sambutan kepala sekolah (halaman jenjang) ---------- */
.pquote { position: relative; max-width: 780px; margin: 0 auto; padding: 8px 0 0 56px; border: 0; }
.pquote__mark { position: absolute; top: -6px; left: 0; width: 40px; height: 40px; color: var(--accent); opacity: .9; }
[data-theme="dark"] .pquote__mark { color: var(--accent-light); }
.pquote__text { font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: clamp(1.125rem, 2.4vw, 1.5rem); line-height: 1.5; color: var(--text); }
.pquote__author { display: flex; align-items: center; gap: 14px; margin-top: 24px; }
.pquote__avatar { display: grid; place-items: center; width: 68px; height: 68px; flex: none; border-radius: 50%; overflow: hidden; background: var(--primary); color: #fff; font-weight: 700; font-size: 1.0625rem; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border), var(--shadow-sm); }
[data-theme="dark"] .pquote__avatar { color: var(--primary-dark); }
.pquote__avatar img { width: 100%; height: 100%; object-fit: cover; }
.pquote__author strong { display: block; font-weight: 700; }
.pquote__author small { display: block; color: var(--text-muted); font-size: .8125rem; }
