/* ==========================================================================
   PORTADA (index.html)
   Requiere base.css cargado antes.
   ========================================================================== */

.home-main {
    padding-top: 20px;
    padding-bottom: 24px;
}

/* ---- Banner de saludo, hora y titulares (dentro del ancho del contenido) ---- */
.home-led {
    position: relative;
    width: 100%;
    max-width: 1050px;
    height: 36px;
    margin: 0 auto 1.75rem auto;
    background-color: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.home-led-viewport {
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.home-led-track {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    width: max-content;
    height: 100%;
    will-change: transform;
    animation: home-led-scroll var(--dur, 30s) linear infinite;
}

.home-led:hover .home-led-track,
.home-led:focus-within .home-led-track {
    animation-play-state: paused;
}

@keyframes home-led-scroll {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-50%, 0, 0); }
}

.home-led-group {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    height: 100%;
    padding-left: 16px;
    padding-right: 48px;
    white-space: nowrap;
}

.home-led-item {
    font-family: 'Doto', monospace;
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1;
    color: #ffcc00;
    text-shadow: 0 0 4px rgba(255, 204, 0, 0.6);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


.home-led-link {
    text-decoration: none;
    text-transform: none;
}

.home-led-link:hover {
    text-decoration: underline;
}

.home-led-link:focus-visible {
    outline: 2px solid #ffcc00;
    outline-offset: 2px;
    border-radius: 2px;
}

.home-led-medio {
    font-weight: 700;
    margin-right: 4px;
    opacity: 0.9;
}

.home-led-sep {
    font-family: 'Doto', monospace;
    font-size: 1rem;
    line-height: 1;
    color: #ffcc00;
    opacity: 0.6;
    margin: 0 12px;
}

@media (prefers-reduced-motion: reduce) {
    .home-led-track {
        animation: none;
    }

    .home-led-viewport {
        overflow-x: auto;
    }
}

/* ---- Encabezado ---- */
.home-hero {
    text-align: center;
    width: 100%;
    padding: 0 1rem;
    margin-bottom: 1.25rem;
}

.home-hero .page-title {
    margin-bottom: 0.5rem;
}

.home-hero .landing-subtitle {
    margin: 1rem auto 1.5rem auto;
}

/* ---- Sitios de interés (franja superior) ---- */
.home-sitios {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 10px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 2.25rem auto;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.home-sitios-titulo {
    font-weight: 700;
    color: var(--text-main);
    margin-right: 4px;
}

.home-sitios a {
    color: var(--accent-color);
    text-decoration: none;
}

.home-sitios a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.home-sitios-sep {
    color: var(--text-muted);
    opacity: 0.6;
}

/* ---- Cuerpo: grupos de categorías y barra lateral ---- */
.home-cuerpo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    align-items: start;
    width: 100%;
    max-width: 1050px;
}

.home-grupos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    align-items: start;
}

.home-grupo {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.home-grupo-titulo {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin: 0;
}

.home-grupo-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.home-grupo-lista .tooltip-container {
    display: inline-flex;
    width: fit-content;
}

/* Enlace de categoría: icono + texto, sin recuadro */
.home-enlace {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 2px 0;
    color: var(--text-main);
    font-size: 0.95rem;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.home-enlace-icono {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--accent-color);
}

.home-enlace:hover {
    text-decoration: underline;
}

.home-enlace:focus-visible {
    outline: 2px solid var(--accent-hover);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ---- Barra lateral: enlaces de interés diario ---- */
.home-aside {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.home-aside .home-grupo-titulo {
    margin-bottom: 8px;
}

.home-aside .dynamic-links-container {
    min-height: 0;
    display: block;
}

.sitios-lista {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.home-aside .interest-link-row {
    display: flex;
    padding: 8px 4px;
    font-size: 0.9rem;
}

/* ---- Footer: centrado dentro del ancho general de la página ---- */
.home-footer {
    width: 100%;
    max-width: 1050px;
    margin: 3rem auto 0 auto;
    padding: 24px 24px 32px 24px;
    box-sizing: border-box;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.85rem;
    color: var(--footer-text);
}

.home-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 10px;
}

.home-footer a,
.home-footer .footer-theme-btn {
    color: var(--footer-text);
    text-decoration: none;
    font: inherit;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.home-footer a:hover,
.home-footer .footer-theme-btn:hover {
    color: var(--text-main);
    text-decoration: underline;
    background: none;
}

.home-footer-sep {
    color: var(--footer-text);
    opacity: 0.6;
}

.home-footer-legal {
    margin-top: 12px;
}

.home-footer .footer-author-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ---- Responsivo ---- */
@media (max-width: 900px) {
    .home-cuerpo {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* El banner ya no es fijo: no hace falta el espacio superior de base.css */
    body {
        padding-top: 0;
    }
}

@media (max-width: 560px) {
    .home-main {
        padding-top: 16px;
    }

    .home-led {
        height: 32px;
    }

    .home-led-item {
        font-size: 0.95rem;
    }

    .home-grupos {
        grid-template-columns: 1fr;
    }

    .home-enlace {
        min-height: 40px;
    }

    .home-footer {
        padding: 20px 16px 28px 16px;
    }
}

/* ---- Footer: sitios de interés (bloque superior) ---- */
.home-footer-sitios {
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.home-footer-titulo {
    font-weight: 700;
    color: var(--text-main);
    margin-right: 4px;
}

/* ---- Columna lateral: enlaces de interés y clima ---- */
.home-lateral {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* ---- Clima ---- */
.home-clima {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.home-clima .home-grupo-titulo {
    margin-bottom: 8px;
}

.home-clima p {
    margin: 0;
}

.home-clima-actual {
    display: block;
    width: 100%;
    padding: 6px 0;
    background: none;
    border: none;
    font: inherit;
    font-size: 1rem;
    text-align: left;
    color: var(--text-main);
    cursor: pointer;
}

.home-clima-actual:hover {
    text-decoration: underline;
}

.home-clima-actual:focus-visible {
    outline: 2px solid var(--accent-hover);
    outline-offset: 2px;
    border-radius: 2px;
}

.home-clima-buscar {
    display: none;            /* el JS lo muestra con style.display = 'block' */
    position: relative;
    margin: 8px 0 12px 0;
}

#headerWeatherInput {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-main);
    color: var(--text-main);
    font: inherit;
    font-size: 0.9rem;
}

.home-clima-resultados {
    display: none;            /* el JS lo muestra con style.display = 'block' */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    list-style: none;
    margin: 4px 0 0 0;
    padding: 4px 0;
    max-height: 220px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.home-clima-resultados li {
    padding: 8px 10px;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
}

.home-clima-resultados li:hover {
    background: var(--bg-hover);
}

.home-clima-ciudad {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 4px !important;
}

.home-clima-temp {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 2px 0 !important;
}

.home-clima-condicion {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px !important;
}

.home-clima-pronostico {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.weather-popup-forecast-item {
    display: grid;
    grid-template-columns: 48px 28px 1fr;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-main);
}

.weather-popup-forecast-item .forecast-temps {
    text-align: right;
    color: var(--text-muted);
}

[data-theme="light"] .home-led {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .home-led-item,
[data-theme="light"] .home-led-sep {
    color: #000000;
    text-shadow: none;
}

[data-theme="light"] .home-led-link:focus-visible {
    outline-color: #000000;
}