/* SPDX-License-Identifier: AGPL-3.0-or-later · Trenalia */
/* Sprint 272 · Bloques del gestor de contenidos y páginas de noticias. Usa las variables de web.css (claro y oscuro). */
.cms { position: relative; padding: 64px 0; }
.cms-s-compact { padding: 36px 0; }
.cms-s-airy { padding: 96px 0; }
.cms-t-tint { background: var(--paper-2); }
.cms-t-dark { background: #0d1626; color: #e6ecf5; --ink: #e6ecf5; --ink-2: #a3b0c4; --rule: #24324b; --card: #131d2e; --blue: #5aa9ff; --blue-ink: #06101f; }
.cms-t-accent { background: linear-gradient(135deg, #1f6fd1 0%, #1858a8 100%); color: #fff; --ink: #fff; --ink-2: #dce8fb; --rule: rgba(255,255,255,.35); --card: rgba(255,255,255,.1); --blue: #fff; --blue-ink: #1858a8; }
.cms-t-board { background: var(--board); color: #f3f6fb; --ink: #f3f6fb; --ink-2: #b8c4d8; --rule: #24324b; --card: var(--board-2); --blue: var(--led); --blue-ink: #0d1626; }
.cms-t-board .cms-h, .cms-t-board .cms-stat b { font-family: var(--mono); color: var(--led); letter-spacing: 0; }
.cms-t-dark .eyebrow, .cms-t-accent .eyebrow { color: inherit; opacity: .85; }
.cms-w-narrow .cms-in { max-width: 820px; }
.cms-w-wide .cms-in { max-width: 1440px; }
.cms-center .cms-h, .cms-center > .cms-in > .eyebrow, .cms-center > .cms-in > .cms-rich { text-align: center; margin-left: auto; margin-right: auto; }
.cms-center .ctas { justify-content: center; }
.cms-h { margin: 0 0 18px; }
.cms-rich { font-size: 17.5px; color: var(--ink); }
.cms-rich > :first-child { margin-top: 0; }
.cms-rich p, .cms-rich ul, .cms-rich ol, .cms-rich blockquote { max-width: 70ch; margin: 0 0 16px; }
.cms-center .cms-rich p { margin-left: auto; margin-right: auto; }
.cms-rich h2 { font-size: clamp(22px, 2.4vw, 28px); margin: 34px 0 12px; }
.cms-rich h3 { font-size: 20px; margin: 28px 0 10px; }
.cms-rich h4 { font-size: 17px; margin: 22px 0 8px; }
.cms-rich ul, .cms-rich ol { padding-left: 1.3em; }
.cms-rich li { margin: 4px 0; }
.cms-rich blockquote { border-left: 4px solid var(--blue); padding: 6px 0 6px 16px; color: var(--ink-2); font-style: italic; }
.cms-rich mark { background: color-mix(in srgb, var(--led) 45%, transparent); color: inherit; padding: 0 3px; border-radius: 3px; }
.cms-rich code { font-family: var(--mono); font-size: .92em; background: var(--paper-2); padding: 1px 5px; border-radius: 5px; }
.cms-rich hr { border: 0; border-top: 1px solid var(--rule); margin: 28px 0; }
.cms-rich a { text-underline-offset: 3px; }
.cms-fig { margin: 24px 0; }
.cms-fig img, .cms-media-fig img, .cms-art-fig img { border-radius: 14px; width: 100%; height: auto; box-shadow: var(--shadow); }
.cms figcaption, .cms-art figcaption { font-size: 14px; color: var(--ink-2); margin-top: 8px; }

/* Imagen y texto */
.cms-media-g { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.cms-media-g.cms-left .cms-media-fig { order: -1; }
.cms-media-fig { margin: 0; }

/* Caja destacada */
.cms-box { border-radius: 20px; padding: 40px 44px; background: var(--card); border: 1px solid var(--rule); box-shadow: var(--shadow); }
.cms-box .cms-h { margin-bottom: 12px; }
.cms-box.cms-tone-accent { background: linear-gradient(135deg, #1f6fd1, #1858a8); color: #fff; border: 0; --ink: #fff; --ink-2: #dce8fb; --blue: #fff; --blue-ink: #1858a8; --rule: rgba(255,255,255,.4); }
.cms-box.cms-tone-accent .eyebrow { color: #dce8fb; }
.cms-box.cms-tone-warn { border-left: 6px solid var(--amber); }
.cms-box.cms-tone-ok { border-left: 6px solid var(--green); }

/* Aviso destacado */
aside.cms-banner { padding: 0; }
.cms-banner .cms-in { max-width: none; padding: 0; }
.cms-bar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; font-size: 15.5px; line-height: 1.45; justify-content: center; }
.cms-bar-t { max-width: 1100px; }
.cms-bar-t p { margin: 0; display: inline; }
.cms-bar-a { font-weight: 700; white-space: nowrap; color: inherit; }
.cms-bar.cms-tone-info { background: #e7f0fc; color: #133e75; }
.cms-bar.cms-tone-ok { background: #e2f6ec; color: #0b5c39; }
.cms-bar.cms-tone-warn { background: #fff3dc; color: #6b4600; }
.cms-bar.cms-tone-alert { background: #d93a32; color: #fff; }
:root[data-theme="dark"] .cms-bar.cms-tone-info { background: #12294a; color: #cfe3ff; }
:root[data-theme="dark"] .cms-bar.cms-tone-ok { background: #0f3324; color: #c4f2dc; }
:root[data-theme="dark"] .cms-bar.cms-tone-warn { background: #3a2b0b; color: #ffe2a6; }
.cms-x { background: none; border: 0; color: inherit; font-size: 22px; line-height: 1; padding: 4px 8px; cursor: pointer; opacity: .75; border-radius: 6px; }
.cms-x:hover { opacity: 1; background: rgba(0,0,0,.08); }

/* Tarjetas */
.cms-cards { display: grid; gap: 22px; margin-top: 26px; }
.cms-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cms-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cms-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cms-card { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.cms-card h3 { margin: 4px 0 4px; }
.cms-card .cms-rich { font-size: 16px; color: var(--ink-2); }
.cms-card .cms-rich p { margin-bottom: 8px; }
.cms-card-ico { font-size: 34px; line-height: 1; }
.cms-card-img { border-radius: 10px; margin: -6px -6px 8px; width: calc(100% + 12px); max-width: none; aspect-ratio: 16 / 10; object-fit: cover; }
.cms-card-a { margin-top: auto; font-weight: 700; text-decoration: none; }

/* Cifras */
.cms-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin-top: 26px; }
.cms-stat { border-top: 3px solid var(--blue); padding: 16px 4px 4px; display: flex; flex-direction: column; gap: 4px; }
.cms-stat b { font-size: clamp(32px, 4vw, 46px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 800; font-variant-numeric: tabular-nums; }
.cms-stat span { font-weight: 650; }
.cms-stat small { color: var(--ink-2); font-size: 14px; }
.cms-note { margin-top: 18px; }
.cms-note .cms-rich { font-size: 14px; color: var(--ink-2); }

/* Preguntas */
.cms-faq { margin-top: 20px; max-width: 880px; }
.cms-faq details { border-bottom: 1px solid var(--rule); padding: 4px 0; }
.cms-faq summary { cursor: pointer; font-weight: 700; padding: 14px 32px 14px 0; list-style: none; position: relative; font-size: 18px; }
.cms-faq summary::-webkit-details-marker { display: none; }
.cms-faq summary::after { content: '+'; position: absolute; right: 4px; top: 10px; font-size: 24px; color: var(--blue); transition: transform .2s; }
.cms-faq details[open] summary::after { transform: rotate(45deg); }
.cms-faq .cms-rich { padding: 0 0 12px; color: var(--ink-2); font-size: 16.5px; }

/* Cita */
.cms-quote { margin: 0 auto; max-width: 860px; text-align: center; }
.cms-quote blockquote { margin: 0; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.35; font-weight: 650; letter-spacing: -0.01em; }
.cms-quote blockquote p { max-width: none; }
.cms-quote blockquote::before { content: '“'; display: block; font-size: 64px; line-height: .6; color: var(--blue); margin-bottom: 12px; }
.cms-quote figcaption { margin-top: 14px; font-size: 16px; }
.cms-quote figcaption span { color: var(--ink-2); }

/* Galería */
.cms-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.cms-gal figure { margin: 0; }
.cms-gal img { border-radius: 12px; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* Noticias: tarjetas y lista */
.cms-nc { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; margin-top: 24px; }
.cms-ncard { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.cms-ncard:hover { transform: translateY(-2px); }
.cms-ncard-img img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.cms-ncard-t { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cms-ncard-k { font-size: 12.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--blue); margin: 0; }
.cms-ncard h3 { font-size: 20px; line-height: 1.25; margin: 0; }
.cms-ncard h3 a { color: var(--ink); text-decoration: none; }
.cms-ncard h3 a:hover { text-decoration: underline; }
.cms-ncard p { font-size: 15.5px; color: var(--ink-2); margin: 0; }
.cms-ncard time { margin-top: auto; padding-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.cms-feat { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.cms-feat .cms-ncard-img img { height: 100%; aspect-ratio: auto; min-height: 260px; }
.cms-feat .cms-ncard-t { padding: 28px 30px; justify-content: center; }
.cms-feat h3 { font-size: clamp(24px, 2.6vw, 32px); }
.cms-nl { list-style: none; padding: 0; margin: 18px 0 0; max-width: 860px; }
.cms-nl li { padding: 12px 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 16px; }
.cms-nl a { font-weight: 700; text-decoration: none; color: var(--ink); }
.cms-nl time { color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.cms-more { margin: 22px 0 0; font-weight: 700; }
.cms-more a { text-decoration: none; }
.cms-empty { color: var(--ink-2); }

/* Página de noticias */
.cms-idx { padding: 56px 0 72px; }
.cms-idx h1, .cms-art h1 { font-size: clamp(32px, 4.6vw, 52px); }
.cms-lead { font-size: clamp(18px, 1.8vw, 21px); color: var(--ink-2); margin: 16px 0 0; max-width: 62ch; line-height: 1.5; }
.cms-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; }
.cms-cats a { border: 1px solid var(--rule); border-radius: 999px; padding: 6px 14px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14.5px; }
.cms-cats a[aria-current="page"] { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); }
.cms-art { padding: 40px 0 72px; }
.cms-art-h { max-width: 860px; }
.cms-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--ink-2); margin-bottom: 22px; }
.cms-crumbs a { color: var(--ink-2); text-decoration: none; }
.cms-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.cms-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14.5px; color: var(--ink-2); margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); max-width: none; }
.cms-meta span:first-child { font-weight: 700; color: var(--ink); }
.cms-art-fig { margin: 32px auto 0; max-width: 1180px; }
.cms-art-b { max-width: 860px; margin-top: 34px; }
.cms-art-b .cms-rich { font-size: 18.5px; line-height: 1.68; }
.cms-hl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 0 0 34px; }
.cms-hl div { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.cms-hl b { font-size: 30px; line-height: 1.05; letter-spacing: -0.02em; font-weight: 800; color: var(--blue); font-variant-numeric: tabular-nums; }
.cms-hl span { font-size: 14.5px; color: var(--ink-2); line-height: 1.35; }
.cms-src { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--rule); }
.cms-src h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin-bottom: 10px; }
.cms-src ul { padding-left: 1.2em; margin: 0; font-size: 15.5px; }
.cms-src li { margin: 4px 0; }
.cms-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 34px; padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.cms-share span { font-weight: 700; margin-right: 6px; }
.cms-share a, .cms-share button { border: 1px solid var(--rule); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.cms-share a:hover, .cms-share button:hover { border-color: var(--ink-2); }
.cms-rel { margin-top: 56px; }
.cms-rel h2 { font-size: 26px; }

/* Vista previa de borradores */
.cms-pvbar { position: sticky; top: 64px; z-index: 4; background: #ffb21a; color: #1b1300; padding: 8px 16px; font-size: 14px; text-align: center; }
.cms-pv { outline: 2px dashed transparent; outline-offset: -6px; }
.cms-pv-draft, .cms-pv-changed, .cms-pv-scheduled { outline-color: #ffb21a; }
.cms-pv-badge { position: absolute; top: 10px; right: 12px; z-index: 2; background: #ffb21a; color: #1b1300; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; letter-spacing: .02em; }
.cms-focus { animation: cmsFocus 1.6s ease-out 1; }
@keyframes cmsFocus { from { box-shadow: inset 0 0 0 4px #ffb21a; } to { box-shadow: inset 0 0 0 0 transparent; } }

@media (max-width: 980px) {
  .cms-cols-3, .cms-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cms-media-g { grid-template-columns: 1fr; gap: 28px; }
  .cms-media-g.cms-left .cms-media-fig { order: 0; }
  .cms-feat { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cms { padding: 44px 0; }
  .cms-s-airy { padding: 64px 0; }
  .cms-cols-2, .cms-cols-3, .cms-cols-4 { grid-template-columns: 1fr; }
  .cms-box { padding: 26px 22px; }
  .cms-bar { padding: 10px 14px; font-size: 14.5px; justify-content: flex-start; }
  .cms-nl li { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { .cms-ncard { transition: none; } .cms-focus { animation: none; } }
@media print { .cms-share, .cms-bar .cms-x, .cms-pvbar { display: none; } }
