/* --- Archive hero --- */
.blog-archive-hero {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glhf-border);
    position: relative;
}

.blog-archive-hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: min(280px, 60%);
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--glhf-accent), transparent);
    box-shadow: 0 0 20px var(--glhf-accent-glow);
}

.blog-archive-hero__title {
    font-family: var(--glhf-font-heading);
    font-weight: 900;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 0.75rem;
    line-height: 1.15;
}

.blog-archive-hero__desc {
    max-width: 640px;
    margin: 0 auto 1rem;
    color: var(--glhf-text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

.blog-archive-hero__count {
    display: inline-block;
    margin: 0;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--glhf-accent);
    background: var(--glhf-accent-dim);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-full);
}

.blog-archive-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* --- Cards --- */
.blog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card--featured {
    flex-direction: row;
    align-items: stretch;
    min-height: 320px;
}

.blog-card--featured .blog-card__media {
    flex: 1.15;
    min-width: 0;
    aspect-ratio: auto;
    min-height: 280px;
}

.blog-card--featured .blog-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 2.25rem;
}

.blog-card--featured .entry-title {
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
}

.blog-card__media {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    contain: paint;
}

.blog-card__media-link {
    display: block;
    height: 100%;
}

.blog-card__media img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    transition: transform var(--glhf-transition-slow);
}

.blog-card__media::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(10, 14, 18, 0.85) 0%, transparent 55%);
    pointer-events: none;
    opacity: 0.7;
    transition: opacity var(--glhf-transition);
}

.blog-card:hover .blog-card__media::after {
    opacity: 0.9;
}

.blog-card:hover .blog-card__media img {
    transform: scale(1.04);
}

.blog-card__chip-row {
    padding: 1rem 1.5rem 0;
}

.blog-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-family: var(--glhf-font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: var(--glhf-radius-full);
    transition: all var(--glhf-transition-fast);
}

.blog-chip--category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    color: var(--glhf-accent);
    background: rgba(10, 14, 18, 0.75);
    border: 1px solid var(--glhf-border-bright);
    backdrop-filter: blur(8px);
}

a.blog-chip--category:hover {
    background: var(--glhf-accent-dim);
    color: var(--glhf-text-primary);
}

.blog-chip--tag {
    color: var(--glhf-text-secondary);
    background: rgba(var(--glhf-accent-rgb), 0.06);
    border: 1px solid var(--glhf-border);
}

a.blog-chip--tag:hover {
    color: var(--glhf-accent);
    border-color: var(--glhf-border-bright);
}

.blog-card__meta {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 1rem;
}

.blog-author-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-author-avatar {
    width: 28px;
    height: auto;
    max-width: 28px;
    max-height: 28px;
    border-radius: var(--glhf-radius-full);
    border: 1px solid var(--glhf-border);
    object-fit: cover;
}

.blog-author-name {
    color: var(--glhf-text-primary);
    font-weight: 600;
    font-size: 0.88rem;
}

.blog-meta-sep {
    color: var(--glhf-text-muted);
    opacity: 0.6;
}

.blog-reading-time,
.blog-card__meta .posted-on,
.blog-card__meta .entry-date {
    font-size: 0.85rem;
    color: var(--glhf-text-muted);
}

.blog-card__excerpt {
    flex: 1;
    margin-bottom: 1.25rem;
}

.blog-card__read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--glhf-font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--glhf-accent);
    text-decoration: none;
    transition: gap var(--glhf-transition-fast), color var(--glhf-transition-fast);
}

.blog-card__read-more:hover {
    color: var(--glhf-text-primary);
    gap: 0.75rem;
}

.blog-card__read-arrow {
    transition: transform var(--glhf-transition-fast);
}

.blog-card__read-more:hover .blog-card__read-arrow {
    transform: translateX(3px);
}

.blog-posts-grid {
    margin-bottom: 0;
}

.blog-posts-grid--related {
    margin-top: 1.5rem;
}

/* --- Single hero --- */
.site-main.blog-single {
    padding-top: 0;
}

.admin-bar .site-main.blog-single {
    padding-top: 0;
}

.admin-bar .blog-single-hero__inner {
    padding-top: calc(32px + var(--glhf-header-height) + 40px);
}

.blog-single-hero {
    position: relative;
    margin-bottom: 3rem;
    padding-top: 0;
    padding-bottom: 3rem;
    background: var(--glhf-bg-secondary);
    border-bottom: 1px solid var(--glhf-border);
    overflow: hidden;
}

.blog-single-hero--has-image {
    min-height: 420px;
    display: flex;
    align-items: flex-end;
    padding-top: 0;
    padding-bottom: 0;
}

.blog-single-hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.blog-single-hero__media img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

.blog-single-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(10, 14, 18, 0.97) 0%,
        rgba(10, 14, 18, 0.6) 45%,
        rgba(10, 14, 18, 0.35) 100%
    );
}

.blog-single-hero__inner {
    position: relative;
    z-index: 1;
    padding-top: calc(var(--glhf-header-height) + 40px);
    padding-bottom: 3rem;
}

.blog-single-hero--has-image .blog-single-hero__inner {
    padding-top: calc(var(--glhf-header-height) + 40px);
}

.blog-single-hero__title {
    font-family: var(--glhf-font-heading);
    font-weight: 900;
    font-size: clamp(1.75rem, 4vw, 2.6rem);
    line-height: 1.15;
    margin: 0 0 1.25rem;
    color: var(--glhf-text-primary);
}

.blog-single-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0;
}

.blog-single-hero__meta .blog-author-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-single-hero__meta .posted-on,
.blog-single-hero__meta .blog-reading-time {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.blog-single-hero__meta .blog-meta-sep {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.blog-single-hero__meta .blog-author-avatar {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
    flex-shrink: 0;
}

.blog-single-hero__meta .blog-chip--category {
    position: static;
    top: auto;
    left: auto;
    backdrop-filter: none;
}

/* --- Single body --- */

.blog-single-body {
    padding-bottom: 4rem;
}

.blog-article {
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-xl);
    padding: 2.5rem 3rem;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}

.blog-article::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(var(--glhf-accent-rgb), 0.08), transparent 45%);
    pointer-events: none;
    z-index: 0;
}

.blog-article > * {
    position: relative;
    z-index: 1;
}

.blog-entry-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--glhf-text-secondary);
}

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

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

.blog-entry-content p {
    margin-bottom: 1.25rem;
}

.blog-entry-content h2,
.blog-entry-content h3,
.blog-entry-content h4 {
    font-family: var(--glhf-font-heading);
    color: var(--glhf-text-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.25;
}

.blog-entry-content h2 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glhf-border);
}

.blog-entry-content h3 {
    font-size: 1.15rem;
}

.blog-entry-content a {
    color: var(--glhf-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color var(--glhf-transition-fast);
}

.blog-entry-content a:hover {
    color: var(--glhf-text-primary);
}

.blog-entry-content ul,
.blog-entry-content ol {
    margin: 0 0 1.25rem;
    padding-left: 1.5rem;
}

.blog-entry-content li {
    margin-bottom: 0.5rem;
}

.blog-entry-content blockquote {
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    border-left: 3px solid var(--glhf-accent);
    background: rgba(var(--glhf-accent-rgb), 0.05);
    border-radius: 0 var(--glhf-radius-md) var(--glhf-radius-md) 0;
    color: var(--glhf-text-primary);
    font-style: italic;
}

.blog-entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--glhf-radius-md);
    margin: 1.5rem 0;
    box-shadow: var(--glhf-shadow-md);
}

.blog-entry-content figure {
    margin: 1.5rem 0;
}

.blog-entry-content figcaption {
    margin-top: 0.5rem;
    font-size: 0.88rem;
    color: var(--glhf-text-muted);
    text-align: center;
}

.blog-entry-content pre,
.blog-entry-content code {
    font-family: var(--glhf-font-mono);
    font-size: 0.9em;
}

.blog-entry-content pre {
    overflow-x: auto;
    padding: 1.25rem;
    background: var(--glhf-bg-primary);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-md);
    margin: 1.5rem 0;
}

.blog-entry-content :not(pre) > code {
    padding: 2px 6px;
    background: rgba(var(--glhf-accent-rgb), 0.1);
    border-radius: 4px;
}

.blog-entry-content hr {
    border: none;
    height: 1px;
    background: var(--glhf-border);
    margin: 2rem 0;
}

.blog-entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.blog-entry-content th,
.blog-entry-content td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--glhf-border);
    text-align: left;
}

.blog-entry-content th {
    background: rgba(var(--glhf-accent-rgb), 0.08);
    color: var(--glhf-text-primary);
    font-family: var(--glhf-font-heading);
}

/* --- Tags --- */
.blog-tags {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glhf-border);
}

.blog-tags__label {
    display: block;
    font-family: var(--glhf-font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--glhf-text-muted);
    margin-bottom: 0.75rem;
}

.blog-tags__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* --- Post navigation --- */
.blog-post-nav .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 3rem;
}

.blog-post-nav .nav-previous,
.blog-post-nav .nav-next {
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-lg);
    padding: 1.25rem 1.5rem;
    transition: all var(--glhf-transition);
}

.blog-post-nav .nav-previous:hover,
.blog-post-nav .nav-next:hover {
    border-color: var(--glhf-border-bright);
    box-shadow: var(--glhf-shadow-glow);
    transform: translateY(-2px);
}

.blog-post-nav .nav-next {
    text-align: right;
}

.blog-post-nav a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.blog-post-nav__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--glhf-accent);
    margin-bottom: 0.35rem;
}

.blog-post-nav__title {
    display: block;
    font-family: var(--glhf-font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--glhf-text-primary);
    line-height: 1.35;
}

/* --- Related --- */
.blog-related {
    margin-bottom: 3rem;
}

.blog-related__title {
    font-family: var(--glhf-font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--glhf-text-primary);
    margin: 0 0 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glhf-border);
}

/* --- Pagination --- */
.blog-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.blog-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    font-family: var(--glhf-font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--glhf-text-secondary);
    background: var(--glhf-bg-card);
    border: 1px solid var(--glhf-border);
    border-radius: var(--glhf-radius-md);
    text-decoration: none;
    transition: all var(--glhf-transition-fast);
}

.blog-pagination .page-numbers:hover,
.blog-pagination .page-numbers.current {
    color: var(--glhf-bg-primary);
    background: var(--glhf-accent);
    border-color: var(--glhf-accent);
    box-shadow: var(--glhf-shadow-glow);
}

/* --- Empty state --- */
.blog-empty__inner {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--glhf-bg-card);
    border: 1px dashed var(--glhf-border);
    border-radius: var(--glhf-radius-xl);
}

.blog-empty__inner h2 {
    font-family: var(--glhf-font-heading);
    margin-bottom: 0.75rem;
}

.blog-empty__inner p {
    color: var(--glhf-text-secondary);
    margin: 0;
}

/* --- Comments (minimal) --- */
.blog-comments {
    margin-top: 1rem;
}

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

/* --- Responsive --- */
@media (max-width: 900px) {
    .blog-card--featured {
        flex-direction: column;
        min-height: 0;
    }

    .blog-card--featured .blog-card__media {
        min-height: 220px;
        aspect-ratio: 16 / 10;
    }

    .blog-card--featured .blog-card__body {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .blog-archive-hero {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }

    .blog-article {
        padding: 1.75rem 1.25rem;
    }

    .blog-post-nav .nav-links {
        grid-template-columns: 1fr;
    }

    .blog-post-nav .nav-next {
        text-align: left;
    }

    .blog-single-hero__inner,
    .blog-single-hero--has-image .blog-single-hero__inner {
        padding-top: calc(var(--glhf-header-height) + 24px);
    }

    .admin-bar .blog-single-hero__inner,
    .admin-bar .blog-single-hero--has-image .blog-single-hero__inner {
        padding-top: calc(46px + var(--glhf-header-height) + 24px);
    }
}
