/* =========================================================================
   W Training — site footer
   -------------------------------------------------------------------------
   Every rule is scoped to .wt-footer, a class added alongside the existing
   .footer class in inc/footer.php. Presentation only: no PHP, query, route,
   contact value or translation depends on anything here.

   Colours come from the brand system already in use — --primary-color is
   printed on :root by inc/spStyles.php from the site settings row, and the
   slate tones match the dark bands on the homepage.
   ========================================================================= */

.wt-footer {
    /* Flat slate instead of the old radial gradient. The class order means this
       wins over the .footer rule in main.css without needing !important. */
    background: #2e3b46;
    color: #e8edf2;
    /* The green accent line the brief asks for. */
    border-block-start: 3px solid var(--primary-color, #97bd2e);
}

.wt-footer .container {
    max-inline-size: 1200px;
    margin-inline: auto;
    padding-inline: 20px;
}

.wt-footer-inner {
    padding-block: 60px 50px;
}

/* --- Column grid -------------------------------------------------------- */

.wt-footer-grid {
    display: grid;
    gap: 40px;
    align-items: start;
}

/* The specializations column only renders on pages that already loaded
   $categories, so the footer declares how many columns it actually has
   rather than leaving an empty track behind. */
.wt-footer-grid--4 {
    grid-template-columns: 1.5fr 1fr 1fr 1.4fr;
}

.wt-footer-grid--3 {
    grid-template-columns: 1.5fr 1fr 1.4fr;
}

/* --- Column 1: brand ---------------------------------------------------- */

.wt-footer-logo {
    display: inline-block;
    margin-block-end: 16px;
}

/* height:auto with a capped width keeps the uploaded logo's aspect ratio; it
   is never stretched and never upscaled past its natural size. */
.wt-footer-logo img {
    inline-size: 104px;
    max-inline-size: 100%;
    block-size: auto;
    display: block;
}

.wt-footer-about {
    margin: 0 0 18px;
    /* main.css sets a global `p { padding: 20px }`. */
    padding: 0;
    max-inline-size: 34em;
    color: rgba(232, 237, 242, 0.72);
    font-size: 14px;
    line-height: 1.75;
}

/* --- Social buttons ----------------------------------------------------- */

.wt-footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wt-footer-social a {
    inline-size: 36px;
    block-size: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: transparent;
    color: #e8edf2;
    font-size: 16px;
    line-height: 1;
    text-decoration: none;
    transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
}

.wt-footer-social a:hover {
    color: var(--primary-color, #97bd2e);
    border-color: var(--primary-color, #97bd2e);
    background: rgba(255, 255, 255, 0.05);
}

/* --- Headings ----------------------------------------------------------- */

/* h2 is large by default in main.css; the footer headings are label-sized. */
.wt-footer-heading {
    margin: 0 0 16px;
    padding: 0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    /* Follows the reading direction in both languages. */
    text-align: start;
}

/* --- Link lists --------------------------------------------------------- */

.wt-footer-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wt-footer-list li {
    margin-block-end: 10px;
}

.wt-footer-list li:last-child {
    margin-block-end: 0;
}

.wt-footer-list a {
    display: inline-block;
    color: rgba(232, 237, 242, 0.75);
    font-size: 14.5px;
    line-height: 1.5;
    text-decoration: none;
    transition: color 200ms ease;
}

/* Colour is not the only hover signal — the underline carries it too. */
.wt-footer-list a:hover {
    color: var(--primary-color, #97bd2e);
    text-decoration: underline;
    text-underline-offset: 3px;
}

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

.wt-footer-contact {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wt-footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-block-end: 12px;
    color: rgba(232, 237, 242, 0.75);
    font-size: 14px;
    line-height: 1.6;
}

.wt-footer-contact li:last-child {
    margin-block-end: 0;
}

/* Small and quiet: supporting marks, not decoration. */
.wt-footer-contact i {
    flex: 0 0 auto;
    margin-block-start: 3px;
    color: var(--primary-color, #97bd2e);
    font-size: 16px;
    line-height: 1;
}

.wt-footer-contact a {
    color: rgba(232, 237, 242, 0.85);
    text-decoration: none;
    /* A long address must wrap rather than widen the column. */
    overflow-wrap: anywhere;
    transition: color 200ms ease;
}

.wt-footer-contact a:hover {
    color: var(--primary-color, #97bd2e);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Addresses are latin text; keep them LTR and start-aligned inside an RTL page
   so the country label still leads. */
.wt-footer-office > span {
    display: block;
    text-align: start;
}

.wt-footer-office b {
    display: block;
    margin-block-end: 2px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.wt-footer-office span span {
    color: rgba(232, 237, 242, 0.7);
    font-size: 13.5px;
    line-height: 1.6;
}

/* --- Bottom bar --------------------------------------------------------- */

.wt-footer-bottom {
    border-block-start: 1px solid rgba(255, 255, 255, 0.12);
}

.wt-footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-block: 18px;
}

.wt-footer-copy {
    margin: 0;
    padding: 0;
    color: rgba(232, 237, 242, 0.65);
    font-size: 13.5px;
    line-height: 1.6;
}

.wt-footer-legal {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wt-footer-legal a {
    color: rgba(232, 237, 242, 0.7);
    font-size: 13.5px;
    line-height: 1.6;
    text-decoration: none;
    transition: color 200ms ease;
}

.wt-footer-legal a:hover {
    color: var(--primary-color, #97bd2e);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- Keyboard focus ----------------------------------------------------- */

.wt-footer a:focus-visible {
    outline: 3px solid var(--primary-color, #97bd2e);
    outline-offset: 3px;
    border-radius: 6px;
}

/* --- Tablet ------------------------------------------------------------- */

@media only screen and (max-width: 991px) {
    .wt-footer-inner {
        padding-block: 48px 40px;
    }

    .wt-footer-grid--3,
    .wt-footer-grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px;
    }
}

/* --- Mobile ------------------------------------------------------------- */

@media only screen and (max-width: 575px) {
    .wt-footer .container {
        padding-inline: 16px;
    }

    .wt-footer-inner {
        padding-block: 40px 32px;
    }

    .wt-footer-grid--3,
    .wt-footer-grid--4 {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .wt-footer-heading {
        margin-block-end: 12px;
    }

    .wt-footer-bottom-inner {
        /* Stack, and keep both rows reading from the start edge. */
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-block: 16px;
    }

    .wt-footer-legal {
        gap: 16px;
    }
}

/* --- Motion preference -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .wt-footer-social a,
    .wt-footer-list a,
    .wt-footer-contact a,
    .wt-footer-legal a {
        transition: none;
    }
}
