/* ==========================================================================
   Componentes compartidos por el sitio público y el panel /admin:
   botones, piezas, etiquetas, eventos, calendario, formularios y avisos.
   ========================================================================== */

/* ---------- Botones ---------- */
.boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--azul-profundo);
    border-radius: 12px;
    background: var(--azul-profundo);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.boton:hover { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.boton--secundario { background: var(--fondo); color: var(--azul-profundo); }
.boton--secundario:hover { background: var(--azul-tinte); color: var(--tinta); border-color: var(--tinta); }
.botones { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; }

/* ---------- Pieza de rompecabezas con símbolo (como en el logo) ---------- */
.pieza { position: relative; display: inline-block; width: 4.5rem; height: 4.5rem; flex: none; }
.pieza__forma { width: 100%; height: 100%; fill: var(--acento); display: block; }
.pieza__simbolo { position: absolute; left: 30%; top: 36%; width: 40%; height: 40%; fill: var(--acento-simbolo); }
.pieza--chica { width: 3rem; height: 3rem; }
.pieza--grande { width: 8rem; height: 8rem; }

/* ---------- Eventos ---------- */
.eventos { list-style: none; display: grid; gap: 0; }
.evento {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem 1.25rem;
    align-items: start;
    padding-block: 1.25rem;
    border-top: 1px solid var(--linea);
}
.evento:last-child { border-bottom: 1px solid var(--linea); }
.evento__fecha {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 4.5rem;
    padding: 0.5rem 0.5rem 0.4rem;
    border-radius: var(--radio);
    background: var(--acento-tinte);
    border-top: 6px solid var(--acento);
    line-height: 1.1;
    text-align: center;
}
.evento__dia { font-size: 1.9rem; font-weight: 800; }
.evento__mes { font-size: 0.95rem; font-weight: 600; color: var(--tinta); }
.evento__titulo { font-size: 1.2rem; margin: 0 0 0.25rem; }
.evento__titulo a { color: var(--tinta); text-decoration-thickness: 2px; }
.evento__titulo a:hover { color: var(--azul-profundo); }
.evento__meta { margin: 0 0 0.5rem; color: var(--tinta-suave); font-size: 1rem; }
.evento--pasado .evento__fecha { background: var(--superficie); border-top-color: var(--linea); }
.evento--pasado .evento__titulo a { color: var(--tinta-suave); }

.etiqueta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0.7rem;
    border-radius: 999px;
    background: var(--acento-tinte);
    border: 1px solid var(--acento);
    color: var(--tinta);
    font-size: 0.9rem;
    font-weight: 600;
}
.etiqueta::before { content: ""; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--acento); border: 1px solid rgba(0,0,0,.25); }
.etiqueta--simple { background: var(--superficie); border-color: var(--linea); }
.etiqueta--simple::before { display: none; }

.enlace-mas { display: inline-block; margin-top: 1.25rem; font-weight: 700; }
.enlaces-mas { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }


.icono { width: 1.35em; height: 1.35em; fill: currentColor; flex: none; vertical-align: middle; }

.cal__barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.cal__barra h2 { margin: 0; font-size: clamp(1.35rem, 1rem + 1.5vw, 1.9rem); }
.cal__nav { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cal__nav .boton { min-height: 44px; padding-inline: 1rem; }

.cal { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; }
.cal caption { text-align: left; padding: 0; }
.cal th { padding: 0.5rem 0.1rem; background: var(--superficie); font-size: 0.9rem; font-weight: 700; border-bottom: 1px solid var(--linea); }
.cal th abbr { text-decoration: none; }
.cal td { vertical-align: top; height: 3.6rem; padding: 0.3rem; border-right: 1px solid var(--linea); border-bottom: 1px solid var(--linea); font-size: 0.95rem; }
.cal tr td:last-child { border-right: 0; }
.cal tr:last-child td { border-bottom: 0; }
.cal__fuera { background: var(--superficie); }
.cal__num { display: inline-flex; align-items: center; justify-content: center; min-width: 1.8rem; height: 1.8rem; border-radius: 50%; font-weight: 600; }
.cal__hoy .cal__num { background: var(--tinta); color: #fff; }
.cal__lista { list-style: none; display: none; margin-top: 0.25rem; gap: 0.25rem; }
.cal__lista li { min-width: 0; }
.cal td { overflow: hidden; }
.cal__puntos { display: flex; flex-wrap: wrap; gap: 0.2rem; margin-top: 0.2rem; }
.cal__punto { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--acento); border: 1px solid rgba(0,0,0,.3); }
.cal__evento {
    display: block;
    padding: 0.15rem 0.4rem;
    border-left: 5px solid var(--acento);
    background: var(--acento-tinte);
    border-radius: 4px;
    color: var(--tinta);
    font-size: 0.82rem;
    line-height: 1.3;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal__evento:hover { text-decoration: underline; }

@media (min-width: 52em) {
    .cal td { height: 7.5rem; }
    .cal__lista { display: grid; }
    .cal__puntos { display: none; }
}

.leyenda { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; list-style: none; margin: 1rem 0 2rem; font-size: 0.95rem; }

/* ---------- Formularios ---------- */
.formulario { display: grid; gap: 1.5rem; max-width: 40rem; }
.campo { display: grid; gap: 0.35rem; }
.campo label, .campo legend { font-weight: 700; }
.campo__opc { font-weight: 400; color: var(--tinta-suave); }
.campo__ayuda { margin: 0; font-size: 1rem; color: var(--tinta-suave); }
.campo input:not([type="checkbox"]):not([type="radio"]), .campo select, .campo textarea {
    width: 100%;
    min-height: 48px;
    padding: 0.6rem 0.85rem;
    border: 2px solid #6B7A84;
    border-radius: var(--radio-chico);
    background: #fff;
    color: var(--tinta);
    font: inherit;
}
.campo textarea { min-height: 8rem; resize: vertical; }
.campo input:focus-visible, .campo select:focus-visible, .campo textarea:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; border-color: var(--foco); }
.campo input.invalid, .campo select.invalid, .campo textarea.invalid { border-color: var(--rojo-profundo); background: var(--rojo-tinte); }

.campo--casilla { grid-template-columns: auto 1fr; align-items: start; gap: 0.2rem 0.75rem; }
.campo--casilla input[type="checkbox"] { width: 1.6rem; height: 1.6rem; margin: 0.15rem 0 0; accent-color: var(--azul-profundo); }
.campo--casilla .campo__error { grid-column: 2; }
.campo__error { min-height: 0; }
.campo__error .validation-message { color: var(--rojo-profundo); font-weight: 700; font-size: 1rem; }

.resumen-errores { border: 2px solid var(--rojo-profundo); background: var(--rojo-tinte); border-radius: var(--radio); padding: 1rem 1.25rem; }
.resumen-errores:empty, .resumen-errores:not(:has(li)) { display: none; }
.resumen-errores:focus { outline: 3px solid var(--foco); outline-offset: 3px; }
.resumen-errores p { margin: 0 0 0.5rem; font-weight: 700; color: var(--rojo-profundo); }
.resumen-errores ul { padding-left: 1.25rem; margin: 0; }
.validation-errors { color: var(--tinta); }

.aviso { display: flex; gap: 0.75rem; align-items: flex-start; padding: 1rem 1.25rem; border-radius: var(--radio); background: var(--azul-tinte); border-left: 6px solid var(--logo-azul); }
.aviso p { margin: 0; }
.aviso--ok { background: var(--verde-tinte); border-left-color: var(--logo-verde); }

.aviso--ancho { max-width: 40rem; margin-bottom: 2rem; }

.nota { margin-top: 1rem; }
.botones--aparte { margin-top: 1.5rem; }

/* Calendario interactivo (panel): día y eventos como botones */
.cal__num--boton { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--tinta); cursor: pointer; min-width: 2rem; height: 2rem; }
.cal__num--boton:hover { background: var(--azul-tinte); }
.cal__hoy .cal__num--boton { background: var(--tinta); color: #fff; }
button.cal__evento { width: 100%; border-top: 0; border-right: 0; border-bottom: 0; font: inherit; font-size: 0.82rem; text-align: left; cursor: pointer; }

/* Los enlaces dentro de un texto no se distinguen solo por el color */
.aviso a, .admin-intro a { text-decoration: underline; text-underline-offset: 0.2em; }

/* Avisos de error, campo trampa anti-spam, fotos reales y listas simples */
.aviso--error { background: var(--rojo-tinte); border-left-color: var(--rojo-profundo); }
.campo-trampa { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.galeria__imagen {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radio);
    border: 1px solid var(--linea);
    background: var(--superficie);
}
.galeria__video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    border-radius: var(--radio);
    border: 1px solid var(--linea);
    background: var(--tinta);
}
h3 > .etiqueta--simple, figcaption > .etiqueta--simple { margin-inline-start: 0.5rem; }
.evento__fotos { display: inline-flex; align-items: center; min-height: 44px; margin-inline-start: 0.5rem; font-weight: 700; }
.fotos-evento { margin-top: 2.5rem; }
.fotos-evento h2:focus { outline: none; }
.medios { list-style: none; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); margin: 0; padding: 0; }
.medios .galeria__item { flex: none; }
.galeria__descripcion { display: block; margin-top: 0.25rem; font-size: 0.95rem; color: var(--tinta-suave); }
/* Grupos de opciones (botones de radio), en el sitio y en el panel */
.grupo-opciones { border: 0; padding: 0; margin: 0; }
.grupo-opciones legend { font-weight: 700; margin-bottom: 0.35rem; padding: 0; }
.opcion, .campo .opcion { display: flex; align-items: flex-start; gap: 0.6rem; min-height: 44px; padding-block: 0.35rem; font-weight: 400; }
.opcion input, .campo .opcion input { width: 1.4rem; height: 1.4rem; min-height: 0; flex: none; margin: 0.1rem 0 0; accent-color: var(--azul-profundo); }
.opcion strong { font-weight: 700; }
.lista-simple { margin: 0.5rem 0 1rem 1.25rem; padding: 0; }
.lista-simple li { margin-bottom: 0.35rem; }
