/*
 * style.css — TurbioSEO
 * -----------------------------------------------------------------------
 * Concepto: un "wire" editorial. La red agrega despachos de decenas de
 * corresponsales (los sitios origen); cada uno lleva su distintivo de
 * 3 letras en monoespaciada, como en un teletipo de agencia de noticias.
 * Serif de carácter para titulares (Fraunces), sans humanista para cuerpo
 * (Libre Franklin), monoespaciada para metadatos/horas/callsigns (Space Mono).
 * -----------------------------------------------------------------------
 */

:root {
    /* Paleta */
    --paper: #EEF0EC;
    --paper-alt: #E3E6DD;
    --card-bg: #FFFFFF;
    --ink: #14181C;
    --ink-soft: #4B5259;
    --ink-faint: #7B828A;
    --rule: #D3D6CC;
    --gold: #C98A2C;
    --teal: #1F6F63;
    --red: #C0432F;
    --wire-bg: #12181C;
    --wire-fg: #EFE7D6;

    /* Tipografía */
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Libre Franklin', -apple-system, Segoe UI, Roboto, sans-serif;
    --font-mono: 'Space Mono', 'SFMono-Regular', Consolas, monospace;

    /* Layout */
    --wrap: 1200px;
    --wrap-narrow: 760px;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(20, 24, 28, 0.04), 0 8px 24px -12px rgba(20, 24, 28, 0.18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
p { margin: 0; }
button { font-family: inherit; }

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 24px;
}
.wrap--narrow { max-width: var(--wrap-narrow); }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 100;
    background: var(--wire-bg); color: var(--wire-fg);
    padding: 12px 18px; border-radius: 0 0 8px 0; font-family: var(--font-mono);
}
.skip-link:focus { left: 0; }

:focus-visible {
    outline: 3px solid var(--teal);
    outline-offset: 2px;
}

/* -------------------------------------------------------------- ticker */
.ticker {
    background: var(--wire-bg);
    color: var(--wire-fg);
    display: flex;
    align-items: stretch;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 13px;
}
.ticker__label {
    flex: 0 0 auto;
    background: var(--gold);
    color: var(--wire-bg);
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 10px 16px;
    display: flex;
    align-items: center;
}
.ticker__track {
    flex: 1 1 auto;
    display: flex;
    overflow: hidden;
    position: relative;
}
.ticker__group {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    animation: ticker-scroll 45s linear infinite;
    padding-left: 100%;
    will-change: transform;
}
.ticker__item {
    color: var(--wire-fg);
    white-space: nowrap;
    padding: 10px 22px;
    border-left: 1px solid rgba(239, 231, 214, 0.18);
    opacity: 0.92;
}
.ticker__item:hover, .ticker__item:focus-visible { color: var(--gold); opacity: 1; }
.ticker__callsign {
    font-weight: 700;
    color: var(--gold);
    margin-right: 8px;
}
@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
}
.ticker:hover .ticker__group,
.ticker:focus-within .ticker__group { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
    .ticker__group { animation: none; }
    .ticker__track { overflow-x: auto; }
}
@media (max-width: 720px) {
    .ticker__label { display: none; }
}

/* ---------------------------------------------------------- site header */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: saturate(1.1);
}
.site-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-top: 16px;
    padding-bottom: 16px;
    flex-wrap: wrap;
}
.brand { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.brand__mark {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: 0.02em;
}
.brand__slash { color: var(--gold); }
.brand__claim {
    font-size: 12px;
    color: var(--ink-faint);
    font-family: var(--font-mono);
}
.main-nav { display: flex; gap: 20px; font-weight: 600; }
.main-nav a { padding: 6px 2px; border-bottom: 2px solid transparent; }
.main-nav a:hover { border-color: var(--gold); }

.search-form { display: flex; gap: 0; }
.search-form input {
    font-family: var(--font-body);
    border: 1px solid var(--rule);
    border-right: none;
    background: var(--card-bg);
    padding: 9px 12px;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    min-width: 180px;
    font-size: 14px;
}
.search-form button {
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    padding: 9px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}
.search-form button:hover { background: var(--teal); border-color: var(--teal); }
.search-form--hero { max-width: 420px; margin-top: 18px; }

/* --------------------------------------------------------------- hero */
.hero { padding: 48px 0 32px; }
.hero--site { padding-top: 32px; }
.breadcrumb {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-faint);
    margin-bottom: 14px;
    display: block;
}
.breadcrumb a:hover { color: var(--teal); }
.hero__eyebrow {
    font-family: var(--font-mono);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gold);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.hero__title {
    font-size: clamp(30px, 5vw, 48px);
    font-weight: 600;
    line-height: 1.08;
    max-width: 18ch;
}
.hero--site .hero__title { max-width none; }
.hero__sub {
    margin-top: 14px;
    font-size: 17px;
    color: var(--ink-soft);
    max-width: 60ch;
}
.hero__sub a:hover { color: var(--teal); text-decoration: underline; }

/* --------------------------------------------------------------- feed */
.feed { padding-bottom: 56px; }
.feed__heading {
    font-size: 22px;
    font-weight: 600;
    margin: 40px 0 20px;
}
.feed__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}
.empty-state {
    padding: 48px 0;
    color: var(--ink-faint);
    font-size: 16px;
}
.empty-state code {
    font-family: var(--font-mono);
    background: var(--paper-alt);
    padding: 2px 6px;
    border-radius: 4px;
}

/* --------------------------------------------------------------- card */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--rule);
    border-top: 4px solid var(--accent, var(--gold));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(20,24,28,.06), 0 16px 32px -16px rgba(20,24,28,.28); }

.card__media {
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--paper-alt);
    position: relative;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media-fallback {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 28px;
    letter-spacing: 0.08em;
    color: #fff;
    background: var(--accent, var(--gold));
    opacity: 0.88;
}
.card__media--fallback { background: var(--accent, var(--gold)); }

.card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card__tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.card__tag:hover { color: var(--teal); }
.card__callsign {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 11px;
    color: #fff;
    background: var(--accent, var(--gold));
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.03em;
}
.card__time {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--ink-faint);
    white-space: nowrap;
}
.card__title {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.28;
}
.card__title a:hover { color: var(--teal); }
.card__teaser {
    font-size: 14.5px;
    color: var(--ink-soft);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card__cta {
    margin-top: auto;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    padding-top: 10px;
    border-top: 1px dashed var(--rule);
}
.card__cta:hover { color: var(--teal); }

/* ------------------------------------------------------------ pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 40px;
    font-family: var(--font-mono);
    font-size: 14px;
}
.pagination__link {
    padding: 8px 13px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
}
.pagination__link:hover { border-color: var(--teal); color: var(--teal); }
.pagination__link--current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pagination__dots { padding: 8px 4px; color: var(--ink-faint); }

/* ------------------------------------------------------------ sites grid */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding-bottom: 56px;
}
.site-tile {
    background: var(--card-bg);
    border: 1px solid var(--rule);
    border-left: 4px solid var(--accent, var(--gold));
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow);
}
.site-tile:hover { border-left-width: 8px; }
.site-tile__callsign {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--accent, var(--gold));
    letter-spacing: 0.05em;
}
.site-tile__name { font-weight: 700; font-size: 16px; }
.site-tile__domain { font-size: 12.5px; color: var(--ink-faint); font-family: var(--font-mono); }
.site-tile__count { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

/* ------------------------------------------------------------------ post */
.post { padding: 8px 0 40px; }
.post__meta {
    display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap;
}
.post__meta time { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-faint); }
.post__title { font-size: clamp(26px, 4vw, 38px); font-weight: 600; line-height: 1.18; margin-bottom: 22px; }
.post__figure { margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); }
.post__figure img { width: 100%; }
.post__teaser { font-size: 19px; line-height: 1.6; color: var(--ink-soft); margin-bottom: 28px; }
.post__cta {
    display: inline-block;
    background: var(--ink);
    color: var(--paper);
    font-weight: 700;
    padding: 14px 24px;
    border-radius: 999px;
}
.post__cta:hover { background: var(--teal); }
.post__note { margin-top: 16px; font-size: 12.5px; color: var(--ink-faint); max-width: 60ch; }

/* --------------------------------------------------------------- footer */
.site-footer { background: var(--wire-bg); color: var(--wire-fg); margin-top: 40px; }
.site-footer__inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
    padding: 48px 24px 32px;
}
.site-footer h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); margin-bottom: 12px; font-family: var(--font-mono); }
.site-footer p { color: rgba(239,231,214,0.72); font-size: 13.5px; line-height: 1.6; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer a:hover { color: var(--gold); }
.brand__mark--footer { display: block; margin-bottom: 10px; }
.site-footer__legal {
    border-top: 1px solid rgba(239,231,214,0.14);
    padding: 16px 24px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: rgba(239,231,214,0.6);
}

@media (max-width: 780px) {
    .site-footer__inner { grid-template-columns: 1fr; }
    .search-form { display: none; }
    .search-form--hero { display: flex; }
}

.error-page { padding: 72px 0; }
