/* ===== COMUNIDAD — cercano, redondeado, estilo app (mobile-first) ===== */
:root {
    --bg-body: #fff8f0; --surface: #ffffff; --surface-subtle: #fff1e2; --surface-hover: #ffe8d1;
    --border: #f1dfca; --border-subtle: #f7ead9;
    --text-primary: #2a2118; --text-main: #2a2118; --text-headline: #2a2118; --text-body: #4a3d30; --text-muted: #8a7968; --text-light: #b9a994;
    --font-serif: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-sans: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-headline: 'Nunito', system-ui, sans-serif; --font-body: 'Nunito', system-ui, sans-serif;
    --radius-sm: 10px; --radius-md: 16px; --radius-lg: 22px; --radius-full: 999px;
    --shadow-card: 0 4px 18px rgba(120, 70, 20, .09); --transition: all .18s ease;
    --accent-orange: var(--accent); --primary-dark: var(--accent);
}
html { -webkit-text-size-adjust: 100%; }
body.cm { background: var(--bg-body); color: var(--text-body); font-family: var(--font-body); font-size: 17px; line-height: 1.55; margin: 0; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
:where(body.cm) a { color: inherit; text-decoration: none; }
:where(body.cm) img { max-width: 100%; height: auto; display: block; }
.cm-wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 14px; box-sizing: border-box; }

/* Cabecera */
.cm-head { background: var(--surface); border-radius: 0 0 var(--radius-lg) var(--radius-lg); box-shadow: var(--shadow-card); padding: 12px 0 14px; }
.cm-head__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cm-brand { font: 900 1.45rem/1.05 var(--font-headline); color: var(--accent); letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
.cm-brand__dot { width: 34px; height: 34px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--secondary)); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.05rem; flex: 0 0 auto; }
.cm-brand img { max-height: 40px; }
.cm-search { display: flex; align-items: center; background: var(--surface-subtle); border: 2px solid var(--border); border-radius: 999px; margin-top: 12px; padding: 0 6px 0 16px; }
.cm-search input { flex: 1; min-width: 0; min-height: 46px; border: 0; background: transparent; font: 700 1rem var(--font-body); color: var(--text-primary); outline: none; }
.cm-search button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--accent); color: #fff; font-size: 1rem; cursor: pointer; }
.cm-greet { margin: 14px 0 2px; font: 800 1.15rem/1.25 var(--font-headline); color: var(--text-primary); }

/* Chips de secciones */
.cm-chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 14px 4px; scrollbar-width: none; max-width: 1100px; margin: 0 auto; box-sizing: border-box; }
.cm-chips::-webkit-scrollbar { display: none; }
.cm-chip { flex: 0 0 auto; min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px; background: var(--surface); border: 2px solid var(--border); font: 800 .88rem/1 var(--font-body); color: var(--text-primary); }
.cm-chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Historias (videos verticales) */
.cm-stories { margin: 16px 0 4px; }
.cm-stories h2, .cm-title { font: 900 1.25rem/1.1 var(--font-headline); color: var(--text-primary); margin: 0 0 10px; }
.cm-stories__row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 14px 10px; margin: 0 -14px; scroll-snap-type: x proximity; scrollbar-width: none; }
.cm-stories__row::-webkit-scrollbar { display: none; }
.cm-story { position: relative; flex: 0 0 124px; aspect-ratio: 9/16; border-radius: 18px; overflow: hidden; background: linear-gradient(160deg, var(--accent), var(--secondary)); scroll-snap-align: start; box-shadow: var(--shadow-card); border: 3px solid var(--accent); box-sizing: border-box; }
.cm-story img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cm-story::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,0) 62%); }
.cm-story span { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 1; color: #fff; font: 800 .78rem/1.15 var(--font-body); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cm-story i { position: absolute; top: 8px; right: 8px; z-index: 1; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-style: normal; font-size: .72rem; display: flex; align-items: center; justify-content: center; }

/* Tarjetas */
.cm-feed { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 8px; }
.cm-feed .nn-ad { grid-column: 1 / -1; margin: 2px 0; }
.cm-card { display: block; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.cm-card__img { position: relative; aspect-ratio: 4/3; background: linear-gradient(135deg, var(--surface-subtle), var(--surface-hover)); }
.cm-card__img img { width: 100%; height: 100%; object-fit: cover; }
.cm-card__img--empty { display: flex; align-items: center; justify-content: center; font-size: 3rem; aspect-ratio: 16/7; }
.cm-card__flag { position: absolute; left: 10px; top: 10px; background: rgba(255,255,255,.95); color: var(--text-primary); border-radius: 999px; padding: 5px 10px; font: 800 .74rem/1 var(--font-body); }
.cm-card__body { padding: 13px 15px 15px; }
.cm-pill { display: inline-block; background: var(--surface-subtle); color: var(--accent); border-radius: 999px; padding: 4px 11px; font: 900 .72rem/1 var(--font-body); letter-spacing: .03em; text-transform: uppercase; margin: 0 4px 8px 0; }
.cm-pill--alt { background: #ccfbf1; color: #0f766e; }
.cm-card h3 { margin: 0 0 8px; font: 800 1.22rem/1.2 var(--font-headline); color: var(--text-primary); }
.cm-meta { font: 700 .8rem/1 var(--font-body); color: var(--text-muted); }

/* Paginación */
.nn-pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 24px 0 8px; }
.nn-page { min-width: 46px; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 2px solid var(--border); font-weight: 800; font-size: .95rem; box-sizing: border-box; }
.nn-page--current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Publicidad */
.nn-ad { margin: 14px 0; text-align: center; overflow: hidden; border-radius: var(--radius-md); }
.nn-ad__label { display: block; font: 800 .62rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--text-light); margin-bottom: 4px; }
.nn-ad--empty { border: 2px dashed var(--secondary); color: var(--secondary); font: 800 .75rem/1.3 var(--font-body); padding: 14px 10px; background: rgba(13,148,136,.06); }
.nn-sticky-ad { position: fixed; left: 0; right: 0; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 90; background: var(--surface); border-top: 1px solid var(--border); padding: 4px 8px; text-align: center; }
.nn-sticky-ad .nn-ad { margin: 0; }
.nn-sticky-ad__close { position: absolute; top: -28px; right: 10px; width: 28px; height: 28px; border: 0; background: var(--surface); border-radius: 50% 50% 0 0; box-shadow: 0 -2px 6px rgba(0,0,0,.08); font-size: .75rem; cursor: pointer; }

/* Barra de pestañas */
.cm-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(120,70,20,.08); padding-bottom: env(safe-area-inset-bottom); }
.cm-tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 62px; font: 800 .7rem/1 var(--font-body); color: var(--text-muted); }
.cm-tabs a span { font-size: 1.35rem; line-height: 1; }
.cm-tabs a.is-active { color: var(--accent); }

/* Pie */
.cm-footer { margin: 34px 14px 10px; padding: 22px 18px; background: linear-gradient(135deg, var(--secondary), #115e59); color: #ecfeff; border-radius: var(--radius-lg); max-width: 1072px; box-sizing: border-box; }
.cm-footer h4 { margin: 0 0 6px; font: 900 1.3rem/1.1 var(--font-headline); color: #fff; }
.cm-footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0; font-weight: 800; font-size: .88rem; }
.cm-footer small { display: block; line-height: 1.5; opacity: .85; }

@media (min-width: 640px) {
    .cm-feed { grid-template-columns: repeat(2, 1fr); }
    .cm-story { flex-basis: 140px; }
}
@media (min-width: 1024px) {
    .cm-wrap { padding: 0 22px; }
    .cm-feed { grid-template-columns: repeat(3, 1fr); gap: 18px; }
    .cm-footer { margin-left: auto; margin-right: auto; }
    body.cm { padding-bottom: 0; }
    .cm-tabs, .nn-sticky-ad { display: none; }
}

/* ===== Pulido v2 ===== */
/* Fotos algo más apaisadas (la portada se recorre más rápido) y notas sin foto sin el bloque vacío */
.cm-card__img { aspect-ratio: 16/10; }
.cm-card__img--empty { display: none; }
.cm-card:has(.cm-card__img--empty) { border-left: 6px solid var(--accent); }
.cm-card:has(.cm-card__img--empty) h3 { font-size: 1.35rem; }
.cm-card:has(.cm-card__img--empty) { align-self: start; }
.cm-excerpt { margin: 0 0 10px; font-size: .98rem; line-height: 1.45; color: var(--text-body, var(--text-primary)); }
.cm-card { transition: transform .18s ease, box-shadow .18s ease; }
.cm-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -12px rgba(0,0,0,.28); }
.cm-card__body { padding: 14px 16px 16px; }
