/* ASA UI kit — styles for resources/views/components/ui/* (uses theme.css tokens). */

/* ---------- Layout primitives ---------- */

.asa-container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 16px;
}

.asa-icon { flex: none; vertical-align: middle; }

/* ---------- Buttons ---------- */

.asa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: var(--asa-radius-pill);
    font-family: var(--asa-font);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s var(--asa-ease), box-shadow .2s var(--asa-ease), background-color .2s var(--asa-ease), color .2s var(--asa-ease), border-color .2s var(--asa-ease);
}
.asa-btn:hover { transform: translateY(-1px); text-decoration: none; }
.asa-btn:focus-visible { outline: 2px solid var(--asa-teal); outline-offset: 3px; }
.asa-btn--lg { min-height: 52px; padding: 0 30px; font-size: 16px; }

.asa-btn--primary {
    background: var(--asa-accent);
    color: var(--asa-accent-contrast);
    box-shadow: var(--asa-shadow-sm);
}
.asa-btn--primary:hover { color: var(--asa-accent-contrast); box-shadow: var(--asa-shadow); background: var(--asa-navy-700); }
html.dark .asa-btn--primary { background: var(--asa-mint); color: var(--asa-navy); }
html.dark .asa-btn--primary:hover { background: #C4EBE6; color: var(--asa-navy); }

.asa-btn--secondary {
    background: transparent;
    color: var(--asa-accent);
    border-color: currentColor;
}
.asa-btn--secondary:hover { background: rgba(var(--asa-navy-rgb), .06); color: var(--asa-accent); }
html.dark .asa-btn--secondary { color: var(--asa-mint); }
html.dark .asa-btn--secondary:hover { background: rgba(var(--asa-mint-rgb), .1); color: var(--asa-mint); }

.asa-btn--ghost { background: transparent; color: var(--asa-text); padding-inline: 14px; }
.asa-btn--ghost:hover { background: rgba(var(--asa-navy-rgb), .06); color: var(--asa-text); }
html.dark .asa-btn--ghost:hover { background: rgba(255, 255, 255, .08); }

/* ---------- Section ---------- */

.asa-section { padding: 56px 0; }
.asa-section--alt { background: var(--asa-surface-2); }
.asa-section__head { max-width: 640px; margin: 0 auto 36px; text-align: center; }
.asa-section__eyebrow {
    margin: 0 0 8px;
    color: var(--asa-teal);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}
html.dark .asa-section__eyebrow { color: var(--asa-mint); }
.asa-section__title {
    margin: 0;
    font-family: var(--asa-font-display);
    font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
    line-height: 1.25;
    color: var(--asa-text);
}
.asa-section__intro { margin: 14px 0 0; color: var(--asa-text-muted); font-size: 17px; line-height: 1.6; }

@media (min-width: 768px) { .asa-section { padding: 80px 0; } .asa-container { padding-inline: 24px; } }
@media (min-width: 1200px) { .asa-section { padding: 96px 0; } }

/* ---------- Grid ---------- */

.asa-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 768px) {
    .asa-grid { gap: 24px; }
    .asa-grid--2, .asa-grid--3, .asa-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
    .asa-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .asa-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Card ---------- */

.asa-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--asa-surface);
    border: 1px solid var(--asa-border);
    border-radius: var(--asa-radius);
    box-shadow: var(--asa-shadow-sm);
    transition: transform .25s var(--asa-ease), box-shadow .25s var(--asa-ease);
}
.asa-card--link:hover, .asa-card--link:focus-within { transform: translateY(-4px); box-shadow: var(--asa-shadow); }
.asa-card__media { overflow: hidden; background: var(--asa-surface-2); }
.asa-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s var(--asa-ease);
}
.asa-card--link:hover .asa-card__media img { transform: scale(1.04); }
.asa-card__body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 20px; }
.asa-card__meta { margin: 0; color: var(--asa-text-muted); font-size: 13px; }
.asa-card__title { margin: 0; font-size: 1.15rem; line-height: 1.35; color: var(--asa-text); }
.asa-card__link { color: inherit; text-decoration: none; }
.asa-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.asa-card__link:focus-visible { outline: none; }
.asa-card:has(.asa-card__link:focus-visible) { outline: 2px solid var(--asa-teal); outline-offset: 3px; }
.asa-card__excerpt {
    margin: 0;
    color: var(--asa-text-muted);
    font-size: 15px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.asa-card__extra { margin-top: auto; padding-top: 8px; }
html.dark .asa-card { box-shadow: none; }

/* ---------- Prose (imported WordPress HTML) ---------- */

.asa-prose {
    max-width: 70ch;
    margin-inline: auto;
    color: var(--asa-text);
    font-size: 17px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}
.asa-prose > :first-child { margin-top: 0; }
.asa-prose > :last-child { margin-bottom: 0; }
.asa-prose p { margin: 0 0 1.2em; }
.asa-prose p:empty { display: none; }
.asa-prose h2, .asa-prose h3, .asa-prose h4 {
    margin: 1.8em 0 .6em;
    font-family: var(--asa-font-display);
    line-height: 1.3;
    text-transform: none;
    color: var(--asa-text);
}
.asa-prose h2 { font-size: 1.65rem; }
.asa-prose h3 { font-size: 1.35rem; }
.asa-prose h4 { font-size: 1.15rem; }
.asa-prose ul, .asa-prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.asa-prose ul { list-style: disc; }
.asa-prose ol { list-style: decimal; }
.asa-prose li { margin-bottom: .4em; padding-left: .2em; }
.asa-prose li::marker { color: var(--asa-teal); }
.asa-prose a { color: var(--asa-link); text-decoration: underline; text-underline-offset: 3px; }
.asa-prose a:hover { text-decoration-thickness: 2px; }
html.dark .asa-prose a { color: var(--asa-mint); }
.asa-prose strong { font-weight: 600; }
.asa-prose blockquote {
    margin: 1.6em 0;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--asa-mint);
    color: var(--asa-text-muted);
    font-style: italic;
}
.asa-prose blockquote p:last-child { margin-bottom: 0; }
.asa-prose figure { margin: 1.8em 0; }
.asa-prose figcaption { margin-top: 8px; color: var(--asa-text-muted); font-size: 14px; text-align: center; }
.asa-prose img { display: block; max-width: 100%; height: auto; margin: 1.6em auto; border-radius: var(--asa-radius-sm); }
.asa-prose figure img { margin: 0 auto; }
.asa-prose iframe, .asa-prose video { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--asa-radius-sm); margin: 1.6em 0; }
.asa-prose hr { margin: 2em 0; border: 0; border-top: 1px solid var(--asa-border); }
.asa-prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.5em 0; }
.asa-prose th, .asa-prose td { padding: 8px 12px; border: 1px solid var(--asa-border); }

/* ---------- Empty state ---------- */

.asa-empty { max-width: 460px; margin: 0 auto; padding: 48px 16px; text-align: center; }
.asa-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--asa-surface-2);
    color: var(--asa-teal);
}
html.dark .asa-empty__icon { color: var(--asa-mint); }
.asa-empty__title { margin: 0 0 8px; font-family: var(--asa-font-display); font-size: 1.35rem; }
.asa-empty__text { margin: 0; color: var(--asa-text-muted); line-height: 1.6; }
.asa-empty__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 24px; }

/* ---------- Page header ---------- */

.asa-page-header {
    position: relative;
    overflow: hidden;
    /* fixed floating header sits on top of the band */
    padding: 36px 0 32px;
    background: linear-gradient(135deg, var(--asa-navy) 0%, var(--asa-navy-700) 100%);
    color: #fff;
}
.asa-page-header__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.asa-page-header--image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(var(--asa-navy-rgb), .78), rgba(14, 24, 41, .86));
}
.asa-page-header__inner { position: relative; z-index: 1; }
.asa-page-header .asa-page-header__title {
    margin: 14px 0 0;
    max-width: 22ch;
    font-family: var(--asa-font-display);
    font-size: clamp(1.6rem, 1.1rem + 2.4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    text-transform: none;
    overflow-wrap: anywhere;
}
.asa-page-header__subtitle { margin: 10px 0 0; max-width: 60ch; color: rgba(255, 255, 255, .8); font-size: 17px; }
.asa-page-header .asa-page-header__crumbs {
    display: inline-block;
    max-width: 100%;
    padding: 6px 14px;
    border-radius: var(--asa-radius-pill);
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .22);
    box-shadow: none;
    font-size: 13px;
}
.asa-page-header__crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin: 0; padding: 0; list-style: none; }
.asa-page-header__crumbs li { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: rgba(255, 255, 255, .85); }
.asa-page-header__crumbs a { display: inline-flex; align-items: center; min-height: 28px; color: #fff; text-decoration: none; }
.asa-page-header__crumbs a:hover { text-decoration: underline; }
.asa-page-header__crumbs [aria-current] { color: rgba(255, 255, 255, .72); }
.asa-page-header__crumbs .asa-icon { opacity: .6; }
@media (min-width: 768px) {
    .asa-page-header { padding: 56px 0 48px; }
}

/* ---------- 404 ---------- */

.asa-error__inner { text-align: center; }
.asa-error__code {
    margin: 0;
    font-family: var(--asa-font-display);
    font-size: clamp(5rem, 3rem + 12vw, 9rem);
    font-weight: 700;
    line-height: 1;
    color: var(--asa-navy);
    opacity: .12;
}
html.dark .asa-error__code { color: var(--asa-mint); opacity: .2; }
.asa-error .asa-empty { margin-top: -24px; }

/* ---------- CTA band (x-ui.cta-band) ---------- */
/* A contained card, never full-bleed, so it never collides with the navy footer. */
.asa-cta-band { padding: 48px 0 64px; }
.asa-cta-band__card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 24px;
    padding: 32px 24px;
    border-radius: var(--asa-radius-lg);
    background: linear-gradient(135deg, var(--asa-navy) 0%, var(--asa-navy-700) 100%);
    color: #fff;
    box-shadow: var(--asa-shadow);
}
/* Soft mint glow for the glassy touch. */
.asa-cta-band__card::before {
    content: "";
    position: absolute;
    inset: -40% -10% auto auto;
    width: 60%;
    aspect-ratio: 1;
    background: radial-gradient(circle, rgba(var(--asa-mint-rgb), .28), transparent 65%);
    pointer-events: none;
}
.asa-cta-band__copy, .asa-cta-band__actions { position: relative; }
.asa-cta-band__title {
    margin: 0 0 8px;
    font-family: var(--asa-font-display);
    font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem);
    line-height: 1.25;
    color: #fff;
}
.asa-cta-band__text { margin: 0; max-width: 60ch; line-height: 1.65; color: rgba(255, 255, 255, .82); }
.asa-cta-band__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.asa-cta-band__actions .asa-btn { flex: 1 1 auto; justify-content: center; }

.asa-cta-band .asa-btn--primary { background: var(--asa-mint); color: var(--asa-navy); }
.asa-cta-band .asa-btn--primary:hover { background: #C4EBE6; color: var(--asa-navy); }
.asa-cta-band .asa-btn--secondary,
.asa-cta-band .asa-btn--ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .45); }
.asa-cta-band .asa-btn--secondary:hover,
.asa-cta-band .asa-btn--ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }

html.dark .asa-cta-band__card {
    background: linear-gradient(135deg, var(--asa-surface-2) 0%, var(--asa-surface) 100%);
    border: 1px solid var(--asa-border);
}

.asa-cta-band--center .asa-cta-band__card { text-align: center; justify-items: center; }
.asa-cta-band--center .asa-cta-band__text { margin-inline: auto; }
.asa-cta-band--center .asa-cta-band__actions { justify-content: center; }

@media (min-width: 768px) {
    .asa-cta-band { padding: 64px 0 88px; }
    .asa-cta-band__card { padding: 48px 56px; }
    .asa-cta-band__actions .asa-btn { flex: 0 0 auto; }
    .asa-cta-band:not(.asa-cta-band--center) .asa-cta-band__card { grid-template-columns: 1fr auto; align-items: center; gap: 48px; }
}

/* ---------- Chip (x-ui.chip) and pagination (x-ui.pagination) ---------- */
.asa-chip {
    display: inline-flex; align-items: center; min-height: 28px; padding: 2px 12px;
    border-radius: var(--asa-radius-pill); background: rgba(var(--asa-mint-rgb), .45);
    color: var(--asa-navy); font-size: 13px; font-weight: 600; line-height: 1.2; text-decoration: none;
}
html.dark .asa-chip { background: rgba(var(--asa-mint-rgb), .16); color: var(--asa-mint); }
.asa-chip--link { transition: background-color .2s var(--asa-ease); }
.asa-chip--link:hover { background: var(--asa-mint); color: var(--asa-navy); }
html.dark .asa-chip--link:hover { background: rgba(var(--asa-mint-rgb), .28); color: var(--asa-mint); }

/* ===== Pagination (x-ui.pagination) ===== */
.asa-pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.asa-pagination--spaced { margin-top: 48px; }
.asa-pagination__item {
    display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 12px;
    border-radius: var(--asa-radius-pill); color: var(--asa-text); font-weight: 600; font-size: 15px; text-decoration: none;
    border: 1px solid transparent; transition: background-color .2s var(--asa-ease), border-color .2s var(--asa-ease);
}
a.asa-pagination__item:hover { background: var(--asa-surface-2); border-color: var(--asa-border); color: var(--asa-text); }
.asa-pagination__item--current { background: var(--asa-accent); color: var(--asa-accent-contrast); }
.asa-pagination__item--disabled { opacity: .35; }
.asa-pagination__gap { color: var(--asa-text-muted); padding: 0 2px; }

/* ---------- Draft preview banner ---------- */

.asa-preview-banner {
    position: sticky; top: 0; z-index: 1000;
    padding: 10px 16px; text-align: center;
    background: #F4B740; color: #16233A;
    font-size: 14px; font-weight: 600;
}

/* ---------- Category icons: light / dark theme variants ---------- */
.asa-category-icon--dark { display: none !important; }
html.dark .asa-category-icon--light { display: none !important; }
html.dark .asa-category-icon--dark { display: block !important; }
