/* =====================================================================
   Activity Full Details — redesign (scoped under .ad-detail)
   Matches Figma frames 236:2 (desktop) / 245:3 (mobile).
   All rules are scoped to .ad-detail so nothing leaks to other pages.
   ===================================================================== */

.ad-detail {
    --ad-teal: #30bea8;
    --ad-teal-dark: #1a9e8c;
    --ad-navy: #094d78;
    --ad-heading: #273331;
    --ad-body: #333333;
    --ad-muted: #595468;
    --ad-subtle: #8a8698;
    --ad-bg: #ffffff;
    --ad-border: #eceef0;
    --ad-divider: #f0f1f3;
    --ad-radius: 16px;
    background: var(--ad-bg);
    color: var(--ad-body);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    text-align: left;
}

.ad-detail *, .ad-detail *::before, .ad-detail *::after { box-sizing: border-box; }

.ad-detail__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 24px 48px;
}

.ad-detail svg { display: inline-block; vertical-align: middle; }

/* --- back link --- */
.ad-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ad-navy);
    font-size: 14px;
    text-decoration: none;
    margin: 12px 0 20px;
}
.ad-back:hover { color: var(--ad-navy); text-decoration: underline; }
.ad-back svg { width: 16px; height: 16px; }

/* --- generic card --- */
.ad-card {
    background: #fff;
    border: 1px solid var(--ad-border);
    border-radius: var(--ad-radius);
    padding: 28px;
}
.ad-card__title {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--ad-heading);
    margin: 0 0 16px;
}

/* --- hero (CSS grid so it reflows: photo left + content right on desktop;
   photo+title side-by-side then full-width content on mobile) --- */
.ad-hero {
    display: grid;
    grid-template-columns: 40% minmax(0, 1fr);
    grid-template-areas:
        "photo heading"
        "photo keyinfo"
        "photo cta"
        "photo org";
    column-gap: 28px;
    row-gap: 20px;
    align-items: start;
    background: #fff;
    border: 1px solid var(--ad-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 6px 20px rgba(13, 31, 41, 0.06);
}
.ad-hero__photo-wrap {
    grid-area: photo;
    position: relative;
    align-self: center;    /* centre the square vertically alongside the content */
    width: 100%;
    max-width: 520px;
    aspect-ratio: 1 / 1;   /* definite (column) width -> square height */
    border-radius: 16px;
    overflow: hidden;
}
.ad-hero__photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ad-hero__photo--placeholder {
    object-fit: contain;
    padding: 10%;
}
.ad-hero__heading {
    grid-area: heading;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}
.ad-keyinfo { grid-area: keyinfo; }
.ad-hero .announcement-actions { grid-area: cta; }
.ad-hero .ad-org { grid-area: org; }

.ad-chip {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #e7f6f3;
    color: var(--ad-teal-dark);
    font-size: 12px;
    font-weight: 500;
}
.ad-chip::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
}
.ad-chip--closed { background: #f2f0f0; color: #8a7f7f; }

.ad-title {
    font-family: 'Poppins', sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--ad-heading);
    margin: 0;
    line-height: 1.15;
    text-align: left;
}

/* --- key info / info rows --- */
.ad-keyinfo {
    border: 1px solid var(--ad-border);
    border-radius: 14px;
    padding: 6px 22px;
}
.ad-inforow {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 0;
}
.ad-inforow + .ad-inforow { border-top: 1px solid var(--ad-divider); }
.ad-icontile {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fff;
    border: 1.5px solid var(--ad-navy);
    color: var(--ad-navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ad-icontile svg { width: 20px; height: 20px; }

/* entry dates: three labelled lines, muted when entries are closed */
.ad-entry-line + .ad-entry-line { margin-top: 2px; }
.ad-entry-label { color: var(--ad-muted); font-weight: 400; }
.ad-inforow__value.ad-entries--closed,
.ad-inforow__value.ad-entries--closed .ad-entry-label { color: var(--ad-subtle); }
.ad-inforow__body { min-width: 0; flex: 1 1 auto; }
.ad-inforow__label {
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--ad-muted);
    margin: 0 0 3px;
}
.ad-inforow__value {
    font-size: 14px;
    font-weight: 500;
    color: var(--ad-heading);
    margin: 0;
    line-height: 1.5;
}
.ad-inforow__value a { color: inherit; text-decoration: none; }
.ad-inforow__value a:hover { text-decoration: underline; }

/* --- action buttons (restyle the shared _AnnouncementButtons partial) --- */
.ad-detail .announcement-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 0;
}
.ad-detail .announcement-actions .btn_Registernow,
.ad-detail .announcement-actions .btn_Auditnow,
.ad-detail .announcement-actions .btn_Waitlistnow {
    flex: 1 1 0;
    float: none;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    min-height: 0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
}
.ad-detail .announcement-actions .btn_Registernow { background: var(--ad-teal); color: #fff; }
.ad-detail .announcement-actions .btn_Registernow.closed { background: #cbcbcb; }
.ad-detail .announcement-actions .btn_Auditnow { background: #fff; color: var(--ad-navy); border: 1.5px solid var(--ad-navy); }
.ad-detail .announcement-actions .btn_Waitlistnow { background: #fff; color: var(--ad-navy); border: 1.5px solid var(--ad-navy); }
/* when a single action is offered (Register / Closed / Invite Only), show it at
   half width and right-aligned — rather than stretching to fill the container */
.ad-detail .announcement-actions .btn_Registernow:only-child,
.ad-detail .announcement-actions .btn_Auditnow:only-child,
.ad-detail .announcement-actions .btn_Waitlistnow:only-child { flex: 0 0 50%; margin-left: auto; }
.ad-detail .announcement-actions .text-danger {
    flex: 1 1 100%;
    float: none !important;
    margin: 0 !important;
    text-align: center;
}

/* --- organizer contact card --- */
.ad-org {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--ad-border);
    border-radius: 14px;
    padding: 16px 18px;
}
.ad-avatar {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: #e6eef4;
    color: var(--ad-navy);
    font-weight: 600;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ad-avatar--help { background: #fff; border: 1.5px solid var(--ad-navy); color: var(--ad-navy); }
.ad-avatar--help svg { width: 24px; height: 24px; }
.ad-org__info { flex: 1 1 auto; min-width: 0; }
.ad-org__label { font-size: 12px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ad-muted); }
.ad-org__name { font-size: 14px; font-weight: 500; color: var(--ad-heading); }
.ad-org__contact { display: flex; gap: 8px; }
.ad-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid #cfd8e0;
    background: #fff;
    color: var(--ad-navy);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}
.ad-btn-outline svg { width: 16px; height: 16px; }

/* --- two-column body --- */
.ad-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    align-items: start;
    margin-top: 32px;
}
.ad-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.ad-side { display: flex; flex-direction: column; gap: 24px; }

/* --- prose --- */
.ad-prose { font-size: 14px; line-height: 1.6; color: var(--ad-body); }
.ad-prose p { margin: 0 0 12px; }
.ad-prose p:last-child { margin-bottom: 0; }
.ad-prose a { color: var(--ad-navy); }

/* --- organizer notes (teal left rail) --- */
.ad-notes {
    background: #f6fbfa;
    border: 1px solid var(--ad-border);
    border-left: 6px solid var(--ad-teal);
    border-radius: 12px;
    padding: 24px 28px 24px 34px;
}
.ad-notes .ad-card__title { margin-bottom: 12px; }

/* --- required-docs checklist --- */
.ad-reqs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.ad-req { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ad-body); }
.ad-req svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--ad-navy); margin-top: 1px; }
.ad-reqs-intro { font-size: 14px; line-height: 1.5; color: var(--ad-muted); margin: 0 0 4px; }
.ad-reqs-intro .ad-learnmore { text-decoration: underline; cursor: pointer; }

/* --- pricing --- */
.ad-price-group + .ad-price-group { margin-top: 22px; }
.ad-subhead {
    font-size: 12px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ad-subtle);
    margin: 0 0 10px;
}
.ad-price {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--ad-divider);
}
.ad-price__main { flex: 1 1 auto; min-width: 0; }
.ad-price__name { font-size: 14px; color: var(--ad-body); }
.ad-price__sub { font-size: 12px; color: var(--ad-subtle); margin-top: 3px; }
.ad-price__amt { font-size: 14px; font-weight: 600; color: #333333; white-space: nowrap; }
.ad-subprice {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 0 6px 18px;
    font-size: 12px;
    color: #666;
}
.ad-subprice .ad-price__amt { font-size: 12px; }

/* --- chips (tests & experience) --- */
.ad-chipgroup + .ad-chipgroup { margin-top: 18px; }
.ad-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-chiptag { padding: 6px 12px; border-radius: 999px; background: #eef2f5; color: var(--ad-heading); font-size: 12px; }

/* --- sidebar: at a glance --- */
.ad-glance__row { padding: 14px 0; }
.ad-glance__row + .ad-glance__row { border-top: 1px solid var(--ad-divider); }
.ad-glance__label { font-size: 12px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ad-subtle); margin: 0 0 2px; }
.ad-glance__value { font-size: 14px; font-weight: 500; color: var(--ad-heading); }

/* --- sidebar: documents & waivers --- */
.ad-docrow { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.ad-docrow svg { flex: 0 0 17px; width: 17px; height: 17px; color: var(--ad-navy); }
.ad-docrow a { color: var(--ad-navy); text-decoration: none; word-break: break-word; }
.ad-docrow a:hover { text-decoration: underline; }
.ad-doc-divider { height: 1px; background: var(--ad-divider); margin: 8px 0; }
.ad-doc-sublabel { font-size: 12px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ad-subtle); margin: 0 0 2px; }

/* small help badge for popovers */
.ad-detail .ad-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1px solid #b9c2cb;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    color: #8a8698;
    margin-left: 6px;
    cursor: default;
    vertical-align: middle;
}

/* --- sidebar: register CTA --- */
.ad-register {
    background: var(--ad-navy);
    color: #fff;
    border-radius: 16px;
    padding: 26px 28px;
}
.ad-register__title { font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.ad-register__sub { font-size: 14px; color: #c7d6e3; margin: 0 0 14px; }
.ad-register__btn {
    display: block;
    text-align: center;
    background: var(--ad-teal);
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
}
.ad-register__note { font-size: 12px; color: #9fb6c8; margin: 14px 0 0; }

/* --- admin info --- */
.ad-admin .ad-inforow__value { font-weight: 400; color: var(--ad-body); }
.ad-admin .ad-inforow__value span { display: block; }

/* --- return to calendar --- */
.ad-return-wrap { display: flex; justify-content: center; margin: 32px 0; }
.ad-return {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--ad-navy);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 13px 24px;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
}
.ad-return svg { width: 16px; height: 16px; }

/* --- ad slots --- */
.ad-detail .banner-container-primary,
.ad-detail .banner-container-secondary { margin: 8px 0; text-align: center; }

/* =====================  RESPONSIVE  ===================== */

@media (max-width: 991px) {
    .ad-body { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .ad-detail__inner { padding: 4px 16px 40px; }

    /* keep calendar navigation in the header/footer only on mobile */
    .ad-back { display: none; }

    /* hero: image + title share the top row; key-info / CTA / organizer go
       full width below — keeps the register buttons above the fold.
       Stays a white card (like desktop) so the title isn't on the grey page. */
    .ad-hero {
        grid-template-columns: 40% minmax(0, 1fr);
        grid-template-areas:
            "photo heading"
            "keyinfo keyinfo"
            "cta cta"
            "org org";
        column-gap: 14px;
        row-gap: 16px;
        padding: 16px;
        border-radius: 16px;
        box-shadow: none;
    }
    .ad-hero__photo-wrap { align-self: start; max-width: none; border-radius: 14px; }
    .ad-title { font-size: 22px; }

    /* CTAs remain stacked full-width on mobile when more than one is offered */
    .ad-detail .announcement-actions { flex-direction: column; }
    .ad-detail .announcement-actions .btn_Registernow,
    .ad-detail .announcement-actions .btn_Auditnow,
    .ad-detail .announcement-actions .btn_Waitlistnow { flex-basis: auto; width: 100%; }
    /* on mobile every action is full width, including a single one
       (overrides the desktop half-width/right-align rule above) */
    .ad-detail .announcement-actions .btn_Registernow:only-child,
    .ad-detail .announcement-actions .btn_Auditnow:only-child,
    .ad-detail .announcement-actions .btn_Waitlistnow:only-child { flex: 0 0 auto; width: 100%; margin-left: 0; }

    /* organizer contact: icon + details share the first row, Call/Email wrap
       to a full-width row below (avoids the icon floating alone on its own line).
       flex-basis:0 lets the details shrink to fit beside the icon instead of
       wrapping to their own line, then grow to fill the remaining width. */
    .ad-org { flex-wrap: wrap; }
    .ad-org__info { flex: 1 1 0; }
    .ad-org__contact { flex: 1 1 100%; }
    .ad-org__contact .ad-btn-outline { flex: 1 1 0; justify-content: center; }

    .ad-reqs { grid-template-columns: 1fr; }
    .ad-card { padding: 18px 16px; }
    .ad-card__title { font-size: 18px; }
    .ad-notes { padding: 18px 16px 18px 20px; }

    /* hide the desktop-only sidebar summaries; keep Documents and float it up */
    .ad-glance, .ad-side .ad-register { display: none; }
    .ad-side { order: -1; }
}
