/* === ACCIONISTAS — Substack Clone === */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --black: #0d0d0d;
    --gray1: #555;
    --gray2: #888;
    --gray3: #c0c0c0;
    --border: #e6e6e6;
    --bg: #fff;
    --accent: #C9952B;
    --max: 1100px;
}

body {
    font-family: var(--gh-font-body, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);
    color: var(--black);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* === TOP BAR === */
.top-bar {
    background: var(--black);
    color: #fff;
    font-size: 13px;
    font-family: var(--gh-font-body, inherit);
    padding: 0;
}

.top-bar-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar-greeting {
    color: #ccc;
}

/* "Pasate a MercadoPago" banner for imported Stripe subscribers */
.migrate-banner {
    background: #faf3e3;
    border-bottom: 1px solid #ecdcb6;
    color: var(--black);
    font-size: 14px;
}

.migrate-banner-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.top-bar-greeting strong {
    color: #fff;
    font-weight: 600;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-bar-link {
    color: #ccc;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.15s;
}

.top-bar-link:hover { color: #fff; }

.top-bar-upgrade {
    color: var(--accent);
    font-weight: 600;
}

.top-bar-upgrade:hover { color: #fff; }

.top-bar-signout { color: #888; }
.top-bar-signout:hover { color: #fff; }

.top-bar-wordmark {
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

/* === HEADER === */
.site-header {
    border-bottom: none;
    background: var(--bg);
}

.site-header-top {
    text-align: center;
    padding: 24px 20px 8px;
}

.site-logo img,
.site-logo svg {
    max-height: 44px;
    margin: 0 auto;
}

.site-logo {
    font-size: 22px;
    font-weight: 600;
    color: var(--black);
}

/* Original Substack header: wide banner, scales with the page */
.site-header-top:has(.site-logo--banner) { padding: 0; }

.site-logo--banner { display: block; max-width: var(--max); margin: 0 auto; }

.site-logo--banner img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
}

/* === NAV — Substack style === */
.site-nav-wrap {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.site-nav {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
}

/* All nav lists (hardcoded + Ghost) inline */
.site-nav ul, .site-nav ol, .nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
}

.site-nav li { display: inline-flex; }

.site-nav li a, .site-nav a {
    font-family: var(--gh-font-body, inherit);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray1);
    text-decoration: none;
    padding: 12px 16px;
    border-bottom: 2px solid transparent;
    display: block;
    transition: color 0.15s, border-color 0.15s;
}

.site-nav li a:hover { color: var(--black); }

/* "Inicio" active state */
.nav-home a {
    color: var(--black);
    font-weight: 600;
    border-bottom-color: var(--black);
}

/* Search button */
.nav-search {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray2);
    padding: 10px 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.nav-search:hover { color: var(--black); }

/* === CONTAINER === */
.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 20px;
}

/* === TWO COL LAYOUT === */
.two-col {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
    padding: 32px 0 60px;
}

/* === HERO === */
.hero {
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.hero-link {
    display: block;
}

.hero-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
    margin-top: 8px;
}

.hero-img img {
    width: 100%;
    border-radius: 0;
    aspect-ratio: 16/10;
    object-fit: cover;
}

.hero-title {
    font-family: var(--gh-font-heading, inherit);
    font-size: 28px;
    text-align: center;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0;
    letter-spacing: -0.3px;
}

.hero-excerpt {
    font-size: 14px;
    color: var(--gray1);
    line-height: 1.6;
    margin-bottom: 10px;
}

.post-meta {
    font-family: var(--gh-font-body, inherit);
    font-size: 12px;
    color: var(--gray2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    font-weight: 500;
}

/* === TABS === */
.tabs {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    gap: 0;
}

.tab {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--gray2);
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-bottom: -1px;
    font-weight: 500;
}

.tab.active {
    color: var(--black);
    border-color: var(--border);
    background: var(--bg);
    font-weight: 600;
}

.tab-search {
    margin-left: auto;
    color: var(--gray2);
    padding: 10px 4px;
}

/* === POST LIST === */
.post-row {
    border-bottom: 1px solid var(--border);
}

.post-row-link {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 18px 0;
}

.post-row-text { flex: 1; min-width: 0; }

.post-row-title {
    font-family: var(--gh-font-heading, inherit);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.post-row-excerpt {
    font-size: 14px;
    color: var(--gray1);
    line-height: 1.5;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-row-img {
    flex-shrink: 0;
    width: 120px;
}

.post-row-img img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

/* === SIDEBAR === */
.sidebar { padding-top: 0; }

.sidebar-about {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.sidebar-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-bottom: 12px;
}

.sidebar-title {
    font-family: var(--gh-font-heading, inherit);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.sidebar-desc {
    font-size: 13px;
    color: var(--gray1);
    line-height: 1.6;
    margin-bottom: 14px;
}

.btn-subscribe {
    display: inline-block;
    padding: 8px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn-subscribe:hover { opacity: 0.85; }

.subscribed {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 20px;
    border: 1px solid var(--accent);
    border-radius: 20px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
}

.sidebar-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-section {
    font-size: 15px;
    font-weight: 600;
    color: var(--black);
}

.sidebar-section:hover { color: var(--accent); }

/* === ARTICLE === */
.article {
    max-width: 680px;
    margin: 40px auto 60px;
}

.article-header { margin-bottom: 28px; }

.article-title {
    font-family: var(--gh-font-heading, inherit);
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.article-excerpt {
    font-size: 18px;
    color: var(--gray1);
    line-height: 1.5;
    margin-bottom: 16px;
}

.article-meta {
    font-size: 14px;
    color: var(--gray2);
    display: flex;
    gap: 12px;
}

.article-author { font-weight: 600; color: var(--black); }

.article-image { margin-bottom: 32px; }
.article-image img { border-radius: 0; }
.article-image figcaption {
    font-size: 13px;
    color: var(--gray2);
    margin-top: 8px;
    text-align: center;
}

.article-content {
    font-family: Charter, 'Bitfield Charter', 'Iowan Old Style', Georgia, serif;
    font-size: 18px;
    line-height: 1.8;
    color: #1a1a1a;
}

.article-content h2 {
    font-family: var(--gh-font-body, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    margin: 40px 0 16px;
    letter-spacing: -0.3px;
}

.article-content h3 {
    font-family: var(--gh-font-body, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin: 36px 0 12px;
    letter-spacing: -0.2px;
}

.article-content p { margin-bottom: 18px; }
.article-content img { margin: 28px 0; }
.article-content blockquote {
    border-left: 3px solid var(--black);
    padding-left: 20px;
    color: var(--gray1);
    font-style: italic;
    margin: 24px 0;
}

.article-content strong { font-weight: 700; }

.article-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-content ul, .article-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.article-content li { margin-bottom: 8px; }

/* === GHOST KOENIG CARDS === */
.kg-image-card {
    margin: 28px 0;
}

.kg-image {
    max-width: 100%;
    height: auto;
}

.kg-card figcaption {
    font-size: 13px;
    color: var(--gray2);
    text-align: center;
    margin-top: 8px;
    font-family: var(--gh-font-body, inherit);
}

/* === TAG/AUTHOR PAGES === */
.section-title {
    font-family: var(--gh-font-heading, inherit);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.section-desc {
    font-size: 15px;
    color: var(--gray1);
    margin-bottom: 24px;
    line-height: 1.5;
}

.author-header {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-bottom: 12px;
}

/* === FOOTER === */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 20px 0;
}

.site-footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    font-size: 13px;
    color: var(--gray2);
}

/* === MOBILE === */
@media (max-width: 900px) {
    .two-col {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .sidebar {
        border-top: 1px solid var(--border);
        padding-top: 28px;
    }
}

@media (max-width: 600px) {
    .hero-body {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .site-nav { gap: 20px; flex-wrap: wrap; }
    .post-row-img { width: 80px; }
    .post-row-img img { width: 80px; height: 56px; }
    .article-title { font-size: 26px; }
}

/* === KOENIG EDITOR WIDTH CLASSES === */
.kg-width-wide {
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
}

.kg-width-full {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.kg-width-wide img,
.kg-width-full img {
    max-width: 100%;
}

/* === CTA BAR (non-members) === */
.top-bar--cta {
    background: #00244D;
}

.top-bar--cta .top-bar-greeting {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}

.top-bar-btn {
    display: inline-block;
    padding: 5px 16px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 14px;
    text-decoration: none;
    transition: opacity 0.15s;
}

.top-bar-btn:hover { opacity: 0.85; }

/* Ghost portal overrides */
.gh-portal-triggerbtn-iframe { display: none !important; }

/* Ghost card font overrides — use body font from Ghost settings */
.gh-card-excerpt,
.gh-card-meta,
.hero-excerpt,
.post-row-excerpt,
.post-meta,
.sidebar-desc,
.article-excerpt,
.article-meta {
    font-family: var(--gh-font-body, inherit);
}

/* Paywall on members-only posts (partials/post-paywall.hbs) */
.post-cta {
    margin: 40px 0;
    padding: 32px 24px;
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    text-align: center;
}

.post-cta-title {
    margin: 0 0 20px;
    font-size: 22px;
}

.post-cta-text {
    margin: 16px 0 0;
    color: var(--gray1);
    font-size: 14px;
}

.post-cta-text a { color: var(--black); }

/* "Pasate a MercadoPago" popup (once per visit) */
.migrate-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(13, 13, 13, 0.6);
}

.migrate-modal[hidden] { display: none; }

.migrate-modal-box {
    max-width: 440px;
    width: 100%;
    padding: 32px 28px 24px;
    background: var(--bg);
    border-top: 4px solid var(--accent);
    border-radius: 8px;
    text-align: center;
}

.migrate-modal-eyebrow {
    margin: 0 0 8px;
    color: #8a6417; /* darker than --accent so the small label stays readable */
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.migrate-modal-box h2 {
    margin: 0 0 16px;
    font-size: 24px;
}

.migrate-modal-box p:not(.migrate-modal-eyebrow) {
    margin: 0 0 14px;
    color: var(--gray1);
    font-size: 15px;
    line-height: 1.5;
}

.migrate-modal-box .btn-subscribe {
    margin-top: 8px;
    padding: 12px 28px;
    font-size: 15px;
}

.migrate-modal-later {
    display: block;
    margin: 14px auto 0;
    padding: 6px 12px;
    background: none;
    border: none;
    color: var(--gray1);
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
}
