/**
 * Component Styles
 * Premium Editorial Design System
 *
 * @package Messlier
 */

/* ========================================
   BLOG LAYOUT - TWO COLUMN
   ======================================== */

.blog-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--space-16);
    align-items: start;
}

.blog-sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--space-8));
}

.blog-sidebar__header {
    position: relative;
    margin-bottom: var(--space-6);
}

.blog-sidebar__header::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -40px;
    width: 30px;
    height: 1px;
    background-color: var(--border);
}

.blog-sidebar__title {
    font-size: var(--text-3xl);
    font-weight: 400;
    margin: 0;
    font-style: italic;
    font-family: var(--font-serif);
    letter-spacing: var(--tracking-tight);
}

.blog-sidebar__stats {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: var(--leading-relaxed);
    font-style: italic;
    margin: 0;
}

.blog-sidebar__stats strong {
    color: var(--text);
    font-weight: 500;
}

.blog-sidebar__description {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: var(--leading-relaxed);
    margin: var(--space-5) 0 0;
    font-style: italic;
    font-family: var(--font-serif);
}

.blog-content {
    min-width: 0;
}

.blog-intro {
    margin-bottom: var(--space-10);
    font-size: var(--text-lg);
    color: var(--text-muted);
    font-style: italic;
    font-family: var(--font-serif);
    line-height: var(--leading-relaxed);
}

.blog-intro p {
    margin: 0;
}

/* ========================================
   SECTION HEADER - Editorial structure cue
   ======================================== */

.section-header {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--text-light);
    font-family: var(--font-sans);
    margin: var(--space-12) 0 var(--space-8);
    padding-bottom: var(--space-4);
    position: relative;
}

/* Short horizontal rule under section header */
.section-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 1px;
    background-color: var(--border);
}

/* ========================================
   POSTS LIST
   ======================================== */

.posts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

/* ========================================
   POST CARD - EDITORIAL INDEX ENTRY
   Cards that feel anchored, resting on paper
   ======================================== */

.post-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: var(--space-6);
    padding: var(--space-5) var(--space-6);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-fast);
}

.post-card:hover {
    background-color: var(--surface);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

/* Thumbnail - paper-framed image tile */
.post-card__thumbnail {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background-color: var(--surface-2);
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.post-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--transition-slow);
}

.post-card:hover .post-card__thumbnail img {
    opacity: 0.95;
}

.post-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    background-color: var(--surface-2);
    text-decoration: none;
}

.post-card__placeholder svg {
    opacity: 0.35;
}

/* Body */
.post-card__body {
    display: flex;
    justify-content: space-between;
    gap: var(--space-5);
    min-width: 0;
}

.post-card__main {
    flex: 1;
    min-width: 0;
}

/* Title - PRIMARY hierarchy: prominent, immediately draws eye */
.post-card__title {
    font-size: var(--text-xl);
    font-weight: 600;
    font-family: var(--font-sans);
    margin: 0 0 var(--space-2);
    line-height: var(--leading-snug);
    letter-spacing: var(--tracking-tight);
}

.post-card__title a {
    color: var(--text);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.post-card__title a:hover {
    color: var(--link);
}

/* Excerpt - SECONDARY hierarchy: clearly subordinate */
.post-card__excerpt {
    font-size: var(--text-base);
    color: var(--text-muted);
    margin: 0 0 var(--space-3);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__excerpt a {
    color: inherit;
    text-decoration: none;
}

/* Tags */
.post-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.post-card__tag {
    font-size: var(--text-xs);
    color: var(--text-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.post-card__tag::before {
    content: "#";
    opacity: 0.6;
}

.post-card__tag:hover {
    color: var(--accent);
}

/* Meta - TERTIARY hierarchy: ambient, clearly secondary */
.post-card__meta {
    flex-shrink: 0;
    text-align: right;
    padding-top: var(--space-1);
}

.post-card__date {
    font-size: var(--text-sm);
    color: var(--text-light);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ========================================
   CATEGORY FILTERS - TACTILE CHIPS
   Visible states with accent highlighting
   ======================================== */

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-10);
}

.category-filter {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--chip-text);
    background-color: var(--chip-bg);
    border: 1px solid var(--chip-border);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all var(--transition-fast);
    /* Tactile depth */
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.category-filter:hover {
    color: var(--chip-hover-text);
    border-color: var(--chip-hover-border);
    background-color: var(--chip-hover-bg);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.category-filter:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.category-filter:focus:not(:focus-visible) {
    outline: none;
}

/* ACTIVE state - accent colored, obvious without blur test */
.category-filter.active,
.category-filter.current-cat a {
    color: var(--chip-active-text);
    background-color: var(--chip-active-bg);
    border-color: var(--chip-active-border);
    font-weight: 600;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.category-filter .category-count {
    font-size: var(--text-xs);
    opacity: 0.6;
    margin-left: var(--space-1);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.btn:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.btn:focus:not(:focus-visible) {
    outline: none;
}

.btn--primary {
    color: var(--text-invert);
    background-color: var(--accent);
    border: 1px solid var(--accent);
}

.btn--primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--text-invert);
}

.btn--secondary {
    color: var(--text);
    background-color: transparent;
    border: 1px solid var(--border);
}

.btn--secondary:hover {
    background-color: var(--surface);
    border-color: var(--border-strong);
}

.btn--ghost {
    color: var(--text-muted);
    background-color: transparent;
    border: 1px solid transparent;
}

.btn--ghost:hover {
    color: var(--text);
    background-color: var(--surface);
}

/* ========================================
   SHARE BUTTONS
   ======================================== */

.share-buttons {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-10);
    padding-top: var(--space-8);
    border-top: 1px solid var(--border-light);
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-muted);
    background-color: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.share-btn:hover {
    color: var(--text);
    background-color: var(--surface-2);
    border-color: var(--border);
}

.share-btn:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.share-btn:focus:not(:focus-visible) {
    outline: none;
}

/* ========================================
   BIO SECTION - Reading width
   ======================================== */

.bio-section {
    max-width: var(--width-reading);
    margin: 0 auto var(--space-16);
    padding-bottom: var(--space-12);
    border-bottom: 1px solid var(--border-light);
}

.bio-section__content {
    font-size: var(--text-lg);
    line-height: var(--leading-loose);
    color: var(--text);
}

.bio-section__content p:last-child {
    margin-bottom: 0;
}

/* ========================================
   PAGE HEADER - Reading width
   ======================================== */

.page-header {
    max-width: var(--width-reading);
    margin: 0 auto var(--space-12);
    text-align: center;
}

.page-header__title {
    margin-bottom: var(--space-4);
}

.page-header__description {
    font-size: var(--text-lg);
    color: var(--text-muted);
    margin: 0;
    line-height: var(--leading-relaxed);
}

/* ========================================
   ENTRY CONTENT - Reading width for body text
   ======================================== */

.entry-content {
    max-width: var(--width-reading);
    margin: 0 auto;
}

.entry-content > *:first-child {
    margin-top: 0;
}

.entry-content > *:last-child {
    margin-bottom: 0;
}

/* ========================================
   SINGLE POST - Spacious reading layout
   ======================================== */

.single-post__header {
    margin-bottom: var(--space-10);
}

.single-post__title {
    font-size: var(--text-4xl);
    font-weight: 500;
    margin-bottom: var(--space-5);
    letter-spacing: var(--tracking-tighter);
}

.single-post__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.single-post__date,
.single-post__reading-time {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.single-post__categories {
    display: flex;
    gap: var(--space-2);
}

.single-post__category {
    color: var(--accent);
    font-weight: 500;
}

.single-post__featured-image {
    margin-bottom: var(--space-10);
    padding: var(--space-4);
    background-color: var(--surface-2);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.single-post__featured-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

.single-post__content {
    margin-bottom: var(--space-12);
}

/* ========================================
   POST NAVIGATION
   ======================================== */

.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    margin-top: var(--space-12);
    padding-top: var(--space-10);
    border-top: 1px solid var(--border-light);
}

.post-navigation__link {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-5);
    background-color: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.post-navigation__link:hover {
    background-color: var(--surface-2);
    border-color: var(--border);
}

.post-navigation__link:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.post-navigation__link:focus:not(:focus-visible) {
    outline: none;
}

.post-navigation__link--next {
    text-align: right;
}

.post-navigation__label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--text-light);
}

.post-navigation__title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
}

/* ========================================
   SEARCH FORM
   ======================================== */

.search-form {
    display: flex;
    gap: var(--space-2);
}

.search-form__input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    color: var(--text);
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.search-form__input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-form__input::placeholder {
    color: var(--text-light);
}

.search-form__submit {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-invert);
    background-color: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.search-form__submit:hover {
    background-color: var(--accent-hover);
}

/* ========================================
   NO RESULTS
   ======================================== */

.no-results {
    text-align: center;
    padding: var(--space-20) 0;
}

.no-results__title {
    margin-bottom: var(--space-4);
}

.no-results__description {
    color: var(--text-muted);
    margin-bottom: var(--space-6);
}

/* ========================================
   COMMENTS - Reading width
   ======================================== */

.comments-area {
    max-width: var(--width-reading);
    margin: 0 auto;
    padding-top: var(--space-12);
    border-top: 1px solid var(--border-light);
}

.comments-title {
    font-size: var(--text-2xl);
}

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

.comment-list .children {
    list-style: none;
    padding-left: var(--space-8);
    margin: 0;
    border-left: 2px solid var(--border-light);
}

.comment-body {
    padding: var(--space-5);
    margin-bottom: var(--space-4);
    background-color: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-base);
}

.comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.comment-author .avatar {
    border-radius: var(--radius-full);
}

.comment-author .fn {
    font-weight: 600;
    color: var(--text);
}

.comment-author .fn a {
    color: inherit;
    text-decoration: none;
}

.comment-metadata {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.comment-metadata a {
    color: inherit;
}

.comment-content {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.reply {
    margin-top: var(--space-3);
}

.reply a {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--accent);
}

/* Comment Form */
.comment-form {
    margin-top: var(--space-8);
}

.comment-reply-title {
    font-size: var(--text-xl);
}

.comment-form label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
    color: var(--text);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    color: var(--text);
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.comment-form .comment-form-comment,
.comment-form .comment-form-author,
.comment-form .comment-form-email,
.comment-form .comment-form-url {
    margin-bottom: var(--space-4);
}

.comment-form .form-submit {
    margin-top: var(--space-4);
}

.comment-form .submit {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-invert);
    background-color: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.comment-form .submit:hover {
    background-color: var(--accent-hover);
}

/* Comment Navigation */
.comment-navigation {
    display: flex;
    justify-content: space-between;
    margin: var(--space-6) 0;
    padding: var(--space-4) 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.comment-navigation a {
    font-size: var(--text-sm);
    font-weight: 500;
}

/* ========================================
   RESPONSIVE - MOBILE ADJUSTMENTS
   ======================================== */

@media (max-width: 900px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

    .blog-sidebar {
        position: static;
        text-align: center;
    }

    .blog-sidebar__header::before {
        display: none;
    }

    .blog-intro {
        text-align: center;
    }

    .category-filters {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .post-card {
        grid-template-columns: 120px 1fr;
        gap: var(--space-4);
        padding: var(--space-4) var(--space-5);
    }

    .post-card__body {
        flex-direction: column;
        gap: var(--space-2);
    }

    .post-card__meta {
        text-align: left;
    }

    .post-card__title {
        font-size: var(--text-lg);
    }

    .post-card__excerpt {
        font-size: var(--text-sm);
    }

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

    .single-post__title {
        font-size: var(--text-3xl);
    }
}

@media (max-width: 480px) {
    .post-card {
        grid-template-columns: 100px 1fr;
        gap: var(--space-3);
        padding: var(--space-4);
    }

    .post-card__title {
        font-size: var(--text-base);
    }

    .post-card__excerpt {
        -webkit-line-clamp: 1;
        font-size: var(--text-sm);
    }

    .share-buttons {
        justify-content: center;
    }

    .category-filters {
        gap: var(--space-2);
    }

    .category-filter {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-xs);
    }
}
