/* =====================================================
   SINGLE POST — hero (breadcrumbs + label + title + meta | featured image)
   ===================================================== */

.sp-hero {
    padding: 120px 0 80px;
}

.sp-hero__layout {
    display: grid;
    grid-template-columns: minmax(0, 611fr) minmax(0, 665fr);
    gap: 84px;
    align-items: center;
}

.sp-hero--no-image .sp-hero__layout {
    grid-template-columns: minmax(0, 900px);
}

/* Breadcrumbs */

.sp-hero__breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 40px;
    font-family: "SF UI Display", sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 1%;
}

.sp-hero__crumb {
    color: #F7F7F7;
    text-decoration: none;
    transition: color 0.22s ease;
}

a.sp-hero__crumb:hover {
    color: #FF9626;
}

.sp-hero__crumb-sep {
    color: #F7F7F7;
}

.sp-hero__crumb--current {
    font-weight: 600;
}

/* Label */

.sp-hero__label {
    display: inline-block;
    margin-bottom: 36px;
    font-family: 'MonoBlack', sans-serif;
    text-transform: uppercase;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.2em;
    background: linear-gradient(90deg, #FF9626 0%, #FFB15D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Title */

.sp-hero__title {
    margin: 0 0 40px;
    font-family: "SF UI Display", sans-serif;
    color: #F7F7F7;
    text-transform: none;
    font-weight: 400;
    font-size: 44px;
    line-height: 57px;
    letter-spacing: -2%;
}

.sp-hero__title-accent {
    color: #FF9626;
}

/* Meta */

.sp-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 40px;
    font-family: "SF UI Display", sans-serif;
    color: #F7F7F7;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 1%;
}

.sp-hero__byline {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sp-hero__author {
    color: #FF9626;
}

.sp-hero__read {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sp-hero__read svg {
    flex-shrink: 0;
}

/* Featured image */

.sp-hero__media {
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 665 / 440;
    background: #141517;
}

.sp-hero__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Reveal on load — only when single-post.js is running (image stays visible without JS) */
.sp-hero.has-js .sp-hero__img {
    opacity: 0;
    transform: scale(1.03);
    transition: opacity 0.6s ease, transform 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.sp-hero.has-js .sp-hero__img.is-loaded {
    opacity: 1;
    transform: none;
}

/* =====================================================
   POST ARTICLE — layout (table of contents | content)
   ===================================================== */

.sp-article {
    padding: 0 0 120px;
}

.sp-article__layout {
    /* aside | content | mirror of the aside — keeps the content card centred on the page */
    display: grid;
    grid-template-columns: minmax(250px, 1fr) minmax(0, 705px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.sp-article__aside {
    grid-column: 1;
    justify-self: end;
    width: 250px;
}

.sp-article__main {
    grid-column: 2;
}

.sp-article--no-toc .sp-article__layout {
    grid-template-columns: minmax(0, 705px);
    justify-content: center;
}

.sp-article--no-toc .sp-article__main {
    grid-column: 1;
}

.sp-article__aside {
    /* --sp-aside-top is set by single-post.js: 96px when the aside fits the screen,
       negative when it is taller — then it sticks by its bottom edge (no inner scroll) */
    position: sticky;
    top: var(--sp-aside-top, 96px);
    padding-top: 36px;
}

.sp-article__main {
    min-width: 0;
}

.sp-article__anchor {
    display: block;
    height: 0;
}

.sp-article__anchor + * {
    margin-top: 0 !important;
}

/* Table of contents — built from the H2 Heading blocks of the post */

.sp-toc__title {
    margin: 0 0 20px;
    font-family: "SF UI Display", sans-serif;
    color: #F7F7F7;
    font-weight: 400;
    font-size: 18px;
    line-height: 26px;
    letter-spacing: 1%;
}

.sp-toc__list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sp-toc__link {
    display: block;
    font-family: "SF UI Display", sans-serif;
    color: #F7F7F7;
    text-decoration: none;
    font-weight: 400;
    font-size: 12px;
    line-height: 18px;
    letter-spacing: 1%;
    transition: color 0.22s ease;
}

.sp-toc__link:hover,
.sp-toc__link:focus-visible,
.sp-toc__link.is-active {
    color: #FF9626;
}

/* Subscribe box — under the table of contents (Site Settings → "Blog — Subscribe Box") */

.sp-subscribe {
    margin-top: 20px;
    padding: 24px 18px 30px;
    border-radius: 12px;
    background: linear-gradient(180deg, #D7C6B5 0%, #E2742F 22%, #D35A25 40%, #BF3A1D 60%, #6B1C0F 82%, #0B0D0F 100%);
    color: #F7F7F7;
    font-family: "SF UI Display", sans-serif;
}

.sp-toc + .sp-subscribe {
    margin-top: 20px;
}

.sp-article__aside > .sp-subscribe:first-child {
    margin-top: 0;
}

.sp-subscribe__heading {
    margin: 0 0 20px;
    font-weight: 500;
    font-size: 18px;
    line-height: 25px;
    letter-spacing: 0;
}

.sp-subscribe__text {
    margin: 0 0 16px;
    font-weight: 400;
    font-size: 13px;
    line-height: 18px;
    letter-spacing: 1%;
}

.sp-subscribe__form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sp-subscribe__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.sp-subscribe__input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    background-color: #F7F7F7;
    border: 1px solid #D9D9D9;
    border-radius: 6px;
    outline: none;
    font-family: "SF UI Display", sans-serif;
    color: #0B0D0F;
    font-weight: 400;
    font-size: 13px;
    line-height: 18px;
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.sp-subscribe__input::placeholder {
    color: #575757;
    opacity: 1;
}

.sp-subscribe__input:focus {
    border-color: #FF9626;
    box-shadow: 0 0 0 2px rgba(255, 150, 38, 0.35);
}

.sp-subscribe__input.is-invalid {
    border-color: #CF2201;
}

.sp-subscribe__btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    height: 40px;
    padding: 0 4px 0 12px;
    background: linear-gradient(180deg, #333436 0%, #1E1E1F 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: "SF UI Display", sans-serif;
    color: #F7F7F7;
    font-weight: 500;
    font-size: 13px;
    line-height: 18px;
    text-align: left;
    transition: background 0.22s ease;
}

.sp-subscribe__btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background-color: #F7F7F7;
    border-radius: 4px;
    transition: background-color 0.22s ease;
}

.sp-subscribe__btn:hover .sp-subscribe__btn-icon,
.sp-subscribe__btn:focus-visible .sp-subscribe__btn-icon {
    background-color: #FF9626;
}

.sp-subscribe__btn:disabled {
    cursor: default;
    opacity: 0.7;
}

.sp-subscribe__status {
    min-height: 0;
    margin: 0;
    font-size: 12px;
    line-height: 16px;
    color: #F7F7F7;
}

.sp-subscribe__status:empty {
    display: none;
}

.sp-subscribe.is-done .sp-subscribe__input,
.sp-subscribe.is-done .sp-subscribe__btn {
    display: none;
}

/* =====================================================
   POST CONTENT — card + styles for native Gutenberg blocks
   (paragraph, heading, list, quote, image, table, separator…)
   ===================================================== */

.sp-content__body {
    --sp-card-pad: 37px;

    padding: 36px var(--sp-card-pad) 44px;
    background-color: #141517;
    border: 1px solid #1E1E1F;
    border-radius: 12px;
    font-family: "SF UI Display", sans-serif;
    color: #F7F7F7;
    font-weight: 400;
    font-size: 16px;
    line-height: 22px;
    letter-spacing: 1%;
    overflow-wrap: break-word;
}

/* Vertical rhythm between top-level blocks */
.sp-content__body > * {
    margin-top: 0;
    margin-bottom: 0;
}

.sp-content__body > * + * {
    margin-top: 16px;
}

/* Paragraph */

.sp-content__body strong,
.sp-content__body b {
    font-weight: 600;
}

/* Lead paragraph — Paragraph block → Typography → size "Lead" */
.sp-content__body .has-lead-font-size {
    font-size: 26px;
    line-height: 36px;
    letter-spacing: -1%;
}

.sp-content__body > .has-lead-font-size + * {
    margin-top: 24px;
}

/* Links */

.sp-content__body a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.22s ease;
}

.sp-content__body a:hover {
    color: #FF9626;
}

/* Headings */

.sp-content__body > h2,
.sp-content__body > h3,
.sp-content__body > h4,
.sp-content__body > h5,
.sp-content__body > h6 {
    font-family: "SF UI Display", sans-serif;
    color: #F7F7F7;
    text-transform: none;
    letter-spacing: 0;
}

.sp-content__body > h2 {
    font-weight: 500;
    font-size: 22px;
    line-height: 30px;
}

.sp-content__body > h3 {
    font-weight: 500;
    font-size: 19px;
    line-height: 26px;
}

.sp-content__body > h4,
.sp-content__body > h5,
.sp-content__body > h6 {
    font-weight: 600;
    font-size: 16px;
    line-height: 22px;
}

.sp-content__body > * + h2 {
    margin-top: 24px;
}

.sp-content__body > * + h3,
.sp-content__body > * + h4,
.sp-content__body > * + h5,
.sp-content__body > * + h6 {
    margin-top: 22px;
}

.sp-content__body > h2 + *,
.sp-content__body > h3 + *,
.sp-content__body > h4 + * {
    margin-top: 14px;
}

/* Quote — the italic "note" (Quote block) */

.sp-content__body > blockquote,
.sp-content__body > .wp-block-quote {
    margin-left: 0;
    margin-right: 0;
    padding: 0 0 0 6px;
    border: none;
    font-style: italic;
}

.sp-content__body > * + blockquote,
.sp-content__body > * + .wp-block-quote,
.sp-content__body > blockquote + *,
.sp-content__body > .wp-block-quote + * {
    margin-top: 20px;
}

.sp-content__body blockquote p + p {
    margin-top: 12px;
}

.sp-content__body blockquote cite {
    display: block;
    margin-top: 10px;
    font-style: normal;
    font-size: 14px;
    line-height: 20px;
    color: #B9B9BA;
}

/* Pull quote — accented variant */

.sp-content__body > .wp-block-pullquote {
    margin-left: 0;
    margin-right: 0;
    padding: 20px 0 20px 20px;
    border-left: 2px solid #FF9626;
    font-size: 20px;
    line-height: 28px;
}

.sp-content__body .wp-block-pullquote blockquote {
    margin: 0;
    padding: 0;
    font-style: normal;
}

/* Lists (top level; the TL;DR block styles its own) */

.sp-content__body > ul,
.sp-content__body > ol {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    list-style: none;
}

.sp-content__body > ul li,
.sp-content__body > ol li {
    position: relative;
    padding-left: 24px;
}

.sp-content__body > ul li::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 9px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: currentColor;
}

.sp-content__body > ol {
    counter-reset: sp-ol;
}

.sp-content__body > ol > li {
    counter-increment: sp-ol;
}

.sp-content__body > ol > li::before {
    content: counter(sp-ol) ".";
    position: absolute;
    left: 0;
    top: 0;
}

.sp-content__body li ul,
.sp-content__body li ol {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding: 0;
    list-style: none;
}

/* Images / media */

.sp-content__body figure {
    margin-left: 0;
    margin-right: 0;
}

.sp-content__body img,
.sp-content__body video,
.sp-content__body iframe {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.sp-content__body > * + figure,
.sp-content__body > figure + * {
    margin-top: 24px;
}

.sp-content__body figcaption {
    margin-top: 10px;
    font-size: 14px;
    line-height: 20px;
    color: #B9B9BA;
}

.sp-content__body .aligncenter {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.sp-content__body .wp-block-embed__wrapper iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
}

/* Table */

.sp-content__body .wp-block-table {
    overflow-x: auto;
}

.sp-content__body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 21px;
}

.sp-content__body th,
.sp-content__body td {
    padding: 10px 12px;
    border: 1px solid #2A2A2C;
    text-align: left;
    vertical-align: top;
}

.sp-content__body th,
.sp-content__body thead td {
    font-weight: 600;
    background-color: #1E1E1F;
}

/* Separator / code */

.sp-content__body hr,
.sp-content__body .wp-block-separator {
    height: 0;
    margin-top: 32px;
    margin-bottom: 32px;
    border: none;
    border-top: 1px solid #2A2A2C;
}

.sp-content__body code {
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #1E1E1F;
    font-size: 0.9em;
}

.sp-content__body pre {
    overflow-x: auto;
    padding: 16px;
    border-radius: 12px;
    background-color: #0B0D0F;
    font-size: 14px;
    line-height: 20px;
}

.sp-content__body pre code {
    padding: 0;
    background: none;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1200px) {
    .sp-hero__layout {
        gap: 48px;
    }

    .sp-hero__title {
        font-size: 38px;
        line-height: 48px;
    }
}

@media (max-width: 1024px) {
    .sp-hero__layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    .sp-article__layout,
    .sp-article--no-toc .sp-article__layout {
        grid-template-columns: minmax(0, 705px);
        justify-content: center;
        gap: 32px;
    }

    .sp-article__aside,
    .sp-article__main,
    .sp-article--no-toc .sp-article__main {
        grid-column: 1;
    }

    .sp-article__aside {
        justify-self: stretch;
        width: auto;
        position: static;
        padding: 24px;
        background: #141517;
        border: 1px solid #1E1E1F;
        border-radius: 12px;
    }

    .sp-toc__link {
        font-size: 14px;
        line-height: 20px;
    }

    /* Aside becomes a plain stack: TOC card + subscribe card */
    .sp-article__aside:has(.sp-subscribe) {
        padding: 0;
        background: none;
        border: none;
    }

    .sp-article__aside:has(.sp-subscribe) .sp-toc {
        padding: 24px;
        background: #141517;
        border: 1px solid #1E1E1F;
        border-radius: 12px;
    }

    .sp-subscribe {
        max-width: 420px;
        padding: 28px 24px 32px;
    }

    .sp-subscribe__heading {
        font-size: 22px;
        line-height: 30px;
    }

    .sp-subscribe__text,
    .sp-subscribe__input,
    .sp-subscribe__btn {
        font-size: 15px;
    }

    .sp-subscribe__input {
        height: 44px;
    }

    .sp-subscribe__btn {
        height: 48px;
    }

    .sp-subscribe__btn-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 768px) {
    .sp-hero {
        padding: 110px 0 56px;
    }

    .sp-hero__breadcrumbs {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .sp-hero__label {
        margin-bottom: 20px;
        font-size: 12px;
    }

    .sp-hero__title {
        margin-bottom: 24px;
        font-size: 30px;
        line-height: 38px;
    }

    .sp-hero__meta {
        gap: 8px 24px;
    }

    .sp-article {
        padding-bottom: 80px;
    }

    .sp-content__body {
        --sp-card-pad: 20px;
        padding-top: 24px;
        padding-bottom: 32px;
    }

    .sp-content__body > h2 {
        font-size: 20px;
        line-height: 28px;
    }

    .sp-content__body .has-lead-font-size {
        font-size: 22px;
        line-height: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sp-hero.has-js .sp-hero__img {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
