/* ==========================================================================
   WEBSITISM — Blog Archive & Single Post Styles
   Uses shared .wsa-* classes from services.css for breadcrumbs, eyebrow, CTA, tabs
   ========================================================================== */


/* ==========================================================================
   READING PROGRESS BAR
   ========================================================================== */

.wsb-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 10000;
    background: transparent;
}

.wsb-progress__bar {
    height: 100%;
    width: 0;
    background: var(--ws-accent);
    transition: width 0.1s linear;
    will-change: width;
}


/* ==========================================================================
   ARCHIVE — HERO
   ========================================================================== */

.wsb-hero {
    position: relative;
    padding: clamp(80px, 12vw, 140px) 0 clamp(40px, 6vw, 60px);
    overflow: hidden;
}

.wsb-hero__glow {
    position: absolute;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 201, 219, 0.05), transparent 70%);
    pointer-events: none;
}

.wsb-hero h1 {
    font-size: var(--ws-text-4xl);
    margin-bottom: var(--ws-space-4);
}

.wsb-hero__desc {
    color: var(--ws-text-muted);
    font-size: var(--ws-text-md);
    max-width: 640px;
    line-height: 1.7;
}

.wsb-hero__count {
    color: var(--ws-text-faint);
    font-family: var(--ws-font-mono);
    font-size: var(--ws-text-xs);
    margin-top: var(--ws-space-3);
    letter-spacing: 0.05em;
}


/* ==========================================================================
   ARCHIVE — FEATURED POST
   ========================================================================== */

.wsb-featured {
    padding: 0 0 var(--ws-space-10);
}

.wsb-featured__card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
    border-radius: var(--ws-radius-xl);
    overflow: hidden;
    background: var(--ws-surface-1);
    border: 1px solid var(--ws-border);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.wsb-featured__card:hover {
    border-color: rgba(0, 201, 219, 0.2);
    transform: translateY(-2px);
}

.wsb-featured__img {
    overflow: hidden;
    aspect-ratio: 16/10;
}

.wsb-featured__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.wsb-featured__card:hover .wsb-featured__img img {
    transform: scale(1.03);
}

.wsb-featured__body {
    padding: clamp(24px, 4vw, 48px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.wsb-featured__body h2 {
    font-size: var(--ws-text-2xl);
    line-height: 1.25;
    margin: 0;
}

.wsb-featured__body p {
    color: var(--ws-text-muted);
    font-size: var(--ws-text-sm);
    line-height: 1.7;
}

.wsb-featured__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ws-font-mono);
    font-size: var(--ws-text-xs);
    color: var(--ws-text-faint);
    margin-top: auto;
}


/* ==========================================================================
   ARCHIVE — CATEGORY FILTERS
   ========================================================================== */

.wsb-filters {
    padding: 0 0 var(--ws-space-8);
}

/* Make tabs wrap instead of scroll */
.wsb-filters .wsa-tabs {
    flex-wrap: wrap;
    gap: 8px;
    overflow-x: visible;
    overflow: visible;
}

.wsb-filters .wsa-tab {
    white-space: nowrap;
    text-decoration: none;
}


/* ==========================================================================
   ARCHIVE — POST CARDS GRID
   ========================================================================== */

.wsb-grid-section {
    padding: 0 0 var(--ws-space-16);
}

.wsb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.wsb-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.wsb-card {
    border-radius: var(--ws-radius-xl);
    overflow: hidden;
    background: var(--ws-surface-1);
    border: 1px solid var(--ws-border);
    transition: border-color 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.wsb-card:hover {
    border-color: rgba(0, 201, 219, 0.15);
    transform: translateY(-3px);
}

.wsb-card__img {
    display: block;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.wsb-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.wsb-card:hover .wsb-card__img img {
    transform: scale(1.04);
}

.wsb-card__body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.wsb-card__title {
    font-size: var(--ws-text-lg);
    font-weight: var(--ws-weight-semibold);
    line-height: 1.3;
    margin: 0;
}

.wsb-card__title a {
    color: var(--ws-text-heading);
    text-decoration: none;
    transition: color 0.2s;
}

.wsb-card__title a:hover {
    color: var(--ws-accent);
}

.wsb-card__excerpt {
    color: var(--ws-text-muted);
    font-size: var(--ws-text-sm);
    line-height: 1.6;
    margin: 0;
}

.wsb-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ws-font-mono);
    font-size: var(--ws-text-xs);
    color: var(--ws-text-faint);
    margin-top: auto;
    padding-top: 8px;
}

/* Category badge */
.wsb-cat-badge {
    display: inline-block;
    font-family: var(--ws-font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ws-accent);
    background: var(--ws-accent-muted);
    padding: 4px 10px;
    border-radius: var(--ws-radius-full);
    width: fit-content;
    text-decoration: none;
    transition: background 0.2s;
}

.wsb-cat-badge--link:hover {
    background: rgba(0, 201, 219, 0.2);
}


/* ==========================================================================
   ARCHIVE — PAGINATION
   ========================================================================== */

.wsb-pagination {
    margin-top: var(--ws-space-12);
    display: flex;
    justify-content: center;
}

.wsb-pagination ul {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.wsb-pagination li a,
.wsb-pagination li span {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--ws-radius-md);
    font-family: var(--ws-font-mono);
    font-size: var(--ws-text-xs);
    color: var(--ws-text-muted);
    text-decoration: none;
    border: 1px solid var(--ws-border);
    background: var(--ws-surface-1);
    transition: all 0.2s;
}

.wsb-pagination li a:hover {
    border-color: var(--ws-accent);
    color: var(--ws-accent);
}

.wsb-pagination li span.current {
    background: var(--ws-accent);
    color: var(--ws-bg);
    border-color: var(--ws-accent);
    font-weight: 600;
}

.wsb-pagination li span.dots {
    border: none;
    background: none;
}


/* ==========================================================================
   ARCHIVE — EMPTY STATE
   ========================================================================== */

.wsb-empty {
    text-align: center;
    padding: var(--ws-space-20) 0;
}

.wsb-empty h2 {
    font-size: var(--ws-text-2xl);
    margin-bottom: var(--ws-space-4);
}

.wsb-empty p {
    color: var(--ws-text-muted);
    margin-bottom: var(--ws-space-8);
}


/* ==========================================================================
   SINGLE — POST HERO
   ========================================================================== */

.wsb-post-hero {
    position: relative;
    padding: clamp(80px, 12vw, 140px) 0 clamp(32px, 5vw, 48px);
    overflow: hidden;
}

.wsb-post-hero__glow {
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 201, 219, 0.04), transparent 70%);
    pointer-events: none;
}

.wsb-post-hero h1 {
    font-size: var(--ws-text-4xl);
    line-height: 1.15;
    margin: var(--ws-space-4) 0 var(--ws-space-4);
    max-width: 800px;
}

.wsb-post-hero__desc {
    color: var(--ws-text-muted);
    font-size: var(--ws-text-md);
    line-height: 1.7;
    max-width: 700px;
    margin-bottom: var(--ws-space-6);
}

.wsb-post-hero__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: var(--ws-space-6);
    border-top: 1px solid var(--ws-border);
}


/* ==========================================================================
   SINGLE — AUTHOR (inline)
   ========================================================================== */

.wsb-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wsb-author__avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--ws-radius-full);
    object-fit: cover;
}

.wsb-author__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wsb-author__name {
    font-weight: var(--ws-weight-semibold);
    font-size: var(--ws-text-sm);
    color: var(--ws-text-heading);
}

.wsb-author__date {
    font-family: var(--ws-font-mono);
    font-size: var(--ws-text-xs);
    color: var(--ws-text-faint);
}


/* ==========================================================================
   SINGLE — SHARE BUTTONS
   ========================================================================== */

.wsb-share {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wsb-share__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--ws-radius-md);
    background: var(--ws-surface-2);
    border: 1px solid var(--ws-border);
    color: var(--ws-text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.wsb-share__btn:hover {
    border-color: var(--ws-accent);
    color: var(--ws-accent);
}

.wsb-share__copied {
    border-color: #4ade80 !important;
    color: #4ade80 !important;
}


/* ==========================================================================
   SINGLE — FEATURED IMAGE
   ========================================================================== */

.wsb-post-img {
    padding: 0 0 var(--ws-space-10);
}

.wsb-post-img__figure {
    margin: 0;
    border-radius: var(--ws-radius-xl);
    overflow: hidden;
    border: 1px solid var(--ws-border);
}

.wsb-post-img__figure img {
    width: 100%;
    height: auto;
    display: block;
}

.wsb-post-img__figure figcaption {
    padding: 12px 20px;
    font-size: var(--ws-text-xs);
    color: var(--ws-text-faint);
    font-style: italic;
    background: var(--ws-surface-1);
}


/* ==========================================================================
   SINGLE — ARTICLE BODY (the_content)
   ========================================================================== */

.wsb-article {
    padding: 0 0 var(--ws-space-12);
}

.wsb-article__body {
    font-size: var(--ws-text-md);
    line-height: 1.85;
    color: var(--ws-text-secondary);
}

/* Headings in content */
.wsb-article__body h2 {
    font-size: var(--ws-text-2xl);
    margin: var(--ws-space-12) 0 var(--ws-space-4);
    padding-top: var(--ws-space-6);
    border-top: 1px solid var(--ws-border);
    color: var(--ws-text-heading);
}

.wsb-article__body h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.wsb-article__body h3 {
    font-size: var(--ws-text-xl);
    margin: var(--ws-space-8) 0 var(--ws-space-3);
    color: var(--ws-text-heading);
}

.wsb-article__body h4 {
    font-size: var(--ws-text-lg);
    margin: var(--ws-space-6) 0 var(--ws-space-2);
    color: var(--ws-text-heading);
}

.wsb-article__body p {
    margin-bottom: var(--ws-space-5);
}

/* Links */
.wsb-article__body a {
    color: var(--ws-accent);
    text-decoration: underline;
    text-decoration-color: rgba(0, 201, 219, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}

.wsb-article__body a:hover {
    text-decoration-color: var(--ws-accent);
}

/* Lists */
.wsb-article__body ul,
.wsb-article__body ol {
    margin: 0 0 var(--ws-space-5) var(--ws-space-5);
    padding: 0;
}

.wsb-article__body li {
    margin-bottom: var(--ws-space-2);
    padding-left: 4px;
}

.wsb-article__body ul li::marker {
    color: var(--ws-accent);
}

.wsb-article__body ol li::marker {
    color: var(--ws-accent);
    font-weight: 600;
}

/* Blockquote */
.wsb-article__body blockquote {
    border-left: 3px solid var(--ws-accent);
    background: var(--ws-surface-1);
    padding: var(--ws-space-5) var(--ws-space-6);
    margin: var(--ws-space-8) 0;
    border-radius: 0 var(--ws-radius-lg) var(--ws-radius-lg) 0;
    font-style: italic;
    color: var(--ws-text-muted);
}

.wsb-article__body blockquote p:last-child {
    margin-bottom: 0;
}

/* Code */
.wsb-article__body code {
    font-family: var(--ws-font-mono);
    font-size: 0.88em;
    background: var(--ws-surface-2);
    padding: 2px 8px;
    border-radius: var(--ws-radius-sm);
    color: var(--ws-accent);
    border: 1px solid var(--ws-border);
}

.wsb-article__body pre {
    background: var(--ws-surface-1);
    border: 1px solid var(--ws-border);
    border-radius: var(--ws-radius-lg);
    padding: var(--ws-space-5);
    overflow-x: auto;
    margin: var(--ws-space-6) 0;
}

.wsb-article__body pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: var(--ws-text-sm);
    color: var(--ws-text-secondary);
}

/* Images */
.wsb-article__body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--ws-radius-lg);
    margin: var(--ws-space-4) 0;
}

/* Horizontal rule */
.wsb-article__body hr {
    border: none;
    height: 1px;
    background: var(--ws-border);
    margin: var(--ws-space-10) 0;
}

/* Tables */
.wsb-article__body table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--ws-space-6) 0;
    font-size: var(--ws-text-sm);
}

.wsb-article__body th,
.wsb-article__body td {
    padding: 12px 16px;
    border: 1px solid var(--ws-border);
    text-align: left;
}

.wsb-article__body th {
    background: var(--ws-surface-1);
    font-weight: 600;
    color: var(--ws-text-heading);
}

.wsb-article__body tr:nth-child(even) td {
    background: var(--ws-surface-1);
}


/* ==========================================================================
   SINGLE — TAGS
   ========================================================================== */

.wsb-tags {
    padding: 0 0 var(--ws-space-10);
}

.wsb-tags__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wsb-tag {
    font-family: var(--ws-font-mono);
    font-size: var(--ws-text-xs);
    color: var(--ws-text-muted);
    background: var(--ws-surface-2);
    border: 1px solid var(--ws-border);
    padding: 6px 14px;
    border-radius: var(--ws-radius-full);
    text-decoration: none;
    transition: all 0.2s;
}

.wsb-tag:hover {
    border-color: var(--ws-accent);
    color: var(--ws-accent);
}


/* ==========================================================================
   SINGLE — AUTHOR BOX
   ========================================================================== */

.wsb-author-box {
    padding: 0 0 var(--ws-space-10);
}

.wsb-author-box__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
    border-radius: var(--ws-radius-xl);
    background: var(--ws-surface-1);
    border: 1px solid var(--ws-border);
}

.wsb-author-box__avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--ws-radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.wsb-author-box__label {
    font-family: var(--ws-font-mono);
    font-size: var(--ws-text-xs);
    color: var(--ws-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.wsb-author-box__name {
    font-size: var(--ws-text-lg);
    margin: 4px 0 0;
}

.wsb-author-box__role {
    display: block;
    font-size: var(--ws-text-xs);
    font-weight: 500;
    color: var(--ws-accent);
    margin: 2px 0 4px;
    letter-spacing: 0.01em;
}

.wsb-author-box__bio {
    color: var(--ws-text-muted);
    font-size: var(--ws-text-sm);
    line-height: 1.6;
    margin: 0;
}

.wsb-author-box__email {
    display: inline-block;
    font-family: var(--ws-font-mono);
    font-size: var(--ws-text-xs);
    color: var(--ws-accent);
    text-decoration: none;
    margin-top: 2px;
    transition: opacity 0.2s;
}

.wsb-author-box__email:hover {
    opacity: 0.8;
}


/* ==========================================================================
   SINGLE — POST NAVIGATION
   ========================================================================== */

.wsb-post-nav {
    padding: 0 0 var(--ws-space-12);
}

.wsb-post-nav__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.wsb-post-nav__link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: var(--ws-radius-lg);
    background: var(--ws-surface-1);
    border: 1px solid var(--ws-border);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.3s, transform 0.3s;
}

.wsb-post-nav__link:hover {
    border-color: rgba(0, 201, 219, 0.2);
    transform: translateY(-2px);
}

.wsb-post-nav__link--next {
    text-align: right;
    justify-content: flex-end;
}

.wsb-post-nav__link svg {
    flex-shrink: 0;
    color: var(--ws-accent);
}

.wsb-post-nav__label {
    display: block;
    font-family: var(--ws-font-mono);
    font-size: var(--ws-text-xs);
    color: var(--ws-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.wsb-post-nav__title {
    display: block;
    font-size: var(--ws-text-sm);
    font-weight: var(--ws-weight-semibold);
    color: var(--ws-text-heading);
}


/* ==========================================================================
   SINGLE — RELATED POSTS
   ========================================================================== */

.wsb-related {
    padding: var(--ws-space-16) 0;
    background: var(--ws-surface-0);
}


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

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

    .wsb-featured__img {
        aspect-ratio: 16/9;
    }

    .wsb-grid--3 {
        grid-template-columns: 1fr;
    }

    .wsb-post-hero__meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .wsb-post-nav__grid {
        grid-template-columns: 1fr;
    }

    .wsb-author-box__inner {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }
}

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