/* public/articles.css */

/* ===== Footnotes in Article Detail ===== */
.detail-footnotes {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px dashed #d4c4a8;
    font-family: 'Amiri', serif;
}
.detail-footnotes-title { display: none; }
.detail-footnotes-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.footnote-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 18px;
    color: #2b2a28;
    line-height: 1.7;
}
.footnote-num {
    font-size: 14px;
    color: #241602;
    flex-shrink: 0;
}
.footnote-text {
    flex: 1;
}

/* ===== Related Articles ===== */
.related-articles {
    margin: 48px 0 0 0;
    padding: 32px 0 0 0;
    border-top: 2px solid #e8dcc8;
}
.related-articles-title {
    font-family: 'Rakkas', serif;
    font-size: 1.5rem;
    color: #5a3e1b;
    margin: 0 0 20px 0;
    text-align: right;
}
.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}
.related-card {
    display: flex;
    flex-direction: column;
    background: #fdf8f0;
    border: 1px solid #e0d0b0;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s;
}
.related-card:hover {
    box-shadow: 0 6px 20px rgba(90,62,27,0.15);
    transform: translateY(-3px);
}
.related-card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}
.related-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: #f0e6d0;
    height: 140px;
}
.related-card-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.related-card-title {
    font-family: 'Amiri', serif;
    font-size: 1rem;
    font-weight: 700;
    color: #3d2b0e;
    line-height: 1.4;
}
.related-card-excerpt {
    font-size: 0.82rem;
    color: #7a6040;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (max-width: 600px) {
    .related-articles-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .related-card-img, .related-card-placeholder { height: 100px; }
}
@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Rakkas&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: #1a1f2e;
    font-family: 'Amiri', serif;
    min-height: 100vh;
    direction: rtl;
}

/* ══════════════════════════════════════
   PHILOSOPHICAL HERO SECTION
══════════════════════════════════════ */
.phil-hero {
    position: relative;
    min-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0a0d16;
}

.hero-bg-layers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-layer {
    position: absolute;
    inset: 0;
}

.hero-layer-1 {
    background: radial-gradient(ellipse 80% 60% at 50% 30%, #1a1f3a 0%, #0a0d16 70%);
}

.hero-layer-2 {
    background:
        radial-gradient(circle 500px at 20% 80%, rgba(139,38,53,0.08) 0%, transparent 70%),
        radial-gradient(circle 400px at 80% 20%, rgba(201,168,76,0.06) 0%, transparent 70%);
}

.hero-particles {
    position: absolute;
    inset: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: #c9a84c;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0%   { transform: translateY(0) translateX(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-120px) translateX(30px); opacity: 0; }
}

.hero-mandala-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.hero-mandala {
    width: min(600px, 100vw);
    height: min(600px, 100vw);
    opacity: 0.7;
}

.mandala-ring-outer {
    animation: rotateSlow 80s linear infinite;
}

.mandala-ring-mid {
    animation: rotateSlow 50s linear infinite reverse;
}

.mandala-ring-inner {
    animation: rotateSlow 30s linear infinite;
}

@keyframes rotateSlow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.hero-socrates-wrap {
    position: absolute;
    left: -60px;
    bottom: 0;
    top: 0;
    z-index: 3;
    pointer-events: none;
    width: clamp(700px, 82vw, 1200px);
    display: flex;
    align-items: flex-end;
    animation: fadeUp 1.2s ease 0.3s both;
}

.hero-socrates-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: bottom left;
    filter:
        drop-shadow(0 0 60px rgba(201,168,76,0.18))
        drop-shadow(0 0 120px rgba(201,168,76,0.08));
    mask-image: linear-gradient(
        to right,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,1) 50%,
        rgba(0,0,0,0.3) 78%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,1) 50%,
        rgba(0,0,0,0.3) 78%,
        transparent 100%
    );
    transform: scaleX(1);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 60px 24px 80px;
    margin-left: clamp(300px, 34vw, 460px);
    max-width: 700px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}

@media (max-width: 1200px) {
    .hero-socrates-wrap {
        width: clamp(480px, 62vw, 800px);
    }
    .hero-content {
        margin-left: clamp(240px, 32vw, 420px);
    }
}

@media (max-width: 900px) {
    .hero-socrates-wrap {
        width: clamp(280px, 50vw, 420px);
        opacity: 0.45;
    }
    .hero-content {
        margin-left: 0;
        padding-left: 24px;
    }
}

@media (max-width: 500px) {
    .hero-socrates-wrap {
        width: 220px;
        opacity: 0.15;
        left: -20px;
    }
    .hero-content {
        margin-left: 0;
        padding: 40px 20px 60px;
    }
}

.hero-eyebrow {
    font-family: 'Amiri', serif;
    font-size: 17px;
    letter-spacing: 0.3em;
    color: #c9a84c;
    text-transform: uppercase;
    opacity: 0.85;
    animation: fadeUp 0.8s ease both;
}

.hero-headline {
    font-family: 'Rakkas', serif;
    font-size: clamp(2.8rem, 8vw, 5.5rem);
    font-weight: 400;
    line-height: 1.1;
    color: #f5f0e4;
    display: flex;
    gap: 0.3em;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
}

.hero-word {
    display: inline-block;
    animation: fadeUp 0.8s ease both;
    animation-delay: calc(var(--i) * 0.15s + 0.2s);
}

.hero-word-accent {
    color: #c9a84c;
    position: relative;
}

.hero-word-accent::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #c9a84c, transparent);
    animation: shimmer 3s ease infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.hero-quote {
    font-family: 'Amiri', serif;
    font-size: clamp(1.2rem, 2.8vw, 1.5rem);
    color: rgba(245,240,228,0.75);
    line-height: 1.9;
    max-width: 520px;
    transition: opacity 0.4s ease, transform 0.4s ease;
    min-height: 2.5em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    animation: fadeUp 0.8s ease 0.7s both;
}

.quote-author {
    font-size: 0.8em;
    color: #c9a84c;
    opacity: 0.8;
    letter-spacing: 0.05em;
}

.hero-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 200px;
    animation: fadeUp 0.8s ease 0.9s both;
}

.hero-divider span:not(.hero-divider-gem) {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201,168,76,0.4), transparent);
}

.hero-divider-gem {
    color: #c9a84c;
    font-size: 10px;
    opacity: 0.7;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 36px;
    animation: fadeUp 0.8s ease 1s both;
    margin: 8px 0;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.hero-stat-num {
    font-family: 'Rakkas', serif;
    font-size: 2.4rem;
    color: #c9a84c;
    line-height: 1;
}

.hero-stat-label {
    font-family: 'Amiri', serif;
    font-size: 15px;
    color: rgba(245,240,228,0.55);
    letter-spacing: 0.05em;
}

.hero-stat-sep {
    color: rgba(201,168,76,0.3);
    font-size: 28px;
    line-height: 1;
}

.hero-cta-group {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeUp 0.8s ease 1.1s both;
    margin-bottom: 8px;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 36px;
    border: 1.5px solid rgba(201,168,76,0.5);
    border-radius: 40px;
    color: #c9a84c;
    font-family: 'Amiri', serif;
    font-size: 16px;
    text-decoration: none;
    letter-spacing: 0.06em;
    transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.hero-cta-secondary {
    background: transparent;
    border-color: rgba(245,240,228,0.2);
    color: rgba(245,240,228,0.6);
}

.hero-cta-secondary:hover {
    background: rgba(245,240,228,0.08);
    border-color: rgba(245,240,228,0.4);
    color: #f5f0e4;
    box-shadow: 0 0 20px rgba(245,240,228,0.08);
}

.hero-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(201,168,76,0.12), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.hero-cta:not(.hero-cta-secondary):hover {
    background: rgba(201,168,76,0.15);
    border-color: #c9a84c;
    box-shadow: 0 0 28px rgba(201,168,76,0.2);
    color: #f5f0e4;
}

.hero-cta:not(.hero-cta-secondary):hover::before { opacity: 1; }

/* ── Hero Issues Carousel ── */
.hero-issues-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    animation: fadeUp 0.8s ease 1.2s both;
    margin-top: 10px;
    margin-bottom: 20px;
    width: 100%;
    perspective: 800px;
}

/* Side covers (prev/next) */
.issues-cover-wrap {
    position: relative;
    flex-shrink: 0;
    transition: all 0.4s ease;
}

.issues-cover-wrap.is-center {
    width: 100px;
    height: 140px;
    z-index: 3;
}

.issues-cover-wrap.is-side {
    width: 72px;
    height: 100px;
    opacity: 0.55;
    z-index: 2;
    filter: brightness(0.7);
}

.issues-cover-link {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6), 0 0 0 1.5px rgba(201,168,76,0.35);
    transition: box-shadow 0.3s, transform 0.3s;
    position: relative;
}

.is-center .issues-cover-link {
    box-shadow: 0 8px 32px rgba(0,0,0,0.8), 0 0 0 2px rgba(201,168,76,0.7);
}

.issues-cover-link:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.75), 0 0 0 2px rgba(201,168,76,0.8);
    transform: scale(1.04);
}

.issues-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s;
}

.issues-cover-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.65);
    color: #c9a84c;
    font-family: 'Amiri', serif;
    font-size: 10px;
    text-align: center;
    padding: 3px 4px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.issues-arrow {
    background: transparent;
    border: 1.5px solid rgba(201,168,76,0.4);
    color: #c9a84c;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    padding: 0;
    flex-shrink: 0;
    z-index: 4;
}

.issues-arrow:hover {
    background: rgba(201,168,76,0.18);
    border-color: #c9a84c;
}

.issues-arrow:disabled {
    opacity: 0.25;
    cursor: default;
}

.issues-arrow-soon {
    font-family: 'Amiri', serif;
    font-size: 11px;
    color: #c9a84c;
    opacity: 0;
    position: absolute;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.3s;
    background: rgba(0,0,0,0.7);
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid rgba(201,168,76,0.4);
    bottom: -28px;
}

.issues-arrow-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.issues-arrow-wrap.show-soon .issues-arrow-soon {
    opacity: 1;
}

/* Dot indicators */
.issues-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 8px;
}
.issues-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(201,168,76,0.3);
    transition: background 0.3s, transform 0.3s;
    cursor: pointer;
    border: none;
    padding: 0;
}
.issues-dot.active {
    background: #c9a84c;
    transform: scale(1.4);
}

.hero-scroll-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.hero-scroll-hint span {
    display: block;
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, rgba(201,168,76,0.6));
    margin: 0 auto;
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { transform: scaleY(0.5); opacity: 0.3; transform-origin: top; }
    50% { transform: scaleY(1); opacity: 1; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .mandala-ring-outer, .mandala-ring-mid, .mandala-ring-inner,
    .particle, .hero-scroll-hint span { animation: none; }
}

@media (max-width: 600px) {
    .phil-hero {
        min-height: 90vh;
        overflow: hidden;
    }
    .hero-stats { gap: 14px; }
    .hero-stat-num { font-size: 1.2rem; }
    .hero-content {
        padding: 50px 20px 70px;
        gap: 18px;
        margin-left: 0;
        position: relative;
        z-index: 5;
    }
    .hero-socrates-wrap {
        width: 55vw;
        max-width: 260px;
        opacity: 0.18;
        left: -10px;
        top: auto;
    }
}

/* ── Header / Navbar ── */
.articles-header {
    background: #12161f;
    border-bottom: 2px solid #8b7355;
    position: sticky;
    top: 0;
    z-index: 200;
}

a { text-decoration: none; }

.header-navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
    gap: 24px;
}

.navbar-logo-link {
    font-family: 'Rakkas', serif;
    font-size: 24px;
    color: #c9a84c;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.04em;
    transition: color 0.2s;
}
.navbar-logo-link:hover { color: #f5f0e4; }

.navbar-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
}

.navbar-item {
    position: relative;
}

.navbar-btn {
    background: transparent;
    border: none;
    color: rgba(245,240,232,0.78);
    font-family: 'Amiri', serif;
    font-size: 16px;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.navbar-btn:hover {
    background: rgba(139,115,85,0.22);
    color: #f5f0e4;
}

.nav-arrow {
    font-size: 11px;
    transition: transform 0.2s;
    display: inline-block;
}

.navbar-item.open .nav-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.navbar-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #1a1f2e;
    border: 1px solid #8b7355;
    border-radius: 10px;
    min-width: 180px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.55);
    padding: 6px;
    list-style: none;
    margin: 0;
    z-index: 300;
    animation: fadeSlideDown 0.15s ease;
}

.navbar-item.open .navbar-dropdown {
    display: block;
}

.nav-drop-link {
    display: block;
    padding: 10px 16px;
    color: #d4c4a8;
    font-family: 'Amiri', serif;
    font-size: 15px;
    border-radius: 7px;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}

.nav-drop-link:hover {
    background: rgba(139,115,85,0.25);
    color: #f5f0e4;
}

/* Mobile toggle */
.navbar-mobile-toggle {
    display: none;
    background: transparent;
    border: 1.5px solid rgba(201,168,76,0.4);
    color: #c9a84c;
    font-size: 22px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.navbar-mobile-toggle:hover {
    background: rgba(201,168,76,0.12);
}

/* Active link highlight */
.navbar-btn.active-nav {
    background: rgba(139,115,85,0.28);
    color: #c9a84c;
}

@media (max-width: 768px) {
    .navbar-mobile-toggle { display: flex; }
    .navbar-links {
        display: none;
        position: absolute;
        top: 62px;
        right: 0;
        left: 0;
        background: #12161f;
        border-bottom: 2px solid #8b7355;
        flex-direction: column;
        align-items: stretch;
        padding: 10px 20px 16px;
        gap: 2px;
        z-index: 200;
    }
    .navbar-links.open { display: flex; }
    .navbar-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        border-right: 2px solid #8b7355;
        border-radius: 0;
        background: transparent;
        padding: 0 0 0 12px;
        margin-top: 4px;
    }
    .navbar-item.open .navbar-dropdown { display: block; }
    .navbar-btn { width: 100%; justify-content: space-between; }
}

.header-title {
    font-family: 'Rakkas', serif;
    font-size: 36px;
    color: #f5f0e8;
    font-weight: 400;
    flex: 1;
    text-align: center;
}

.header-subtitle {
    font-size: 14px;
    color: #8b7355;
    white-space: nowrap;
}

.back-link {
    color: #8b7355;
    text-decoration: none;
    font-size: 16px;
    white-space: nowrap;
    transition: color 0.2s;
}
.back-link:hover { color: #c4a47c; }

/* ── Controls bar ── */
/* Categories dropdown */
.categories-dropdown-wrap {
    position: relative;
}

.categories-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1a1f2e;
    color: #f0e6d0;
    border: 1px solid #8b7355;
    border-radius: 8px;
    padding: 8px 14px;
    font-family: 'Amiri', serif;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.categories-toggle-btn:hover {
    background: #8b7355;
    color: white;
}

.cat-arrow {
    font-size: 12px;
    transition: transform 0.2s;
}

.categories-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1e1e1e;
    border: 1px solid #8b7355;
    border-radius: 10px;
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 999;
    padding: 6px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

.categories-dropdown.open {
    display: block;
    animation: fadeSlideDown 0.15s ease;
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cat-item {
    display: block;
    width: 100%;
    text-align: right;
    padding: 9px 14px;
    background: transparent;
    border: none;
    color: #ccc;
    font-family: 'Amiri', serif;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}

.cat-item:hover {
    background: #2e2e2e;
    color: #f0e6d0;
}

.cat-item.active {
    background: #8b7355;
    color: white;
    font-weight: 700;
}

.categories-dropdown::-webkit-scrollbar { width: 5px; }
.categories-dropdown::-webkit-scrollbar-track { background: #1e1e1e; }
.categories-dropdown::-webkit-scrollbar-thumb { background: #8b7355; border-radius: 4px; }

/* Sticky footer layout */
html, body.articles-body {
    height: 100%;
}

body.articles-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.articles-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    background: #1a1f2e;
    padding: 16px 20px;
    border-radius: 0;
    margin-left: -30px;
    margin-right: -30px;
    padding-left: 30px;
    padding-right: 30px;
}

.articles-search-wrap {
    flex: 1;
    min-width: 220px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    right: 14px;
    font-size: 16px;
    pointer-events: none;
    z-index: 2;
}

.articles-search-input {
    width: 100%;
    padding: 12px 42px 12px 42px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    background: #1a1f2e;
    color: #f5f0e8;
    font-family: 'Amiri', serif;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.articles-search-input::placeholder { color: rgba(245,240,232,0.45); }

.articles-search-input:focus {
    border-color: #8b7355;
    background: #1a1f2e;
}

.search-clear-btn {
    position: absolute;
    left: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #f5f0e8;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 2;
}
.search-clear-btn:hover { background: rgba(255,255,255,0.3); }

.articles-lang-filter {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.lang-filter-btn {
    padding: 10px 18px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: transparent;
    color: rgba(245,240,232,0.7);
    font-family: 'Amiri', serif;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.lang-filter-btn:hover {
    background: rgba(139,115,85,0.3);
    border-color: #8b7355;
    color: #f5f0e8;
}

.lang-filter-btn.active {
    background: #8b7355;
    border-color: #8b7355;
    color: #fff;
}

.articles-results-info {
    display: none;
    color: rgba(245,240,232,0.6);
    font-size: 14px;
    margin-bottom: 16px;
    font-family: 'Amiri', serif;
    padding-right: 4px;
}

/* ── Grid ── */
.articles-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px 40px;
    flex: 1;
}

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

/* ── Card ── */
a.article-card {
    text-decoration: none;
    color: inherit;
    display: block;
}
a.article-card:hover {
    text-decoration: none;
}
.article-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    transition: transform 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
    height: 560px;
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}

.card-image-wrap {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #e8e0d0;
    position: relative;
    flex-shrink: 0;
}

.card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}

.article-card:hover .card-image-wrap img {
    transform: scale(1.05);
}

.card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2b323f 0%, #3d4b5c 100%);
    font-size: 48px;
    color: #8b7355;
}

.card-body {
    padding: 18px 16px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 3px solid #8b7355;
    overflow: hidden;
}

/* h2 reset inside card — screen renders h2 but we style it as card title */
.card-title {
    font-family: 'Rakkas', serif;
    font-size: 20px;
    color: #2c3e50;
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-subtitle {
    font-size: 14px;
    color: #666;
    font-style: italic;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-author {
    font-size: 13px;
    color: #8b7355;
    padding-top: 8px;
    border-top: 1px dashed #ddd;
    flex-shrink: 0;
}

/* Tags on cards */
.card-tags-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
}

.card-tag {
    background: rgba(102,126,234,0.9);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 9px;
    border-radius: 10px;
    white-space: nowrap;
    font-family: 'Amiri', serif;
    backdrop-filter: blur(2px);
}

.card-description {
    font-size: 13px;
    color: #000000;
    background: #ffffff;
    border: 2px solid #000;
    border-radius: 3px;
    padding: 8px 10px;
    margin: 8px 0;
    font-style: italic;
    line-height: 1.6;
    font-family: 'Amiri', serif;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-read-more {
    display: inline-block;
    margin-top: auto;
    padding-top: 8px;
    font-size: 13px;
    color: #8b7355;
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
}

/* Edition badge on article cards */
.card-edition-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 12px;
    margin-top: 6px;
    font-family: 'Amiri', serif;
    letter-spacing: 0.3px;
}
.edition-badge-1 { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.edition-badge-2 { background: #f3e5f5; color: #6a1b9a; border: 1px solid #ce93d8; }
.edition-badge-3 { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.edition-badge-4 { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.edition-badge-5 { background: #fce4ec; color: #880e4f; border: 1px solid #f48fb1; }

/* ── Empty state ── */
/* Pagination */
.pagination-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 32px 16px 16px;
    flex-wrap: wrap;
}
.page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 2px solid #c9b99a;
    background: #fff;
    color: #302504;
    border-radius: 8px;
    font-family: 'Amiri', serif;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.18s;
}
.page-btn:hover:not(:disabled) {
    background: #302504;
    color: #fdf8f0;
    border-color: #302504;
}
.page-btn.active {
    background: #302504;
    color: #fdf8f0;
    border-color: #302504;
    font-weight: bold;
}
.page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.page-nav {
    padding: 0 16px;
    font-size: 14px;
}
.page-ellipsis {
    color: #888;
    padding: 0 4px;
    line-height: 38px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: #8b7355;
    padding: 80px 20px;
}
.empty-state .empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state p { font-size: 20px; font-family: 'Rakkas', serif; }

/* ── Article Detail Page ── */
.article-detail-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 50px 30px;
}

.article-detail-container {
    background: #faf8f3;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    border: 2px solid #8b7355;
}

/* ── Core Web Vitals: prevent layout shift on images ── */
.card-image-wrap img,
.detail-hero-img,
.related-card-img {
    aspect-ratio: 16 / 9;
    height: auto;
}

.detail-hero-img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.detail-content-wrap {
    padding: 36px 40px 48px;
}

.detail-title {
    font-family: 'Rakkas', serif;
    font-size: 32px;
    color: #2c3e50;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 10px;
    border-bottom: 2px solid #8b7355;
    padding-bottom: 12px;
}

.detail-subtitle {
    font-size: 18px;
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
    line-height: 1.7;
}

.detail-author {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding: 14px 16px;
    background: #f0ebe0;
    border-right: 4px solid #8b7355;
    border-radius: 4px;
}

.detail-author-img {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.detail-author-name {
    font-weight: 700;
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 4px;
}

.detail-author-bio {
    font-size: 13px;
    color: #666;
    font-style: italic;
    line-height: 1.6;
}

.detail-description {
    font-size: 15px;
    color: #000000;
    background: #ffffff;
    border: 2px solid #000;
    border-radius: 4px;
    padding: 14px 16px;
    margin: 16px 0 20px 0;
    font-style: italic;
    line-height: 1.8;
    font-family: 'Amiri', serif;
    text-align: justify;
}

.detail-body {
    font-size: 18px;
    line-height: 2;
    color: #2c3e50;
    text-align: justify;
    user-select: text;
}

/* ── SEO: skip-to-content ── */
.skip-link {
    position: absolute;
    top: -100px;
    right: 0;
    background: #8b7355;
    color: #fff;
    padding: 8px 16px;
    font-family: 'Amiri', serif;
    font-size: 15px;
    z-index: 9999;
    border-radius: 0 0 8px 8px;
    transition: top 0.2s;
    text-decoration: none;
}
.skip-link:focus {
    top: 0;
}

.detail-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 16px auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.loading {
    text-align: center;
    padding: 60px;
    color: #8b7355;
    font-size: 20px;
    font-family: 'Rakkas', serif;
}

.error-state {
    text-align: center;
    padding: 60px;
    color: #c0392b;
    font-size: 18px;
}

/* ── Article Detail Tags ── */
.detail-keywords-block {
    margin: 28px 0 10px 0;
    padding: 10px 16px;
    border-top: 1px solid #d4c4a8;
    font-family: 'Amiri', serif;
    font-size: 14px;
    line-height: 2;
    color: #333;
}
.detail-keywords-label {
    font-weight: bold;
    color: #3a2a1a;
    margin-left: 4px;
}
.detail-keyword-item {
    color: #3a2a1a;
    text-decoration: none;
    font-style: italic;
}
.detail-keyword-item:hover {
    text-decoration: underline;
}
.detail-keyword-sep {
    color: #555;
}
.detail-tags {
    margin-top: 36px;
    padding-top: 22px;
    border-top: 2px dashed #d4c4a8;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

.detail-tags-label {
    font-size: 15px;
    font-weight: bold;
    color: #8b7355;
    white-space: nowrap;
    padding-top: 4px;
    font-family: 'Amiri', serif;
}

.detail-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    padding: 5px 16px;
    border-radius: 20px;
    font-family: 'Amiri', serif;
    cursor: default;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 6px rgba(102,126,234,0.25);
    text-decoration: none;
}

.detail-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(102,126,234,0.35);
}

/* ── Footer ── */
.articles-footer {
    background: #1a1f2e;
    border-top: 3px solid #8b7355;
    padding: 28px 30px;
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-email a {
    color: #c4a47c;
    text-decoration: none;
    font-family: 'Amiri', serif;
    font-size: 15px;
    transition: color 0.2s;
}
.footer-email a:hover { color: #f5f0e8; }

.footer-socials {
    display: flex;
    gap: 12px;
}

.footer-social-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    background: #4267B2;
    color: #fff;
    text-decoration: none;
    font-family: 'Amiri', serif;
    font-size: 14px;
    font-weight: bold;
    transition: opacity 0.2s, transform 0.2s;
}
.footer-social-btn:hover { opacity: 0.85; transform: translateY(-2px); }
.footer-social-btn.telegram { background: #0088cc; }

@media (max-width: 600px) {
    .header-inner { flex-direction: column; text-align: center; }
    .articles-grid { grid-template-columns: 1fr; }
    .modal-body { padding: 20px; }
    .modal-title { font-size: 22px; }
    .articles-controls { flex-direction: column; align-items: stretch; }
    .articles-lang-filter { justify-content: center; }
    .article-detail-main {
        padding: 25px 15px;   /* au lieu de 50px 30px */
    }

    .detail-content-wrap {
        padding: 20px 18px 28px;  /* réduit l’espace interne */
    }
     .detail-title {
        font-size: 24px;   /* au lieu de 32px */
    }

    .detail-subtitle {
        font-size: 15px;   /* au lieu de 18px */
    }

    .detail-body {
        font-size: 16px;   /* au lieu de 18px */
        line-height: 1.8;  /* un peu plus compact */
    }

    .detail-author-name {
        font-size: 14px;
    }

    .detail-author-bio {
        font-size: 12px;
    }
    .footer-inner { flex-direction: column; align-items: center; text-align: center; }
}