/* =========================================================
   StaticPress – main.css
   All frontend styles. Uses CSS custom properties from :root.
   ========================================================= */

/* ── Reset & Base ───────────────────────────────────────── */
html { font-size: var(--sp-font-size-base); scroll-behavior: smooth; }
body {
    font-family: var(--sp-font-body);
    font-size:   1rem;
    font-weight: var(--sp-font-weight-normal);
    line-height: var(--sp-line-height-normal);
    color:       var(--sp-color-text);
    background:  var(--sp-color-bg);
    -webkit-font-smoothing: antialiased;
    transition: background var(--sp-transition-base), color var(--sp-transition-base);
}
a       { color: var(--sp-color-link); text-decoration: underline; text-underline-offset: 3px; transition: color var(--sp-transition-fast); }
a:hover { color: var(--sp-color-link-hover); }
img, video, svg { max-width: 100%; height: auto; display: block; }
picture { display: block; }
h1,h2,h3,h4,h5,h6 {
    font-family:   var(--sp-font-heading);
    font-weight:   var(--sp-font-weight-bold);
    line-height:   var(--sp-line-height-tight);
    color:         var(--sp-color-heading);
    margin-bottom: 0.5em;
}
h1 { font-size: clamp(2rem, 5vw, var(--sp-font-size-5xl)); }
h2 { font-size: clamp(1.5rem, 4vw, var(--sp-font-size-4xl)); }
h3 { font-size: clamp(1.25rem, 3vw, var(--sp-font-size-3xl)); }
h4 { font-size: var(--sp-font-size-2xl); }
h5 { font-size: var(--sp-font-size-xl); }
h6 { font-size: var(--sp-font-size-lg); }
p  { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* ── Dark mode ─────────────────────────────────────────── */
.sp-dark {
    --sp-color-bg:       var(--sp-dark-bg);
    --sp-color-bg-alt:   #161B22;
    --sp-color-surface:  var(--sp-dark-surface);
    --sp-color-border:   var(--sp-dark-border);
    --sp-color-text:     var(--sp-dark-text);
    --sp-color-text-muted: var(--sp-dark-text-muted);
    --sp-color-heading:  #F0F6FC;
}
@media (prefers-color-scheme: dark) {
    body:not(.sp-light) {
        --sp-color-bg:      var(--sp-dark-bg);
        --sp-color-surface: var(--sp-dark-surface);
        --sp-color-border:  var(--sp-dark-border);
        --sp-color-text:    var(--sp-dark-text);
        --sp-color-heading: #F0F6FC;
    }
}

/* ── Container ─────────────────────────────────────────── */
.sp-container {
    width:   100%;
    max-width: var(--sp-container-max);
    margin:  0 auto;
    padding: 0 var(--sp-container-pad);
}
.sp-container--wide   { max-width: var(--sp-container-wide); }
.sp-container--narrow { max-width: var(--sp-container-narrow); }
.sp-container--full   { max-width: 100%; padding: 0; }

/* ── Header ─────────────────────────────────────────────── */
.sp-header {
    position:   relative;
    z-index:    var(--sp-z-sticky);
    background: var(--sp-header-bg, var(--sp-color-bg));
    color:      var(--sp-header-color, var(--sp-color-text));
    border-bottom: 1px solid var(--sp-color-border);
    transition: all var(--sp-transition-base);
}
.sp-header--sticky { position: sticky; top: 0; }
.sp-header--transparent { background: transparent; border-bottom: none; position: absolute; width: 100%; }
.sp-header--transparent .sp-header__site-name,
.sp-header--transparent .sp-nav__link { color: #fff; }
.sp-header--scrolled { background: var(--sp-color-bg) !important; border-bottom: 1px solid var(--sp-color-border); box-shadow: var(--sp-shadow-sm); }

.sp-header__inner {
    display:     flex;
    align-items: center;
    gap:         var(--sp-space-6);
    height:      var(--sp-header-height);
}
.sp-header__logo { flex-shrink: 0; }
.sp-header__logo a { display: flex; align-items: center; text-decoration: none; }
.sp-header__logo img { height: var(--sp-logo-width, 160px); width: auto; max-height: 56px; }
.sp-header__site-name {
    font-family: var(--sp-font-heading);
    font-size:   var(--sp-font-size-xl);
    font-weight: var(--sp-font-weight-bold);
    color:       var(--sp-color-heading);
    text-decoration: none;
}
.sp-header__nav { flex: 1; display: flex; justify-content: center; }
.sp-header__actions { display: flex; align-items: center; gap: var(--sp-space-3); flex-shrink: 0; }

/* ── Navigation ─────────────────────────────────────────── */
.sp-nav__list { list-style: none; display: flex; gap: 0; margin: 0; padding: 0; }
.sp-nav__item { position: relative; }
.sp-nav__link {
    display:     block;
    padding:     var(--sp-space-2) var(--sp-space-4);
    font-weight: var(--sp-font-weight-medium);
    font-size:   var(--sp-font-size-sm);
    color:       var(--sp-color-text);
    text-decoration: none;
    border-radius: var(--sp-radius-sm);
    transition:  background var(--sp-transition-fast), color var(--sp-transition-fast);
    white-space: nowrap;
}
.sp-nav__link:hover,
.sp-nav__item--current > .sp-nav__link {
    background: rgba(var(--sp-color-primary), .08);
    color:      var(--sp-color-primary);
}
.sp-nav__item--current > .sp-nav__link { font-weight: var(--sp-font-weight-semibold); }

/* Submenu */
.sp-nav__submenu {
    position:   absolute;
    top:        calc(100% + 8px);
    left:       0;
    min-width:  200px;
    background: var(--sp-color-surface);
    border:     1px solid var(--sp-color-border);
    border-radius: var(--sp-radius-lg);
    box-shadow: var(--sp-shadow-xl);
    list-style: none;
    padding:    var(--sp-space-2);
    opacity:    0;
    visibility: hidden;
    transform:  translateY(-8px);
    transition: all var(--sp-transition-fast);
    z-index:    var(--sp-z-dropdown);
}
.sp-nav__item:hover > .sp-nav__submenu,
.sp-nav__item:focus-within > .sp-nav__submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.sp-nav__submenu .sp-nav__link { border-radius: var(--sp-radius-sm); }
.sp-nav__toggle { display: none; }

/* ── Hamburger ─────────────────────────────────────────── */
.sp-hamburger {
    display:        none;
    flex-direction: column;
    gap:            5px;
    padding:        8px;
    background:     none;
    border:         none;
    cursor:         pointer;
    border-radius:  var(--sp-radius-sm);
}
.sp-hamburger span {
    display:    block;
    width:      22px;
    height:     2px;
    background: var(--sp-color-text);
    border-radius: 2px;
    transition: all var(--sp-transition-fast);
}
.sp-hamburger.sp-hamburger--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sp-hamburger.sp-hamburger--open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.sp-hamburger.sp-hamburger--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav drawer ─────────────────────────────────── */
.sp-mobile-nav { position: fixed; inset: 0; z-index: var(--sp-z-modal); pointer-events: none; }
.sp-mobile-nav--open { pointer-events: all; }
.sp-mobile-nav__overlay {
    position:   absolute;
    inset:      0;
    background: rgba(0,0,0,.5);
    opacity:    0;
    transition: opacity var(--sp-transition-base);
    backdrop-filter: blur(4px);
}
.sp-mobile-nav--open .sp-mobile-nav__overlay { opacity: 1; }
.sp-mobile-nav__drawer {
    position:   absolute;
    right:      0;
    top:        0;
    bottom:     0;
    width:      min(320px, 90vw);
    background: var(--sp-color-bg);
    transform:  translateX(100%);
    transition: transform var(--sp-transition-base);
    overflow-y: auto;
    padding:    var(--sp-space-6);
}
.sp-mobile-nav--open .sp-mobile-nav__drawer { transform: translateX(0); }
.sp-mobile-nav__header { display: flex; justify-content: flex-end; margin-bottom: var(--sp-space-6); }
.sp-mobile-nav__list { list-style: none; padding: 0; margin: 0; }
.sp-mobile-nav__list .sp-nav__link { padding: var(--sp-space-3) 0; font-size: 1.1rem; border-bottom: 1px solid var(--sp-color-border); border-radius: 0; }
.sp-mobile-nav__list .sp-nav__submenu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding-left: var(--sp-space-4); }

/* ── Icon button ────────────────────────────────────────── */
.sp-icon-btn {
    display:     flex;
    align-items: center;
    justify-content: center;
    width:       38px;
    height:      38px;
    background:  transparent;
    border:      none;
    border-radius: var(--sp-radius-md);
    cursor:      pointer;
    color:       var(--sp-color-text);
    transition:  background var(--sp-transition-fast);
}
.sp-icon-btn:hover { background: var(--sp-color-bg-alt); }
.sp-icon-btn svg   { pointer-events: none; }
.sp-moon-icon      { display: none; }
.sp-dark .sp-sun-icon  { display: none; }
.sp-dark .sp-moon-icon { display: block; }

/* ── Search overlay ─────────────────────────────────────── */
.sp-search-overlay {
    position:  fixed;
    inset:     0;
    z-index:   var(--sp-z-modal);
    display:   flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    opacity:   0;
    visibility:hidden;
    transition: all var(--sp-transition-base);
}
.sp-search-overlay--open { opacity: 1; visibility: visible; }
.sp-search-overlay__backdrop {
    position:   absolute;
    inset:      0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(8px);
}
.sp-search-overlay__inner {
    position:   relative;
    width:      min(640px, 90vw);
    z-index:    1;
}
.sp-search-overlay__form {
    display:    flex;
    align-items: center;
    gap:        var(--sp-space-3);
    background: var(--sp-color-bg);
    border-radius: var(--sp-radius-xl);
    padding:    var(--sp-space-4) var(--sp-space-5);
    box-shadow: var(--sp-shadow-2xl);
}
.sp-search-overlay__input {
    flex:       1;
    border:     none;
    outline:    none;
    font-size:  var(--sp-font-size-xl);
    background: transparent;
    color:      var(--sp-color-text);
}
.sp-search-overlay__results {
    margin-top:  var(--sp-space-3);
    background:  var(--sp-color-bg);
    border-radius: var(--sp-radius-lg);
    overflow:    hidden;
    box-shadow:  var(--sp-shadow-xl);
    max-height:  60vh;
    overflow-y:  auto;
}
.sp-search-result {
    display:      flex;
    gap:          var(--sp-space-4);
    padding:      var(--sp-space-4);
    border-bottom: 1px solid var(--sp-color-border);
    text-decoration: none;
    color:        var(--sp-color-text);
    transition:   background var(--sp-transition-fast);
}
.sp-search-result:hover { background: var(--sp-color-bg-alt); }
.sp-search-result img   { width: 56px; height: 56px; object-fit: cover; border-radius: var(--sp-radius-md); flex-shrink: 0; }
.sp-search-result__title { font-weight: var(--sp-font-weight-semibold); margin-bottom: 4px; }
.sp-search-result__excerpt { font-size: var(--sp-font-size-sm); color: var(--sp-color-text-muted); }

/* ── Buttons ─────────────────────────────────────────────── */
.sp-btn {
    display:      inline-flex;
    align-items:  center;
    gap:          var(--sp-space-2);
    padding:      var(--sp-space-3) var(--sp-space-6);
    font-family:  var(--sp-font-body);
    font-weight:  var(--sp-font-weight-semibold);
    font-size:    var(--sp-font-size-sm);
    line-height:  1;
    text-decoration: none;
    border-radius: var(--sp-radius-md);
    border:       2px solid transparent;
    cursor:       pointer;
    transition:   all var(--sp-transition-fast);
    white-space:  nowrap;
}
.sp-btn--primary   { background: var(--sp-color-primary); color: #fff; border-color: var(--sp-color-primary); }
.sp-btn--primary:hover { background: var(--sp-color-primary-dark); border-color: var(--sp-color-primary-dark); color: #fff; }
.sp-btn--secondary { background: var(--sp-color-secondary); color: #fff; border-color: var(--sp-color-secondary); }
.sp-btn--secondary:hover { filter: brightness(0.9); color: #fff; }
.sp-btn--outline   { background: transparent; color: var(--sp-color-primary); border-color: var(--sp-color-primary); }
.sp-btn--outline:hover { background: var(--sp-color-primary); color: #fff; }
.sp-btn--ghost     { background: transparent; color: var(--sp-color-text); border-color: transparent; }
.sp-btn--ghost:hover { background: var(--sp-color-bg-alt); }
.sp-btn--white     { background: #fff; color: var(--sp-color-primary); border-color: #fff; }
.sp-btn--white:hover { background: rgba(255,255,255,.9); }
.sp-btn--danger    { background: var(--sp-color-error); color: #fff; border-color: var(--sp-color-error); }
.sp-btn--success   { background: var(--sp-color-success); color: #fff; border-color: var(--sp-color-success); }

/* ── Tags ────────────────────────────────────────────────── */
.sp-tag {
    display:      inline-flex;
    align-items:  center;
    padding:      3px 10px;
    font-size:    0.75rem;
    font-weight:  var(--sp-font-weight-semibold);
    border-radius: var(--sp-radius-full);
    text-decoration: none;
    transition:   all var(--sp-transition-fast);
    background:   var(--sp-color-bg-alt);
    color:        var(--sp-color-text-muted);
    border:       1px solid var(--sp-color-border);
}
.sp-tag--primary { background: rgba(0,87,255,.1); color: var(--sp-color-primary); border-color: rgba(0,87,255,.2); }
.sp-tag--sm { font-size: 0.7rem; padding: 2px 8px; }
.sp-tag:hover { background: var(--sp-color-primary); color: #fff; border-color: var(--sp-color-primary); }

/* ── Main & layout ─────────────────────────────────────── */
.sp-main { min-height: 60vh; }
.sp-post-layout, .sp-page-layout { max-width: var(--sp-container-narrow); padding-block: var(--sp-space-16); }
.sp-archive { padding-block: var(--sp-space-12); }

/* ── Post / page ────────────────────────────────────────── */
.sp-post__header { margin-bottom: var(--sp-space-8); }
.sp-post__cats   { display: flex; gap: var(--sp-space-2); flex-wrap: wrap; margin-bottom: var(--sp-space-4); }
.sp-post__title  { margin-bottom: var(--sp-space-4); }
.sp-post__meta   { display: flex; align-items: center; gap: var(--sp-space-5); font-size: var(--sp-font-size-sm); color: var(--sp-color-text-muted); flex-wrap: wrap; }
.sp-post__meta svg { flex-shrink: 0; }
.sp-post__thumbnail { margin-block: var(--sp-space-8); border-radius: var(--sp-radius-xl); overflow: hidden; }
.sp-post__img    { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.sp-post__tags   { display: flex; gap: var(--sp-space-2); flex-wrap: wrap; align-items: center; margin-top: var(--sp-space-8); padding-top: var(--sp-space-8); border-top: 1px solid var(--sp-color-border); }

/* ── Prose (rich text) ──────────────────────────────────── */
.sp-prose { max-width: 72ch; }
.sp-prose h2 { margin-top: 2em; }
.sp-prose h3 { margin-top: 1.5em; }
.sp-prose p  { color: var(--sp-color-text); line-height: var(--sp-line-height-relaxed); }
.sp-prose ul, .sp-prose ol { padding-left: 1.5em; margin-bottom: 1em; }
.sp-prose li  { margin-bottom: .25em; }
.sp-prose blockquote { border-left: 4px solid var(--sp-color-primary); padding-left: 1.5em; margin: 2em 0; font-style: italic; color: var(--sp-color-text-muted); }
.sp-prose code { font-family: var(--sp-font-mono); background: var(--sp-color-bg-alt); padding: 2px 6px; border-radius: var(--sp-radius-sm); font-size: .9em; color: var(--sp-color-secondary); }
.sp-prose pre  { background: var(--sp-color-heading); color: #e2e8f0; padding: 1.5em; border-radius: var(--sp-radius-lg); overflow-x: auto; margin-bottom: 1em; }
.sp-prose pre code { background: none; color: inherit; padding: 0; }
.sp-prose table { width: 100%; border-collapse: collapse; margin-bottom: 1em; }
.sp-prose th, .sp-prose td { padding: .75em 1em; border: 1px solid var(--sp-color-border); }
.sp-prose th   { background: var(--sp-color-bg-alt); font-weight: var(--sp-font-weight-semibold); }
.sp-prose img  { border-radius: var(--sp-radius-lg); margin-block: 1.5em; }
.sp-prose a    { color: var(--sp-color-link); font-weight: var(--sp-font-weight-medium); }
.sp-prose hr   { border: none; border-top: 1px solid var(--sp-color-border); margin: 2em 0; }

/* ── Author box ─────────────────────────────────────────── */
.sp-post__author-box {
    display:      flex;
    gap:          var(--sp-space-5);
    padding:      var(--sp-space-8);
    background:   var(--sp-color-bg-alt);
    border-radius: var(--sp-radius-xl);
    margin-top:   var(--sp-space-10);
    border:       1px solid var(--sp-color-border);
}
.sp-author-box__avatar { width: 80px; height: 80px; border-radius: var(--sp-radius-full); flex-shrink: 0; object-fit: cover; }
.sp-author-box__label  { font-size: var(--sp-font-size-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--sp-color-text-muted); font-weight: var(--sp-font-weight-semibold); display: block; margin-bottom: .25em; }
.sp-author-box__name   { font-size: var(--sp-font-size-lg); font-weight: var(--sp-font-weight-bold); margin-bottom: .5em; }
.sp-author-box__bio    { font-size: var(--sp-font-size-sm); color: var(--sp-color-text-muted); }

/* ── Post navigation ────────────────────────────────────── */
.sp-post__nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-space-4); margin-top: var(--sp-space-10); }
.sp-post__nav-link { display: flex; flex-direction: column; gap: 4px; padding: var(--sp-space-5); border: 1px solid var(--sp-color-border); border-radius: var(--sp-radius-lg); text-decoration: none; color: var(--sp-color-text); transition: all var(--sp-transition-fast); }
.sp-post__nav-link:hover { border-color: var(--sp-color-primary); background: var(--sp-color-bg-alt); color: var(--sp-color-text); }
.sp-post__nav-link--next { text-align: right; }
.sp-post__nav-dir   { font-size: var(--sp-font-size-xs); color: var(--sp-color-text-muted); text-transform: uppercase; letter-spacing: .05em; }
.sp-post__nav-title { font-weight: var(--sp-font-weight-semibold); font-size: var(--sp-font-size-sm); }

/* ── Blog grid / cards ──────────────────────────────────── */
.sp-blog-grid--grid   { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-space-8); }
.sp-blog-grid--list   { display: flex; flex-direction: column; gap: var(--sp-space-6); }
.sp-blog-grid--masonry { columns: 3; gap: var(--sp-space-6); }
@media (max-width: 768px) { .sp-blog-grid--grid { grid-template-columns: 1fr; } .sp-blog-grid--masonry { columns: 1; } }
@media (min-width: 768px) and (max-width: 1200px) { .sp-blog-grid--masonry { columns: 2; } }

.sp-card {
    background:   var(--sp-color-surface);
    border:       1px solid var(--sp-color-border);
    border-radius: var(--sp-radius-xl);
    overflow:     hidden;
    transition:   all var(--sp-transition-base);
    display:      flex;
    flex-direction: column;
}
.sp-card:hover { box-shadow: var(--sp-shadow-xl); transform: translateY(-4px); border-color: transparent; }
.sp-card__thumb-wrap { display: block; aspect-ratio: 16/9; overflow: hidden; }
.sp-card__thumb { width: 100%; height: 100%; object-fit: cover; transition: transform var(--sp-transition-slow); }
.sp-card:hover .sp-card__thumb { transform: scale(1.05); }
.sp-card__body { display: flex; flex-direction: column; gap: var(--sp-space-3); padding: var(--sp-space-6); flex: 1; }
.sp-card__cats { display: flex; gap: var(--sp-space-2); flex-wrap: wrap; }
.sp-card__title { font-size: var(--sp-font-size-lg); margin-bottom: 0; }
.sp-card__title a { color: var(--sp-color-heading); text-decoration: none; }
.sp-card__title a:hover { color: var(--sp-color-primary); }
.sp-card__excerpt { font-size: var(--sp-font-size-sm); color: var(--sp-color-text-muted); line-height: var(--sp-line-height-relaxed); flex: 1; }
.sp-card__footer { display: flex; justify-content: space-between; font-size: var(--sp-font-size-xs); color: var(--sp-color-text-light); margin-top: auto; }

/* List card variant */
.sp-blog-grid--list .sp-card { flex-direction: row; max-height: 200px; }
.sp-blog-grid--list .sp-card__thumb-wrap { aspect-ratio: 4/3; width: 220px; flex-shrink: 0; }
@media (max-width: 640px) { .sp-blog-grid--list .sp-card { flex-direction: column; max-height: none; } .sp-blog-grid--list .sp-card__thumb-wrap { width: 100%; } }

/* ── Breadcrumb ─────────────────────────────────────────── */
.sp-breadcrumb { margin-bottom: var(--sp-space-8); }
.sp-breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-space-2); align-items: center; padding: 0; margin: 0; font-size: var(--sp-font-size-sm); color: var(--sp-color-text-muted); }
.sp-breadcrumb li:not(:last-child)::after { content: '/'; margin-left: var(--sp-space-2); }
.sp-breadcrumb a { color: var(--sp-color-text-muted); text-decoration: none; }
.sp-breadcrumb a:hover { color: var(--sp-color-primary); }
.sp-breadcrumb [aria-current] { color: var(--sp-color-text); font-weight: var(--sp-font-weight-medium); }

/* ── Pagination ─────────────────────────────────────────── */
.sp-pagination { display: flex; justify-content: center; margin-top: var(--sp-space-12); }
.sp-pagination .page-numbers { display: inline-flex; align-items: center; gap: var(--sp-space-1); }
.sp-pagination a, .sp-pagination span {
    display:     flex;
    align-items: center;
    justify-content: center;
    width:       40px;
    height:      40px;
    border-radius: var(--sp-radius-md);
    font-size:   var(--sp-font-size-sm);
    font-weight: var(--sp-font-weight-medium);
    text-decoration: none;
    color:       var(--sp-color-text);
    border:      1px solid var(--sp-color-border);
    transition:  all var(--sp-transition-fast);
}
.sp-pagination a:hover { background: var(--sp-color-primary); color: #fff; border-color: var(--sp-color-primary); }
.sp-pagination .current { background: var(--sp-color-primary); color: #fff; border-color: var(--sp-color-primary); }
.sp-pagination .dots { border: none; pointer-events: none; color: var(--sp-color-text-muted); }

/* ── 404 ─────────────────────────────────────────────────── */
.sp-404 { display: flex; align-items: center; justify-content: center; min-height: 70vh; text-align: center; }
.sp-404__content { max-width: 500px; }
.sp-404__code { font-size: 8rem; font-weight: var(--sp-font-weight-black); color: var(--sp-color-primary); line-height: 1; opacity: .15; }
.sp-404__title { font-size: var(--sp-font-size-3xl); margin-top: var(--sp-space-4); }
.sp-404__text  { color: var(--sp-color-text-muted); margin-block: var(--sp-space-4) var(--sp-space-6); }

/* ── Archive header ─────────────────────────────────────── */
.sp-archive__header { margin-bottom: var(--sp-space-10); text-align: center; }
.sp-archive__title  { margin-bottom: var(--sp-space-4); }
.sp-archive__desc   { color: var(--sp-color-text-muted); max-width: 60ch; margin: 0 auto; }

/* ── Footer ─────────────────────────────────────────────── */
.sp-footer {
    background: var(--sp-footer-bg, var(--sp-color-bg-alt));
    color:      var(--sp-footer-color, var(--sp-color-text));
    border-top: 1px solid var(--sp-color-border);
    margin-top: var(--sp-space-20);
}
.sp-footer--dark { background: var(--sp-dark-bg); color: var(--sp-dark-text); --sp-color-border: var(--sp-dark-border); }
.sp-footer__main { padding-block: var(--sp-space-16); }
.sp-footer__cols { display: grid; gap: var(--sp-space-10); }
.sp-footer__cols--2 { grid-template-columns: repeat(2, 1fr); }
.sp-footer__cols--3 { grid-template-columns: repeat(3, 1fr); }
.sp-footer__cols--4 { grid-template-columns: repeat(4, 1fr); }
.sp-footer__cols--5 { grid-template-columns: repeat(5, 1fr); }
.sp-footer__brand { margin-bottom: var(--sp-space-4); }
.sp-footer__tagline { font-size: var(--sp-font-size-sm); color: var(--sp-color-text-muted); margin-top: var(--sp-space-2); }
.sp-footer__menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-space-2); }
.sp-footer__menu a { font-size: var(--sp-font-size-sm); color: var(--sp-color-text-muted); text-decoration: none; transition: color var(--sp-transition-fast); }
.sp-footer__menu a:hover { color: var(--sp-color-primary); }
.sp-footer__bottom { border-top: 1px solid var(--sp-color-border); padding-block: var(--sp-space-6); }
.sp-footer__bottom-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-space-4); }
.sp-footer__copyright { font-size: var(--sp-font-size-sm); color: var(--sp-color-text-muted); margin: 0; }
.sp-footer__legal-list { list-style: none; display: flex; gap: var(--sp-space-4); padding: 0; margin: 0; }
.sp-footer__legal-list a { font-size: var(--sp-font-size-sm); color: var(--sp-color-text-muted); text-decoration: none; }
.sp-footer__legal-list a:hover { color: var(--sp-color-primary); }

/* ── Lightbox ───────────────────────────────────────────── */
.sp-lightbox {
    position:   fixed;
    inset:      0;
    z-index:    var(--sp-z-modal);
    background: rgba(0,0,0,.92);
    display:    flex;
    align-items: center;
    justify-content: center;
    opacity:    0;
    visibility: hidden;
    transition: all var(--sp-transition-base);
}
.sp-lightbox--open { opacity: 1; visibility: visible; }
.sp-lightbox__stage { max-width: 90vw; max-height: 85vh; }
.sp-lightbox__img   { max-width: 90vw; max-height: 80vh; object-fit: contain; border-radius: var(--sp-radius-md); }
.sp-lightbox__close,
.sp-lightbox__prev,
.sp-lightbox__next {
    position:   absolute;
    background: rgba(255,255,255,.15);
    border:     none;
    color:      #fff;
    cursor:     pointer;
    border-radius: var(--sp-radius-full);
    width:      48px;
    height:     48px;
    display:    flex;
    align-items: center;
    justify-content: center;
    font-size:  2rem;
    transition: background var(--sp-transition-fast);
    backdrop-filter: blur(4px);
}
.sp-lightbox__close:hover, .sp-lightbox__prev:hover, .sp-lightbox__next:hover { background: rgba(255,255,255,.3); }
.sp-lightbox__close { top: 1.5rem; right: 1.5rem; font-size: 1.25rem; }
.sp-lightbox__prev  { left: 1.5rem; top: 50%; transform: translateY(-50%); }
.sp-lightbox__next  { right: 1.5rem; top: 50%; transform: translateY(-50%); }
.sp-lightbox__caption { position: absolute; bottom: 4rem; left: 50%; transform: translateX(-50%); color: #fff; font-size: var(--sp-font-size-sm); text-align: center; max-width: 60vw; }
.sp-lightbox__counter { position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.6); font-size: var(--sp-font-size-sm); }

/* ── Spinner / loader ───────────────────────────────────── */
.sp-spinner {
    display:    inline-block;
    width:      32px;
    height:     32px;
    border:     3px solid var(--sp-color-border);
    border-top-color: var(--sp-color-primary);
    border-radius: 50%;
    animation:  sp-spin 0.7s linear infinite;
}
@keyframes sp-spin { to { transform: rotate(360deg); } }
.sp-loader { display: flex; align-items: center; justify-content: center; padding: var(--sp-space-12); }

/* ── Toast ──────────────────────────────────────────────── */
.sp-toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: var(--sp-z-toast); display: flex; flex-direction: column; gap: var(--sp-space-3); }
.sp-toast {
    padding:       var(--sp-space-4) var(--sp-space-6);
    background:    var(--sp-color-heading);
    color:         #fff;
    border-radius: var(--sp-radius-lg);
    box-shadow:    var(--sp-shadow-xl);
    font-size:     var(--sp-font-size-sm);
    animation:     sp-toast-in .3s ease;
    max-width:     320px;
}
@keyframes sp-toast-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.sp-toast--success { background: var(--sp-color-success); }
.sp-toast--error   { background: var(--sp-color-error); }

/* ── Animations ─────────────────────────────────────────── */
.sp-animate { opacity: 0; }
.sp-animate--fade-in   { transform: none; }
.sp-animate--slide-up  { transform: translateY(24px); }
.sp-animate--slide-left{ transform: translateX(-24px); }
.sp-animate--in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s ease; }

/* ── Responsive breakpoints ─────────────────────────────── */
@media (max-width: 1024px) {
    .sp-header__nav { display: none; }
    .sp-hamburger   { display: flex; }
    .sp-footer__cols--4, .sp-footer__cols--5 { grid-template-columns: repeat(2, 1fr); }
    .sp-footer__cols--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .sp-footer__cols--2,
    .sp-footer__cols--3,
    .sp-footer__cols--4,
    .sp-footer__cols--5 { grid-template-columns: 1fr; }
    .sp-footer__bottom-inner { flex-direction: column; text-align: center; }
    .sp-post__nav  { grid-template-columns: 1fr; }
    .sp-lightbox__prev, .sp-lightbox__next { display: none; }
}

/* ── No posts ────────────────────────────────────────────── */
.sp-no-posts { text-align: center; color: var(--sp-color-text-muted); padding: var(--sp-space-16) 0; font-size: var(--sp-font-size-lg); }
