/* ═══════════════════════════════════════════════════════════
   CERTIFICATIONS PAGE  —  resources-certifications.css
   ═══════════════════════════════════════════════════════════ */

/* ── Intro ─────────────────────────────────────────────────── */
.cert-intro {
    background: #f5f5f3;
    padding: 40px 0 32px;
    border-bottom: 1px solid #e4e4e2;
}
.cert-intro__text {
    font-size: 15px;
    color: #555;
    line-height: 1.85;
    margin: 0;
    max-width: 720px;
}

/* ── Matrix Section ─────────────────────────────────────────── */
.cert-matrix-section {
    background: #fff;
    padding: 60px 0 52px;
}
.cert-matrix-wrap {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 40px;
    align-items: start;
}

/* Table */
.cert-matrix-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    max-width: 100%;
    /* Fade hint so users know table scrolls horizontally */
    background: linear-gradient(to right, #fff 0%, #fff calc(100% - 24px), rgba(255,255,255,0) 100%) local,
                linear-gradient(to right, rgba(0,0,0,0.06), rgba(0,0,0,0)) local;
    background-size: 40px 100%, 10px 100%;
    background-attachment: local, scroll;
    background-repeat: no-repeat;
    background-position: right, right;
}
.cert-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 640px;
}
.cert-matrix-table thead tr {
    background: #454646;
}
.cert-matrix-table thead th {
    padding: 14px 16px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.90);
    border-right: 1px solid rgba(255,255,255,0.08);
}
.cert-matrix-table thead th:first-child {
    text-align: left;
    min-width: 110px;
}
.cert-matrix-table__loc {
    line-height: 1.35;
}
.cert-matrix-table__loc span {
    display: block;
    color: #b0ce5a;
    font-weight: 700;
}
.cert-matrix-table__subsidiary-col {
    background: #3d3e3e;
    min-width: 130px;
}
.cert-matrix-table__subsidiary {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.cert-matrix-table__subsidiary--solo {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.cert-matrix-table__subsidiary--solo .cert-matrix-table__subsidiary-logo {
    max-width: 72px;
    max-height: 50px;
}
.cert-matrix-table__subsidiary-logo {
    max-width: 76px;
    max-height: 44px;
    width: auto;
    height: auto;
    background: #ffffff;
    border-radius: 4px;
    padding: 5px 8px;
}
/* Parent-brand logo in the Mercury-operated location columns */
.cert-matrix-table__brand {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.12);
    display: flex;
    justify-content: center;
}
.cert-matrix-table__brand-logo {
    max-width: 82px;
    max-height: 32px;
    width: auto;
    height: auto;
    background: #ffffff;
    border-radius: 4px;
    padding: 4px 6px;
}
.cert-matrix-table__subsidiary span {
    text-transform: none;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: rgba(255,255,255,0.65);
    font-style: italic;
}
.cert-matrix-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.14s;
}
.cert-matrix-table tbody tr:last-child {
    border-bottom: none;
}
.cert-matrix-table tbody tr:nth-child(odd) {
    background: #fafaf8;
}
.cert-matrix-table tbody tr:hover {
    background: #f0f5e6;
}
.cert-matrix-table td {
    padding: 12px 16px;
    text-align: center;
    border-right: 1px solid #eee;
    vertical-align: middle;
}
.cert-matrix-table td:last-child {
    border-right: none;
}
.cert-matrix-table__label {
    text-align: left !important;
    font-weight: 700;
    color: #333;
    font-size: 13px;
    white-space: nowrap;
}

/* Badges */
.cert-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 2px;
    padding: 4px 8px;
    white-space: nowrap;
}
.cert-badge i {
    font-size: 13px;
    line-height: 1;
}
.cert-badge--reg {
    background: rgba(176,206,90,0.12);
    color: #5a7a1a;
    border: 1px solid rgba(176,206,90,0.35);
}
.cert-badge.cert-badge--comp {
    background: none;
    color: #7aac1f;
    border: none;
    padding: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.cert-matrix-scroll-hint {
    display: none; /* shown only on mobile via media query */
    font-size: 11px;
    color: #aaa;
    text-align: center;
    margin: 8px 0 4px;
    letter-spacing: 0.05em;
}
.cert-matrix-note {
    font-size: 12px;
    color: #777;
    margin-top: 14px;
    line-height: 1.6;
}
.cert-matrix-note i {
    color: #b0ce5a;
    margin-right: 4px;
}

/* Right: cert previews */
.cert-matrix-right__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #b0ce5a;
    margin: 0 0 14px;
}
.cert-preview-card {
    border: 1px solid #e4e4e2;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 14px;
    transition: box-shadow 0.18s;
}
.cert-preview-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.09);
}
.cert-preview-card__img-wrap {
    height: 180px;
    background: #f5f5f3;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.cert-preview-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.3s ease;
}
.cert-preview-card:hover .cert-preview-card__img-wrap img {
    transform: scale(1.03);
}
.cert-preview-card__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #bbb;
}
.cert-preview-card__placeholder i {
    font-size: 28px;
    color: #b0ce5a;
    opacity: 0.5;
}
.cert-preview-card__placeholder span {
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #aaa;
    text-align: center;
}
.cert-preview-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #fff;
    gap: 8px;
}
.cert-preview-card__name {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}
.cert-preview-card__dl {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #b0ce5a;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.15s;
}
.cert-preview-card__dl i {
    font-size: 13px;
    vertical-align: -1px;
}
.cert-preview-card__dl:hover { color: #454646; }

/* ── Tabs Section ───────────────────────────────────────────── */
.cert-tabs-section {
    background: #f5f5f3;
    padding: 56px 0 64px;
    border-top: 1px solid #e4e4e2;
}
.cert-tabs-intro {
    font-size: 15px;
    color: #555;
    line-height: 1.8;
    max-width: 760px;
    margin: 0 0 32px;
}
.cert-tabs {
    display: flex;
    gap: 10px;
    border-bottom: none;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.cert-tab {
    background: #efefed;
    border: 1px solid #ddd;
    border-left: 4px solid #ddd;
    border-radius: 4px;
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 700;
    color: #777;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-align: left;
    line-height: 1.3;
}
.cert-tab:hover {
    background: #e4e4e0;
    color: #454646;
}
.cert-tab.is-active {
    background: #fff;
    border-color: #ddd;
    border-left-color: #b0ce5a;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.cert-tab-panel { display: none; }
.cert-tab-panel.is-active { display: block; }
.cert-tab-panel__desc {
    font-size: 14px;
    color: #666;
    line-height: 1.75;
    margin: 0 0 24px;
    max-width: 680px;
}

/* Download list — simple green link rows */
.cert-dl-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.cert-dl-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid #e8e8e5;
    text-decoration: none;
    color: #7aac1f;
    font-size: 13.5px;
    font-weight: 600;
    transition: color 0.15s, background 0.12s;
    border-radius: 2px;
}
.cert-dl-link:first-child { border-top: 1px solid #e8e8e5; }
.cert-dl-link:hover {
    color: #5a8c10;
    background: rgba(176,206,90,0.07);
    text-decoration: none;
    padding-left: 8px;
}
.cert-dl-link i {
    font-size: 14px;
    flex-shrink: 0;
    opacity: 0.75;
}
.cert-dl-link--muted {
    color: #999;
    font-weight: 500;
}
.cert-dl-link--muted:hover { color: #777; background: rgba(0,0,0,0.03); }

/* ── Policies Section ───────────────────────────────────────── */
.cert-policies {
    background: #fff;
    padding: 60px 0 56px;
    border-top: 1px solid #e4e4e2;
}
.cert-policies__head {
    margin-bottom: 36px;
}
.cert-policies__eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #b0ce5a;
    margin-bottom: 10px;
}
.cert-policies__title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px;
}
.cert-policies__title .hl { color: #b0ce5a; }
.cert-policies__sub {
    font-size: 14px;
    color: #666;
    line-height: 1.75;
    max-width: 640px;
    margin: 0;
}
.cert-policies__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.cert-policy-card {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #e4e4e2;
    border-radius: 5px;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.cert-policy-card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.07);
    border-color: #b0ce5a;
    text-decoration: none;
    color: inherit;
}
.cert-policy-card--pending {
    opacity: 0.65;
}
.cert-policy-card__icon {
    width: 36px;
    height: 36px;
    background: rgba(176,206,90,0.10);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #b0ce5a;
    flex-shrink: 0;
}
.cert-policy-card--pending .cert-policy-card__icon {
    background: rgba(69,70,70,0.06);
    color: #bbb;
}
.cert-policy-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cert-policy-card__name {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    display: block;
}
.cert-policy-card__loc {
    font-size: 11px;
    color: #999;
}
.cert-policy-card__status {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #bbb;
    white-space: nowrap;
    flex-shrink: 0;
}
/* Download affordance. Reads as a pill so the card is obviously
   clickable, and fills in on hover to confirm the whole card is the
   target — the hover is on the card, not the pill, so pointing
   anywhere on the row lights it up. */
.cert-policy-card--active .cert-policy-card__status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid rgba(176, 206, 90, 0.5);
    border-radius: 999px;
    background: rgba(176, 206, 90, 0.12);
    color: #5a7a1a;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cert-policy-card--active .cert-policy-card__status i {
    font-size: 14px;
    line-height: 1;
}

.cert-policy-card--active:hover .cert-policy-card__status,
.cert-policy-card--active:focus-visible .cert-policy-card__status {
    background: #b0ce5a;
    border-color: #b0ce5a;
    color: #0c0a0c;
}
.cert-policies__note {
    font-size: 12px;
    color: #999;
    margin-top: 20px;
}
.cert-policies__note i { color: #b0ce5a; margin-right: 4px; }
.cert-policies__note a { color: #454646; font-weight: 700; }
.cert-policies__note a:hover { color: #b0ce5a; }

/* ── Quality Stats Bar ──────────────────────────────────────── */
/* Sits on the certifications banner. Washed in brand grey rather
   than black so the band keeps the weight it has today between the
   sections either side of it. */
.cert-stats-bar {
    background:
        linear-gradient(
            rgba(69, 70, 70, 0.88),
            rgba(69, 70, 70, 0.88)
        ),
        url('../img/backgrounds/certifications-banner.webp') center center / cover no-repeat,
        #454646;
    padding: 64px 0;
}
.cert-stats-bar__title {
    color: #fff !important; /* beats global h1-h6 color in mercury-override.css */
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 10px;
}
.cert-stats-bar__sub {
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    margin: 0;
}
.quality-stat {
    text-align: center;
    padding: 36px 16px;
}
.quality-stat__num {
    font-size: 44px;
    font-weight: 900;
    color: #b0ce5a;
    line-height: 1;
    margin-bottom: 8px;
}
.quality-stat__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
}

/* ── Green CTA Strip ────────────────────────────────────────── */
.cert-cta-strip {
    background: #b0ce5a;
    padding: 48px 0;
}
.cert-cta-strip__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}
.cert-cta-strip__title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}
.cert-cta-strip__btn {
    background: #454646 !important;
    border-color: #454646 !important;
    color: #fff !important;
    white-space: nowrap;
    flex-shrink: 0;
}
.cert-cta-strip__btn:hover {
    background: #1a1a1a !important;
    border-color: #1a1a1a !important;
}

/* ── Legacy cert-card (kept for fallback) ───────────────────── */
.cert-card {
    background: #fff;
    border: 1px solid #dcdfdf;
    border-top: 4px solid #b0ce5a;
    padding: 36px 28px;
    height: 100%;
    transition: box-shadow 0.2s;
}
.cert-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.1); }
.cert-card__logo {
    height: 72px;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}
.cert-card__logo i { font-size: 48px; color: #b0ce5a; }
.cert-card__logo img { max-height: 72px; width: auto; }
.cert-card__name { font-size: 18px; font-weight: 700; color: #454646; margin-bottom: 8px; }
.cert-card__scope { font-size: 11px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: #b0ce5a; margin-bottom: 14px; }
.cert-card__text { font-size: 14px; color: #555; line-height: 1.75; margin: 0; }

/* ── Responsive ─────────────────────────────────────────────── */

/* 1100px — tighten side column */
@media (max-width: 1100px) {
    .cert-matrix-wrap {
        grid-template-columns: 1fr 210px;
        gap: 24px;
    }
}

/* 991px — stack matrix, previews go horizontal 3-col, policies 2-col */
@media (max-width: 991px) {
    .cert-matrix-wrap {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .cert-matrix-right {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
    .cert-matrix-right__label {
        grid-column: 1 / -1;
        margin-bottom: 4px;
    }
    .cert-preview-card { margin-bottom: 0; }
    .cert-preview-card__img-wrap { height: 150px; }

    .cert-policies__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .cert-tabs { gap: 8px; }
    .cert-tab { padding: 10px 14px; font-size: 12px; }
    .cert-cta-strip__title { font-size: 22px; }
}

/* Show scroll hint when table needs horizontal scroll */
@media (max-width: 640px) {
    .cert-matrix-scroll-hint { display: block; }
}

/* 767px — key tablet/phone boundary */
@media (max-width: 767px) {
    /* Intro */
    .cert-intro { padding: 28px 0 20px; }
    .cert-intro__text { font-size: 14px; }

    /* Matrix section */
    .cert-matrix-section { padding: 36px 0 28px; }
    .cert-matrix-table-wrap { border-radius: 4px; }
    /* Compact the table on small screens */
    .cert-matrix-table { font-size: 12px; min-width: 560px; }
    .cert-matrix-table thead th { padding: 10px 10px; font-size: 10px; }
    .cert-matrix-table thead th:first-child { min-width: 80px; }
    .cert-matrix-table td { padding: 10px 10px; }
    .cert-matrix-table__label { font-size: 12px; }
    .cert-badge { font-size: 9px; padding: 3px 6px; gap: 2px; }
    .cert-matrix-table__brand { margin-top: 6px; padding-top: 6px; }
    .cert-matrix-table__brand-logo { max-width: 66px; max-height: 26px; padding: 3px 5px; }

    /* Previews: 2-col on tablet */
    .cert-matrix-right {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .cert-preview-card__img-wrap { height: 130px; }

    /* Tabs */
    .cert-tabs-section { padding: 36px 0 44px; }
    .cert-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        gap: 8px;
    }
    .cert-tab { flex-shrink: 0; padding: 10px 14px; font-size: 12px; }

    /* Download links */
    .cert-dl-link { font-size: 13px; }

    /* Policies */
    .cert-policies { padding: 44px 0 40px; }
    .cert-policies__grid { grid-template-columns: 1fr; gap: 10px; }
    .cert-policies__title { font-size: 24px; }
    /* Keep the download cue on small screens, but drop the "PDF"
       wording so long policy names keep the room they need. */
    .cert-policy-card__status { font-size: 0; padding: 6px 8px; gap: 0; }
    .cert-policy-card__status i { font-size: 15px; }

    /* Stats bar */
    .cert-stats-bar { padding: 40px 0; }
    .cert-stats-bar__title { font-size: 24px; }
    .cert-stats-bar__sub { font-size: 13px; }
    .quality-stat { padding: 20px 12px; }
    .quality-stat__num { font-size: 34px; }
    .quality-stat__label { font-size: 10px; letter-spacing: 0.09em; }

    /* CTA strip */
    .cert-cta-strip { padding: 32px 0; }
    .cert-cta-strip__inner { flex-direction: column; align-items: flex-start; gap: 20px; }
    .cert-cta-strip__title { font-size: 20px; }
}

/* 575px — single column for previews */
@media (max-width: 575px) {
    .cert-matrix-right {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .cert-preview-card__img-wrap { height: 160px; }
    .cert-stats-bar__title { font-size: 22px; }
    .quality-stat__num { font-size: 30px; }
}

/* 480px — small phone optimisations */
@media (max-width: 480px) {
    .cert-intro__text { font-size: 13px; }

    /* Table: tightest it can go before scrolling takes over */
    .cert-matrix-table { min-width: 480px; font-size: 11px; }
    .cert-matrix-table thead th { padding: 8px 6px; font-size: 9px; }
    .cert-matrix-table thead th:first-child { min-width: 72px; }
    .cert-matrix-table td { padding: 8px 6px; }
    .cert-badge { font-size: 8px; padding: 2px 5px; }
    .cert-badge i { display: none; }   /* hide download cue on tiny screens */

    .cert-matrix-note { font-size: 11px; }

    .cert-dl-link { font-size: 12px; }

    .cert-policies__title { font-size: 20px; }
    .cert-policy-card { padding: 12px 14px; gap: 10px; }
    .cert-policy-card__icon { width: 30px; height: 30px; font-size: 14px; }
    .cert-policy-card__name { font-size: 12px; }

    .cert-stats-bar { padding: 32px 0; }
    .cert-stats-bar__title { font-size: 20px; }
    .quality-stat { padding: 16px 8px; }
    .quality-stat__num { font-size: 28px; }

    .cert-cta-strip { padding: 28px 0; }
    .cert-cta-strip__title { font-size: 18px; }
    .cert-cta-strip__btn { width: 100%; text-align: center; }

    .cert-tabs-intro { font-size: 13px; }
    .cert-tab-panel__desc { font-size: 13px; }
}

/* 360px — prevent any stray overflow on the smallest common phones */
@media (max-width: 360px) {
    .cert-matrix-table { min-width: 380px; }
    .cert-cta-strip__title { font-size: 16px; }
    .cert-stats-bar__title { font-size: 18px; }
    .quality-stat__num { font-size: 26px; }
}


/* document listed but the PDF is not posted yet — non-interactive label */
.cert-preview-card__dl--muted,
.cert-dl-link--muted {
    color: #5f6060;
    cursor: default;
    opacity: 0.85;
}
/* the muted label is far longer than "Download", so let it wrap instead of
   overflowing the card the way the nowrap/flex-shrink:0 base rule would */
.cert-preview-card__dl--muted {
    white-space: normal;
    flex-shrink: 1;
    text-align: right;
}
.cert-preview-card__dl--muted:hover,
.cert-dl-link--muted:hover {
    color: #5f6060;
    background: none;
}
