/* ═══════════════════════════════════════════════
 *
 *   Die helle Seite. Buchstäblich.
 *   Insights, Blog, Gedanken — alles was Tobias
 *   so durch den Kopf geht. In hellem Modus,
 *   weil dunkle Gedanken reichen schon im echten Leben.
 *
 *   #F5F2EE — die Farbe von gutem Papier
 *   und noch besserem Kaffee.
 *
 * ═══════════════════════════════════════════════ */

/* ─── Insights Archive ─── */
.th-insights {
    padding: var(--th-space-3xl) 0 var(--th-space-5xl);
}

.th-insights__header {
    text-align: center;
    margin-bottom: var(--th-space-3xl);
    padding-top: var(--th-space-2xl);
}

.th-insights__header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--th-light-text);
    margin-bottom: var(--th-space-sm);
}

.th-insights__header p {
    font-size: 1.1rem;
    color: var(--th-light-text-2);
    max-width: 500px;
    margin: 0 auto;
}

.th-insights__subtitle-line {
    width: 60px;
    height: 3px;
    background: var(--th-vermillion);
    margin: var(--th-space-lg) auto 0;
}

/* Category filter */
.th-cat-filter {
    display: flex;
    justify-content: center;
    gap: var(--th-space-sm);
    margin-bottom: var(--th-space-3xl);
    flex-wrap: wrap;
}

.th-cat-filter a {
    font-family: var(--th-font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem;
    border: 1px solid var(--th-light-border);
    border-radius: 2px;
    color: var(--th-light-text-2);
    transition: all var(--th-duration);
}

.th-cat-filter a:hover,
.th-cat-filter a.active {
    border-color: var(--th-vermillion);
    color: var(--th-vermillion);
    background: rgba(255, 63, 0, 0.05);
}

/* Blog Grid */
.th-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--th-space-xl);
}

.th-blog-card {
    background: var(--th-light-bg-2);
    border: 1px solid var(--th-light-border);
    border-radius: 2px;
    overflow: hidden;
    transition: all var(--th-duration) var(--th-ease);
    opacity: 0;
    transform: translateY(20px);
}

.th-blog-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.th-blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    border-color: var(--th-vermillion);
}

.th-blog-card__image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3/2;
}

.th-blog-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(30%);
    transition: all 0.5s var(--th-ease);
}

.th-blog-card:hover .th-blog-card__image img {
    filter: grayscale(0%);
    transform: scale(1.03);
}

.th-blog-card__cat {
    position: absolute;
    top: var(--th-space-md);
    left: var(--th-space-md);
    font-family: var(--th-font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #FFFFFF;
    background: var(--th-vermillion);
    padding: 0.25rem 0.6rem;
    border-radius: 2px;
}

.th-blog-card__body {
    padding: var(--th-space-lg);
}

.th-blog-card__title {
    font-family: var(--th-font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--th-light-text);
    line-height: 1.3;
    margin-bottom: var(--th-space-sm);
}

.th-blog-card__excerpt {
    font-size: 0.9rem;
    color: var(--th-light-text-2);
    line-height: 1.6;
    margin-bottom: var(--th-space-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.th-blog-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--th-font-mono);
    font-size: 0.75rem;
    color: var(--th-light-text-3);
}

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

/* ─── Single Article ─── */
.th-article {
    padding-bottom: var(--th-space-5xl);
}

/* Article Hero */
.th-article__hero {
    position: relative;
    width: 100%;
    min-height: 60vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    margin-bottom: var(--th-space-3xl);
}

.th-article__hero-img {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.th-article__hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.th-article__hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0) 100%);
    z-index: 1;
}

.th-article__hero-content {
    position: relative;
    z-index: 2;
    padding: var(--th-space-3xl) var(--th-space-lg);
    max-width: var(--th-max-width);
    margin: 0 auto;
    width: 100%;
    color: #FFFFFF;
}

.th-article__hero-content h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    max-width: 800px;
    margin-bottom: var(--th-space-md);
}

.th-article__hero-meta {
    display: flex;
    gap: var(--th-space-lg);
    font-family: var(--th-font-mono);
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
}

/* Article Body */
.th-article__body {
    max-width: var(--th-content-width);
    margin: 0 auto;
    padding: 0 var(--th-space-lg);
}

.th-article__body h2 {
    font-size: 1.75rem;
    color: var(--th-light-text);
    margin-top: var(--th-space-3xl);
    margin-bottom: var(--th-space-lg);
    padding-left: var(--th-space-md);
    border-left: 3px solid var(--th-vermillion);
}

.th-article__body h3 {
    font-size: 1.35rem;
    color: var(--th-light-text);
    margin-top: var(--th-space-2xl);
    margin-bottom: var(--th-space-md);
}

.th-article__body p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--th-light-text);
    margin-bottom: var(--th-space-lg);
    max-width: none;
}

.th-article__body a {
    color: var(--th-vermillion);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.th-article__body img {
    width: calc(100% + 4rem);
    margin-left: -2rem;
    margin-top: var(--th-space-2xl);
    margin-bottom: var(--th-space-2xl);
    border-radius: 2px;
}

.th-article__body blockquote {
    border-left: 3px solid var(--th-vermillion);
    padding: var(--th-space-md) var(--th-space-xl);
    margin: var(--th-space-2xl) 0;
    font-size: 1.2rem;
    font-style: italic;
    color: var(--th-light-text);
    line-height: 1.7;
    background: var(--th-light-bg-3);
}

.th-article__body ul,
.th-article__body ol {
    padding-left: var(--th-space-xl);
    margin-bottom: var(--th-space-lg);
}

.th-article__body li {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--th-light-text);
    margin-bottom: var(--th-space-sm);
}

/* Code blocks */
.th-article__body pre {
    background: var(--th-dark-bg-3);
    color: var(--th-dark-text);
    padding: var(--th-space-xl);
    margin: var(--th-space-2xl) 0;
    border-radius: 2px;
    overflow-x: auto;
    font-family: var(--th-font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    border-left: 3px solid var(--th-vermillion);
}

.th-article__body code {
    font-family: var(--th-font-mono);
    font-size: 0.9em;
    background: var(--th-light-bg-3);
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
}

.th-article__body pre code {
    background: none;
    padding: 0;
}

/* Article Footer */
.th-article__footer {
    max-width: var(--th-content-width);
    margin: var(--th-space-3xl) auto 0;
    padding: 0 var(--th-space-lg);
}

.th-article__author {
    display: flex;
    align-items: center;
    gap: var(--th-space-lg);
    padding: var(--th-space-xl);
    background: var(--th-light-bg-2);
    border: 1px solid var(--th-light-border);
    border-radius: 2px;
}

.th-article__author img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    filter: grayscale(100%);
    object-fit: cover;
}

.th-article__author-info strong {
    display: block;
    font-size: 1rem;
}

.th-article__author-info span {
    font-size: 0.85rem;
    color: var(--th-light-text-2);
}

/* Related Posts */
.th-related {
    margin-top: var(--th-space-3xl);
}

.th-related h3 {
    font-size: 1.25rem;
    margin-bottom: var(--th-space-xl);
}

.th-related__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--th-space-lg);
}

/* ─── Downloads Section (Insights Page) ─── */
.th-downloads {
    padding: var(--th-space-3xl) 0;
    border-top: 1px solid var(--th-light-border);
    margin-top: var(--th-space-3xl);
}

.th-downloads h2 {
    font-size: 1.75rem;
    margin-bottom: var(--th-space-sm);
}

.th-downloads__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--th-space-lg);
    margin-top: var(--th-space-2xl);
}

.th-download-card {
    background: var(--th-light-bg-2);
    border: 1px solid var(--th-light-border);
    padding: var(--th-space-xl);
    border-radius: 2px;
    display: flex;
    align-items: flex-start;
    gap: var(--th-space-md);
    transition: all var(--th-duration);
}

.th-download-card:hover {
    border-color: var(--th-vermillion);
    transform: translateY(-2px);
}

.th-download-card__icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    color: var(--th-vermillion);
}

.th-download-card__icon svg {
    width: 100%;
    height: 100%;
}

.th-download-card h4 {
    font-size: 1rem;
    margin-bottom: var(--th-space-xs);
}

.th-download-card p {
    font-size: 0.85rem;
    color: var(--th-light-text-2);
    margin-bottom: var(--th-space-sm);
}

.th-download-card__meta {
    font-family: var(--th-font-mono);
    font-size: 0.7rem;
    color: var(--th-light-text-3);
}

/* ─── Media Hub (Insights Page) ─── */
.th-media-hub {
    padding: var(--th-space-3xl) 0;
    border-top: 1px solid var(--th-light-border);
}

.th-media-hub h2 {
    font-size: 1.75rem;
    margin-bottom: var(--th-space-2xl);
}

.th-media-tabs {
    display: flex;
    gap: var(--th-space-sm);
    margin-bottom: var(--th-space-2xl);
}

.th-media-tab {
    font-family: var(--th-font-mono);
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--th-light-border);
    border-radius: 2px;
    background: transparent;
    color: var(--th-light-text-2);
    cursor: pointer;
    transition: all var(--th-duration);
}

.th-media-tab:hover,
.th-media-tab.active {
    border-color: var(--th-vermillion);
    color: var(--th-vermillion);
}

.th-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--th-space-lg);
}

.th-media-card {
    background: var(--th-light-bg-2);
    border: 1px solid var(--th-light-border);
    border-radius: 2px;
    overflow: hidden;
    transition: all var(--th-duration);
}

.th-media-card:hover {
    border-color: var(--th-vermillion);
    transform: translateY(-2px);
}

.th-media-card__thumb {
    aspect-ratio: 16/9;
    background: var(--th-dark-bg-3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.th-media-card__play {
    width: 56px;
    height: 56px;
    background: var(--th-vermillion);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    transition: transform var(--th-duration);
}

.th-media-card:hover .th-media-card__play {
    transform: scale(1.1);
}

.th-media-card__body {
    padding: var(--th-space-lg);
}

.th-media-card__type {
    font-family: var(--th-font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--th-vermillion);
    margin-bottom: var(--th-space-xs);
}

.th-media-card h4 {
    font-size: 1rem;
    margin-bottom: var(--th-space-xs);
}

.th-media-card p {
    font-size: 0.85rem;
    color: var(--th-light-text-2);
}

/* ─── X Feed Embed ─── */
.th-x-feed {
    max-width: 550px;
    margin: 0 auto;
}

/* ─── Pagination ─── */
.th-pagination {
    display: flex;
    justify-content: center;
    gap: var(--th-space-sm);
    margin-top: var(--th-space-3xl);
}

.th-pagination a,
.th-pagination span {
    font-family: var(--th-font-mono);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--th-light-border);
    border-radius: 2px;
    transition: all var(--th-duration);
}

.th-pagination a:hover,
.th-pagination .current {
    border-color: var(--th-vermillion);
    color: var(--th-vermillion);
}

@media (max-width: 768px) {
    .th-article__hero {
        min-height: 40vh;
    }

    .th-article__body img {
        width: calc(100% + 2rem);
        margin-left: -1rem;
    }

    .th-article__author {
        flex-direction: column;
        text-align: center;
    }

    .th-downloads__grid,
    .th-media-grid {
        grid-template-columns: 1fr;
    }
}
