/* Shadcn-inspired portal theme (separate from IIS Bootstrap layout) */
:root {
    --ssp-background: hsl(0 0% 100%);
    --ssp-foreground: hsl(240 10% 3.9%);
    --ssp-muted: hsl(240 4.8% 95.9%);
    --ssp-muted-foreground: hsl(240 3.8% 46.1%);
    --ssp-border: hsl(240 5.9% 90%);
    --ssp-card: hsl(0 0% 100%);
    --ssp-primary: hsl(240 5.9% 10%);
    --ssp-primary-foreground: hsl(0 0% 98%);
    --ssp-accent: hsl(240 4.8% 95.9%);
    --ssp-radius: 0.5rem;
    --ssp-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

* {
    box-sizing: border-box;
}

body.ssp-body {
    margin: 0;
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: hsl(0 0% 98%);
    color: var(--ssp-foreground);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.ssp-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ssp-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--ssp-border);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
}

.ssp-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ssp-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.ssp-brand-mark {
    width: 2rem;
    height: 2rem;
    border-radius: var(--ssp-radius);
    background: var(--ssp-primary);
    color: var(--ssp-primary-foreground);
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.ssp-brand-text strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
}

.ssp-brand-text span {
    font-size: 0.75rem;
    color: var(--ssp-muted-foreground);
}

.ssp-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ssp-nav a {
    text-decoration: none;
    font-size: 0.875rem;
    color: var(--ssp-muted-foreground);
    padding: 0.375rem 0.625rem;
    border-radius: calc(var(--ssp-radius) - 2px);
}

.ssp-nav a:hover,
.ssp-nav a.is-active {
    color: var(--ssp-foreground);
    background: var(--ssp-accent);
}

.ssp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    border-radius: var(--ssp-radius);
    border: 1px solid var(--ssp-border);
    background: var(--ssp-background);
    color: var(--ssp-foreground);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ssp-btn:hover {
    background: var(--ssp-accent);
}

.ssp-btn-primary {
    background: var(--ssp-primary);
    color: var(--ssp-primary-foreground);
    border-color: var(--ssp-primary);
}

.ssp-btn-primary:hover {
    opacity: 0.92;
    background: var(--ssp-primary);
}

.ssp-main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2.5rem;
}

.ssp-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ssp-page-title {
    margin: 0;
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.ssp-page-desc {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: var(--ssp-muted-foreground);
    max-width: 42rem;
}

.ssp-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .ssp-stats {
        grid-template-columns: 1fr;
    }
}

.ssp-card {
    background: var(--ssp-card);
    border: 1px solid var(--ssp-border);
    border-radius: var(--ssp-radius);
    box-shadow: var(--ssp-shadow);
}

.ssp-stat-card {
    padding: 1rem 1.125rem;
}

.ssp-stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ssp-muted-foreground);
}

.ssp-stat-value {
    margin-top: 0.25rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ssp-stat-hint {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--ssp-muted-foreground);
}

.ssp-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 992px) {
    .ssp-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .ssp-grid {
        grid-template-columns: 1fr;
    }
}

.ssp-story-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.125rem;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.ssp-story-card:hover {
    border-color: hsl(240 5.9% 80%);
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.06);
}

.ssp-story-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
}

.ssp-badge {
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--ssp-border);
    background: var(--ssp-muted);
    color: var(--ssp-muted-foreground);
}

.ssp-story-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

.ssp-story-title a {
    color: inherit;
    text-decoration: none;
}

.ssp-story-title a:hover {
    text-decoration: underline;
}

.ssp-story-excerpt {
    margin: 0;
    flex: 1;
    font-size: 0.875rem;
    color: var(--ssp-muted-foreground);
}

.ssp-story-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ssp-border);
    font-size: 0.75rem;
    color: var(--ssp-muted-foreground);
}

.ssp-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--ssp-muted-foreground);
}

.ssp-prose {
    max-width: 48rem;
    font-size: 0.9375rem;
}

.ssp-prose p {
    margin: 0 0 1rem;
}

.ssp-rich-text .ssp-story-lead {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ssp-border);
    font-size: 1.025rem;
    line-height: 1.6;
}

.ssp-rich-text .ssp-story-body {
    line-height: 1.65;
}

.ssp-rich-text h1,
.ssp-rich-text h2,
.ssp-rich-text h3,
.ssp-rich-text h4 {
    margin: 1.25rem 0 0.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.ssp-rich-text ul,
.ssp-rich-text ol {
    margin: 0 0 1rem 1.25rem;
    padding: 0;
}

.ssp-rich-text li {
    margin-bottom: 0.35rem;
}

.ssp-rich-text a {
    color: hsl(240 5.9% 20%);
    text-decoration: underline;
}

.ssp-rich-text blockquote {
    margin: 0 0 1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--ssp-border);
    color: var(--ssp-muted-foreground);
}

.ssp-site-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem;
}

.ssp-site-tags--compact {
    margin: 0.5rem 0 0.75rem;
}

.ssp-site-tag {
    display: inline-flex;
    flex-direction: column;
    gap: 0.125rem;
    max-width: 100%;
    padding: 0.375rem 0.625rem;
    border-radius: calc(var(--ssp-radius) - 2px);
    border: 1px solid var(--ssp-border);
    background: var(--ssp-muted);
    font-size: 0.75rem;
}

.ssp-site-tag__name {
    font-weight: 600;
    color: var(--ssp-foreground);
    line-height: 1.25;
}

.ssp-site-tag__geo {
    color: var(--ssp-muted-foreground);
    line-height: 1.25;
}

.ssp-footer {
    border-top: 1px solid var(--ssp-border);
    padding: 1rem 1.25rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--ssp-muted-foreground);
}

.ssp-layout-two {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .ssp-layout-two {
        grid-template-columns: 1fr;
    }
}

.ssp-sidebar-card {
    padding: 1rem;
}

.ssp-sidebar-card h3 {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.ssp-related-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ssp-related-list li + li {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ssp-border);
}

.ssp-related-list a {
    font-size: 0.8125rem;
    color: var(--ssp-foreground);
    text-decoration: none;
    font-weight: 500;
}

.ssp-related-list a:hover {
    text-decoration: underline;
}
