/* =============================================================================
   NWC2027 — Session details modal (standalone drop-in module)
   Add to any Premier show page (e.g. ROBTESTBA3). Pairs with session-details.js.
   Self-contained and NWC2027-branded; the match table becomes stacked cards on
   mobile. All styling is scoped to .session-* / the modal body, so it won't
   collide with the host page.
   ============================================================================= */

/* ---- NWC2027 brand fonts (self-contained) ---- */
@font-face {
    font-family: "NWC2027 Headline";
    src: url("https://d35kvm5iuwjt9t.cloudfront.net/customview/netballworldcup/2027/fonts/NWC27-Headline.woff2") format("woff2"),
         url("https://d35kvm5iuwjt9t.cloudfront.net/customview/netballworldcup/2027/fonts/NWC27-Headline.woff") format("woff"),
         url("https://d35kvm5iuwjt9t.cloudfront.net/customview/netballworldcup/2027/fonts/NWC27-Headline.ttf") format("truetype");
    font-weight: normal; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "NWC2027 Regular";
    src: url("https://d35kvm5iuwjt9t.cloudfront.net/customview/netballworldcup/2027/fonts/NWC27-Regular.woff2") format("woff2"),
         url("https://d35kvm5iuwjt9t.cloudfront.net/customview/netballworldcup/2027/fonts/NWC27-Regular.woff") format("woff"),
         url("https://d35kvm5iuwjt9t.cloudfront.net/customview/netballworldcup/2027/fonts/NWC27-Regular.ttf") format("truetype");
    font-weight: normal; font-style: normal; font-display: swap;
}

/* ---- Trigger link ---- */
.session-detail-link {
    font-family: "NWC2027 Regular", "Inter", Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #007EB6;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
.session-detail-link:hover { color: #00668f; }
.session-detail-link:focus-visible { outline: 3px solid #6465E2; outline-offset: 2px; border-radius: 2px; }

/* ---- Hidden data blocks + modal default-hidden ---- */
.session-detail[hidden],
.session-modal[hidden] { display: none !important; }

/* ---- Modal shell ---- */
.session-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.session-modal, .session-modal *, .session-modal *::before, .session-modal *::after { box-sizing: border-box; }
.session-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.session-modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.30);
}
.session-modal-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #000000;
    padding: 20px 24px;
}
.session-modal .session-modal-title {
    margin: 0;
    font-family: "NWC2027 Headline", "Inter", Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025rem;
    color: #FFFFFF;
}
.session-modal-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 28px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
}
.session-modal-close:focus-visible { outline: 3px solid #6465E2; outline-offset: 2px; border-radius: 4px; }
.session-modal-body {
    padding: 24px;
    overflow-y: auto;
}

/* ---- Session-level facts ---- */
.session-modal-body .session-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 36px;
    margin: 0 0 24px;
    padding: 0 0 20px;
    border-bottom: 1px solid #D7D7D7;
}
.session-modal-body .session-fact { display: flex; flex-direction: column; }
.session-modal-body .session-fact dt {
    font-family: "NWC2027 Regular", "Inter", Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555555;
    margin-bottom: 2px;
}
.session-modal-body .session-fact dd {
    margin: 0;
    font-family: "NWC2027 Headline", "Inter", Arial, sans-serif;
    font-size: 16px;
    color: #000000;
}

/* ---- Match table (desktop) ---- */
.session-modal-body .session-matches { width: 100%; border-collapse: collapse; }
.session-modal-body .session-matches th {
    text-align: left;
    font-family: "NWC2027 Headline", "Inter", Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #555555;
    padding: 0 16px 10px 0;
    border-bottom: 2px solid #D7D7D7;
    white-space: nowrap;
    background: none;
}
.session-modal-body .session-matches td {
    font-family: "NWC2027 Regular", "Inter", Arial, sans-serif;
    font-size: 15px;
    color: #000000;
    padding: 12px 16px 12px 0;
    border-bottom: 1px solid #EEEEEE;
    vertical-align: top;
    background: none;
}
.session-modal-body .session-matches tr:last-child td { border-bottom: none; }

/* ---- Mobile: stacked cards (no horizontal scroll) ---- */
@media (max-width: 768px) {
    .session-modal { padding: 0; }
    .session-modal-dialog { max-width: 100%; max-height: 100%; height: 100%; border-radius: 0; }
    /* header row kept for screen readers, hidden visually */
    .session-modal-body .session-matches thead {
        position: absolute;
        width: 1px; height: 1px;
        padding: 0; margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .session-modal-body .session-matches,
    .session-modal-body .session-matches tbody,
    .session-modal-body .session-matches tr,
    .session-modal-body .session-matches td { display: block; width: 100%; }
    .session-modal-body .session-matches tr {
        border: 1px solid #D7D7D7;
        border-radius: 8px;
        padding: 12px 14px;
        margin-bottom: 14px;
    }
    .session-modal-body .session-matches tr:last-child { margin-bottom: 0; }
    .session-modal-body .session-matches td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 18px;
        padding: 7px 0;
        border-bottom: 1px solid #F0F0F0;
    }
    .session-modal-body .session-matches tr td:last-child { border-bottom: none; }
    .session-modal-body .session-matches td::before {
        content: attr(data-label);
        font-family: "NWC2027 Regular", "Inter", Arial, sans-serif;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #555555;
        flex-shrink: 0;
    }
    .session-modal-body .session-matches td[data-label="Teams"] { flex-direction: column; gap: 2px; align-items: flex-start; }
}
