/* ============================================
   Training Portal — Shell Styles
   Inherits: sr-design-tokens.css (Dusk Ember palette, typography tokens)
   Scope: portal header, footer, layout, course-hero, container
   ============================================ */

/* ── Reset / Base ── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--surface-page);
    color: var(--text-body);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    margin: 0 0 0.5em;
    line-height: 1.3;
    color: var(--text-primary);
    font-family: var(--font-title);
}

p {
    margin: 0 0 1em;
}

a {
    color: var(--thread-renergence);
}

a:focus-visible {
    outline: 2px solid var(--thread-renergence);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ── Portal Header ── */
.portal-header {
    height: 52px;
    background: var(--surface-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.portal-header__inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
}

.portal-header__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.portal-header__admin {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--thread-renergence);
    text-decoration: none;
    padding: 0.25rem 0.625rem;
    border: 1px solid var(--thread-renergence);
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}
.portal-header__admin:hover {
    background: var(--thread-renergence);
    color: #fff;
}

.portal-header__logout {
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-decoration: none;
    flex-shrink: 0;
}
.portal-header__logout:hover {
    color: var(--text-secondary);
}

.portal-header__mark {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--thread-renergence);
}

.portal-header__brand {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--thread-renergence);
    font-weight: 600;
    font-size: var(--text-sm);
    letter-spacing: -0.01em;
}

.portal-header__brand:hover {
    color: #0a0d50;
}

.portal-header__sep {
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 300;
    user-select: none;
}

.portal-header__context {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.portal-header__course {
    font-size: var(--text-sm);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

@media (max-width: 600px) {
    .portal-header__course {
        display: none;
    }
}

/* ── Portal Footer ── */
.portal-footer {
    margin-top: 4rem;
    border-top: 1px solid var(--surface-card-border);
    padding: 1.25rem 0;
    background: var(--surface-card);
}

.portal-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.portal-footer__link {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-decoration: none;
}

.portal-footer__link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.portal-footer__copy {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .portal-footer__inner {
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }
}

/* ── Container ── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Course Hero ── */
.course-hero {
    position: relative;
    overflow: hidden;
    padding: 3rem 0;
    text-align: center;
}

.course-hero .container {
    position: relative;
    z-index: 2;
}

.course-hero h1 {
    font-size: clamp(1.5rem, 3vw + 1rem, 2.25rem);
    color: #fff;
    margin-bottom: 0.5rem;
    font-family: var(--font-title);
    border-top: none;
    padding-top: 0;
}

.page-intro {
    font-size: var(--text-md, 1rem);
    line-height: 1.5;
}

.course-hero .page-intro {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0;
}

.course-hero__back-wrap {
    margin-bottom: 0.75rem;
    text-align: left;
}

.course-hero__back {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: var(--text-sm);
    transition: color 0.15s;
}

.course-hero__back:hover {
    color: rgba(255, 255, 255, 0.9);
}

.course-hero__back:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
    border-radius: 2px;
}

.course-hero__mark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    height: 420px;
    opacity: 0.45;
    z-index: 1;
    pointer-events: none;
}

@media (min-width: 768px) {
    .course-hero__mark {
        width: 560px;
        height: 560px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .course-hero__mark { opacity: 0.10; }
}

/* Thread background colors */
.course-hero--renergence { background: var(--thread-renergence); }
.course-hero--hnr        { background: var(--thread-hnr); }
.course-hero--mn         { background: var(--thread-mn-deep); }
.course-hero--engagement { background: var(--thread-engagement); }

/* ── About Section (main content wrapper) ── */
.about-section {
    padding: 2.5rem 0;
}

/* ── Accessibility ── */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--thread-renergence);
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: var(--text-sm);
    z-index: 9999;
    transition: top 0.1s;
}

.skip-link:focus {
    top: 0;
}
