/* ── WRITING PAGE ── */
.writing-header {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 3.5rem 4rem;
    border-bottom: 1px solid var(--faint);
}

.writing-header .page-label {
    font-family:
        "DM Mono", "DM Mono Fallback", ui-monospace, SFMono-Regular, Menlo,
        Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 1.5rem;
    display: block;
}

.writing-header .page-title {
    font-family:
        "EB Garamond", "EB Garamond Fallback", Georgia, "Times New Roman",
        Times, serif;
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 400;
    line-height: 1.08;
    color: var(--text);
    margin-bottom: 1.5rem;
    max-width: 22ch;
    letter-spacing: -0.02em;
}

.writing-header .page-title em {
    font-style: normal;
    color: inherit;
}

.writing-header .page-desc {
    font-family: "Inter", sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--muted);
    margin-bottom: 0;
    max-width: 50ch;
}

.writing-feed {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 3.5rem 6rem;
}

/* ── LAYOUT 1: 2 articles - Side by side (50/50) ── */
.layout-2-sidebyside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* ── LAYOUT 2: 2 articles - Stacked vertically ── */
.layout-2-stacked {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ── LAYOUT 3: Economist-style (1 large left, 2 stacked right - 50/50 height) ── */
.layout-3-economist {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0 3rem;
}

.layout-3-economist .writing-card-side-equal {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.25rem;
    align-items: center;
}

.layout-3-economist .writing-card-side-equal .writing-card-img {
    width: 140px;
    aspect-ratio: 16 / 10;
    background: var(--faint);
    border-radius: 4px;
    overflow: hidden;
}

.layout-3-economist .writing-card-side-equal .writing-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.layout-3-economist .writing-card-side-equal .writing-card-body {
    display: flex;
    flex-direction: column;
}

.layout-3-economist .writing-card-side-equal:first-of-type {
    grid-row: 1;
}

.layout-3-economist .writing-card-side-equal:last-of-type {
    grid-row: 2;
}

/* ── LAYOUT 4: 3 articles - Horizontal row ── */
.layout-3-horizontal {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* ── LAYOUT 5: 3 articles - 1 large top, 2 small below ── */
.layout-3-pyramid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 1.5rem;
}

.layout-3-pyramid .writing-card-bento-large {
    grid-column: 1 / -1;
    grid-row: 1;
}

.layout-3-pyramid .writing-card-equal:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
}

.layout-3-pyramid .writing-card-equal:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
}

/* ── LAYOUT 6: 4 articles - 2x2 grid ── */
.layout-4-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* ── LAYOUT 7: 4 articles - 1 large left, 3 stacked right ── */
.layout-4-1plus3 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, auto);
    gap: 0 3rem;
}

.layout-4-1plus3 .writing-card-main {
    grid-row: 1 / 4;
}

.layout-4-1plus3 .writing-card-side-compact {
    display: flex;
    flex-direction: column;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--faint);
}

.layout-4-1plus3 .writing-card-side-compact:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* ── LAYOUT 8: List-style (already exists as layout-list) ── */

/* ── LAYOUT 9: 5 articles - Bento grid ── */
.layout-5-bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    gap: 1.5rem;
}

/* ── LAYOUT 10: 3 articles - Compact cards (no excerpt) ── */
.layout-3-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* ── Shared card styles ── */
.writing-card-equal {
    display: flex;
    flex-direction: column;
}

.writing-card-equal .writing-card-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--faint);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.writing-card-equal .writing-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.writing-card-equal .writing-card-body {
    display: flex;
    flex-direction: column;
}

.writing-card-compact {
    display: flex;
    flex-direction: column;
}

.writing-card-compact .writing-card-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--faint);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.writing-card-compact .writing-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.writing-card-compact .writing-card-body {
    display: flex;
    flex-direction: column;
}

.writing-card-bento-large {
    grid-column: span 2;
    grid-row: span 2;
}

.writing-card-bento-wide {
    grid-column: span 2;
}

.writing-card-bento-wide .writing-card-img {
    display: none;
}

/* ── LAYOUT 2: Simple 3-column equal grid ── */
.layout-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.layout-grid-3 .writing-card-simple {
    display: flex;
    flex-direction: column;
}

.layout-grid-3 .writing-card-simple .writing-card-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--faint);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-bottom: 1rem;
}

.layout-grid-3 .writing-card-simple .writing-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.layout-grid-3 .writing-card-simple .writing-card-body {
    display: flex;
    flex-direction: column;
}

/* ── LAYOUT 3: 2-column alternating ── */
.layout-alternating {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.layout-alternating .writing-card-alternate {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    align-items: start;
    border-bottom: 1px solid var(--faint);
    padding-bottom: 2rem;
}

.layout-alternating .writing-card-alternate:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.layout-alternating .writing-card-alternate-reverse {
    grid-template-columns: 1fr 200px;
}

.layout-alternating .writing-card-alternate-reverse .writing-card-img {
    order: 2;
}

.layout-alternating .writing-card-alternate .writing-card-img {
    width: 200px;
    aspect-ratio: 16 / 10;
    background: var(--faint);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.layout-alternating .writing-card-alternate .writing-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.layout-alternating .writing-card-alternate .writing-card-body {
    display: flex;
    flex-direction: column;
}

/* ── LAYOUT 4: List-style horizontal rows ── */
.layout-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.layout-list .writing-card-list {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    align-items: start;
    border-bottom: 1px solid var(--faint);
    padding-bottom: 2rem;
}

.layout-list .writing-card-list:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.layout-list .writing-card-list .writing-card-img {
    width: 250px;
    aspect-ratio: 16 / 10;
    background: var(--faint);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.layout-list .writing-card-list .writing-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.layout-list .writing-card-list .writing-card-body {
    display: flex;
    flex-direction: column;
}

/* ── LAYOUT 5: Bento/Masonry grid ── */
.layout-bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    gap: 1.5rem;
}

.layout-bento .writing-card-bento {
    display: flex;
    flex-direction: column;
    background: var(--faint);
    border-radius: 4px;
    overflow: hidden;
}

.layout-bento .writing-card-bento-large {
    grid-column: span 2;
    grid-row: span 2;
}

.layout-bento .writing-card-bento-wide {
    grid-column: span 2;
}

.layout-bento .writing-card-bento .writing-card-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--faint);
    overflow: hidden;
    position: relative;
}

.layout-bento .writing-card-bento .writing-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.layout-bento .writing-card-bento-wide .writing-card-img {
    display: none;
}

.layout-bento .writing-card-bento .writing-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.layout-bento .writing-card-bento-large .writing-card-body {
    padding: 1.25rem;
}

/* Default grid styling (backward compatibility) */
.writing-feed-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 3rem;
}

.writing-card {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.writing-card:hover {
    opacity: 0.85;
}

/* ── LEFT: Main card (spans 2 rows, image top, text below) ── */
.writing-card-main {
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
}

.writing-card-main .writing-card-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--faint);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-bottom: 1.25rem;
}

.writing-card-main .writing-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.writing-card-main .writing-card-body {
    display: flex;
    flex-direction: column;
}

.writing-card-main .writing-card-title {
    font-family: "EB Garamond", "EB Garamond Fallback", Georgia, serif;
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.writing-card-main .writing-card-excerpt {
    font-family: "Inter", sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--muted);
    margin-bottom: 1rem;
}

/* ── RIGHT: Side cards (text left, image right, stacked) ── */
.writing-card-side {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.25rem;
    align-items: start;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--faint);
}

.writing-card-side:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.writing-card-side .writing-card-body {
    display: flex;
    flex-direction: column;
}

.writing-card-side .writing-card-img {
    width: 180px;
    aspect-ratio: 16 / 10;
    background: var(--faint);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.writing-card-side .writing-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Shared card typography */
.writing-card-category {
    font-family: "Inter", "Inter Fallback", system-ui, sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    color: #1f2e7a;
    margin-bottom: 0.25rem;
}

.writing-card-title {
    font-family: "EB Garamond", "EB Garamond Fallback", Georgia, serif;
    font-size: clamp(1.3rem, 1.8vw, 1.6rem);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.writing-card-excerpt {
    font-family: "Inter", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.writing-card-meta {
    font-family: "Inter", "Inter Fallback", system-ui, sans-serif;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--muted);
    margin-top: auto;
}

/* Featured article — full-width hero card */
.writing-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--faint);
    padding-bottom: 3rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.writing-featured:hover {
    opacity: 0.85;
}

.writing-featured-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--faint);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.writing-featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.writing-featured-img .img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "DM Mono", monospace;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.writing-featured-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.writing-tag {
    font-family: "DM Mono", "DM Mono Fallback", monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 0.75rem;
}

.writing-featured-title {
    font-family: "EB Garamond", "EB Garamond Fallback", Georgia, serif;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--text);
}

.writing-featured-title em {
    font-style: italic;
    color: var(--blue);
}

.desktop-featured-title {
    display: inline;
}

.mobile-featured-title {
    display: none;
}

@media (max-width: 768px) {
    .desktop-featured-title {
        display: none;
    }

    .mobile-featured-title {
        display: inline;
    }
}

.writing-excerpt {
    font-family: "Inter", sans-serif;
    font-size: 15px;
    line-height: 1.75;
    color: var(--muted);
    max-width: 55ch;
    margin-bottom: 1.25rem;
}

.writing-meta {
    font-family: "Inter", "Inter Fallback", system-ui, sans-serif;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.writing-meta .writing-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--muted);
    display: inline-block;
}

/* Article list — side-by-side rows */
.writing-list {
    display: flex;
    flex-direction: column;
}

.writing-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--faint);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
}

.writing-item:hover {
    opacity: 0.85;
}

.writing-item-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--faint);
    border-radius: 4px;
    overflow: hidden;
}

.writing-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.writing-item-img .img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "DM Mono", monospace;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.writing-item-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.writing-item-title {
    font-family: "EB Garamond", "EB Garamond Fallback", Georgia, serif;
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.writing-item-excerpt {
    font-family: "Inter", sans-serif;
    font-size: 14px;
    line-height: 1.65;
    color: var(--muted);
    max-width: 52ch;
    margin-bottom: 0.75rem;
}

/* ── WRITING ARTICLE VIEW ── */
.article-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 3.5rem 6rem;
}

.article-back {
    font-family: "DM Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 1.5rem;
    transition: color 0.15s;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--faint);
    width: 100%;
}

.article-back:hover {
    color: var(--text);
}

.article-header-content {
    margin-top: 0;
}

.article-back svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.article-kicker {
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.article-kicker .kicker-main {
    color: #1f2e7a;
}

.article-kicker .kicker-divider {
    color: #999;
    margin: 0 0.15em;
}

.article-kicker .article-category {
    text-decoration: none;
    color: #1f2e7a;
    transition: all 0.15s;
}

.article-kicker .article-category:hover {
    text-decoration: underline;
}

.article-share {
    margin-top: 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: flex;
    gap: 12px;
}

.share-btn {
    font-family: "Inter", sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #111111;
    background: transparent;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: #999999;
}

.share-btn svg {
    width: 18px;
    height: 18px;
    stroke: #1f2e7a;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.15s;
}

.share-btn:hover svg {
    stroke: #3c54cc;
}

.article-main-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    border-radius: 4px;
    margin: 0 0 1.5rem 0;
    background: #e8e8e8;
}

/* Share Modal */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.share-modal.active {
    display: flex;
}

.share-modal-content {
    background: #ffffff;
    border-radius: 8px;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--faint);
}

.share-modal-header h3 {
    font-family: "Inter", sans-serif;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.share-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.share-modal-close:hover {
    color: var(--text);
}

.share-modal-close svg {
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.share-options {
    padding: 0.5rem 0;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 1.25rem;
    border: none;
    background: none;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    color: var(--text);
    text-align: left;
    transition: background 0.15s;
}

.share-option:hover {
    background: var(--blue-bg);
}

.share-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.share-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--text);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.share-icon svg[fill] {
    fill: var(--text);
}

.share-label {
    font-weight: 500;
}

/* Economist-style share dropdown popover */
.article-share {
    position: relative;
    display: inline-block;
}

.share-dropdown {
    display: block;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    width: 200px;
    padding: 6px 0;
    transform: translateY(-8px);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}

.share-dropdown.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Elegant pointer triangle arrow at the top */
.share-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 24px;
    border-width: 0 6px 6px 6px;
    border-style: solid;
    border-color: transparent transparent #ffffff transparent;
    z-index: 2;
}

.share-dropdown::after {
    content: '';
    position: absolute;
    top: -7px;
    left: 23px;
    border-width: 0 7px 7px 7px;
    border-style: solid;
    border-color: transparent transparent #d0d0d0 transparent;
    z-index: 1;
}

.share-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    color: #333333;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.share-dropdown-item:hover {
    background: #fbfaf7; /* match cream background of subpages */
    color: #111111;
}

.share-dropdown-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.share-dropdown-icon svg {
    width: 16px;
    height: 16px;
    stroke: #555555;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.15s;
}

.share-dropdown-item:hover .share-dropdown-icon svg {
    stroke: #005073; /* Economist Blue */
}

@media (max-width: 768px) {
    .share-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 12px 12px 0 0;
        border: none;
        border-top: 1px solid #d0d0d0;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
        padding: 18px 0 24px 0;
        transform: translateY(100%);
        transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s;
    }
    
    .share-dropdown.active {
        transform: translateY(0);
    }
    
    /* Remove triangle on mobile sheets */
    .share-dropdown::before,
    .share-dropdown::after {
        display: none !important;
    }
    
    .share-dropdown-item {
        padding: 14px 24px;
        font-size: 15px;
    }
    
    /* Drag handle indicator at the top of sheet */
    .share-dropdown::before {
        display: block !important;
        content: '' !important;
        position: absolute !important;
        top: 8px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 36px !important;
        height: 4px !important;
        background: #e0e0e0 !important;
        border-radius: 2px !important;
        border: none !important;
    }
}

.article-headline {
    font-family: "EB Garamond", "EB Garamond Fallback", Georgia, serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-bottom: 1.25rem;
}

.article-headline em {
    font-style: italic;
    color: var(--blue);
}

.article-headline .desktop-headline {
    display: inline;
}

.article-headline .mobile-headline {
    display: none;
}

@media (max-width: 768px) {
    .article-headline .desktop-headline {
        display: none;
    }

    .article-headline .mobile-headline {
        display: inline;
    }
}

.article-deck {
    font-family: "Inter", sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: var(--muted);
    margin-bottom: 1.5rem;
    max-width: 60ch;
}

.article-byline {
    font-family: "Inter", "Inter Fallback", system-ui, sans-serif;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--faint);
}

.article-byline .writing-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--muted);
    display: inline-block;
}

.article-hero-img {
    display: none;
}

/* ── CHART IFRAME CONTAINER ──
           CRITICAL: This container wraps the articlechart.html iframe.

           Width behavior:
           - Desktop: 100% of the 70% center column (15-70-15 article layout)
             The chart aligns flush with article text because articlechart.html
             has padding: 0 on its #chart-wrapper
           - Mobile: 100vw with negative margins creates full-bleed effect
             (see @media 600px below)

           DO NOT CHANGE margin values on desktop without testing mobile.
           The mobile full-bleed relies on margin-left/right: -1.5rem.
        */
.article-chart-frame {
    margin: 2.5rem 0;
    width: 100%;
    position: relative;
}

.chart-fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: #444;
    transition:
        background 0.15s,
        box-shadow 0.15s;
}

.chart-fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.chart-fullscreen-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* ── FULLSCREEN CHART FIX ──
           ⚠️  See also: articlechart.html for the iframe content styles.
           Both files must stay in sync for fullscreen to work.

           When user clicks fullscreen button, the article-chart-frame expands
           to fill the entire viewport (100vw x 100vh). We use flexbox to center
           the iframe and prevent any overflow/scrolling issues.
           NOTE: The iframe reloads on fullscreen toggle (see main.js) to ensure
           the D3 chart recalculates its dimensions for the new viewport size. */
.article-chart-frame:fullscreen {
    background: #f4f1e6;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── FULLSCREEN IFRAME ──
           iframe fills 100% of its container (the fullscreen wrapper).
           max-width/max-height constraints prevent any overflow. */
.article-chart-frame:fullscreen iframe {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

/* ── CHART IFRAME ──
           CRITICAL DIMENSIONS - DO NOT MODIFY WITHOUT TESTING:

           Height: 1050px (desktop) / 850px (mobile)
           - These heights were tuned to fit the D3 map + callouts + footer
           - Too short = content gets cut off
           - Too tall = excessive whitespace below chart

           Width: 100% (fills the .article-chart-frame container)
           - Actual pixel width controlled by parent layout (15-70-15 grid)
           - iframe content handles its own responsive scaling via viewBox

           The iframe src (articlechart.html) uses:
           - Desktop: width: 900, height: 620 for D3 map + full callouts
           - Mobile: width: 500, height: 620 for D3 map (no callouts)
        */
.article-chart-frame iframe {
    width: 100%;
    height: 1050px;
    border: none;
    display: block;
}

/* ==========================================================
           MOBILE CHART OVERRIDES (600px and below)
           ==========================================================
           CRITICAL: These rules create the full-bleed chart effect on mobile.

           PROBLEM THIS SOLVES:
           On mobile the article has padding: 1.5rem, which would inset the chart
           and make it look cramped compared to the full-width design.

           SOLUTION:
           - width: 100vw = force full viewport width
           - margin-left/right: -1.5rem = negate the article's 1.5rem padding
           - Combined effect: chart extends edge-to-edge on mobile screen

           DO NOT MODIFY these values unless you also change:
           - #article-view-content padding in the 768px media query above
           - #chart-wrapper padding in articlechart.html

           Height 850px includes:
           - 500x620 D3 map (scaled via viewBox)
           - Header text + legend (~120px)
           - Mobile list: 5 safest + 5 least safe (~200px)
           - Footer/citation (~80px)
           - Buffer for safety (~50px)
        */
@media (max-width: 600px) {
    .article-chart-frame {
        width: 100vw;
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        left: 0;
    }

    .article-chart-frame iframe {
        height: 850px;
    }

    .chart-fullscreen-btn {
        display: none;
    }
}

.article-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-hero-img .img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "DM Mono", monospace;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.article-body {
    font-family: "Lora", "Lora Fallback", Georgia, serif;
    font-size: 18px;
    line-height: 30px;
    color: var(--text);
}

.article-body p {
    margin-bottom: 1.9rem;
    line-height: 1.6;
    letter-spacing: -0.01em;
}

.article-body h2 {
    font-family: "EB Garamond", "EB Garamond Fallback", Georgia, serif;
    font-size: 1.6rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.article-body h3 {
    font-family: "EB Garamond", "EB Garamond Fallback", Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-body blockquote {
    border-left: 3px solid var(--blue);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--muted);
}

.article-body strong {
    font-weight: 600;
}

.article-body em {
    font-style: italic;
}

.article-body ul,
.article-body ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body .data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-family: "Inter", sans-serif;
    font-size: 14px;
}

.article-body .data-table th {
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 2px solid var(--text);
    padding: 0.75rem 1rem;
}

.article-body .data-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--faint);
    color: var(--text);
}

.article-body .data-table tr:hover td {
    background: var(--blue-bg);
}

.article-footer {
    margin-top: 2rem;
    padding-top: 1rem;
}

.article-footer .article-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.article-footer .article-tag {
    font-family: "Inter", "Inter Fallback", system-ui, sans-serif;
    font-size: 15px;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    border: 1px solid var(--faint);
    border-radius: 3px;
    color: var(--muted);
}

/* Photo caption under hero */
.photo-caption {
    font-family: "DM Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Byline below hero image */
.article-byline-below {
    border-top: none;
    border-bottom: none;
    padding-top: 0.75rem;
    padding-bottom: 0;
    margin-bottom: 2rem;
}

/* Drop cap for first paragraph */
.article-body .has-drop-cap::first-letter {
    float: left;
    font-size: 4.5rem;
    line-height: 0.8;
    padding-right: 0.75rem;
    padding-top: 0.25rem;
    font-weight: 600;
    color: var(--text);
}

/* FAQ Accordion */
.faq-accordion {
    margin-top: 1.5rem;
    border-top: 1px solid var(--faint);
}

.faq-item {
    border-bottom: 1px solid var(--faint);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.25rem 0;
    font-family: "Lora", "Lora Fallback", Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
    transition: color 0.2s;
}

.faq-question:hover {
    color: var(--blue);
}

.faq-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 1rem;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition:
        max-height 0.3s ease-out,
        padding 0.3s;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding-bottom: 1.25rem;
}

.faq-answer p {
    margin: 0;
    font-family: "Lora", "Lora Fallback", Georgia, serif;
    font-size: 20px;
    line-height: 30px;
    color: var(--muted);
}

.article-body .p-lead {
    font-weight: 600;
    font-size: 1.04em;
}

/* ── ARTICLE 15-70-15 THREE COLUMN LAYOUT ── */
.article-three-col {
    display: grid;
    grid-template-columns: 15% 70% 15%;
    gap: 0;
    align-items: start;
}

.article-col-center {
    max-width: 100%;
}

/* ── MOBILE: STACK TO SINGLE COLUMN ── */
@media (max-width: 768px) {
    .article-three-col {
        display: block;
    }
}

/* ── WRITING PAGE RESPONSIVE ── */
/* ── RESEARCH PAGE: TABLET (769px – 1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Tighten the page header vertical padding */
    .page-header {
        padding: 3.5rem 2.5rem 3rem;
    }

    /* Tighten the writing feed */
    .writing-feed {
        padding: 2rem 2.5rem 4rem;
    }

    /* Card grid: single column on tablet */
    .writing-feed-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .writing-card-main {
        grid-row: auto;
        border-bottom: 1px solid var(--faint);
        padding-bottom: 2rem;
    }

    .writing-card-side {
        grid-template-columns: 1fr;
        border-bottom: 1px solid var(--faint);
        padding-bottom: 2rem;
    }

    .writing-card-side .writing-card-img {
        width: 100%;
        aspect-ratio: 16 / 9;
        order: -1;
    }

    /* Stack the featured article to one column — two cramped columns at 769px looks broken */
    .writing-featured {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }

    /* Full-width image: shallower ratio so it doesn’t dominate the screen */
    .writing-featured-img {
        aspect-ratio: 16 / 7;
    }

    /* More room for the title now that it’s full-width */
    .writing-featured-title {
        font-size: clamp(2rem, 3.5vw, 2.8rem);
    }

    /* Carousel category sections */
    .category {
        padding: 3rem 2.5rem;
    }

    /* Narrower cards so 2–3 are visible at once, not just 1.5 */
    .research-card {
        width: 320px;
    }
}

@media (max-width: 768px) {
    .writing-header {
        padding: 3.5rem 1.5rem 3rem;
    }

    .writing-feed {
        padding: 2rem 1.5rem 5rem;
    }

    /* Card grid: single column on mobile */
    .writing-feed-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .writing-card-main {
        grid-row: auto;
        border-bottom: 1px solid var(--faint);
        padding-bottom: 2rem;
    }

    .writing-card-side {
        grid-template-columns: 1fr;
        border-bottom: 1px solid var(--faint);
        padding-bottom: 2rem;
    }

    .writing-card-side .writing-card-img {
        width: 100%;
        aspect-ratio: 16 / 9;
        order: -1;
    }

    .writing-featured {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .writing-item {
        grid-template-columns: 140px 1fr;
        gap: 1.25rem;
    }

    .article-container {
        padding: 2.5rem 1.5rem 5rem;
    }

    .article-headline {
        font-size: 2rem;
    }

    .article-body {
        font-size: 16px;
    }

    .article-footer .article-tag {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .writing-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .writing-item-img {
        max-width: 100%;
        aspect-ratio: 16 / 9;
    }
}

/* ================================================================
   READ NEXT — article recommendation section
   Sits at the bottom of every article, after the footer tags.
   Full-width inside .article-outer (not constrained to 50% column).
   ================================================================ */

.read-next {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #1a1a1a;
}

.read-next-label {
    font-family: "Inter", "Inter Fallback", system-ui, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    display: block;
    margin-bottom: 1.5rem;
}

.read-next-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.read-next-card {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 1.25rem 1.5rem 1.5rem;
    border: 1px solid #d6d2c4;
    border-radius: 3px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.read-next-card:hover {
    border-color: #888;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.read-next-card-category {
    font-family: "Inter", "Inter Fallback", system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1f2e7a;
    display: block;
    margin-bottom: 0.6rem;
}

.read-next-card-title {
    font-family: "EB Garamond", "EB Garamond Fallback", Georgia, serif;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.25;
    color: var(--text);
    display: block;
    margin-bottom: 0.5rem;
}

.read-next-card-excerpt {
    font-family: "Inter", "Inter Fallback", system-ui, sans-serif;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.55;
    display: block;
}

@media (max-width: 600px) {
    .read-next-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .read-next {
        margin-top: 3rem;
    }
}
