/* Portugal Protests Now - Ghost theme */

@font-face {
    font-family: "Archivo";
    src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Source Serif 4";
    src: url("../fonts/source-serif-4-latin-standard-normal.woff2") format("woff2-variations");
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Source Serif 4";
    src: url("../fonts/source-serif-4-latin-standard-italic.woff2") format("woff2-variations");
    font-weight: 200 900;
    font-style: italic;
    font-display: swap;
}

:root {
    --accent: #0E5A4A;
    --ground: #F4F5F2;
    --surface: #FFFFFF;
    --ink: #15202B;
    --ink-2: #2E3A44;
    --muted: #4A5560;
    --rule: #D5D9D6;
    --placeholder: #E1E6E3;
    --ochre: #E3B04B;
    --on-accent-muted: #E3EFEB;
    --sans: var(--gh-font-heading, "Archivo", "Helvetica Neue", Arial, sans-serif);
    --serif: var(--gh-font-body, "Source Serif 4", Georgia, "Times New Roman", serif);
    --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.page-pad { padding-top: 48px; padding-bottom: 24px; display: flex; flex-direction: column; gap: 72px; }
.muted { color: var(--muted); }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 10; }
.skip-link:focus { left: 8px; color: #fff; }

/* Top bar */
.topbar { background: var(--ink); color: #E9ECEA; font-size: 13px; letter-spacing: 0.02em; }
.topbar-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-top: 10px; padding-bottom: 10px; }
.topbar-date { color: #B9C2BE; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--rule); }
.masthead .wrap { padding-top: 28px; display: flex; flex-direction: column; gap: 24px; }
.masthead-row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-logo { max-height: 56px; width: auto; }
.brand-name { font-size: clamp(22px, 3vw, 30px); font-weight: 800; font-stretch: 112%; letter-spacing: -0.01em; line-height: 1; }
.wordmark { display: inline-flex; flex-wrap: wrap; gap: 0 0.3em; align-items: baseline; }
.wordmark-now { color: var(--accent); border-bottom: 0.17em solid var(--accent); padding-bottom: 0.1em; }
.footer-name .wordmark-now { color: #7FD1B5; border-bottom-color: #7FD1B5; }
.masthead-actions { display: flex; gap: 12px; align-items: center; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 48px; padding: 0 22px;
    background: var(--accent); color: #fff; border: 0; border-radius: 2px;
    font: 700 15px/1 var(--sans); cursor: pointer;
}
.btn:hover { color: #fff; filter: brightness(0.92); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-outline:hover { color: var(--ink); }
.link-btn { background: none; border: 0; padding: 12px 6px; font: 600 15px/1 var(--sans); color: var(--ink); cursor: pointer; }
.link-btn:hover { color: var(--accent); }

.primary-nav .nav { list-style: none; margin: 0; padding: 0 0 14px; display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: 15px; font-weight: 600; }
.primary-nav .nav a { display: block; padding: 10px 0; border-bottom: 3px solid transparent; }
.primary-nav .nav-current a { border-bottom-color: var(--accent); }

/* Shared type */
.kicker, .eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.kicker { color: var(--accent); }
.eyebrow { color: var(--muted); margin: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--muted); }

/* Lead + upcoming */
.lead-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.lead { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.lead-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--placeholder); }
.lead-title { margin: 0; font-size: clamp(34px, 4.6vw, 52px); line-height: 1.05; font-weight: 800; font-stretch: 108%; letter-spacing: -0.015em; text-wrap: balance; }
.lead-dek { margin: 0; font-family: var(--serif); font-size: 21px; line-height: 1.5; color: var(--ink-2); max-width: 720px; }

.upcoming { background: var(--surface); border-top: 4px solid var(--ink); padding: 24px; }
.section-head-sm { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 12px; }
.section-head-sm h2 { margin: 0; font-size: 20px; font-weight: 800; font-stretch: 108%; }
.section-head-sm a { font-size: 14px; font-weight: 600; color: var(--accent); }
.upcoming-list { list-style: none; margin: 0; padding: 0; }
.upcoming-list a { display: flex; flex-direction: column; gap: 4px; padding: 16px 0; border-top: 1px solid var(--placeholder); }
.upcoming-title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.upcoming-meta { font-size: 14px; color: var(--muted); }

/* Issues */
.issues { display: flex; flex-direction: column; gap: 20px; border-top: 1px solid var(--rule); padding-top: 32px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.chip { display: inline-block; border: 1.5px solid var(--ink); padding: 11px 18px; font-size: 15px; font-weight: 600; border-radius: 999px; }
.chip:hover { background: var(--ink); color: #fff; }

/* Latest */
.latest { display: flex; flex-direction: column; gap: 28px; }
.section-head { border-top: 4px solid var(--ink); padding-top: 16px; }
.section-head h2 { margin: 0; font-size: 32px; font-weight: 800; font-stretch: 110%; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 48px 40px; }
.card { display: flex; flex-direction: column; gap: 12px; }
.card-media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--placeholder); }
.card .kicker { font-size: 12px; }
.card-title { margin: 0; font-size: 23px; line-height: 1.2; font-weight: 700; font-stretch: 104%; text-wrap: balance; }
.card-excerpt { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.card .meta { font-size: 13px; }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 24px; font-weight: 600; }
.pagination a { color: var(--accent); padding: 12px 0; }
.page-number { color: var(--muted); }

/* Newsletter */
.newsletter { border: 1.5px solid var(--ink); background: var(--surface); padding: clamp(24px, 4vw, 40px); display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: end; justify-content: space-between; }
.wrap ~ .newsletter, main > .newsletter { max-width: calc(var(--max) - 48px); margin: 72px auto 0; }
.newsletter-copy { flex: 1 1 380px; display: flex; flex-direction: column; gap: 8px; }
.newsletter h2 { margin: 0; font-size: 28px; font-weight: 800; font-stretch: 108%; }
.newsletter-copy p { margin: 0; font-family: var(--serif); font-size: 18px; color: var(--ink-2); }
.newsletter-form { flex: 1 1 420px; display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.field { flex: 1 1 240px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input { height: 48px; padding: 0 14px; border: 1.5px solid var(--ink); border-radius: 2px; font: 16px var(--sans); background: #fff; color: var(--ink); }
.form-msg { display: none; flex-basis: 100%; margin: 0; font-size: 15px; }
.newsletter-form.success .form-success, .newsletter-form.error .form-error { display: block; }
.newsletter-form.loading .btn { opacity: 0.7; }

/* Article */
.article { gap: 40px; }
.article-head { max-width: 860px; display: flex; flex-direction: column; gap: 20px; }
.article-title { margin: 0; font-size: clamp(36px, 5vw, 56px); line-height: 1.04; font-weight: 800; font-stretch: 108%; letter-spacing: -0.015em; text-wrap: balance; }
.article-dek { margin: 0; font-family: var(--serif); font-size: 22px; line-height: 1.5; color: var(--ink-2); }
.article-meta { border-top: 1px solid var(--rule); padding-top: 16px; gap: 8px 24px; }
.article-meta a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.article-figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.article-figure img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; background: var(--placeholder); }
.article-figure figcaption { font-size: 14px; color: var(--muted); }
.article-layout { display: flex; flex-wrap: wrap; gap: 48px 64px; align-items: start; }
.article-main { flex: 999 1 560px; min-width: 0; max-width: 720px; display: flex; flex-direction: column; gap: 32px; }
.page-body { margin: 0 auto; }
.article-side { flex: 1 1 280px; display: flex; flex-direction: column; gap: 32px; }
.side-block { border-top: 4px solid var(--ink); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.side-block h2 { margin: 0; font-size: 18px; font-weight: 800; font-stretch: 108%; }
.side-block p { margin: 0; font-size: 15px; }
.side-block > a { color: var(--accent); font-weight: 700; padding: 6px 0; }
.related { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.related a { display: block; padding: 10px 0; border-top: 1px solid var(--rule); font-size: 17px; font-weight: 700; line-height: 1.3; }


/* Post content */
.gh-content { font-family: var(--serif); font-size: 20px; line-height: 1.65; color: #1E2932; }
.gh-content > * + * { margin-top: 1.2em; }
.gh-content > :first-child { margin-top: 0; }
.gh-content p, .gh-content ul, .gh-content ol { margin-bottom: 0; }
.gh-content h2, .gh-content h3, .gh-content h4 { font-family: var(--sans); font-weight: 800; font-stretch: 106%; line-height: 1.2; margin: 1.6em 0 0; }
.gh-content h2 { font-size: 28px; }
.gh-content h3 { font-size: 22px; }
.gh-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.gh-content blockquote:not(.kg-blockquote-alt) { margin: 1.4em 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--ink); font-size: 24px; line-height: 1.45; font-style: italic; }
.gh-content figcaption { font-family: var(--sans); font-size: 14px; color: var(--muted); margin-top: 10px; }
.gh-content hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.gh-content .kg-callout-card { font-family: var(--sans); font-size: 17px; }

/* Koenig editor card widths (required by Ghost) */
.kg-width-wide { position: relative; width: min(1040px, calc(100vw - 48px)); max-width: none; }
.kg-width-full { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); max-width: none; }
.kg-width-full img { width: 100%; }

/* Archive headers */
.archive-head { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.archive-head h1 { margin: 0; font-size: clamp(36px, 5vw, 52px); font-weight: 800; font-stretch: 110%; line-height: 1.05; }
.archive-head p { margin: 0; font-family: var(--serif); font-size: 20px; color: var(--ink-2); }

/* Footer */
.site-footer { margin-top: 80px; background: var(--ink); color: #D9DEDB; }
.site-footer .wrap { padding-top: 48px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 32px; }
.footer-row { display: flex; flex-wrap: wrap; gap: 24px 64px; justify-content: space-between; }
.footer-about { max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.footer-name { font-size: 22px; font-weight: 800; font-stretch: 112%; color: #fff; }
.footer-about p { margin: 0; font-size: 15px; }
.footer-nav .nav { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 48px; }
.footer-nav a { color: #fff; padding: 4px 0; display: inline-block; }
.footer-nav a:hover { color: var(--ochre); }
.footer-legal { border-top: 1px solid #36434F; padding-top: 20px; font-size: 13px; color: #B9C2BE; }

/* Responsive */
@media (max-width: 900px) {
    .lead-grid { grid-template-columns: minmax(0, 1fr); }
    .page-pad { gap: 56px; }
}
@media (max-width: 600px) {
    .wrap { padding: 0 16px; }
    .gh-content { font-size: 18px; }
    .lead-dek, .article-dek { font-size: 19px; }
    .footer-nav .nav { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}
