.navbar-brand img {
    object-fit: contain;
}

/* Public-site buttons read as friendlier, more modern pill shapes. Scoped to this stylesheet
   (only loaded by _PublicLayout) so Admin/Parent/StudentPortal button density is unaffected. */
.btn {
    border-radius: 50rem;
}

/* ---------------------------------------------------------------------- */
/* Navbar                                                                  */
/* ---------------------------------------------------------------------- */

.public-navbar {
    transition: box-shadow 0.2s ease;
    z-index: 1040;
}

.public-navbar.is-scrolled {
    box-shadow: var(--ahis-shadow-sm);
}

.public-navbar .nav-link {
    position: relative;
    font-weight: 500;
    padding-block: 0.5rem;
}

.public-navbar .nav-link.active {
    color: var(--bs-primary);
}

.public-navbar .nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--ahis-gold-dark);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.public-navbar .nav-link:hover::after,
.public-navbar .nav-link.active::after {
    transform: scaleX(1);
}

.public-navbar .dropdown-menu {
    border-radius: 0.75rem;
    border: 1px solid var(--bs-border-color);
    box-shadow: var(--ahis-shadow-md);
    padding: 0.5rem;
}

.public-navbar .dropdown-item {
    border-radius: 0.5rem;
}

/* Floating WhatsApp button's office-picker menu (2+ offices configured — see
   Views/Shared/_PublicLayout.cshtml) — same treatment as the navbar dropdowns above. */
.whatsapp-menu {
    border-radius: 0.75rem;
    border: 1px solid var(--bs-border-color);
    box-shadow: var(--ahis-shadow-md);
    padding: 0.5rem;
    min-width: 14rem;
}

.whatsapp-menu .dropdown-item {
    border-radius: 0.5rem;
}

/* ---------------------------------------------------------------------- */
/* Back-to-top button (WhatsApp button, same fixed-position pattern, sits  */
/* directly above it — see whatsapp-btn below).                           */
/* ---------------------------------------------------------------------- */

.back-to-top-btn {
    border: 0;
    color: var(--ahis-navy);
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.back-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

[data-bs-theme="dark"] .back-to-top-btn {
    color: var(--ahis-gold);
}

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */
/* ---------------------------------------------------------------------- */

.footer-heading {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    margin-bottom: 1rem;
}

footer a.text-light {
    text-decoration: none;
    transition: color 0.15s ease;
}

footer a.text-light:hover {
    color: var(--ahis-gold) !important;
}

.cms-content img {
    max-width: 100%;
    height: auto;
}

/*
  Homepage hero image collage. aspect-ratio (not a fixed height) drives the box, so it
  scales fluidly with the column width at every breakpoint — including live, as the
  browser window is resized, with no JS involved.
*/
.hero-gallery {
    display: grid;
    grid-template-columns: 3fr 2fr;
    grid-template-rows: 1fr 1fr;
    gap: 0.75rem;
    aspect-ratio: 4 / 3;
}

.hero-gallery-main,
.hero-gallery-side {
    overflow: hidden;
    border-radius: 1rem;
}

.hero-gallery-main img,
.hero-gallery-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-gallery-main {
    grid-row: 1 / span 2;
}

/* Only one supporting photo supplied: let it fill the whole side column. */
.hero-gallery-one-side .hero-gallery-side {
    grid-row: 1 / span 2;
}

/* No supporting photos supplied: the main photo (or fallback illustration) is the whole hero. */
.hero-gallery-single {
    grid-template-columns: 1fr;
}

.hero-gallery-single .hero-gallery-main {
    grid-row: auto;
}

.hero-illustration {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 1rem;
}

.hero-illustration svg {
    position: absolute;
    inset: 0;
}

/* Small stat callouts floating over the homepage hero image (large viewports only — see
   d-none d-lg-flex on the markup). Position is relative to the .position-relative wrapper
   around the hero gallery/illustration in Views/Home/Index.cshtml. */
.hero-float-card {
    position: absolute;
    align-items: center;
    gap: 0.75rem;
    max-width: 13rem;
    padding: 0.85rem 1.1rem;
    border-radius: 0.85rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    box-shadow: var(--ahis-shadow-lg);
}

.hero-float-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.6rem;
    background: rgba(242, 183, 5, 0.15);
    color: var(--ahis-gold-dark);
    font-size: 1.15rem;
}

.hero-float-card-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
}

.hero-float-card-value {
    font-weight: 700;
    line-height: 1.1;
}

.hero-float-card-top {
    top: -1rem;
    left: -1rem;
}

.hero-float-card-bottom {
    bottom: -1rem;
    right: -1rem;
}

.hero-illustration-crest {
    position: relative;
    width: 40%;
    max-width: 220px;
    filter: drop-shadow(0 0.5rem 1rem rgba(0, 0, 0, 0.35));
}

/* ---------------------------------------------------------------------- */
/* Homepage / public-site design system: sections, stat tiles, feature   */
/* cards, portal cards, CTA bands. Shared across Home, News, Events,     */
/* Staff Directory, Contact so the whole public site reads as one design. */
/* ---------------------------------------------------------------------- */

/* Subtle dot-grid texture, layered over navy surfaces (page header, homepage hero, CTA band) to
   keep large flat navy areas from feeling inert. CSS-only — no image asset to maintain/theme. */
.bg-pattern {
    position: relative;
    overflow: hidden;
}

.bg-pattern::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}

.bg-pattern > * {
    position: relative;
}

/* Page-header banner: breadcrumb + optional eyebrow badge + heading, shown at the top of every
   interior public page (News, Events, Contact, Staff Directory, Admissions, CMS pages). See
   Views/Shared/_PageHeader.cshtml. */
.page-header {
    background: linear-gradient(135deg, var(--ahis-navy) 0%, var(--ahis-navy-dark) 100%);
    color: #fff;
}

.page-header-breadcrumb {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1rem;
}

.page-header-breadcrumb a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.page-header-breadcrumb a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Error/404/status-code page — a taller, centered variant of .page-header. See
   Views/Shared/Error.cshtml. */
.error-page .container {
    padding-block: 5rem;
}

.error-page-code {
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 800;
    line-height: 1;
    color: rgba(255, 255, 255, 0.18);
    margin-bottom: 0.5rem;
}

.page-header-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    border-radius: 50rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
}

.public-section {
    padding-block: 4rem;
}

.public-section-title {
    font-weight: 700;
}

.public-section-lead {
    max-width: 640px;
}

.stat-tile {
    text-align: center;
    padding: 1.75rem 1rem;
}

.stat-tile .bi {
    font-size: 1.75rem;
    color: var(--ahis-gold-dark);
}

.stat-tile-value {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.1;
    margin-block: 0.5rem 0.25rem;
}

.stat-tile-label {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
}

.feature-card,
.portal-card {
    height: 100%;
    padding: 1.75rem 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover,
.portal-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: var(--ahis-shadow-md);
    border-color: var(--ahis-gold-dark);
}

.feature-card-icon,
.portal-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: rgba(20, 40, 63, 0.08);
    color: var(--ahis-navy);
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.portal-card {
    text-align: center;
}

.portal-card-icon {
    margin-inline: auto;
    background: rgba(242, 183, 5, 0.18);
    color: var(--ahis-gold-dark);
}

[data-bs-theme="dark"] .feature-card-icon {
    background: rgba(242, 183, 5, 0.14);
    color: var(--ahis-gold);
}

[data-bs-theme="dark"] .portal-card-icon {
    background: var(--ahis-gold-dark);
    color: var(--ahis-navy-dark);
}

/* Contact page detail rows (address/phone/email/hours) — same tinted-tile language as
   .feature-card-icon, sized down for an inline row instead of a card header. */
.contact-row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.6rem;
    background: rgba(20, 40, 63, 0.08);
    color: var(--ahis-navy);
    font-size: 1.1rem;
}

[data-bs-theme="dark"] .contact-row-icon {
    background: rgba(242, 183, 5, 0.14);
    color: var(--ahis-gold);
}

/* Two-column on wider screens (heading+text left, button right); stacks and centers on small
   screens via the flex-wrap + justify-content-center classes applied alongside this in markup. */
.cta-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, var(--ahis-navy) 0%, var(--ahis-navy-dark) 100%);
    color: #fff;
    padding: 2.5rem 2.5rem;
    text-align: left;
}

.cta-band-text {
    flex: 1 1 320px;
}

.public-card {
    border-radius: 1rem;
    border: 1px solid var(--bs-border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.public-card:hover {
    transform: translateY(-0.2rem);
    box-shadow: var(--ahis-shadow-sm);
}

/* Same look as .public-card but for static (non-link) containers — no hover lift. */
.public-panel {
    border-radius: 1rem;
    border: 1px solid var(--bs-border-color);
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #25d366;
}

.whatsapp-btn:hover {
    color: #1ebe57;
}

/* Scroll-reveal: elements start slightly offset/invisible, then settle into
   place once wwwroot/js/scroll-reveal.js adds .is-visible via IntersectionObserver.
   No-op (fully visible, no transform) if JS never runs. */
[data-reveal] {
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
