/* ===== Estilos propios =====
/* Bordes punteados de las tarjetas con foto/ícono */
.wireframe-border        { border: 2px dashed #cbd5e1; }
.wireframe-border-cyan   { border: 2px dashed #a5f3fc; }
.wireframe-border-orange { border: 2px dashed #fed7aa; }

/* Barra superior*/
.glass-light {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* Al navegar con el menú, la barra fija (80px)*/
section[id] { scroll-margin-top: 5rem; }

/* Los modales y el aviso usan "hidden" + "flex": nos aseguramos de que "hidden" siempre gane */
.modal.hidden, #toast.hidden, #error-banner.hidden { display: none; }

/* Animación suave al abrir un modal */
.modal:not(.hidden) > div { animation: modal-in 0.2s ease-out; }
@keyframes modal-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

/* Foco visible para quien navega con teclado (accesibilidad) */
a:focus-visible, button:focus-visible, .empresa-card:focus-visible {
    outline: 2px solid #0284c7;
    outline-offset: 2px;
}

/* Respeta a quien desactiva las animaciones en su sistema */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    .modal:not(.hidden) > div { animation: none; }
    * { transition-duration: 0.01ms !important; }
}

/* =====================================================================
   Carrusel de speakers (hero)
   ===================================================================== */
.spk {
    --spk-dur: 6000ms;
    max-width: 64rem;
    margin: 0 auto 2.5rem;
    text-align: left;
    scroll-margin-top: 6rem;
}
.spk[hidden] { display: none; }
.spk-viewport { overflow: hidden; }
.spk-track { display: flex; transition: transform 0.6s cubic-bezier(0.22, 0.8, 0.3, 1); }

/* Cada diapositiva lleva su propio margen */
.spk-slide { flex: 0 0 100%; min-width: 0; display: flex; box-sizing: border-box; padding: 1.25rem 1rem 2rem; }
.spk-card {
    flex: 1;
    display: grid;
    grid-template-columns: 19.5rem 1fr;
    gap: 3.5rem;
    align-items: center;
    padding: 2.25rem 3rem 2.25rem 2.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1.75rem;
    box-shadow: 0 30px 50px -30px rgba(2, 132, 199, 0.35), 0 2px 8px rgba(15, 23, 42, 0.05);
}

/* Foto vertical con un fondo de color desplazada detrás */
.spk-photo { position: relative; aspect-ratio: 4 / 5; margin: 0 0.9rem 0.9rem 0; }
.spk-photo::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: translate(0.9rem, 0.9rem);
    border-radius: 1.25rem;
    background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
}
.spk-frame {
    position: relative;
    height: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 1.25rem;
    background: #e2e8f0;
    color: #94a3b8;
}
.spk-frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12); pointer-events: none; }
.spk-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }

.spk-body { min-width: 0; }
.spk-name {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #0f172a;
    text-wrap: balance;
}
.spk-role { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0.9rem 0 0; font-size: 1.1875rem; font-weight: 500; color: #475569; }
.spk-company { padding: 0.2rem 0.8rem; border-radius: 999px; background: #e0f2fe; color: #0369a1; font-size: 1rem; font-weight: 700; }
.spk-talk { margin-top: 2rem; padding-left: 1.125rem; border-left: 4px solid #f97316; }
.spk-talk-label { display: block; margin-bottom: 0.3rem; font-size: 0.875rem; font-weight: 700; color: #ea580c; }
.spk-talk-title { margin: 0; font-size: clamp(1.2rem, 2.1vw, 1.65rem); font-weight: 600; line-height: 1.35; color: #1e293b; text-wrap: balance; }

/* Controles: una pestaña por speaker (la barra marca el tiempo) y las flechas */
.spk-controls { display: flex; align-items: flex-end; gap: 1.5rem; padding: 0 1rem 0.25rem; }
.spk-controls[hidden] { display: none; }
.spk-tabs { flex: 1; display: flex; gap: 0.75rem; min-width: 0; }
.spk-tab { flex: 1 1 0; min-width: 0; padding: 0.5rem 0 0; border: 0; background: none; font: inherit; text-align: left; color: #64748b; cursor: pointer; }
.spk-tab:focus-visible { outline: 2px solid #0284c7; outline-offset: 4px; border-radius: 0.25rem; }
.spk-tab-bar { display: block; height: 4px; border-radius: 999px; background: #cbd5e1; overflow: hidden; }
.spk-tab-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0284c7, #06b6d4); }
.spk-tab-name { display: block; margin-top: 0.5rem; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.2s; }
.spk-tab:hover .spk-tab-name { color: #0284c7; }
.spk-tab.is-active .spk-tab-name { color: #0f172a; }
.spk-tab.is-done .spk-tab-fill { width: 100%; }
.spk-tab.is-active .spk-tab-fill { animation: spk-fill var(--spk-dur) linear forwards; }
.spk.is-paused .spk-tab.is-active .spk-tab-fill { animation-play-state: paused; }
.spk.spk--static .spk-tab.is-active .spk-tab-fill { animation: none; width: 100%; }
@keyframes spk-fill { from { width: 0; } to { width: 100%; } }

.spk-arrows { display: flex; gap: 0.5rem; flex-shrink: 0; }
.spk-arrow {
    width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
    border: 1px solid #cbd5e1; border-radius: 50%; background: #fff; color: #334155; cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.spk-arrow:hover { border-color: #0284c7; color: #0284c7; background: #f0f9ff; }
.spk-arrow:focus-visible { outline: 2px solid #0284c7; outline-offset: 2px; }

@media (max-width: 767px) {
    .spk-card { gap: 1.75rem; }
    .spk-slide { padding: 1rem 0.25rem 1.5rem; }
    .spk-card { grid-template-columns: 1fr; padding: 1.5rem 1.25rem 1.75rem; text-align: center; justify-items: center; }
    .spk-photo { width: min(62%, 13rem); }
    .spk-role { justify-content: center; }
    .spk-talk { width: 100%; margin-top: 1.5rem; text-align: left; }
    .spk-name { font-size: 2rem; }
    .spk-talk-title { font-size: 1.15rem; }
    .spk-controls { padding: 0 0.25rem; gap: 1rem; }
    .spk-arrow { width: 2.5rem; height: 2.5rem; }
}
@media (max-width: 479px) {
    .spk-rest { display: none; } /* en pantallas muy angostas, las pestañas solo muestran el nombre de pila */
}
@media (prefers-reduced-motion: reduce) {
    .spk-track { transition: none; }
    .spk-tab.is-active .spk-tab-fill { animation: none; width: 100%; }
}
