/* ===== Writing Page — Link Preview Cards ===== */

/* ── Screen-reader only (visible to crawlers, hidden visually) ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Active topbar link ── */
.topbar__link--active {
    color: var(--text) !important;
    font-weight: 500;
}


/* ════════════════════════════════════════════ */
/* WRITING ARTICLES SECTION                    */
/* ════════════════════════════════════════════ */
.writing-section {
    padding: 56px 56px 100px;
}

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


/* ════════════════════════════════════════════ */
/* LINK PREVIEW CARD                           */
/* ════════════════════════════════════════════ */
.link-card {
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

body.dark .link-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* ── Image ── */
.link-card__img {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(150, 150, 150, 0.08), rgba(150, 150, 150, 0.03));
}

body.dark .link-card__img {
    background: linear-gradient(145deg, #2a2825, #1f1e1b);
}

.link-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

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

/* ── Body ── */
.link-card__body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Title */
.link-card__title {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.35;
    letter-spacing: -0.1px;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Description */
.link-card__desc {
    font-size: 0.825rem;
    color: var(--muted);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Source / domain */
.link-card__source {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.2px;
    margin-top: 2px;
}

.link-card__source-icon {
    opacity: 0.5;
    flex-shrink: 0;
}


/* ════════════════════════════════════════════ */
/* RESPONSIVE                                  */
/* ════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .writing-section {
        padding: 48px 40px 80px;
    }

    .writing-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 820px) {
    .writing-section {
        padding: 32px 24px calc(100px + env(safe-area-inset-bottom, 16px));
    }

    .writing-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}