/* ==========================================================================
   Tema "novo" — Concello do Grove
   Mobile-first. Mantén a identidade (azul #174c97, tarxetas brancas,
   separador con punto, botoneira azul) cun acabado máis actual.
   ========================================================================== */

:root {
    --cdg-azul: #174c97;
    --cdg-azul-escuro: #143874;
    --cdg-azul-fondo: #0f2f5e;
    --cdg-azul-claro: #4a73b1;
    --cdg-azul-suave: #e8eef8;
    --cdg-acento: #ffcc00;
    --cdg-texto: #24292f;
    --cdg-texto-suave: #5b6472;
    --cdg-fondo: #f6f8fb;
    --cdg-branco: #fff;
    --cdg-borde: #e3e8ef;
    --cdg-radio: 14px;
    --cdg-radio-sm: 10px;
    --cdg-sombra: 0 1px 2px rgba(16, 38, 76, .06), 0 2px 8px rgba(16, 38, 76, .06);
    --cdg-sombra-hover: 0 10px 28px rgba(16, 38, 76, .14);
    --cdg-espazo: clamp(1rem, 3vw, 2rem);
    --cdg-cabeceira-alto: 64px;

    --bs-primary: #174c97;
    --bs-primary-rgb: 23, 76, 151;
    --bs-link-color: #174c97;
    --bs-link-color-rgb: 23, 76, 151;
    --bs-link-hover-color: #143874;
    --bs-link-hover-color-rgb: 20, 56, 116;
    --bs-body-font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
}

html { scroll-padding-top: calc(var(--cdg-cabeceira-alto) + 12px); }

body {
    font-family: var(--bs-body-font-family);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--cdg-texto);
    background: var(--cdg-fondo);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5 { font-weight: 700; color: var(--cdg-azul); line-height: 1.25; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + .9vw, 1.65rem); }
h3 { font-size: clamp(1.1rem, 1rem + .4vw, 1.25rem); }

a { color: var(--cdg-azul); text-underline-offset: .18em; }
a:hover { color: var(--cdg-azul-escuro); }

:focus-visible { outline: 3px solid var(--cdg-acento); outline-offset: 2px; border-radius: 4px; }

.btn { border-radius: 999px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding-inline: 1.1rem; }
.btn-sm { min-height: 36px; padding-inline: .85rem; }
.btn-primary { --bs-btn-bg: var(--cdg-azul); --bs-btn-border-color: var(--cdg-azul); --bs-btn-hover-bg: var(--cdg-azul-escuro); --bs-btn-hover-border-color: var(--cdg-azul-escuro); --bs-btn-active-bg: var(--cdg-azul-escuro); }
.btn-outline-primary { --bs-btn-color: var(--cdg-azul); --bs-btn-border-color: var(--cdg-azul); --bs-btn-hover-bg: var(--cdg-azul); --bs-btn-hover-border-color: var(--cdg-azul); }
.form-control { border-radius: 999px; min-height: 44px; padding-inline: 1.1rem; border-color: var(--cdg-borde); }
.form-control:focus { border-color: var(--cdg-azul-claro); box-shadow: 0 0 0 .25rem rgba(23, 76, 151, .15); }

.saltar {
    position: absolute; left: 1rem; top: -100px; z-index: 2000;
    background: var(--cdg-acento); color: #000; padding: .6rem 1rem; border-radius: 8px; font-weight: 700;
}
.saltar:focus { top: .75rem; }

/* --------------------------------------------------------------------------
   Separador co punto (sinal da casa)
   -------------------------------------------------------------------------- */
.separator {
    position: relative; height: 2px; margin: clamp(1.75rem, 4vw, 2.75rem) auto; max-width: 960px;
    background: linear-gradient(to right, transparent, var(--cdg-azul), transparent);
}
.separator::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px;
    border-radius: 50%; background: var(--cdg-azul); transform: translate(-50%, -50%);
    box-shadow: 0 0 0 4px var(--cdg-fondo);
}

/* --------------------------------------------------------------------------
   Cabeceira
   -------------------------------------------------------------------------- */
.cab {
    /* z-index por riba do backdrop do offcanvas (1040), que vive dentro da cabeceira.
       Sen backdrop-filter: crearía un bloque contedor e recortaría o offcanvas. */
    position: sticky; top: 0; z-index: 1050;
    background: #fff;
    border-bottom: 1px solid var(--cdg-borde);
    box-shadow: 0 1px 6px rgba(16, 38, 76, .06);
}
.cab-fila { display: flex; align-items: center; gap: .75rem; min-height: var(--cdg-cabeceira-alto); }
/* O logo pode encoller (min-width: 0) para que a fila non desborde en móbiles estreitos */
.cab-logo { display: inline-flex; align-items: center; margin-right: auto; min-width: 0; flex: 0 1 auto; }
.cab-logo img { display: block; width: auto; height: auto; max-width: 100%; max-height: 44px; }
.cab-accions { display: flex; align-items: center; gap: .5rem; }

.idioma {
    display: inline-flex; padding: 3px; border-radius: 999px; background: var(--cdg-azul-suave);
}
.idioma a {
    display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 32px;
    padding: 0 .6rem; border-radius: 999px; font-size: .85rem; font-weight: 700; letter-spacing: .04em;
    color: var(--cdg-azul); text-decoration: none;
}
.idioma a.activo { background: var(--cdg-azul); color: #fff; }

.cab-menu-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    height: 44px; padding: 0 .9rem; border: 0; border-radius: 999px;
    background: var(--cdg-azul); color: #fff; font-weight: 600;
}
.cab-menu-btn i { font-size: 1.35rem; line-height: 1; }

/* Menú principal: offcanvas en móbil, barra horizontal en escritorio */
.menu-principal .offcanvas-header { background: var(--cdg-azul); color: #fff; }
.menu-principal .offcanvas-title { color: #fff; font-size: 1.15rem; }
.menu-principal .btn-close { filter: invert(1) grayscale(1) brightness(2); }

.menu-lista { list-style: none; margin: 0; padding: 0; }
.menu-item { border-bottom: 1px solid var(--cdg-borde); }
.menu-btn {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    min-height: 52px; padding: .75rem 1.25rem; border: 0; background: none; text-align: left;
    font-weight: 600; font-size: 1.05rem; color: var(--cdg-texto); text-decoration: none;
}
.menu-btn .bi-chevron-down { transition: transform .2s; font-size: .9rem; color: var(--cdg-azul); }
.menu-item.aberto > .menu-btn { color: var(--cdg-azul); }
.menu-item.aberto > .menu-btn .bi-chevron-down { transform: rotate(180deg); }
.menu-panel { display: none; background: var(--cdg-fondo); padding: .25rem 0 .75rem; }
.menu-item.aberto > .menu-panel { display: block; }
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
.menu-panel a {
    display: block; padding: .6rem 1.25rem .6rem 1.75rem; color: var(--cdg-texto); text-decoration: none;
}
.menu-panel a:hover, .menu-panel a.activo { color: var(--cdg-azul); background: var(--cdg-azul-suave); }
.menu-panel a.activo { font-weight: 700; box-shadow: inset 3px 0 0 var(--cdg-azul); }
.menu-grupo-btn {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: .7rem 1.25rem .4rem 1.75rem; border: 0; background: none; text-align: left;
    font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--cdg-texto-suave);
}
.menu-grupo-btn .bi { transition: transform .2s; }
.menu-grupo.aberto > .menu-grupo-btn { color: var(--cdg-azul); }
.menu-grupo.aberto > .menu-grupo-btn .bi { transform: rotate(90deg); }
.menu-grupo > ul { display: none; }
.menu-grupo.aberto > ul { display: block; }
.menu-grupo > ul a { padding-left: 2.25rem; }

/* --------------------------------------------------------------------------
   Botoneira de accesos rápidos
   -------------------------------------------------------------------------- */
.botonera { background: var(--cdg-azul); background-image: linear-gradient(135deg, var(--cdg-azul) 0%, var(--cdg-azul-escuro) 100%); }
.botonera-pista {
    display: flex; gap: .6rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px;
    padding: .9rem 16px; margin: 0 -12px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, #000 88%, transparent);
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
}
.botonera-pista::-webkit-scrollbar { display: none; }
.botonera-item {
    flex: 0 0 auto; scroll-snap-align: start;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
    width: 108px; min-height: 92px; padding: .7rem .5rem;
    border-radius: var(--cdg-radio); background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
    color: #fff; text-decoration: none; text-align: center; font-size: .85rem; font-weight: 600; line-height: 1.2;
    transition: background-color .2s, transform .2s;
}
.botonera-item i { font-size: 1.6rem; line-height: 1; }
.botonera-item:hover, .botonera-item:focus-visible { background: rgba(255, 255, 255, .2); color: #fff; transform: translateY(-2px); }

/* --------------------------------------------------------------------------
   Migas
   -------------------------------------------------------------------------- */
.migas { padding: .75rem 0 0; }
.migas .breadcrumb {
    margin: 0; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none;
    font-size: .9rem;
}
.migas .breadcrumb::-webkit-scrollbar { display: none; }
.migas .breadcrumb-item, .migas .breadcrumb-item a { color: var(--cdg-texto-suave); text-decoration: none; }
.migas .breadcrumb-item a:hover { color: var(--cdg-azul); text-decoration: underline; }
.migas .breadcrumb-item:last-child { color: var(--cdg-azul); font-weight: 600; }

/* --------------------------------------------------------------------------
   Contido xeral
   -------------------------------------------------------------------------- */
#content { padding-top: 1.25rem; padding-bottom: 1rem; }

.tarxeta {
    background: var(--cdg-branco); border: 1px solid var(--cdg-borde); border-radius: var(--cdg-radio);
    box-shadow: var(--cdg-sombra); padding: clamp(1.1rem, 3vw, 1.75rem);
}
.seccion-tit {
    display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; font-size: clamp(1.25rem, 1.1rem + .7vw, 1.5rem);
}
.seccion-tit i {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 40px;
    border-radius: 12px; background: var(--cdg-azul-suave); color: var(--cdg-azul); font-size: 1.15rem;
}
.seccion-cab { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.seccion-cab .seccion-tit { margin-bottom: 0; }

.pax-cab { margin-bottom: 1.25rem; }
.pax-cab h1 { margin-bottom: .35rem; }
.pax-cab .meta { color: var(--cdg-texto-suave); display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .95rem; }

/* O texto usa o ancho da súa tarxeta ou columna (antes 78ch pegado á esquerda deixaba un oco á dereita) */
.texto-longo { max-width: none; }
/* Páxinas de lectura (nova, aviso legal): tarxeta centrada e máis estreita para liñas cómodas */
.tarxeta.novas, .tarxeta.lectura { max-width: 900px; margin-inline: auto; }
.texto-longo img, .contenido img, .novas img, .agenda img { max-width: 100% !important; height: auto !important; border-radius: var(--cdg-radio-sm); }
/* SunEditor envolve as imaxes nun <figure style="width: 400px">: tampouco debe pasar do ancho dispoñible */
.texto-longo figure, .contenido figure, .novas figure, .agenda figure { max-width: 100% !important; }
.texto-longo iframe, .contenido iframe { max-width: 100%; }
.contenido table, .texto-longo table { max-width: 100%; }

/* Imaxe principal da nova: miniatura á esquerda do título, ampliable nun modal */
.pax-cab.con-miniatura { display: flex; align-items: flex-start; gap: 1.25rem; }
.pax-cab-texto { flex: 1; min-width: 0; }
.nova-miniatura {
    position: relative; flex: 0 0 auto; width: 200px; aspect-ratio: 4 / 3; padding: 0; border: 0;
    border-radius: var(--cdg-radio-sm); overflow: hidden; background: var(--cdg-azul-suave);
    box-shadow: var(--cdg-sombra); cursor: zoom-in;
}
.novas .nova-miniatura img {
    position: absolute; inset: 0; width: 100%; height: 100% !important; object-fit: cover;
    border-radius: 0; transition: transform .25s;
}
.nova-miniatura:hover img { transform: scale(1.05); }
.nova-miniatura-lupa {
    position: absolute; right: .4rem; bottom: .4rem; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(15, 47, 94, .8); color: #fff; font-size: 1rem;
}
@media (max-width: 575.98px) {
    .pax-cab.con-miniatura { gap: .85rem; }
    .nova-miniatura { width: 104px; }
    .pax-cab.con-miniatura h1 { font-size: 1.3rem; }
    .nova-miniatura-lupa { right: .25rem; bottom: .25rem; width: 26px; height: 26px; font-size: .8rem; }
}
.imaxe-modal .modal-content { position: relative; background: transparent; border: 0; box-shadow: none; }
.imaxe-modal img {
    display: block; max-width: 100%; max-height: calc(100vh - 3.5rem); margin: 0 auto;
    object-fit: contain; border-radius: var(--cdg-radio-sm);
}
.imaxe-pechar {
    position: absolute; top: .6rem; right: .6rem; z-index: 1; width: 42px; height: 42px; border: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .6); color: #fff; font-size: 1.15rem;
}
.imaxe-pechar:hover { background: rgba(0, 0, 0, .8); }
/* O aviso de cookies (z-index 2000) non debe tapar a imaxe ampliada */
body.modal-open #avisoCookies { display: none; }

.editar-link {
    display: inline-flex; align-items: center; gap: .35rem; margin-bottom: 1rem; padding: .3rem .8rem;
    border-radius: 999px; background: #fff7d6; color: #6b5200; font-size: .9rem; text-decoration: none;
}

/* Contido editorial vindo do CMS (páxinas non tematizadas incluídas) */
.contenido h1, .contenido h2, .contenido h3 { color: var(--cdg-azul); }

/* Banners */
.banners-grella { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.banners-grella a { display: block; border-radius: var(--cdg-radio-sm); overflow: hidden; box-shadow: var(--cdg-sombra); transition: transform .2s, box-shadow .2s; background: #fff; }
.banners-grella a:hover { transform: translateY(-2px); box-shadow: var(--cdg-sombra-hover); }
.banners-grella img { display: block; width: 100%; height: auto; }

/* Páxinas antigas sen versión no tema (espazos, aviso legal...) */
.banners .row > [class*="col-"] img, .banner-img { border-radius: var(--cdg-radio-sm); box-shadow: var(--cdg-sombra); }

/* --------------------------------------------------------------------------
   Portada
   -------------------------------------------------------------------------- */
.hero { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.hero .carousel { border-radius: var(--cdg-radio); overflow: hidden; box-shadow: var(--cdg-sombra); background: var(--cdg-azul-fondo); }
.hero .carousel-item { aspect-ratio: 4 / 3; }
.hero .carousel-item img { width: 100%; height: 100%; object-fit: cover; }
.hero .carousel-item::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(10, 28, 58, .92) 0%, rgba(10, 28, 58, .55) 38%, transparent 70%);
}
.hero-texto {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    padding: 1.1rem 1.1rem 2.4rem; color: #fff;
}
.hero-etiqueta {
    display: inline-block; margin-bottom: .5rem; padding: .15rem .6rem; border-radius: 999px;
    background: var(--cdg-acento); color: #1c1c1c; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.hero-texto h2 { color: #fff; font-size: clamp(1.2rem, 1rem + 1.6vw, 2.1rem); margin: 0 0 .35rem; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.hero-texto p {
    margin: 0; color: rgba(255, 255, 255, .9); font-size: .95rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero .carousel-indicators { margin-bottom: .75rem; z-index: 3; }
.hero .carousel-indicators [data-bs-target] { width: 8px; height: 8px; border-radius: 50%; border: 0; margin: 0 4px; opacity: .55; }
.hero .carousel-indicators .active { width: 22px; border-radius: 4px; opacity: 1; background: var(--cdg-acento); }
.hero .carousel-control-prev, .hero .carousel-control-next { display: none; z-index: 3; }

/* Novas */
.novas-lista { display: grid; gap: .9rem; }
.nova {
    display: flex; gap: .85rem; align-items: center; position: relative; padding: .6rem;
    background: #fff; border: 1px solid var(--cdg-borde); border-radius: var(--cdg-radio);
    box-shadow: var(--cdg-sombra); overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.nova:hover { transform: translateY(-2px); box-shadow: var(--cdg-sombra-hover); }
.nova-imx {
    position: relative; flex: 0 0 88px; width: 88px; height: 88px; border-radius: var(--cdg-radio-sm);
    background: var(--cdg-azul-suave); display: flex; align-items: center; justify-content: center;
    color: var(--cdg-azul-claro); font-size: 1.6rem; overflow: hidden;
}
.nova-imx img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; background: #fff; }
.nova-corpo { padding: 0 .4rem 0 0; display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.nova-data { font-size: .8rem; font-weight: 700; color: var(--cdg-azul-claro); text-transform: uppercase; letter-spacing: .04em; }
.nova h3 { font-size: 1.02rem; margin: 0; color: var(--cdg-texto); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nova a { color: inherit; text-decoration: none; }
.nova a::after { content: ""; position: absolute; inset: 0; }
.nova:hover h3 { color: var(--cdg-azul); }

/* Lateral portada: webcam */
.webcam-tarxeta { padding: 0; overflow: hidden; }
.webcam-tarxeta .webcam-cab { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; }
.webcam-tarxeta h2 { margin: 0; font-size: 1.1rem; }
.en-directo { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; color: #c62828; }
.en-directo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #e53935; animation: latexo 1.6s infinite; }
@keyframes latexo { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.videoContainer { position: relative; aspect-ratio: 16 / 9; background: #0b1b33; }
.videoContainer video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.webcam-tarxeta .webcam-pe { padding: .6rem 1rem; font-size: .9rem; }

/* --------------------------------------------------------------------------
   Axenda (calendario)
   -------------------------------------------------------------------------- */
.calendar-container { background: #fff; border-radius: var(--cdg-radio); }
.calendar-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.calendar-title { font-weight: 700; font-size: 1.15rem; color: var(--cdg-azul); text-transform: capitalize; }
.calendar-nav-left, .calendar-nav-right {
    width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 1.2rem;
}
.calendar-container table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; margin: 0; }
.calendar-container .table > :not(caption) > * > * { padding: 0; border: 0; background: none; box-shadow: none; }
.calendar-container th.header { text-align: center; font-size: .75rem; font-weight: 700; color: var(--cdg-texto-suave); padding: .25rem 0; }
.calendar-container td { vertical-align: top; }
.calendar-day {
    position: relative; min-height: 44px; border-radius: 8px; background: var(--cdg-fondo);
    display: flex; flex-direction: column; align-items: center; padding: .3rem .15rem;
}
.calendar-day-num { font-size: .9rem; font-weight: 600; color: var(--cdg-texto); }
.calendar-day.hoxe { background: var(--cdg-azul); }
.calendar-day.hoxe .calendar-day-num { color: #fff; }
.calendar-day.con-eventos { background: var(--cdg-azul-suave); }
.calendar-day.con-eventos.hoxe { background: var(--cdg-azul); }
.calendar-day .evento {
    display: block; width: 100%; margin-top: .2rem; padding: .1rem .3rem; border-radius: 4px;
    background: var(--cdg-azul); color: #fff; font-size: .72rem; line-height: 1.25; text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.calendar-day.hoxe .evento { background: #fff; color: var(--cdg-azul); }
.calendar-day .evento:hover { background: var(--cdg-azul-escuro); color: #fff; }
.calendar-day .puntos { display: none; gap: 3px; margin-top: 4px; }
.calendar-day .puntos span { width: 6px; height: 6px; border-radius: 50%; background: var(--cdg-azul); }
.calendar-day.hoxe .puntos span { background: var(--cdg-acento); }
td.empty { background: none; }

.eventos-mes { margin-top: 1.25rem; }
.eventos-mes h3 { font-size: 1.05rem; color: var(--cdg-texto); margin-bottom: .75rem; }
.evento-fila {
    display: flex; gap: .85rem; align-items: center; padding: .6rem; margin: 0 -.6rem;
    border-radius: var(--cdg-radio-sm); color: var(--cdg-texto); text-decoration: none;
}
.evento-fila:hover { background: var(--cdg-fondo); color: var(--cdg-azul); }
.evento-data {
    flex: 0 0 56px; height: 60px; border-radius: 12px; background: var(--cdg-azul); color: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.evento-data .dia { font-size: 1.35rem; font-weight: 700; }
.evento-data .mes { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-top: .2rem; opacity: .85; }
.evento-info { min-width: 0; }
.evento-info strong { display: block; font-weight: 600; line-height: 1.3; }
.evento-info small { color: var(--cdg-texto-suave); }
.sen-eventos { color: var(--cdg-texto-suave); padding: .5rem 0; }

@media (max-width: 399.98px) {
    /* Móbiles estreitos: botóns da cabeceira máis compactos para deixarlle sitio ao logo */
    .cab-fila { gap: .5rem; }
    .cab-accions { gap: .35rem; }
    .idioma a { min-width: 34px; padding: 0 .45rem; }
    .cab-menu-btn { padding: 0 .7rem; }
}

@media (max-width: 575.98px) {
    /* No móbil o calendario amosa puntos; os títulos van na lista inferior */
    .calendar-day .evento { display: none; }
    .calendar-day .puntos { display: flex; }
    .calendar-day { min-height: 42px; }
}

/* --------------------------------------------------------------------------
   Listados (novas, buscador, paxinación)
   -------------------------------------------------------------------------- */
.buscador { display: flex; gap: .5rem; width: 100%; max-width: 420px; }
.buscador .form-control { flex: 1; }
.buscador .btn { width: 44px; padding: 0; }

.listado { display: grid; gap: .75rem; }
.listado-item {
    position: relative; display: flex; flex-direction: column; gap: .2rem;
    padding: .9rem 1.1rem; background: #fff; border: 1px solid var(--cdg-borde); border-radius: var(--cdg-radio);
    box-shadow: var(--cdg-sombra); transition: transform .2s, box-shadow .2s;
}
.listado-item:hover { transform: translateY(-2px); box-shadow: var(--cdg-sombra-hover); }
.listado-item a { color: var(--cdg-texto); font-weight: 600; text-decoration: none; }
.listado-item a::after { content: ""; position: absolute; inset: 0; }
.listado-item:hover a { color: var(--cdg-azul); }
.listado-item .nova-data { order: -1; }
/* Listado de novas con imaxe á esquerda (mesma miniatura ca na portada) */
.listado-item.con-imx { flex-direction: row; align-items: center; gap: 1rem; padding: .6rem 1.1rem .6rem .6rem; }
.listado-corpo { display: flex; flex-direction: column; gap: .2rem; flex: 1; min-width: 0; }
@media (min-width: 576px) {
    .listado-item .nova-imx { flex-basis: 120px; width: 120px; height: 90px; }
}

.paxinacion { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin: 1.75rem 0 .5rem; }
.paxinacion-botons { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.paxinacion-botons a, .paxinacion-botons span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 .6rem;
    border-radius: 12px; border: 1px solid var(--cdg-borde); background: #fff; color: var(--cdg-texto); text-decoration: none; font-weight: 600;
}
.paxinacion-botons a:hover { border-color: var(--cdg-azul); color: var(--cdg-azul); }
.paxinacion-botons .actual { background: var(--cdg-azul); border-color: var(--cdg-azul); color: #fff; }
.paxinacion-botons .puntos { border: 0; background: none; min-width: 20px; }
.paxinacion-info { font-size: .9rem; color: var(--cdg-texto-suave); }

/* Erro */
.erro { text-align: center; padding: clamp(2rem, 8vw, 4rem) 1rem; }
.erro-num { font-size: clamp(4rem, 3rem + 6vw, 7rem); font-weight: 800; color: var(--cdg-azul-suave); line-height: 1; -webkit-text-stroke: 2px var(--cdg-azul); }
.erro .botons { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1.5rem; }

/* --------------------------------------------------------------------------
   Pé
   -------------------------------------------------------------------------- */
.pe { margin-top: clamp(2rem, 5vw, 3.5rem); background: var(--cdg-azul-fondo); color: rgba(255, 255, 255, .82); font-size: .95rem; }
.pe a { color: #fff; text-decoration: none; }
.pe a:hover { text-decoration: underline; }
.pe-principal { padding: 2.25rem 0 1.5rem; }
.pe h2 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .85rem; opacity: .75; }
.pe-marca { font-size: 1.2rem; font-weight: 700; color: #fff; margin-bottom: .5rem; }
.pe ul { list-style: none; margin: 0; padding: 0; }
.pe li { margin-bottom: .45rem; }
.pe-contacto li { display: flex; gap: .55rem; align-items: flex-start; }
.pe-contacto i { color: var(--cdg-acento); margin-top: .15rem; }
.pe-redes { display: flex; gap: .5rem; }
.pe-redes a {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    border-radius: 50%; background: rgba(255, 255, 255, .1); font-size: 1.2rem;
}
.pe-redes a:hover { background: var(--cdg-acento); color: #1c1c1c; text-decoration: none; }
.pe-financiacion { background: #fff; padding: 1rem 0; }
.pe-financiacion .logos { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem 2rem; }
.pe-financiacion img { max-height: 54px; width: auto; max-width: 100%; }
.pe-legal { padding: .9rem 0; font-size: .85rem; border-top: 1px solid rgba(255, 255, 255, .12); text-align: center; }

/* Aviso de cookies */
#avisoCookies {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 2000;
    max-width: 560px; margin: 0 auto; padding: 1rem 1.1rem;
    background: #fff; color: var(--cdg-texto); border-radius: var(--cdg-radio);
    box-shadow: 0 12px 40px rgba(16, 38, 76, .25); font-size: .9rem;
}
#avisoCookies p { margin: 0; }
#avisoCookies .accions { display: flex; justify-content: flex-end; margin-top: .75rem; }

/* Volver arriba */
.arriba {
    position: fixed; right: 16px; bottom: 16px; z-index: 1020; width: 48px; height: 48px; border-radius: 50%;
    border: 0; background: var(--cdg-azul); color: #fff; box-shadow: var(--cdg-sombra-hover); font-size: 1.25rem;
    opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s, transform .2s;
}
.arriba.visible { opacity: 1; pointer-events: auto; transform: none; }

/* --------------------------------------------------------------------------
   Tablet
   -------------------------------------------------------------------------- */
@media (min-width: 576px) {
    .hero .carousel-item { aspect-ratio: 16 / 9; }
    .hero-texto { padding: 1.5rem 1.75rem 2.75rem; }
    .banners-grella { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
    .hero-texto { max-width: 75%; }
    .hero-texto p { -webkit-line-clamp: 3; font-size: 1.02rem; }
    .hero .carousel-control-prev, .hero .carousel-control-next { display: flex; width: 56px; }
    .novas-lista { grid-template-columns: repeat(2, 1fr); }
}

/* --------------------------------------------------------------------------
   Escritorio
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
    :root { --cdg-cabeceira-alto: 76px; }
    .cab { position: relative; }
    .cab-logo img { max-height: 54px; }

    .cab-nav { border-top: 1px solid var(--cdg-borde); }
    .menu-principal.offcanvas-lg { background: none; }
    .menu-lista { display: flex; flex-wrap: wrap; justify-content: center; gap: .15rem; }
    .menu-item { position: relative; border: 0; }
    .menu-btn {
        min-height: 50px; padding: .5rem .85rem; font-size: .98rem; border-radius: 0; position: relative;
    }
    .menu-btn::after {
        content: ""; position: absolute; left: .85rem; right: .85rem; bottom: 0; height: 3px; border-radius: 3px 3px 0 0;
        background: var(--cdg-azul); transform: scaleX(0); transition: transform .2s;
    }
    .menu-btn:hover::after, .menu-item.aberto > .menu-btn::after, .menu-item.actual > .menu-btn::after { transform: scaleX(1); }
    .menu-btn .bi-chevron-down { margin-left: .35rem; font-size: .75rem; }
    .menu-panel {
        position: absolute; top: 100%; left: 50%; transform: translateX(-50%); z-index: 1040;
        min-width: 280px; max-width: 360px; max-height: 70vh; overflow-y: auto;
        background: #fff; border: 1px solid var(--cdg-borde); border-radius: 0 0 var(--cdg-radio) var(--cdg-radio);
        box-shadow: var(--cdg-sombra-hover); padding: .5rem 0;
    }
    .menu-item:first-child .menu-panel { left: 0; transform: none; }
    .menu-item:last-child .menu-panel { left: auto; right: 0; transform: none; }
    .menu-panel a { padding: .5rem 1.25rem; font-size: .95rem; }
    .menu-grupo-btn { padding-left: 1.25rem; }
    .menu-grupo > ul a { padding-left: 1.75rem; }

    .botonera-pista {
        display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem;
        overflow: visible; padding: 1.1rem 0; margin: 0; mask-image: none; -webkit-mask-image: none;
    }
    .botonera-item { width: auto; min-height: 96px; font-size: .92rem; }

    .hero .carousel-item { aspect-ratio: 16 / 9; }
    .hero-texto { padding: 1.75rem 2rem 2.75rem; max-width: 90%; }
    .banners-grella { grid-template-columns: repeat(2, 1fr); }
    .lateral { position: sticky; top: 1rem; }
    .novas-lista { grid-template-columns: repeat(2, 1fr); }
    .calendar-day { min-height: 76px; align-items: stretch; }
    .calendar-day-num { text-align: right; padding-right: .2rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
    .cab, .botonera, .pe, .arriba, #avisoCookies, .lateral { display: none !important; }
    body { background: #fff; }
}
