/* ================================================================
   Flip Mentors — Articles
   Built on the tokens in style.css (ink / gold / bone, Playfair + Inter).
   ================================================================ */

/* ---------- category filter ---------- */
.article-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 50px;
}
.article-filter a {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 9px 20px;
    border-radius: 999px;
    border: 1.5px solid #dcd5c0;
    color: var(--slate);
    background: #fff;
    transition: all 0.2s ease;
}
.article-filter a:hover { border-color: var(--gold); color: var(--ink); }
.article-filter a.active { background: var(--ink); border-color: var(--ink); color: var(--gold); }

/* ---------- cards ---------- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}
.article-card {
    background: #fff;
    border: 1px solid #ebe6d6;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.article-card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: var(--shadow-md); }

.article-card-media {
    display: block;
    aspect-ratio: 16 / 10;
    background: linear-gradient(145deg, var(--ink) 0%, var(--ink-3) 100%);
    overflow: hidden;
}
.article-card-media img { width: 100%; height: 100%; object-fit: cover; }
.article-card-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 26px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.85);
    background: radial-gradient(260px 160px at 80% 0%, rgba(212, 175, 55, 0.28), transparent 70%);
}
.article-card-placeholder em { color: var(--gold); }

.article-card-body { padding: 26px 28px 28px; display: flex; flex-direction: column; flex: 1; }
.article-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 12.5px;
    color: var(--slate-2);
    margin-bottom: 12px;
}
.article-cat {
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold-dim);
}
.article-card h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}
.article-card h3 a:hover { color: var(--gold-dim); }
.article-card p {
    font-size: 15.5px;
    color: var(--slate);
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-more { margin-top: auto; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.article-more:hover { color: var(--gold-dim); }

.articles-empty {
    text-align: center;
    padding: 70px 24px;
    background: #fff;
    border: 1px dashed #dcd5c0;
    border-radius: var(--radius-lg);
}
.articles-empty h3 { font-family: 'Playfair Display', Georgia, serif; font-size: 26px; margin-bottom: 8px; }
.articles-empty p { color: var(--slate); }

#article-results { transition: opacity 0.2s ease; }
#article-results.loading { opacity: 0.45; pointer-events: none; }

/* ---------- pagination ---------- */
.article-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 56px;
    font-size: 14.5px;
    font-weight: 600;
}
.article-pagination a,
.article-pagination span {
    min-width: 42px;
    padding: 9px 14px;
    text-align: center;
    border-radius: 999px;
}
.article-pagination a { border: 1.5px solid #dcd5c0; background: #fff; color: var(--ink); transition: all 0.2s ease; }
.article-pagination a:hover { border-color: var(--gold); }
.article-pagination .current { background: var(--ink); color: var(--gold); }
.article-pagination .gap { color: var(--slate-2); min-width: 0; padding: 9px 2px; }

/* ---------- single article ---------- */
.article-hero { padding: 100px 32px 90px; }
.article-hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.12; overflow-wrap: anywhere; }
.article-hero .eyebrow:hover { background: rgba(212, 175, 55, 0.14); }
.article-date { color: #a8a8c0; font-size: 15px; letter-spacing: 0.3px; }

.article-main { padding-top: 70px; }
.article-wrap { max-width: 760px; margin: 0 auto; }
.article-featured {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 48px;
}

.article-body { font-size: 18px; line-height: 1.8; color: #2a2a3e; overflow-wrap: break-word; }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.4em; }
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--ink);
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 1.8em 0 0.6em;
}
.article-body h1, .article-body h2 { font-size: 32px; }
.article-body h3 { font-size: 25px; }
.article-body h4 { font-size: 20px; }
.article-body h5, .article-body h6 {
    font-size: 14px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
    color: var(--gold-dim); margin: 2em 0 0.6em;
}
.article-body a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.article-body a:hover { color: var(--gold-dim); }
.article-body ul, .article-body ol { margin: 0 0 1.4em 1.4em; }
.article-body li { margin-bottom: 0.5em; padding-left: 4px; }
.article-body li::marker { color: var(--gold-dim); font-weight: 700; }
.article-body blockquote {
    margin: 2em 0;
    padding: 22px 28px;
    background: #fff;
    border: 1px solid #ebe6d6;
    border-left: 4px solid var(--gold);
    border-radius: var(--radius);
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 21px;
    line-height: 1.5;
    color: var(--ink);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body img { height: auto; border-radius: var(--radius); margin: 2em auto; }
.article-body figure { margin: 2em 0; }
.article-body figure img { margin: 0 auto; }
.article-body figcaption { text-align: center; font-size: 14px; color: var(--slate-2); margin-top: 10px; }
.article-body hr { border: none; height: 1px; background: #dcd5c0; margin: 2.6em 0; }
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    font-size: 16px;
    display: block;
    overflow-x: auto;
}
.article-body th, .article-body td { border: 1px solid #e3dcc8; padding: 12px 16px; text-align: left; vertical-align: top; background: #fff; }
.article-body th { background: var(--ink); color: #fff; font-weight: 600; }
.article-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: #efe9d8;
    padding: 2px 6px;
    border-radius: 5px;
}
.article-body pre {
    background: var(--ink);
    color: #e6e6f0;
    padding: 22px 24px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 2em 0;
    font-size: 15px;
    line-height: 1.6;
}
.article-body pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

.author-block {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-top: 60px;
    padding: 30px 32px;
    background: #fff;
    border: 1px solid #ebe6d6;
    border-radius: var(--radius-lg);
}
.author-block .avatar {
    flex-shrink: 0;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ink), var(--ink-3));
    color: var(--gold);
    font-weight: 700;
    font-size: 18px;
    display: flex; align-items: center; justify-content: center;
}
.author-label { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-dim); }
.author-name { font-weight: 700; font-size: 17px; color: var(--ink); margin: 2px 0 6px; }
.author-block p { font-size: 15.5px; color: var(--slate); line-height: 1.6; }

.preview-bar {
    background: var(--gold);
    color: var(--ink);
    text-align: center;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 9px 16px;
}

@media (max-width: 900px) {
    .article-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .article-grid { grid-template-columns: 1fr; }
    .article-hero { padding: 80px 20px 70px; }
    .article-body { font-size: 17px; }
    .article-body h1, .article-body h2 { font-size: 27px; }
    .author-block { flex-direction: column; padding: 24px; }
    .article-filter { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
    .article-filter a { white-space: nowrap; }
}
