/* Shared components - one definition per component, used by every page type.
   Page stylesheets may add layout around these but must not redefine them. */

/* Accessibility primitives */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute;
    left: var(--space-4);
    top: -100px;
    z-index: calc(var(--z-modal) + 1);
    padding: var(--space-3) var(--space-4);
    background: var(--dark);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { top: var(--space-2); }

:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
    box-sizing: border-box;
}

/* Links inside running text */
main p a:not([class]),
main li a:not([class]),
main td a:not([class]) {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}
main p a:not([class]):hover,
main li a:not([class]):hover { color: var(--brand-dark); }

/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--tap);
    padding: 0.875rem 1.75rem;
    font-size: var(--fs-base);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    border-radius: var(--radius);
    border: 2px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 4px 14px rgba(194, 65, 12, 0.3);
}
.btn-primary:hover {
    background: var(--brand-dark);
    color: #fff;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #fff;
    color: var(--ink);
    border-color: var(--border-strong);
}
.btn-secondary:hover {
    border-color: var(--brand);
    color: var(--brand);
}

/* Section headings */
.section-title {
    font-size: var(--fs-3xl);
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
    margin: 0 0 var(--space-4);
}
.section-subtitle {
    font-size: var(--fs-lg);
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto var(--space-8);
}

/* Call-to-action band (dark enough for white text: 5.2:1+) */
.cta-section {
    padding: var(--space-16) 0;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    text-align: center;
}
.cta-section h2,
.cta-section p { color: #fff; }
.cta-section .btn-primary {
    background: #fff;
    color: var(--brand-dark);
}
.cta-section .btn-primary:hover { background: var(--brand-tint); }
.cta-section .btn-secondary {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: var(--fs-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    background: var(--brand-tint);
    color: var(--brand-dark);
}

/* Responsive tables */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
