/* ==========================================================================
   Ficha de centro.

   Dos columnas: a la izquierda lo que se lee seguido (quien es el centro, que
   imparte, que tiene), y a la derecha lo que se consulta de un vistazo o lleva
   a una accion (precio, valoracion, empleo, admisiones).
   ========================================================================== */

.profile-head {
    padding-block: var(--space-5) var(--space-7);
    background: var(--board);
    color: #fff;
    border-radius: 0 0 var(--r-2xl) var(--r-2xl);
}

/* --- Migas ---------------------------------------------------------------- */

.crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.66);
}

.crumbs a:hover {
    color: #fff;
    text-decoration: underline;
}

.crumbs__sep {
    width: 0.7rem;
    height: 0.7rem;
    rotate: -90deg;
    opacity: 0.5;
}

/* --- Identidad del centro ------------------------------------------------- */

.profile-head__main {
    display: flex;
    align-items: flex-start;
    gap: var(--space-5);
}

.profile-head__crest {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: var(--r-lg);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.profile-head__crest[data-tone='teal'] { background: var(--teal); color: #fff; }
.profile-head__crest[data-tone='brand'] { background: var(--brand-deep); color: #fff; }
.profile-head__crest[data-tone='sun'] { background: var(--sun); color: #4a3800; }
.profile-head__crest[data-tone='ink'] { background: var(--ink); color: #fff; }

.profile-head__name {
    font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.75rem);
    line-height: 1.1;
}

.profile-head__place {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: var(--space-3);
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, 0.72);
}

.profile-head__place svg {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
}

.profile-head__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

/* --- Cuerpo --------------------------------------------------------------- */

.profile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20rem;
    align-items: start;
    gap: var(--space-6);
    padding-block: var(--space-7);
}

.profile__main,
.profile__side {
    display: grid;
    gap: var(--space-5);
}

.profile__side {
    position: sticky;
    top: 5.5rem;
}

.profile-panel {
    padding: var(--space-6);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
}

.profile-panel--tight {
    padding: var(--space-5);
}

.profile-panel--accent {
    background: var(--sun-soft);
    border-color: #f0dfa8;
}

.profile-panel__title {
    font-size: var(--fs-h3);
    margin-bottom: var(--space-4);
}

.profile-panel__title--small {
    font-size: 1rem;
    margin-bottom: var(--space-3);
}

.profile-panel__subtitle {
    font-size: 0.95rem;
    font-family: var(--font-display);
    font-weight: 700;
    margin: var(--space-5) 0 var(--space-3);
}

/* El margen va arriba y no abajo: este parrafo estaba encima de la lista de
   datos y ahora va debajo, de ultimo en su panel. */
.profile-panel__lead {
    margin-top: var(--space-5);
    font-size: var(--fs-sm);
    color: var(--ink-soft);
    line-height: 1.6;
}

.profile-panel__note {
    font-size: var(--fs-xs);
    color: var(--ink-soft);
    line-height: 1.5;
    margin-bottom: var(--space-4);
}

/* --- Datos en dos columnas ------------------------------------------------ */

.facts {
    display: grid;
    gap: 0;
}

.facts__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
    padding-block: 0.7rem;
    border-top: 1px solid var(--rule);
    font-size: var(--fs-sm);
}

.facts__row dt {
    color: var(--ink-soft);
}

.facts__row dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

.facts__row a:hover {
    color: var(--brand-deep);
    text-decoration: underline;
}

/* --- Listas ---------------------------------------------------------------- */

.pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.pill {
    padding: 0.35rem 0.8rem;
    border-radius: var(--r-pill);
    background: var(--teal-soft);
    color: var(--teal);
    font-size: var(--fs-xs);
    font-weight: 600;
}

.checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
    gap: var(--space-2) var(--space-4);
}

.checks__item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    color: var(--ink-soft);
}

.checks__icon {
    width: 0.85rem;
    height: 0.85rem;
    flex-shrink: 0;
    color: var(--brand-deep);
}

/* --- Preguntas frecuentes -------------------------------------------------- */

.faq {
    border-top: 1px solid var(--rule);
}

.faq__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding-block: var(--space-4);
    font-size: var(--fs-sm);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.faq__question::-webkit-details-marker {
    display: none;
}

.faq__caret {
    width: 0.8rem;
    height: 0.8rem;
    flex-shrink: 0;
    color: var(--ink-faint);
    transition: rotate var(--dur) var(--ease);
}

.faq[open] .faq__caret {
    rotate: 180deg;
}

.faq__answer {
    padding-bottom: var(--space-4);
    font-size: var(--fs-sm);
    color: var(--ink-soft);
    line-height: 1.6;
}

/* --- Precio y valoracion --------------------------------------------------- */

.price {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.rating {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    color: var(--ink-soft);
    margin-bottom: var(--space-3);
}

.rating strong {
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--ink);
}

.rating__star {
    width: 1rem;
    height: 1rem;
    align-self: center;
    color: var(--sun);
}

@media (max-width: 62rem) {
    .profile {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile__side {
        position: static;
    }
}

/* --- Opiniones de Google -------------------------------------------------
   Google devuelve como mucho cinco, asi que es una lista corta y no hace
   falta carrusel ni paginacion. Cada una lleva autor, foto y enlace a la
   original porque sus condiciones lo exigen.
   ------------------------------------------------------------------------ */

.reviews {
    display: grid;
    gap: var(--space-4);
    margin: var(--space-4) 0 var(--space-3);
    padding: 0;
    list-style: none;
}

.reviews__item {
    padding-top: var(--space-4);
    border-top: 1px solid var(--rule);
}

.reviews__item:first-child {
    padding-top: 0;
    border-top: 0;
}

.reviews__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.reviews__avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--r-pill);
    object-fit: cover;
}

.reviews__author {
    display: block;
    font-weight: 700;
    font-size: var(--fs-sm);
}

.reviews__meta {
    display: block;
    font-size: var(--fs-xs);
    color: var(--ink-faint);
}

.reviews__stars {
    display: inline-flex;
    gap: 0.05em;
    vertical-align: -0.1em;
}

.reviews__star {
    width: 0.9em;
    height: 0.9em;
    color: var(--sun);
}

/* Las que no ha dado: se dejan marcadas en gris en vez de quitarlas, para que
   se vea sobre cuanto puntua. Un "tres estrellas" sin las otras dos no dice si
   es sobre cinco o sobre tres. */
.reviews__star--off {
    color: var(--rule-strong);
}

.reviews__text {
    margin-top: var(--space-2);
    font-size: var(--fs-sm);
    line-height: var(--lh-body);
    color: var(--ink-soft);
}

.reviews__link {
    display: inline-block;
    margin-top: var(--space-2);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--teal);
}

.reviews__link:hover {
    text-decoration: underline;
}

/* --- Foto del centro -----------------------------------------------------
   La de Google cuando la hay, en el hueco del escudo de iniciales.
   ------------------------------------------------------------------------ */

.profile-head__photo {
    display: block;
    flex-shrink: 0;
    width: 96px;
    height: 96px;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--teal-tint);
    cursor: zoom-in;
}

.profile-head__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--dur) var(--ease);
}

.profile-head__photo:hover img {
    transform: scale(1.04);
}

/* --- Carrusel de fotos ----------------------------------------------------
   Encima de "Informacion general": de un colegio lo primero que se mira es
   como es. Es scroll horizontal con anclaje, no un carrusel de los de
   temporizador: se arrastra con el dedo y las flechas son solo para el raton.
   ------------------------------------------------------------------------ */

.gallery {
    position: relative;
    margin-bottom: var(--space-6);
}

.gallery__strip {
    display: flex;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Que la sombra del foco no se corte contra el borde del scroll. */
    padding-bottom: var(--space-1);
}

.gallery__strip::-webkit-scrollbar {
    display: none;
}

.gallery__item {
    flex: 0 0 auto;
    /* Dos y pico a la vista en escritorio, para que se vea que hay mas. */
    width: min(100%, 320px);
    scroll-snap-align: start;
}

.gallery__link {
    display: block;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--teal-tint);
    cursor: zoom-in;
}

.gallery__link img {
    display: block;
    width: 100%;
    height: 210px;
    object-fit: cover;
    transition: transform var(--dur) var(--ease);
}

.gallery__link:hover img {
    transform: scale(1.04);
}

/* Autoria por foto: las condiciones de Google la piden en cada una. */
.gallery__credit {
    margin-top: var(--space-2);
    font-size: var(--fs-xs);
    color: var(--ink-faint);
}

.gallery__credit a {
    color: inherit;
    border-bottom: 1px solid currentColor;
}

.gallery__arrow {
    position: absolute;
    top: 105px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: 1px solid var(--rule);
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(16, 56, 64, 0.15));
    font-size: 1.25rem;
    line-height: 1;
    color: var(--teal);
    cursor: pointer;
    transition: opacity var(--dur) var(--ease);
}

.gallery__arrow--prev {
    left: calc(var(--space-2) * -1);
}

.gallery__arrow--next {
    right: calc(var(--space-2) * -1);
}

/* Una flecha que no lleva a ninguna parte se apaga, no desaparece: si se
   quitara, la otra bailaria de sitio al llegar al extremo. */
.gallery__arrow[disabled] {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 640px) {
    /* En movil se arrastra con el dedo y las flechas solo tapan foto. */
    .gallery__arrow {
        display: none;
    }

    .gallery__link img {
        height: 180px;
    }

    .gallery__arrow {
        top: 90px;
    }
}

/* El dialogo de ampliar, que crea assets/js/zoom.js. */
.zoom {
    inset: 0;
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: var(--r-md);
    background: transparent;
    max-width: min(92vw, 1100px);
    max-height: 92vh;
    overflow: visible;
}

.zoom::backdrop {
    background: rgba(10, 39, 46, 0.82);
}

.zoom__img {
    display: block;
    max-width: 100%;
    max-height: 88vh;
    border-radius: var(--r-md);
}

.zoom__close {
    position: absolute;
    top: -0.6rem;
    right: -0.6rem;
    width: 2.2rem;
    height: 2.2rem;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

/* --- Mapa ----------------------------------------------------------------
   Proporcion fija para que el iframe no salte al cargar.
   ------------------------------------------------------------------------ */

.profile-map {
    margin-top: var(--space-3);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.profile-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Autoria de la foto: obligatoria por las condiciones de Google, pero discreta. */
.profile-head__credit {
    margin-top: var(--space-2);
    font-size: var(--fs-xs);
    color: rgba(255, 255, 255, 0.55);
}

.profile-head__credit a {
    color: inherit;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.profile-head__credit a:hover {
    color: #fff;
}

/* Las opiniones, plegadas: cinco textos seguidos estiran demasiado la columna. */
.reviews__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-3);
    padding-block: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--teal);
    cursor: pointer;
    list-style: none;
}

.reviews__summary::-webkit-details-marker {
    display: none;
}

.reviews__mark {
    flex-shrink: 0;
    width: 0.45rem;
    height: 0.45rem;
    margin-right: 0.2rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform var(--dur) var(--ease);
}

.reviews__fold[open] > .reviews__summary .reviews__mark {
    transform: rotate(-135deg);
}

/* --- Modal de opiniones --------------------------------------------------
   Lo monta assets/js/reviews.js a partir del <details>. Sin JavaScript no
   existe y se queda el plegable, que tambien vale.
   ------------------------------------------------------------------------ */

/* Texto subrayado y centrado, no un boton.

   Sigue siendo un <button> en el marcado a proposito: abre un dialogo, no
   navega a ningun sitio, y un <a> sin href no lo anuncia bien un lector de
   pantalla. Lo que cambia es como se ve. */
.reviews__open {
    display: block;
    margin: var(--space-4) auto 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--teal);
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.25em;
    cursor: pointer;
}

/* La flecha va aqui y no en el texto: es decoracion, y asi no hay que
   repetirla en los cinco idiomas. */
.reviews__open::after {
    content: ' →';
    text-decoration: none;
    display: inline-block;
    transition: transform var(--dur-fast) var(--ease);
}

.reviews__open:hover::after {
    transform: translateX(0.15em);
}

.sheet {
    /* Centrado explicito: el margin auto del navegador se pierde en cuanto se
       le da un ancho, y el dialogo se queda pegado arriba. */
    inset: 0;
    margin: auto;
    width: min(92vw, 560px);
    max-height: 86vh;
    padding: 0;
    border: 0;
    border-radius: var(--r-lg);
    background: var(--surface);
    color: var(--ink);
    overflow: hidden;
}

.sheet::backdrop {
    background: rgba(10, 39, 46, 0.72);
}

.sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--rule);
}

.sheet__title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
}

.sheet__close {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--teal-tint);
    color: var(--ink);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

/* Con cinco opiniones largas hace falta barra propia, o el modal se sale de
   la pantalla en un movil. */
.sheet__body {
    padding: var(--space-5);
    max-height: calc(86vh - 4.5rem);
    overflow-y: auto;
}

.sheet__body .reviews {
    margin: 0;
}
