/*
  Zambia Air Force Centre of Advanced Learning
  Site styles layered over the Grad School template (templatemo-grad-school.css)
  and Bootstrap 5. Loaded last.
*/

:root {
    --cal-navy: #172238;
    --cal-navy-deep: #0c1228;
    --cal-gold: #f5a425;
}

/* ---------- Header ---------- */

.main-header .logo a {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    height: 80px;
    font-size: 28px;
    line-height: 1;
    white-space: nowrap;
}

.main-header .logo img {
    height: 60px;
    width: auto;
}

.main-menu li .sub-menu {
    width: 200px;
}

/* Wordmark: a large "ZAF" over the Centre's name, which sits on two short
   lines so the block stays narrow. "Advanced Learning" sets the width; "ZAF"
   and "Centre of" are stretched to that same width, so all three lines align
   at both edges while the letters of ZAF stay close together. */
.wordmark {
    display: inline-flex;
    flex-direction: column;
    width: max-content;
    line-height: 1;
}

.wordmark-zaf {
    display: flex;
    justify-content: space-between;
    font-size: 44px;
    font-weight: 800;
    line-height: 0.82;
    letter-spacing: 0;
}

.wordmark-zaf b {
    font-weight: inherit;
}

.wordmark-sub {
    margin-top: 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.5px;
    color: var(--cal-gold);
}

.wordmark-sub span {
    display: block;
    white-space: nowrap;
    margin-right: -0.5px; /* cancel the trailing letter-space so edges line up */
}

.wordmark-sub .wordmark-spread {
    display: flex;
    justify-content: space-between;
    margin-right: 0;
    letter-spacing: 0;
}

.wordmark-spread i {
    font-style: normal;
}

.wordmark-spread .gap {
    width: 0.1em; /* the space between the two words, a touch wider than a letter gap */
}

@media screen and (max-width: 950px) {
    .wordmark-zaf { font-size: 40px; }
    .wordmark-sub { font-size: 9px; margin-top: 4px; }
}

@media screen and (max-width: 950px) {
    .main-header .logo a { height: 73px; font-size: 24px; }
    .main-header .logo img { height: 52px; }
}

/* ---------- Banner (Bootstrap 5 carousel of graduation photos) ---------- */

.main-banner {
    margin-bottom: 0;
}

.main-banner .carousel-item {
    height: 100vh;
    min-height: 600px;
    background-size: cover;
    background-position: center;
}

.main-banner .video-overlay {
    bottom: 0;
    background-color: rgba(22, 34, 57, 0.72);
}

.main-banner .caption .motto {
    margin: -10px 0 30px;
    font-size: 16px;
    font-style: italic;
    letter-spacing: 2px;
    color: var(--cal-gold);
}

/* ---------- Why us: Bootstrap 5 tabs in the template's tab styling ---------- */

#tabs ul li a.active {
    color: var(--cal-gold);
}

#tabs ul li a.active:after {
    background-color: var(--cal-gold);
    width: 15px;
    height: 15px;
}

#tabs ul li a.active:before {
    border-color: var(--cal-gold);
}

.tabs-content img {
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

.tabs-content a {
    color: var(--cal-gold);
    text-decoration: underline;
}

@media screen and (max-width: 575px) {
    #tabs ul li a { font-size: 11px; letter-spacing: 0; padding-left: 4px; padding-right: 4px; }
}

.statements {
    margin-top: 56px; /* with the row gutter this keeps the 80px gap above */
}

.statements .mission {
    margin-top: 0;
    height: 100%;
}

.mission {
    margin-top: 80px;
    padding: 40px;
    text-align: center;
    border: 2px solid rgba(250, 250, 250, 0.1);
}

.mission > span {
    display: block;
    margin-bottom: 15px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--cal-gold);
}

.mission p {
    max-width: 820px;
    margin: 0 auto;
    font-size: 22px;
    line-height: 36px;
    font-weight: 600;
    color: #fff;
}

/* ---------- Admissions ---------- */

section.coming-soon .action-panel {
    background-color: rgba(250, 250, 250, 0.1);
    padding: 40px;
}

section.coming-soon .action-panel .button {
    display: block;
    margin-bottom: 15px;
    padding: 12px 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    background-color: var(--cal-gold);
    border: 2px solid var(--cal-gold);
    transition: all 0.3s;
}

section.coming-soon .action-panel .button:last-child {
    margin-bottom: 0;
}

section.coming-soon .action-panel .button-outline {
    background-color: transparent;
    border-color: rgba(250, 250, 250, 0.3);
}

section.coming-soon .action-panel .button:hover {
    background-color: #fff;
    border-color: #fff;
    color: var(--cal-navy);
}

/* ---------- Programmes ---------- */

.programme-summary {
    margin: -30px 0 40px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
}

.programme-summary span {
    display: inline-block;
    margin: 6px 0 0 10px;
    padding: 3px 12px;
    font-size: 12px;
    border: 1px solid rgba(250, 250, 250, 0.25);
}

/* equal-height cards */
section.courses .owl-carousel .owl-stage { display: flex; }
section.courses .owl-carousel .owl-item { display: flex; }
section.courses .item { display: flex; flex-direction: column; width: 100%; }
section.courses .item .down-content { flex: 1; }

section.courses .programme-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 130px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    color: #fff;
    background: var(--cal-navy-deep);
    border-bottom: 4px solid var(--cal-gold);
}

section.courses .programme-top i { font-size: 36px; color: var(--cal-gold); }

section.courses .programme-top span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

section.courses .item .down-content h4 {
    font-size: 14px;
    line-height: 1.45;
    min-height: 5.8em; /* four lines, so cards align */
    margin-bottom: 12px;
}

section.courses .item .down-content .author-image {
    min-height: 44px;
}

section.courses .item .down-content img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background-color: #fff;
}

section.courses .item .down-content .text-button-free a {
    color: #7a7a7a;
}

.affiliations {
    margin-top: 80px;
}

.affiliations h6 {
    margin-bottom: 30px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
}

.affiliation {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
}

.affiliation img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    flex-shrink: 0;
}

.affiliation strong {
    display: block;
    font-size: 16px;
    font-weight: 800;
    color: #1e1e1e;
}

.affiliation span {
    font-size: 13px;
    line-height: 1.4;
    color: #5a5a5a;
}

/* ---------- Leadership messages ---------- */

section.video .left-content p {
    font-size: 15px;
    line-height: 28px;
    text-align: justify;
}

/* Rank stars above the Commander's name */
.video-item.portrait .video-caption .rank-stars {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 18px;
    line-height: 1;
    color: var(--cal-gold);
}

section.video .message-row {
    margin-top: 100px;
}

.message-toggle .when-open,
.message-toggle:not(.collapsed) .when-closed { display: none; }
.message-toggle:not(.collapsed) .when-open { display: inline; }

.video-item.portrait figure { margin: 0; }

.video-item.portrait figure img {
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center top;
}

.video-item.portrait .video-caption {
    height: auto;
    padding: 18px 24px;
    background-color: rgba(250, 250, 250, 0.9);
}

.video-item.portrait .video-caption h4 {
    margin: 0 0 4px;
    font-size: 16px;
    letter-spacing: 0.5px;
    color: #1e1e1e;
}

.video-item.portrait .video-caption span {
    font-size: 13px;
    color: #4a4a4a;
}

@media screen and (max-width: 767px) {
    section.video .message-row { margin-top: 70px; }
}

/* ---------- Graduation gallery ---------- */

section.gallery {
    background-image: url(../images/choosing-bg.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    background-color: var(--cal-navy);
    padding-bottom: 100px;
}

.gallery-item {
    display: block;
    overflow: hidden;
    border-radius: 5px;
}

.gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    transition: transform 0.5s;
}

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

/* ---------- Contact ---------- */

section.contact .alert {
    border-radius: 0;
    font-size: 14px;
}

#map iframe {
    display: block;
}

/* ---------- Programme modal ---------- */

#programmeModal .modal-content {
    border-radius: 5px;
    border: 0;
}

#programmeModal .modal-header {
    background-color: var(--cal-navy);
    color: #fff;
    border-bottom: 4px solid var(--cal-gold);
    border-radius: 5px 5px 0 0;
}

#programmeModal .modal-title {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#programmeModal .programme-modal-meta {
    color: rgba(255, 255, 255, 0.75);
}

#programmeModal .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
}

.programme-modal-note {
    margin: 20px 0;
    text-align: center;
    font-size: 14px;
}

.programme-year {
    margin: 24px 0 12px;
    padding-bottom: 8px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--cal-navy);
    border-bottom: 2px solid var(--cal-gold);
}

.programme-year:first-child {
    margin-top: 0;
}

.programme-semester {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #7a7a7a;
}

.programme-courses li {
    display: flex;
    gap: 12px;
    padding: 7px 0;
    font-size: 13px;
    line-height: 1.45;
    border-bottom: 1px solid #eee;
}

.programme-courses .code {
    flex: 0 0 82px;
    font-weight: 700;
    color: var(--cal-navy);
    overflow-wrap: anywhere;
}

.btn-cal {
    background-color: var(--cal-gold);
    border-color: var(--cal-gold);
    color: #fff;
    font-weight: 700;
}

.btn-cal:hover,
.btn-cal:focus {
    background-color: #d98c12;
    border-color: #d98c12;
    color: #fff;
}

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

footer p {
    line-height: 26px;
}

@media (prefers-reduced-motion: reduce) {
    .gallery-item img { transition: none; }
}

/* The active Bootstrap carousel slide carries z-index 1 — keep the overlay,
   caption and the feature boxes that overlap the banner above it. */
.main-banner .video-overlay { z-index: 2; }
.features-post { z-index: 3; }

/* Admissions: graduation procession behind the countdown instead of the stock photo */
section.coming-soon {
    background-image:
        linear-gradient(rgba(22, 34, 57, 0.86), rgba(22, 34, 57, 0.86)),
        var(--cal-admissions-bg, url(../images/cal/grad7.jpg));
    background-position: center;
}

/* Programme cards: keep the institution line two rows tall so logos line up */
section.courses .item .down-content p {
    min-height: 66px;
}
