/*
 * Shared inner-page styles for compass1..4. Self-contained (no Bootstrap /
 * Tailwind needed) and driven by CSS variables that each theme sets in its
 * partials/links.php, so one page body can wear four different designs.
 *
 *   --cp-primary  main brand colour      --cp-accent   highlight / buttons
 *   --cp-ink      body text              --cp-muted    secondary text
 *   --cp-soft     tinted section bg      --cp-line     hairlines
 *   --cp-font     body font              --cp-head     heading font
 *   --cp-radius   card corner radius
 */
.cp-inner { font-family: var(--cp-font, 'Poppins', sans-serif); color: var(--cp-ink, #222); background: #fff; }
.cp-inner *, .cp-inner *::before, .cp-inner *::after { box-sizing: border-box; }
.cp-inner img { max-width: 100%; }
.cp-container { width: 1240px; max-width: 92%; margin: 0 auto; }
.cp-narrow { width: 820px; max-width: 92%; margin: 0 auto; }

/* ---- hero ---- */
.cp-hero { background: var(--cp-primary); color: #fff; padding: 64px 0; text-align: center; position: relative; overflow: hidden; }
.cp-hero::after { content: ''; position: absolute; right: -80px; top: -110px; width: 300px; height: 300px; border-radius: 50%; background: var(--cp-accent); opacity: .16; }
.cp-hero h1 { font-family: var(--cp-head, inherit); font-size: clamp(30px, 5vw, 48px); font-weight: 600; margin: 0 0 10px; color: #fff; position: relative; z-index: 1; } /* explicit colour: themes colour bare headings dark, same reason as .cp-hero p below */
.cp-hero p { font-size: 17px; line-height: 1.7; color: #fff; opacity: .92; max-width: 700px; margin: 0 auto; position: relative; z-index: 1; } /* explicit colour: themes colour bare <p> dark */

/* ---- sections ---- */
.cp-section { padding: 72px 0; }
.cp-section.soft { background: var(--cp-soft, #f6f8fb); }
.cp-sec-head { text-align: center; margin-bottom: 40px; }
.cp-sec-head h2, .cp-h2 { font-family: var(--cp-head, inherit); font-size: clamp(26px, 3.6vw, 38px); font-weight: 600; margin: 0 0 10px; color: var(--cp-primary); line-height: 1.2; }
.cp-sec-head p { color: var(--cp-muted, #555); max-width: 700px; margin: 0 auto; line-height: 1.8; }
.cp-eyebrow { display: inline-block; font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 700; color: var(--cp-accent); margin-bottom: 10px; }
.cp-text { color: var(--cp-muted, #555); line-height: 1.9; font-size: 16px; }
.cp-empty { text-align: center; padding: 64px 0; color: var(--cp-muted, #666); }
.cp-empty .cp-emoji { font-size: 42px; margin-bottom: 10px; }

/* ---- grids & cards ---- */
/* flex grid, left-aligned; only the gallery below centres a short last row */
.cp-grid { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 28px; }
.cp-grid > * { flex: 1 1 100%; min-width: 0; }
.cp-g2 > * { flex: 0 0 calc((100% - 28px) / 2); }
.cp-g3 > * { flex: 0 0 calc((100% - 56px) / 3); }
.cp-g4 > * { flex: 0 0 calc((100% - 84px) / 4); }
.cp-card { background: #fff; border: 1px solid var(--cp-line, #e8ecf1); border-radius: var(--cp-radius, 16px); overflow: hidden; box-shadow: 0 8px 26px rgba(0, 0, 0, .04); }
.cp-card .cp-card-body { padding: 24px; }
.cp-card img.cp-card-img { width: 100%; height: 210px; object-fit: cover; display: block; }
.cp-card h3 { font-family: var(--cp-head, inherit); font-size: 22px; margin: 0 0 8px; color: var(--cp-primary); font-weight: 600; }
.cp-card p { margin: 0; color: var(--cp-muted, #555); line-height: 1.75; font-size: 15px; }
/* Age/category badge. NOTE: this must NOT reuse --cp-soft as its background --
   --cp-soft is also the "soft section" background (.cp-section.soft), so a
   plain --cp-soft pill disappears completely on a soft section (this bit us
   in compass1, where both resolve to the identical #F3F5F5). color-mix()
   against the theme's own accent keeps it visibly tinted against ANY
   background, with a plain-color fallback for browsers without color-mix. */
.cp-tag {
    display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .2px;
    padding: 5px 14px; border-radius: 999px; margin-bottom: 10px; color: var(--cp-primary);
    background: var(--cp-soft, #f0f4f8); border: 1px solid var(--cp-line, #e2e8f0);
}
@supports (background: color-mix(in srgb, red, blue)) {
    .cp-tag {
        background: color-mix(in srgb, var(--cp-accent) 14%, #fff);
        border-color: color-mix(in srgb, var(--cp-accent) 38%, transparent);
    }
}
.cp-icon { width: 54px; height: 54px; border-radius: 50%; background: var(--cp-soft, #f0f4f8); color: var(--cp-accent); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 14px; flex-shrink: 0; }
.cp-checks { list-style: none; padding: 0; margin: 14px 0 0; }
.cp-checks li { position: relative; padding-left: 24px; font-size: 14px; color: var(--cp-muted, #555); margin-bottom: 7px; }
.cp-checks li::before { content: '\2713'; position: absolute; left: 0; color: var(--cp-accent); font-weight: 700; }

/* alternating image + copy rows (academics) */
.cp-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.cp-split.rev > :first-child { order: 2; }
.cp-split img { width: 100%; border-radius: var(--cp-radius, 16px); object-fit: cover; max-height: 420px; }

/* ---- buttons ---- */
.cp-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--cp-accent); color: var(--cp-btn-ink, #111); font-weight: 600; font-size: 15px; padding: 13px 26px; border-radius: var(--cp-btn-radius, 10px); border: 0; cursor: pointer; text-decoration: none; font-family: inherit; transition: transform .2s, box-shadow .2s; }
.cp-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 0, 0, .14); }
.cp-btn.alt { background: var(--cp-primary); color: #fff; }
.cp-btn.ghost { background: transparent; color: var(--cp-primary); border: 1.5px solid var(--cp-primary); }

/* ---- forms ---- */
.cp-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--cp-ink, #222); }
.cp-form input[type=text], .cp-form input[type=tel], .cp-form input[type=email], .cp-form input[type=date], .cp-form select, .cp-form textarea {
    width: 100%; padding: 12px 14px; border: 1px solid #d5dbe3; border-radius: 10px; font: inherit; font-size: 15px; background: #fff; color: var(--cp-ink, #222); }
.cp-form input:focus, .cp-form select:focus, .cp-form textarea:focus { outline: 2px solid var(--cp-accent); outline-offset: 1px; border-color: transparent; }
.cp-form .cp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.cp-form .cp-field { margin-bottom: 18px; }
.cp-form .cp-row .cp-field { margin-bottom: 0; }
.cp-hp { position: absolute; left: -9999px; }
.cp-note { font-size: 13px; color: var(--cp-muted, #666); }

/* ---- two-column layout (form + side info) ---- */
.cp-cols { display: grid; grid-template-columns: 1fr 340px; gap: 48px; align-items: start; }
.cp-side { display: flex; flex-direction: column; gap: 22px; }
.cp-side h3 { font-family: var(--cp-head, inherit); font-size: 20px; margin: 0 0 10px; color: var(--cp-primary); }
.cp-side ul { margin: 0; padding-left: 18px; color: var(--cp-muted, #555); line-height: 1.9; font-size: 15px; }
.cp-info-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.cp-info-row b { display: block; color: var(--cp-primary); }
.cp-info-row a, .cp-info-row span { color: var(--cp-muted, #555); text-decoration: none; line-height: 1.6; }

/* ---- FAQ ---- */
.cp-faq details { border-bottom: 1px solid var(--cp-line, #e8ecf1); padding: 18px 0; }
.cp-faq summary { cursor: pointer; font-weight: 600; font-size: 17px; color: var(--cp-primary); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.cp-faq summary::-webkit-details-marker { display: none; }
.cp-faq summary::after { content: '+'; font-size: 24px; line-height: 1; color: var(--cp-accent); }
.cp-faq details[open] summary::after { content: '\2212'; }
.cp-faq details p { margin: 12px 0 0; color: var(--cp-muted, #555); line-height: 1.8; }

/* ---- gallery ---- */
/* Event filter strip. A school can add many events, and pills that WRAP onto
   several rows once there are ~6+ of them look heavy and push the gallery
   down -- so this scrolls sideways on one line instead of wrapping, same as
   a mobile chip/segment picker. justify-content:center only matters while
   everything fits on one line; once it overflows the row simply scrolls. */
.cp-tabs {
    display: flex; gap: 8px; justify-content: center; margin: 0 auto 32px; padding: 4px 2px;
    overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -ms-overflow-style: none;
    scroll-snap-type: x proximity; max-width: 100%;
}
.cp-tabs::-webkit-scrollbar { display: none; }
.cp-tabs button {
    flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap;
    border: 1.5px solid var(--cp-line, #d8dee6); background: #fff; padding: 8px 16px; border-radius: 999px;
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--cp-ink, #222);
}
.cp-tabs button.active { background: var(--cp-primary); border-color: var(--cp-primary); color: #fff; }
.cp-gallery { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.cp-gallery .cp-g-item { flex: 0 0 calc((100% - 54px) / 4); }
.cp-gallery .cp-g-item { cursor: zoom-in; overflow: hidden; border-radius: var(--cp-radius, 14px); }
.cp-gallery .cp-g-item.hide { display: none; }
.cp-gallery img { width: 100%; height: 220px; object-fit: cover; display: block; transition: transform .35s; }
.cp-gallery .cp-g-item:hover img { transform: scale(1.06); }
.cp-lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .9); z-index: 10000; display: none; align-items: center; justify-content: center; padding: 20px; }
.cp-lightbox.show { display: flex; }
.cp-lightbox img { max-width: 100%; max-height: 90vh; border-radius: 10px; }
.cp-lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 40px; cursor: pointer; padding: 10px 16px; line-height: 1; }
.cp-lightbox .x { top: 12px; right: 12px; } .cp-lightbox .p { left: 8px; top: 50%; } .cp-lightbox .n { right: 8px; top: 50%; }

/* ---- lists (notices / disclosures) ---- */
.cp-list { display: flex; flex-direction: column; gap: 14px; }
.cp-list-item { display: flex; align-items: center; gap: 18px; background: #fff; border: 1px solid var(--cp-line, #e8ecf1); border-radius: var(--cp-radius, 14px); padding: 18px 22px; }
.cp-list-item .grow { flex: 1; }
.cp-list-item h3 { margin: 0; font-size: 17px; color: var(--cp-primary); }
.cp-date { flex-shrink: 0; width: 60px; height: 60px; border-radius: 12px; background: var(--cp-primary); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.cp-date b { font-size: 20px; } .cp-date small { font-size: 11px; text-transform: uppercase; margin-top: 4px; }

/* ---- map ---- */
.cp-map iframe { width: 100%; height: 100%; min-height: 340px; border: 0; border-radius: var(--cp-radius, 16px); }

/* ---- hours ---- */
.cp-hours .row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; padding: 5px 0; color: var(--cp-muted, #555); }
.cp-hours .row b { color: var(--cp-ink, #222); font-weight: 600; }

/* ---- principal ---- */
.cp-quote { display: flex; gap: 28px; align-items: flex-start; }
.cp-quote img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cp-quote blockquote { margin: 0 0 10px; font-size: 18px; line-height: 1.8; font-style: italic; color: var(--cp-muted, #444); }

/* ---- CTA band (shared footer call-to-action) ---- */
.cp-cta { background: var(--cp-primary); color: #fff; text-align: center; padding: 72px 0; }
.cp-cta h2 { font-family: var(--cp-head, inherit); font-size: clamp(26px, 4vw, 40px); margin: 0 0 12px; font-weight: 600; }
.cp-cta p { font-size: 17px; color: #fff; opacity: .92; max-width: 640px; margin: 0 auto 26px; line-height: 1.7; }
.cp-cta .cp-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cp-cta .cp-btn.wa { background: #25d366; color: #fff; }

/* ---- notification ticker ---- */
.cp-ticker { background: var(--cp-accent); color: var(--cp-btn-ink, #111); overflow: hidden; white-space: nowrap; font-size: 14px; font-weight: 500; padding: 8px 0; }
.cp-ticker a { color: inherit; font-weight: 700; text-decoration: underline; }
.cp-ticker-track { display: inline-block; padding-left: 100%; animation: cp-scroll 32s linear infinite; }
.cp-ticker-track > * { margin-right: 60px; }
.cp-ticker-warn { background: #fff3cd; color: #664d03; }
@keyframes cp-scroll { to { transform: translateX(-100%); } }

/* ---- feedback modals ---- */
#loading { display: none; position: fixed; inset: 0; background: rgba(255, 255, 255, .7); z-index: 10001; align-items: center; justify-content: center; }
#loading[style*="block"] { display: flex !important; }
#loading img { width: 70px; }
.cp-modal { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 10002; align-items: center; justify-content: center; }
.cp-modal[style*="block"] { display: flex !important; }
.cp-modal-card { background: #fff; border-radius: 18px; padding: 34px 30px; max-width: 380px; width: 90%; text-align: center; }
.cp-modal-card h3 { margin: 12px 0 6px; font-size: 22px; color: var(--cp-primary); }
.cp-modal-card div { color: var(--cp-muted, #555); margin-bottom: 18px; line-height: 1.6; }

/* ---- floating WhatsApp ---- */
.cp-wa-float { position: fixed; right: 22px; bottom: 22px; width: 58px; height: 58px; border-radius: 50%; background: #25d366; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 28px; box-shadow: 0 10px 24px rgba(37, 211, 102, .4); z-index: 9990; border: 0; cursor: pointer; }

@media (max-width: 992px) {
    .cp-g3 > *, .cp-g4 > * { flex: 0 0 calc((100% - 28px) / 2); }
    .cp-gallery .cp-g-item { flex: 0 0 calc((100% - 36px) / 3); }
    .cp-split, .cp-cols { grid-template-columns: 1fr; gap: 32px; }
    .cp-split.rev > :first-child { order: 0; }
}
@media (max-width: 640px) {
    .cp-form .cp-row { grid-template-columns: 1fr; }
    .cp-g2 > *, .cp-g3 > *, .cp-g4 > * { flex: 0 0 100%; }
    .cp-gallery .cp-g-item { flex: 0 0 calc((100% - 18px) / 2); }
    .cp-section { padding: 52px 0; }
    .cp-quote { flex-direction: column; }
    .cp-list-item { flex-wrap: wrap; }
}
