/**
 * Term Index Pages — shared CSS for /accreditations/, /topics/,
 * /delivery-partners/, /venues/ and their Indonesian sisters.
 *
 * All four pages use the same shell + same card markup, so this is one
 * bundle. Per-term accent colour is injected as the CSS custom property
 * `--accent` on each card by the shell template (set from
 * ptst_term_accent_colour()).
 */

/* ── Hero — match the schedule hero proportions ──────────────────── */
.ptst-term-index .ptst-term-index__hero {
    min-height: 360px;
    display: flex;
    align-items: flex-end;
    padding-bottom: 56px;
}
/* The hero uses flexbox to bottom-anchor the text. Without this, the
   .container (a flex item with margin:0 auto) shrinks to its content
   width and the auto-margins centre that narrow box — pushing the
   text right and making the indent vary by heading length. Forcing
   width:100% makes the container fill the flex row so its own
   max-width + margin:auto centre it at the full container width,
   left-aligned to match the breadcrumb + the rest of the site. */
.ptst-term-index .ptst-term-index__hero .container {
    width: 100%;
}
@media (max-width: 768px) {
    .ptst-term-index .ptst-term-index__hero {
        min-height: 260px;
        padding-bottom: 40px;
    }
}

/* ── Breadcrumb ──────────────────────────────────────────────────── */
.ptst-term-index .ptst-term-index__crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ink-3);
    padding: 18px 0 6px;
}
.ptst-term-index .ptst-term-index__crumb a {
    color: var(--ink-3);
    text-decoration: none;
}
.ptst-term-index .ptst-term-index__crumb a:hover {
    color: var(--brand-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.ptst-term-index .ptst-term-index__crumb-sep     { color: var(--ink-4, #889AB7); }
.ptst-term-index .ptst-term-index__crumb-current { color: var(--ink); }

/* ── Grid section padding (override .section helper's 80px default) */
.ptst-term-index .section.ptst-term-index__grid-section {
    padding-top: 40px;
    padding-bottom: 80px;
}

.ptst-term-index .ptst-term-index__grid-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 28px;
}
.ptst-term-index .ptst-term-index__grid-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--brand-blue, #012F63);
    margin: 0;
    letter-spacing: -0.012em;
}
.ptst-term-index .ptst-term-index__grid-count {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand-blue, #012F63);
    background: var(--brand-blue-50, #EEF4FB);
    padding: 2px 10px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

/* ── The grid itself — 3-up at desktop, 2-up at tablet, 1-up at mobile */
.ptst-term-index .ptst-term-index__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
@media (max-width: 960px) {
    .ptst-term-index .ptst-term-index__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 540px) {
    .ptst-term-index .ptst-term-index__grid {
        grid-template-columns: 1fr;
    }
}

/* ── Term card ───────────────────────────────────────────────────── */
/* --accent comes from the shell template, set per-card from the
   ptst_term_accent_colour() resolver. Default brand-blue is set here
   in case the inline style is somehow missing. */
.ptst-term-index .term-card {
    --accent: var(--brand-blue, #012F63);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line, #E2E8F2);
    border-radius: var(--radius-lg, 14px);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    /* Subtle top stripe in the term's accent colour. */
    box-shadow: inset 0 4px 0 0 var(--accent);
}
.ptst-term-index .term-card:hover {
    transform: translateY(-3px);
    box-shadow:
        inset 0 4px 0 0 var(--accent),
        var(--shadow-md, 0 8px 24px rgba(11, 27, 51, 0.10));
    border-color: var(--brand-blue-100, #D6E7F4);
}

.ptst-term-index .term-card__cover {
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* --cover-bg defaults to --accent; logo-mode cards override it
       inline with the term's brand background colour. */
    background-color: var(--cover-bg, var(--accent));
    position: relative;
}
/* Gradient fallback when no image is set — uses the cover-bg as the
   dominant tone and brand-blue-deep at the bottom for depth. */
.ptst-term-index .term-card__cover--gradient {
    background: linear-gradient(150deg,
        var(--cover-bg, var(--accent)) 0%,
        var(--brand-blue-deep, #08316B) 100%);
}
/* Subtle scrim over photos for legibility if/when copy overlays appear */
.ptst-term-index .term-card__cover--photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11, 27, 51, 0) 60%, rgba(11, 27, 51, 0.20) 100%);
    pointer-events: none;
}

/* Logo mode — solid brand background, logo centred + proportionally
   constrained. Used by accrediting bodies + delivery partners where
   the brand asset IS the visual. The 16:9 aspect-ratio inherited
   above gives us a generous canvas; padding keeps the logo from
   touching the card edges.
   When you have time to prepare normalised logo lockups (each on a
   uniform transparent canvas, e.g. 800×400), upload them as the term's
   `hero_image` field — the template prefers that over the brand logo
   so cards become visually consistent. The current values below are
   tuned for the brand-logo fallback case. */
.ptst-term-index .term-card__cover--logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 32px;
    background: var(--cover-bg);
}
.ptst-term-index .term-card__logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    /* Defensive cap — older browsers without aspect-ratio + flex
       sizing fall back to this fixed pixel ceiling. Bumped from 110px
       so square logos (IADC, BP3IP) get more presence. */
    max-height: 150px;
}

.ptst-term-index .term-card__body {
    padding: 18px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.ptst-term-index .term-card__name {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink, #0B1B33);
    margin: 0;
    letter-spacing: -0.012em;
    line-height: 1.3;
}
.ptst-term-index .term-card__excerpt {
    font-size: 14px;
    color: var(--ink-3, #4A5C7A);
    line-height: 1.5;
    margin: 0;
}
.ptst-term-index .term-card__meta {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-3, #4A5C7A);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-top: 4px;
}
.ptst-term-index .term-card__cta {
    align-self: flex-start;
    padding: 0 20px 18px;
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-blue, #012F63);
    transition: transform .12s;
}
.ptst-term-index .term-card:hover .term-card__cta {
    transform: translateX(3px);
}

/* ── Empty state ─────────────────────────────────────────────────── */
.ptst-term-index .ptst-term-index__empty {
    text-align: center;
    padding: 48px 24px;
    border: 1px dashed var(--line, #E2E8F2);
    border-radius: var(--radius-lg, 14px);
    background: var(--bg-soft, #F4F7FB);
    color: var(--ink-3, #4A5C7A);
}
.ptst-term-index .ptst-term-index__empty p {
    margin: 0;
    font-size: 15px;
}
