/* Public-site styling, layered on top of Bootstrap 5. Palette and
   typography match isyedu.org's own brand (gold #ddb41f + Inter/Open
   Sans), self-hosted below rather than linked to Google Fonts — this
   app already vendors Bootstrap/Bootstrap Icons locally instead of via
   CDN, and font loading follows that same convention. */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/Inter-Variable.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/Inter-Variable.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('fonts/Inter-Variable.woff2') format('woff2');
}

@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/OpenSans-Bold.woff2') format('woff2');
}

:root {
    --site-accent: #ddb41f;
    --site-accent-dark: #b8940f;
    --site-accent-soft: rgba(221, 180, 31, 0.14);
    --site-secondary: #4c5587;
    --site-ink: #14141a;
    --site-muted: #6b7280;
    --site-bg: #f8f9fb;
    --isy-gold: #ddb41f;
    --isy-gold-dark: #b8940f;
}

.site-utility-bar {
    background: var(--isy-gold);
    color: #fff;
    font-size: 0.85rem;
    padding: 0.45rem 0;
}

.site-utility-tagline {
    font-weight: 600;
}

.site-utility-links {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-utility-links a {
    color: #fff;
    text-decoration: none;
    opacity: 0.92;
}

.site-utility-links a:hover,
.site-utility-links a:focus {
    text-decoration: underline;
    opacity: 1;
}

body {
    background: var(--site-bg);
    color: var(--site-ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* --- Buttons: bold, pill-shaped CTAs in the site accent color --- */
.btn-primary {
    background-color: var(--site-accent);
    border-color: var(--site-accent);
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--site-accent-dark) !important;
    border-color: var(--site-accent-dark) !important;
}

.btn-outline-primary {
    color: var(--site-accent);
    border-color: var(--site-accent);
    font-weight: 600;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: var(--site-accent) !important;
    border-color: var(--site-accent) !important;
}

.btn-primary,
.btn-outline-primary,
.btn-light {
    border-radius: 2rem;
    padding-left: 1.35rem;
    padding-right: 1.35rem;
}

/* --- Navbar (two rows: clean nav-only top row, search row below —
   modeled on elements.envato.com's header layout) --- */
.site-navbar {
    background: #fff;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 0;
    flex-wrap: wrap;
}

.site-navbar-top {
    flex: 1 0 100%;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.site-navbar-search-row {
    flex: 1 0 100%;
}

.site-navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--site-ink);
}

.site-navbar-brand i {
    color: var(--site-accent);
    font-size: 1.3rem;
}

.site-navbar-brand img {
    height: 34px;
    width: 34px;
    object-fit: contain;
}

.site-navbar .nav-link {
    position: relative;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--site-ink);
    padding: 0.5rem 0.85rem;
    border-radius: 2rem;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.site-navbar .nav-link:hover,
.site-navbar .nav-link:focus,
.site-navbar .nav-link.show {
    color: var(--site-accent-dark);
    background-color: var(--site-accent-soft);
}

/* A ::before (not ::after) underline indicator — Bootstrap's dropdown
   caret is drawn on ::after, so this avoids clobbering it. */
.site-navbar .nav-link::before {
    content: "";
    position: absolute;
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.1rem;
    height: 2px;
    background: var(--site-accent);
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform 0.15s ease;
}

.site-navbar .nav-link:hover::before,
.site-navbar .nav-link:focus::before,
.site-navbar .nav-link.show::before {
    transform: scaleX(1);
}

.site-navbar .dropdown-toggle::after {
    vertical-align: 0.1em;
    opacity: 0.6;
}

.site-navbar .dropdown-menu {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.75rem;
    box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.2);
    padding: 0.6rem;
    margin-top: 0.6rem;
}

.site-navbar .dropdown-item {
    border-radius: 0.4rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.92rem;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.site-navbar .dropdown-item:hover,
.site-navbar .dropdown-item:focus {
    background-color: var(--site-accent-soft);
    color: var(--site-accent-dark);
}

.site-navbar .dropdown-header {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--site-muted);
}

.site-navbar-search-row {
    background: var(--site-bg);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    padding: 0.65rem 0;
}

.site-navbar-search {
    position: relative;
    width: 100%;
}

.site-navbar-search i {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--site-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.site-navbar-search input {
    padding-left: 2.3rem;
    border-radius: 0.5rem;
    border-color: rgba(15, 23, 42, 0.12);
    background: #fff;
}

.site-navbar-search input:focus {
    border-color: var(--site-accent);
    box-shadow: 0 0 0 0.2rem var(--site-accent-soft);
}

.year-nav-menu {
    max-height: 70vh;
    overflow-y: auto;
}

/* --- Hero --- */
.site-hero {
    background: var(--isy-gold);
    color: var(--site-ink);
    border-radius: 0 0 1.5rem 1.5rem;
    padding: 4rem 0 3.25rem;
    margin-bottom: 2.5rem;
}

.site-hero h1 {
    font-weight: 800;
    letter-spacing: -0.03em;
    font-size: clamp(1.9rem, 4vw, 2.75rem);
}

.site-hero p {
    color: rgba(20, 20, 26, 0.75);
    font-size: 1.1rem;
}

.site-hero .btn-light {
    font-weight: 600;
    border-radius: 2rem;
    padding: 0.6rem 1.5rem;
}

/* --- Taxonomy pill links (browse-by lists) --- */
.taxonomy-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.taxonomy-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--site-ink);
    border-radius: 2rem;
    padding: 0.4rem 0.95rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.taxonomy-pill:hover {
    background: var(--site-accent);
    border-color: var(--site-accent);
    color: #fff;
    transform: translateY(-1px);
}

.taxonomy-section-title {
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--site-muted);
    margin-bottom: 0.75rem;
}

/* --- Named sections within one publication's gallery (e.g. a Staff
   page organized by department) --- */
.gallery-section-title {
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--site-ink);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--isy-gold);
}

.gallery-section-title:first-of-type {
    margin-top: 0;
}

/* --- Publication cards (home + browse grid) --- */
.pub-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

.pub-card-inner {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pub-card:hover .pub-card-inner {
    transform: translateY(-4px);
    box-shadow: 0 16px 28px rgba(221, 180, 31, 0.22);
    border-color: rgba(221, 180, 31, 0.3);
}

.pub-card-cover {
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pub-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pub-card-cover i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.7);
}

.pub-card-body {
    padding: 0.85rem 0.95rem;
}

.pub-card-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pub-card-meta {
    font-size: 0.75rem;
    color: var(--site-muted);
}

/* --- Filter bar (browse page) --- */
.filter-bar {
    background: #fff;
    border-radius: 0.85rem;
    padding: 1.1rem 1.25rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

/* --- Detail page --- */
.pub-detail-hero {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    min-height: 220px;
    background: linear-gradient(135deg, #475569, #1e293b);
    display: flex;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.pub-detail-hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.55);
}

.pub-detail-hero-content {
    position: relative;
    color: #fff;
    padding: 2rem;
}

.pub-detail-hero .badge {
    background: rgba(255, 255, 255, 0.18);
    font-weight: 600;
    border-radius: 2rem;
    padding: 0.4rem 0.8rem;
}

/* --- Photo gallery grid + lightbox --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
}

.gallery-item-wrap {
    margin: 0;
}

.gallery-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 0.6rem;
    overflow: hidden;
    border: none;
    padding: 0;
    cursor: pointer;
    background: #e2e8f0;
    position: relative;
    display: block;
}

.gallery-item-caption {
    font-size: 0.8rem;
    color: var(--site-muted);
    margin: 0.4rem 0 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.gallery-item:hover img {
    transform: scale(1.06);
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    opacity: 0;
}

.gallery-item:hover .gallery-item-overlay {
    background: rgba(15, 23, 42, 0.28);
    opacity: 1;
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 20, 0.94);
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox.is-open {
    display: flex;
}

.lightbox-image-wrap {
    max-width: 90vw;
    max-height: 78vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    max-width: 90vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 0.4rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: background 0.15s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(221, 180, 31, 0.35);
}

.lightbox-close {
    top: 1.25rem;
    right: 1.25rem;
}

.lightbox-prev {
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-caption {
    color: #fff;
    margin-top: 1.25rem;
    margin-bottom: 0;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.75);
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

@media (max-width: 575.98px) {
    .lightbox-prev,
    .lightbox-next {
        width: 2.4rem;
        height: 2.4rem;
        font-size: 1.1rem;
    }
}

/* --- Homepage yearbook shelf (one cover card per academic year) --- */
.yearbook-card {
    display: block;
    text-decoration: none;
    color: var(--site-ink);
    text-align: center;
}

.yearbook-card-cover {
    aspect-ratio: 3 / 4;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #eceef2;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.yearbook-card:hover .yearbook-card-cover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(221, 180, 31, 0.28);
}

.yearbook-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.yearbook-card-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--site-muted);
}

.yearbook-card-placeholder i {
    font-size: 3rem;
}

.yearbook-card-label {
    margin-top: 0.9rem;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: left;
}

/* --- Year-scoped navbar (inside one academic year: dark bar with the
   year's own Grades/Elementary/Secondary/Events/Staff menus) --- */
.year-navbar {
    background: #101010;
    border-bottom: 3px solid var(--isy-gold);
}

.year-navbar .site-navbar-brand,
.year-navbar .nav-link {
    color: #fff;
}

.year-navbar .site-navbar-brand i {
    color: var(--isy-gold);
}

.year-navbar .nav-link:hover,
.year-navbar .nav-link:focus,
.year-navbar .nav-link.show {
    color: var(--isy-gold);
    background: rgba(255, 255, 255, 0.06);
}

.year-navbar .dropdown-menu {
    background: #181818;
    border: none;
    border-radius: 0;
}

.year-navbar .dropdown-item {
    color: #fff;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.year-navbar .dropdown-item:hover,
.year-navbar .dropdown-item:focus {
    background: var(--isy-gold);
    color: #101010;
}

/* Nested dropdowns for the year navbar's arbitrary-depth menu tree
   (see year-navbar.php's year_navbar_render_items()) — Bootstrap 5's
   dropdown component has no built-in submenu support, so a folder
   nested past the top level renders as a `.dropdown-submenu`: a
   dropdown-item that reveals its own `.dropdown-menu` to the side on
   hover/focus, the standard CSS-only pattern for this. */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -0.6rem;
    display: none;
}

.dropdown-submenu:hover > .dropdown-menu,
.dropdown-submenu:focus-within > .dropdown-menu {
    display: block;
}

.dropdown-submenu > a.dropdown-toggle::after {
    float: right;
    margin-top: 0.4em;
    transform: rotate(-90deg);
}

.year-navbar .site-navbar-search-row {
    background: #181818;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.year-navbar .site-navbar-search .form-control {
    background: #101010;
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.year-navbar .site-navbar-search .form-control::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.year-navbar .site-navbar-search i {
    color: rgba(255, 255, 255, 0.6);
}
