/* ============================================================
   AMPA Las Castañeras — Capa mobile-first (spec UX/UI v1.0)
   Navegación inferior + bloques de utilidad diaria de la Home.
   Se carga después de style.css y respeta su design system.
   ============================================================ */

/* ---------- Navegación inferior móvil (§7) ---------- */
.bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    display: none;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.bottomnav__item {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 7px 2px 6px; min-height: 52px;
    text-decoration: none; color: var(--color-text-tertiary);
    -webkit-tap-highlight-color: transparent;
}
.bottomnav__icon { display: flex; line-height: 0; }
.bottomnav__label {
    font-size: 0.66rem; font-weight: 600; letter-spacing: -0.01em;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bottomnav__item.is-active { color: var(--color-amber-dark); }
.bottomnav__item:focus-visible { outline: 2px solid var(--color-amber); outline-offset: -3px; }

@media (max-width: 900px) {
    .bottomnav { display: flex; }
    body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
}
[data-theme="dark"] .bottomnav { background: #1C1C1E; border-top-color: #2C2C2E; }

/* ---------- Home: utilidad diaria (§10–§27) ---------- */
.home { padding-top: calc(var(--header-height) + 0.9rem); }
.home__wrap { max-width: 720px; margin: 0 auto; padding: 0 1rem; }
.home__section { margin-bottom: 1.1rem; }
.home__h {
    display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem;
    margin: 0 0 0.55rem;
}
.home__h h2 {
    font-size: 1.02rem; font-weight: 700; margin: 0; color: var(--color-text);
    letter-spacing: -0.01em;
}
.home__h a {
    font-size: 0.82rem; font-weight: 600; color: var(--color-amber-dark);
    text-decoration: none; white-space: nowrap;
}
.home-card {
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 16px; padding: 1rem;
}

/* Hoy en Castañeras (§12) */
.today {
    border-radius: 18px; padding: 1.1rem 1.15rem;
    border: 1px solid var(--color-border); background: var(--color-surface);
    border-left: 5px solid var(--tone, var(--color-amber));
}
.today--ok   { --tone: #34a853; background: linear-gradient(180deg, #f3fbf5, var(--color-surface) 60%); }
.today--warn { --tone: #f59e0b; background: linear-gradient(180deg, #fff9ec, var(--color-surface) 60%); }
.today--off  { --tone: #0ea5e9; background: linear-gradient(180deg, #eff9ff, var(--color-surface) 60%); }
.today--info { --tone: #6366f1; background: linear-gradient(180deg, #f2f3ff, var(--color-surface) 60%); }
.today--unknown { --tone: #86868B; }
.today__kicker {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--color-text-tertiary); margin: 0 0 0.15rem;
}
.today__date {
    font-size: 1.28rem; font-weight: 800; color: var(--color-text);
    margin: 0 0 0.5rem; letter-spacing: -0.02em; line-height: 1.2;
}
.today__state {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.95rem; font-weight: 700; color: var(--color-text);
    background: rgba(0,0,0,0.04); border-radius: 999px; padding: 0.3rem 0.75rem;
}
.today__detail { margin: 0.6rem 0 0; font-size: 0.9rem; color: var(--color-text-secondary); line-height: 1.5; }
.today__sched { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.today__sched-item {
    flex: 1 1 30%; min-width: 92px;
    background: rgba(255,255,255,0.75); border: 1px solid var(--color-border-light);
    border-radius: 10px; padding: 0.5rem 0.6rem;
}
.today__sched-label {
    display: block; font-size: 0.66rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--color-text-tertiary);
}
.today__sched-value {
    font-size: 1.02rem; font-weight: 800; color: var(--color-text);
    font-variant-numeric: tabular-nums;
}
.today__next { margin: 0.75rem 0 0; font-size: 0.88rem; color: var(--color-text-secondary); }
.today__next strong { color: var(--color-text); }
.today__cta {
    display: inline-flex; align-items: center; margin-top: 0.85rem; padding: 0 1.1rem;
    background: var(--color-amber); color: #fff; border-radius: 10px;
    font-size: 0.88rem; font-weight: 700; text-decoration: none; min-height: 44px;
}

/* Avisos (§15) */
.avisos { display: flex; flex-direction: column; gap: 0.5rem; }
.aviso {
    display: flex; gap: 0.7rem; align-items: flex-start;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 12px; padding: 0.75rem 0.85rem; text-decoration: none;
}
.aviso__dot {
    flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%;
    margin-top: 0.35rem; background: var(--c, var(--color-amber));
}
.aviso__body { min-width: 0; }
.aviso__title { font-size: 0.92rem; font-weight: 700; color: var(--color-text); margin: 0 0 0.1rem; }
.aviso__meta { font-size: 0.78rem; color: var(--color-text-secondary); margin: 0; }

/* ¿Qué necesitas? (§17) */
.needs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.need {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.35rem; padding: 0.85rem 0.3rem; min-height: 82px;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 14px; text-decoration: none; color: var(--color-text);
    text-align: center; transition: border-color 0.15s, transform 0.15s;
}
.need:active { transform: scale(0.97); }
.need__ico {
    width: 38px; height: 38px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg, var(--color-amber-light)); color: var(--fg, var(--color-amber-dark));
}
.need__txt { font-size: 0.7rem; font-weight: 600; line-height: 1.15; }
@media (max-width: 389px) { .needs { grid-template-columns: repeat(3, 1fr); } }

/* Menú de hoy (§18–§20) */
.chips {
    display: flex; gap: 0.35rem; overflow-x: auto; padding-bottom: 0.3rem;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex-shrink: 0; border: 1px solid var(--color-border); background: var(--color-surface);
    color: var(--color-text-secondary); border-radius: 999px;
    padding: 0.4rem 0.8rem; font-size: 0.78rem; font-weight: 600;
    cursor: pointer; white-space: nowrap; min-height: 36px;
}
.chip.is-on { background: var(--color-green-dark); border-color: var(--color-green-dark); color: #fff; }
.menu-course + .menu-course { margin-top: 0.7rem; }
.menu-course__label {
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--color-text-tertiary); margin: 0 0 0.1rem;
}
.menu-course__text { font-size: 0.95rem; color: var(--color-text); margin: 0; line-height: 1.4; }

/* Lo próximo (§23) */
.agenda { display: flex; flex-direction: column; gap: 0.5rem; }
.agenda__row {
    display: flex; gap: 0.75rem; align-items: center;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 12px; padding: 0.65rem 0.8rem; text-decoration: none;
}
.agenda__date {
    flex-shrink: 0; width: 46px; text-align: center; line-height: 1;
    background: var(--color-amber-light); color: var(--color-amber-dark);
    border-radius: 9px; padding: 0.4rem 0.2rem;
}
.agenda__d { display: block; font-size: 1.12rem; font-weight: 800; }
.agenda__m {
    display: block; font-size: 0.62rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em; margin-top: 1px;
}
.agenda__body { min-width: 0; flex: 1; }
.agenda__title { font-size: 0.92rem; font-weight: 700; color: var(--color-text); margin: 0 0 0.1rem; }
.agenda__meta { font-size: 0.78rem; color: var(--color-text-secondary); margin: 0; }

/* Próximo cambio relevante (§27) */
.change {
    display: flex; gap: 0.6rem; align-items: flex-start;
    background: var(--color-amber-light); border: 1px solid rgba(212,160,48,0.3);
    border-radius: 12px; padding: 0.75rem 0.9rem;
    font-size: 0.9rem; color: #7a5800; line-height: 1.45;
}

/* Hazte socio (§36) */
.socio {
    background: linear-gradient(135deg, #fff8e7, #fff);
    border: 1px solid rgba(212,160,48,0.35); border-radius: 16px; padding: 1.1rem;
}
.socio__title { font-size: 1.05rem; font-weight: 800; margin: 0 0 0.15rem; color: var(--color-text); }
.socio__price { font-size: 0.88rem; color: var(--color-amber-dark); font-weight: 700; margin: 0 0 0.6rem; }
.socio__list { list-style: none; padding: 0; margin: 0 0 0.9rem; }
.socio__list li {
    position: relative; padding-left: 1.3rem; font-size: 0.88rem;
    color: var(--color-text-secondary); line-height: 1.45; margin-bottom: 0.3rem;
}
.socio__list li::before { content: '\2713'; position: absolute; left: 0; color: var(--color-green-dark); font-weight: 800; }

.btn-block {
    display: flex; align-items: center; justify-content: center; width: 100%;
    padding: 0.85rem 1rem; border-radius: 12px; font-weight: 700; font-size: 0.95rem;
    text-decoration: none; min-height: 48px; border: 0; cursor: pointer;
}
.btn-block--amber { background: var(--color-amber); color: #fff; }
.btn-block--ghost { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }

/* Estados vacíos (§51) */
.empty { text-align: center; color: var(--color-text-tertiary); font-size: 0.88rem; padding: 1.1rem 0.5rem; margin: 0; }

/* Escritorio: expansión de la experiencia móvil (§64) */
@media (min-width: 901px) {
    .home__wrap { max-width: 1040px; }
    .needs { grid-template-columns: repeat(8, 1fr); }
}

[data-theme="dark"] .home-card,
[data-theme="dark"] .today,
[data-theme="dark"] .aviso,
[data-theme="dark"] .need,
[data-theme="dark"] .agenda__row,
[data-theme="dark"] .chip { background: #1C1C1E; border-color: #2C2C2E; }
[data-theme="dark"] .today--ok,
[data-theme="dark"] .today--warn,
[data-theme="dark"] .today--off,
[data-theme="dark"] .today--info,
[data-theme="dark"] .socio { background: #1C1C1E; }
[data-theme="dark"] .today__sched-item { background: rgba(255,255,255,0.04); border-color: #2C2C2E; }
[data-theme="dark"] .today__state { background: rgba(255,255,255,0.08); }
