/* ============================================================
   TLIP Ghost Theme — Financial Times Style
   ============================================================ */

/* Ghost required width classes */
.kg-width-wide {
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

.kg-width-full {
  max-width: none;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
}

:root {
    --bg: #fff1e5;
    --surface: #ffffff;
    --ink: #33302e;
    --ink-secondary: #736e69;
    --accent: #990f3d;
    --accent2: #0d7680;
    --border: #ccc1b7;
    --nav-bg: #33302e;
    --tag-bg: #f2dfce;
    --premium-bg: #990f3d;
    --font-display: 'Playfair Display', 'Noto Serif TC', 'Noto Serif JP', Georgia, serif;
    --font-body: 'Source Sans 3', 'Noto Sans TC', 'Noto Sans JP', sans-serif;
    --max-width: 1220px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ============================================================
   NAV
   ============================================================ */

.nav {
    background: var(--nav-bg);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 50px;
    gap: 24px;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 900;
    color: var(--bg);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2px;
    flex: 1;
}

.nav-links a {
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 3px;
}

.nav-links a:hover {
    color: #fff;
}

.nav-links a.active {
    color: #fff;
    border-bottom: 2px solid var(--bg);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-lang a {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    padding: 3px 8px;
}

.nav-lang a.active,
.nav-lang a:hover {
    color: #fff;
}

.nav-cta {
    background: var(--accent);
    color: #fff;
    padding: 6px 16px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.nav-cta:hover {
    opacity: 0.9;
}

/* ============================================================
   CONTAINER
   ============================================================ */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================
   MASTHEAD
   ============================================================ */

.masthead {
    text-align: center;
    padding: 20px 0 16px;
    border-bottom: 1px solid var(--border);
}

.masthead-title {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -1px;
}

.masthead-sub {
    font-size: 13px;
    color: var(--ink-secondary);
    margin-top: 4px;
}

.masthead-date {
    font-size: 12px;
    color: var(--ink-secondary);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* ============================================================
   TOP STORY
   ============================================================ */

.top-story {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
}

.top-story-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.top-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.top-title {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 12px;
}

.top-excerpt {
    font-size: 16px;
    color: var(--ink-secondary);
    line-height: 1.5;
}

.top-meta {
    margin-top: 12px;
    font-size: 12px;
    color: var(--ink-secondary);
}

.top-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

/* ============================================================
   SECTION & GRID
   ============================================================ */

.section {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}

.section-head {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 4px solid var(--ink);
    display: inline-block;
}

.three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.col-divider {
    border-left: 1px solid var(--border);
    padding-left: 24px;
}

/* ============================================================
   STORY CARD (FT style — flat, no shadow)
   ============================================================ */

.story {
    margin-bottom: 20px;
}

.story-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.story-premium {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: var(--premium-bg);
    padding: 1px 6px;
    border-radius: 2px;
    margin-left: 6px;
    display: inline-block;
    vertical-align: middle;
}

.story-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    margin: 6px 0;
}

.story-title a {
    color: inherit;
}

.story-title a:hover {
    color: var(--accent);
}

.story-title.sm {
    font-size: 17px;
}

.story-excerpt {
    font-size: 14px;
    color: var(--ink-secondary);
    line-height: 1.5;
}

.story-time {
    font-size: 12px;
    color: var(--ink-secondary);
    margin-top: 6px;
}

.story-img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    margin-bottom: 10px;
}

.story-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

.story-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent2);
}

.story-link:hover {
    color: var(--accent);
}

/* ============================================================
   OPINION BAR
   ============================================================ */

.opinion-bar {
    background: var(--surface);
    padding: 20px 24px;
    border-radius: 4px;
    margin: 24px 0;
    display: grid;
    grid-template-columns: auto 1fr 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.opinion-label {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.opinion-item {
    border-left: 1px solid var(--border);
    padding-left: 16px;
}

.opinion-item .story-title {
    font-size: 15px;
}

/* ============================================================
   SIDEBAR LAYOUT
   ============================================================ */

.sidebar-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    padding: 24px 0;
}

.sidebar-block {
    background: var(--surface);
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.sidebar-head {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
}

.sidebar-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.sidebar-item:last-child {
    border-bottom: none;
}

.sidebar-item .story-title {
    font-size: 14px;
    font-family: var(--font-body);
    font-weight: 600;
}

/* ============================================================
   SUBSCRIBE CTA (FT accent red)
   ============================================================ */

.subscribe-ft {
    background: var(--accent);
    color: #fff;
    padding: 24px 20px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 20px;
}

.subscribe-ft h3 {
    font-family: var(--font-display);
    font-size: 20px;
    margin-bottom: 8px;
}

.subscribe-ft p {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 16px;
}

.subscribe-ft button,
.subscribe-ft a.sub-btn {
    background: #fff;
    color: var(--accent);
    border: none;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 3px;
    cursor: pointer;
    display: inline-block;
}

.subscribe-ft button:hover,
.subscribe-ft a.sub-btn:hover {
    opacity: 0.9;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--ink-secondary);
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: 22px;
    margin-bottom: 8px;
    color: var(--ink);
}

/* ============================================================
   ARTICLE / POST PAGE
   ============================================================ */

.article-page {
    max-width: 780px;
    margin: 0 auto;
    padding: 32px 0 48px;
}

.article-header {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.article-header .top-tag {
    margin-bottom: 12px;
}

.article-page-title {
    font-family: var(--font-display);
    font-size: 38px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 16px;
}

.article-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--ink-secondary);
}

.article-meta-bar .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-meta-bar .meta-label {
    color: var(--border);
}

.article-feature-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    margin-bottom: 32px;
}

/* Language switcher (post page) */
.language-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.language-switcher__label {
    color: var(--ink-secondary);
    font-size: 12px;
    font-weight: 600;
}

.language-switcher__options {
    display: flex;
    gap: 6px;
}

.language-switcher__option {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-secondary);
}

.language-switcher__option:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Ghost content body */
.gh-content {
    font-size: 17px;
    line-height: 1.75;
    color: var(--ink);
}

.gh-content p,
.gh-content ul,
.gh-content ol,
.gh-content blockquote,
.gh-content h2,
.gh-content h3,
.gh-content h4,
.gh-content figure,
.gh-content table,
.gh-content pre {
    margin-block: 16px;
}

.gh-content h2,
.gh-content h3,
.gh-content h4 {
    font-family: var(--font-display);
    line-height: 1.25;
    margin-top: 32px;
}

.gh-content h2 {
    font-size: 28px;
}

.gh-content h3 {
    font-size: 22px;
}

.gh-content a {
    color: var(--accent2);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.gh-content a:hover {
    color: var(--accent);
}

.gh-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 20px;
    font-style: italic;
    color: var(--ink-secondary);
}

.gh-content table {
    width: 100%;
    border-collapse: collapse;
}

.gh-content th,
.gh-content td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
    font-size: 14px;
}

.gh-content th {
    background: var(--tag-bg);
    font-weight: 700;
}

.gh-content img {
    border-radius: 2px;
}

.gh-content pre {
    background: var(--nav-bg);
    color: var(--bg);
    padding: 16px 20px;
    border-radius: 3px;
    overflow-x: auto;
    font-size: 14px;
}

/* Paywall CTA */
.paywall-cta {
    background: var(--surface);
    border: 2px solid var(--accent);
    border-radius: 4px;
    padding: 32px;
    text-align: center;
    margin: 32px 0;
}

.paywall-cta h3 {
    font-family: var(--font-display);
    font-size: 24px;
    margin-bottom: 8px;
}

.paywall-cta p {
    color: var(--ink-secondary);
    margin-bottom: 16px;
}

.paywall-cta .nav-cta {
    font-size: 15px;
    padding: 10px 28px;
}

/* Legal disclaimer */
.legal-disclaimer {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 32px;
    font-size: 13px;
    color: var(--ink-secondary);
    line-height: 1.6;
}

.legal-disclaimer p {
    margin-bottom: 4px;
}

/* Related articles */
.related-section {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    margin-top: 32px;
}

.related-section .section-head {
    margin-bottom: 16px;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    background: var(--nav-bg);
    color: rgba(255, 255, 255, 0.7);
    padding: 24px 0;
    margin-top: 32px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.footer-inner a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-inner a:hover {
    color: #fff;
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
    .top-story {
        grid-template-columns: 1fr;
    }

    .three-col {
        grid-template-columns: 1fr;
    }

    .col-divider {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border);
        padding-top: 20px;
    }

    .opinion-bar {
        grid-template-columns: 1fr;
    }

    .opinion-label {
        writing-mode: horizontal-tb;
    }

    .sidebar-layout {
        grid-template-columns: 1fr;
    }

    .nav-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 20px;
        gap: 8px;
    }

    .nav-links {
        order: 3;
        flex-basis: 100%;
        flex-wrap: wrap;
    }

    .masthead-title {
        font-size: 28px;
    }

    .top-title {
        font-size: 26px;
    }

    .article-page-title {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .nav-links a {
        padding: 4px 8px;
        font-size: 12px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .article-meta-bar {
        flex-direction: column;
        gap: 8px;
    }
}
