/* ========================================================================
   SL OnStage — Article & DevNotes Styling
   Backstage Pass / Cotton Candy Fuego aesthetic — wide-format layout
   ======================================================================== */

/* -- Reading Progress Bar ------------------------------------------------ */
.slo-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--slo-purple) 0%, var(--slo-magenta) 100%);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
    z-index: 9999;
    transition: width 80ms linear;
}

/* -- Article Hero / Header -- Full Bleed --------------------------------- */
.slo-article-hero {
    position: relative;
    width: 100%;
    padding: 72px 0 0;
}

.slo-article-hero__viewport {
    position: relative;
    width: 100%;
    max-height: 56vh;
    overflow: hidden;
}

.slo-article-hero__viewport::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(14, 10, 20, 0.15) 0%,
        transparent 20%,
        transparent 40%,
        rgba(14, 10, 20, 0.5) 70%,
        var(--slo-bg) 100%
    );
    z-index: 1;
    pointer-events: none;
}

.slo-article-hero__viewport::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(168, 85, 247, 0.05);
    z-index: 2;
    pointer-events: none;
}

.slo-article-hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slo-article-hero__corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: rgba(168, 85, 247, 0.2);
    border-style: solid;
    border-width: 0;
    z-index: 3;
    pointer-events: none;
}
.slo-article-hero__corner--tl { top: 12px; left: 12px; border-top-width: 1px; border-left-width: 1px; }
.slo-article-hero__corner--tr { top: 12px; right: 12px; border-top-width: 1px; border-right-width: 1px; }
.slo-article-hero__corner--bl { bottom: 12px; left: 12px; border-bottom-width: 1px; border-left-width: 1px; }
.slo-article-hero__corner--br { bottom: 12px; right: 12px; border-bottom-width: 1px; border-right-width: 1px; }

/* -- Article Layout -- Sidebar + Content Grid ---------------------------- */
.slo-article-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0 48px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px clamp(24px, 4vw, 64px) 0;
}

.slo-article-hero ~ .slo-article-layout {
    padding-top: 0;
}

/* -- Sidebar -- Telemetry Rail ------------------------------------------- */
.slo-article-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
    padding: 32px 0;
    height: fit-content;
}

.slo-article-sidebar__section {
    margin-bottom: 32px;
}

.slo-article-sidebar__label {
    display: block;
    font-family: var(--slo-font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--slo-purple);
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 8px;
}

.slo-article-sidebar__value {
    font-family: var(--slo-font-mono);
    font-size: 12px;
    color: var(--slo-text-secondary);
    line-height: 1.5;
}

.slo-article-sidebar__divider {
    height: 1px;
    background: var(--slo-border);
    margin: 0 0 32px;
}

.slo-article-sidebar__tags {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slo-article-sidebar__tag {
    font-family: var(--slo-font-mono);
    font-size: 11px;
    color: var(--slo-text-muted);
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.slo-article-sidebar__tag::before {
    content: '\25B9 ';
    color: var(--slo-purple);
    opacity: 0.4;
}

.slo-article-sidebar__tag:hover {
    color: var(--slo-purple);
}

.slo-article-sidebar__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--slo-font-mono);
    font-size: 11px;
    color: var(--slo-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.slo-article-sidebar__back:hover {
    color: var(--slo-purple);
}

/* Sidebar progress indicator */
.slo-article-sidebar__progress-track {
    width: 100%;
    height: 2px;
    background: var(--slo-border);
    margin-top: 8px;
    overflow: hidden;
}

.slo-article-sidebar__progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--slo-purple), var(--slo-magenta));
    transition: width 80ms linear;
}

/* -- Article Main Content Area ------------------------------------------- */
.slo-article-main {
    min-width: 0;
    padding: 32px 0 80px;
}

/* -- Article Meta -------------------------------------------------------- */
.slo-article-meta {
    max-width: 840px;
    margin: 0 0 40px;
    padding: 0;
}

.slo-article-meta__title {
    font-family: var(--slo-font-display);
    font-size: clamp(32px, 4.5vw, 52px);
    font-weight: 700;
    color: var(--slo-text);
    line-height: 1.1;
    letter-spacing: -1px;
    margin: 0 0 16px;
}

.slo-article-meta__excerpt {
    font-family: var(--slo-font);
    font-size: 18px;
    color: var(--slo-text-secondary);
    line-height: 1.65;
    margin: 0 0 24px;
    max-width: 720px;
}

.slo-article-meta__telemetry {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 0;
    border-top: 1px solid var(--slo-border);
    border-bottom: 1px solid var(--slo-border);
    font-family: var(--slo-font-mono);
    font-size: 11px;
    color: var(--slo-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slo-article-meta__telemetry-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.slo-article-meta__telemetry-label {
    color: var(--slo-purple);
    opacity: 0.5;
}

.slo-article-meta__telemetry-value {
    color: var(--slo-text-secondary);
}

/* -- Article Body -------------------------------------------------------- */
.slo-article-body {
    max-width: 840px;
    margin: 0;
    padding: 0;
    font-family: var(--slo-font);
    font-size: 18px;
    line-height: 1.85;
    color: var(--slo-text-secondary);
}

/* - Headings - */
.slo-article-body h1 {
    font-family: var(--slo-font-display);
    font-size: clamp(28px, 3.5vw, 36px);
    font-weight: 700;
    color: var(--slo-text);
    margin: 64px 0 20px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.slo-article-body h2 {
    font-family: var(--slo-font-display);
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 600;
    color: var(--slo-text);
    margin: 56px 0 16px;
    padding-left: 16px;
    border-left: 2px solid var(--slo-purple);
    letter-spacing: -0.3px;
    line-height: 1.25;
}

.slo-article-body h3 {
    font-family: var(--slo-font-display);
    font-size: clamp(20px, 2.5vw, 24px);
    font-weight: 600;
    color: var(--slo-text);
    margin: 44px 0 12px;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.slo-article-body h4 {
    font-family: var(--slo-font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--slo-purple);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 36px 0 12px;
}

/* - Paragraphs - */
.slo-article-body p {
    margin: 0 0 28px;
}

/* - Strong / Emphasis - */
.slo-article-body strong {
    color: var(--slo-text);
    font-weight: 600;
}

.slo-article-body em {
    color: var(--slo-text);
    font-style: italic;
}

/* - Links - */
.slo-article-body a {
    color: var(--slo-purple);
    text-decoration: none;
    border-bottom: 1px solid rgba(168, 85, 247, 0.25);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.slo-article-body a:hover {
    color: var(--slo-purple-hover);
    border-bottom-color: var(--slo-purple);
}

/* - Images: Wide Breakout - */
.slo-article-body img {
    display: block;
    width: calc(100% + 80px);
    margin-left: -40px;
    margin-top: 48px;
    margin-bottom: 48px;
    border: 1px solid var(--slo-border);
    transition: border-color 0.3s ease;
}

.slo-article-body img:hover {
    border-color: rgba(168, 85, 247, 0.15);
}

.slo-article-body p:has(> img) {
    position: relative;
}

/* - Blockquotes: Backstage Note - Wide - */
.slo-article-body blockquote {
    position: relative;
    width: calc(100% + 40px);
    margin-left: -20px;
    margin-top: 44px;
    margin-bottom: 44px;
    padding: 24px 28px;
    background: var(--slo-glass);
    border-left: 2px solid var(--slo-purple);
    font-size: 17px;
    color: var(--slo-text);
    line-height: 1.7;
}

.slo-article-body blockquote::before {
    content: '// BACKSTAGE';
    display: block;
    font-family: var(--slo-font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--slo-purple);
    opacity: 0.4;
    margin-bottom: 12px;
}

.slo-article-body blockquote p {
    margin: 0 0 8px;
}

.slo-article-body blockquote p:last-child {
    margin-bottom: 0;
}

/* - Code: Inline - */
.slo-article-body code {
    font-family: var(--slo-font-mono);
    font-size: 0.82em;
    padding: 2px 8px;
    background: rgba(168, 85, 247, 0.06);
    border: 1px solid rgba(168, 85, 247, 0.1);
    color: var(--slo-purple);
}

/* - Code: Block / Terminal Display - Wide - */
.slo-article-body pre {
    position: relative;
    width: calc(100% + 80px);
    margin-left: -40px;
    margin-top: 40px;
    margin-bottom: 40px;
    padding: 0;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--slo-border);
    overflow: hidden;
}

.slo-article-body pre::before {
    content: 'TERMINAL';
    display: block;
    padding: 8px 20px;
    font-family: var(--slo-font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--slo-purple);
    opacity: 0.4;
    background: rgba(168, 85, 247, 0.03);
    border-bottom: 1px solid var(--slo-border);
}

.slo-article-body pre code {
    display: block;
    padding: 20px 24px;
    background: transparent;
    border: none;
    color: var(--slo-text-secondary);
    font-size: 14px;
    line-height: 1.7;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* - Lists - */
.slo-article-body ul,
.slo-article-body ol {
    margin: 0 0 28px;
    padding-left: 0;
    list-style: none;
}

.slo-article-body ul li,
.slo-article-body ol li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 14px;
    line-height: 1.75;
}

.slo-article-body ul li::before {
    content: '\25B9';
    position: absolute;
    left: 0;
    color: var(--slo-purple);
    font-size: 14px;
}

.slo-article-body ol {
    counter-reset: article-counter;
}

.slo-article-body ol li {
    counter-increment: article-counter;
}

.slo-article-body ol li::before {
    content: counter(article-counter, decimal-leading-zero);
    position: absolute;
    left: 0;
    font-family: var(--slo-font-mono);
    font-size: 12px;
    color: var(--slo-purple);
    opacity: 0.6;
}

/* - Horizontal Rule: Divider - */
.slo-article-body hr {
    border: none;
    height: 1px;
    margin: 64px -40px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--slo-border) 10%,
        rgba(168, 85, 247, 0.12) 50%,
        var(--slo-border) 90%,
        transparent 100%
    );
    position: relative;
}

.slo-article-body hr::after {
    content: '\25C6';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    color: var(--slo-purple);
    opacity: 0.3;
    background: var(--slo-bg);
    padding: 0 16px;
}

/* - Tables - Wide - */
.slo-article-body table {
    width: calc(100% + 80px);
    margin: 40px 0 40px -40px;
    border-collapse: collapse;
    font-size: 14px;
}

.slo-article-body thead th {
    font-family: var(--slo-font-mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--slo-purple);
    text-align: left;
    padding: 10px 16px;
    border-bottom: 1px solid var(--slo-purple);
    opacity: 0.7;
}

.slo-article-body tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--slo-border);
    color: var(--slo-text-secondary);
}

.slo-article-body tbody tr:hover td {
    background: var(--slo-glass);
}

/* -- Article Tags (inline, below body) ----------------------------------- */
.slo-article-tags {
    max-width: 840px;
    margin: 0;
    padding: 0 0 48px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.slo-article-tags__label {
    font-family: var(--slo-font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--slo-text-muted);
    text-transform: uppercase;
    margin-right: 8px;
}

.slo-article-tag {
    font-family: var(--slo-font-mono);
    font-size: 11px;
    background: rgba(168, 85, 247, 0.08);
    color: var(--slo-purple);
    padding: 4px 12px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.slo-article-tag:hover {
    background: rgba(168, 85, 247, 0.2);
}

/* -- Article Card (Briefing Card) ---------------------------------------- */
.slo-briefing-card {
    position: relative;
    display: block;
    padding: 24px;
    margin-bottom: 2px;
    background: var(--slo-glass);
    border: 1px solid var(--slo-border);
    text-decoration: none;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.slo-briefing-card:hover {
    background: var(--slo-glass-strong);
    border-color: rgba(168, 85, 247, 0.2);
}

.slo-briefing-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.slo-briefing-card__date {
    font-family: var(--slo-font-mono);
    font-size: 11px;
    color: var(--slo-text-muted);
    letter-spacing: 0.5px;
}

.slo-briefing-card__type {
    font-family: var(--slo-font-mono);
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 3px 10px;
}

.slo-briefing-card__type--post {
    background: rgba(168, 85, 247, 0.08);
    color: var(--slo-purple);
}

.slo-briefing-card__type--backlink {
    background: rgba(236, 72, 153, 0.08);
    color: var(--slo-magenta);
}

.slo-briefing-card__title {
    font-family: var(--slo-font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--slo-text);
    line-height: 1.25;
    margin: 0 0 8px;
    transition: color 0.2s ease;
}

.slo-briefing-card:hover .slo-briefing-card__title {
    color: var(--slo-purple);
}

.slo-briefing-card__excerpt {
    font-family: var(--slo-font);
    font-size: 14px;
    color: var(--slo-text-muted);
    line-height: 1.6;
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slo-briefing-card__footer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slo-briefing-card__tag {
    font-family: var(--slo-font-mono);
    font-size: 10px;
    color: var(--slo-text-muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 2px 8px;
}

.slo-briefing-card__read-time {
    font-family: var(--slo-font-mono);
    font-size: 10px;
    color: var(--slo-text-muted);
    margin-left: auto;
    letter-spacing: 0.5px;
}

.slo-briefing-card__external {
    font-size: 11px;
    color: var(--slo-text-muted);
    margin-left: auto;
    transition: color 0.2s ease, transform 0.2s ease;
}

.slo-briefing-card:hover .slo-briefing-card__external {
    color: var(--slo-purple);
    transform: translateX(2px);
}

/* -- Image Card Variant -------------------------------------------------- */
.slo-briefing-card--has-image {
    background-size: cover;
    background-position: center;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

.slo-briefing-card--has-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(12,12,12,0.1) 0%, rgba(12,12,12,0.4) 35%, rgba(12,12,12,0.85) 65%, rgba(12,12,12,0.95) 100%);
    z-index: 0;
    transition: background 0.3s ease;
}

.slo-briefing-card--has-image:hover::before {
    background: linear-gradient(180deg, rgba(168,85,247,0.05) 0%, rgba(12,12,12,0.35) 35%, rgba(12,12,12,0.8) 65%, rgba(12,12,12,0.93) 100%);
}

.slo-briefing-card--has-image > * {
    position: relative;
    z-index: 1;
}

.slo-briefing-card--has-image .slo-briefing-card__header {
    margin-top: auto;
}

/* -- DevNotes Listing (Blog Home / Backstage Pass) ----------------------- */
.slo-devnotes {
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px clamp(24px, 4vw, 64px) 80px;
}

.slo-devnotes__header {
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--slo-border);
}

.slo-devnotes__label {
    display: block;
    font-family: var(--slo-font-mono);
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--slo-purple);
    text-transform: uppercase;
    margin-bottom: 12px;
    opacity: 0.6;
}

.slo-devnotes__title {
    font-family: var(--slo-font-display);
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    color: var(--slo-text);
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin: 0 0 8px;
}

.slo-devnotes__subtitle {
    font-family: var(--slo-font);
    font-size: 15px;
    color: var(--slo-text-muted);
    margin: 0;
}

.slo-devnotes__count {
    font-family: var(--slo-font-mono);
    font-size: 11px;
    color: var(--slo-text-muted);
    margin-top: 16px;
}

.slo-devnotes__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2px;
}

/* -- Home Page DevNotes Section ------------------------------------------ */
.slo-devnotes-preview {
    max-width: var(--slo-page-width);
    margin: 0 auto;
}

.slo-devnotes-preview__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2px;
}

.slo-devnotes-preview__more {
    text-align: center;
    margin-top: 32px;
}

/* -- Responsive ---------------------------------------------------------- */

/* Tablet -- collapse sidebar, single column */
@media (max-width: 1024px) {
    .slo-article-layout {
        grid-template-columns: 1fr;
        gap: 0;
        max-width: 840px;
    }

    .slo-article-sidebar {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 20px 40px;
        padding: 24px 0;
        border-bottom: 1px solid var(--slo-border);
        margin-bottom: 8px;
    }

    .slo-article-sidebar__section {
        margin-bottom: 0;
    }

    .slo-article-sidebar__divider {
        display: none;
    }

    .slo-article-sidebar__tags {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px 12px;
    }

    .slo-article-sidebar__progress-track {
        display: none;
    }

    /* Reset breakout on tablet */
    .slo-article-body img,
    .slo-article-body pre,
    .slo-article-body table {
        width: 100%;
        margin-left: 0;
    }

    .slo-article-body blockquote {
        width: 100%;
        margin-left: 0;
    }

    .slo-article-body hr {
        margin-left: 0;
        margin-right: 0;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .slo-article-hero__viewport {
        max-height: 40vh;
    }

    .slo-article-meta__title {
        font-size: 28px;
    }

    .slo-article-meta__telemetry {
        flex-wrap: wrap;
        gap: 12px;
    }

    .slo-article-body {
        font-size: 16px;
    }

    .slo-article-body h2 {
        margin-top: 40px;
    }

    .slo-article-body pre code {
        font-size: 13px;
    }

    .slo-devnotes__grid,
    .slo-devnotes-preview__grid {
        grid-template-columns: 1fr;
    }

    .slo-briefing-card {
        padding: 20px;
    }

    .slo-article-sidebar {
        flex-direction: column;
        gap: 12px;
    }
}
