/* RY Agenda — página pública */

.ryag-ag {
    --ag-radius: 15px;
    --ag-ink: #111;
    --ag-muted: #6f6f6f;
    --ag-line: rgba(0, 0, 0, .09);
    --ag-soft: #f4f4f4;
    --ag-accent: #111;
    /* Fuentes de la revista (plugin de fuentes de la web): Museo para titulares, Open Sans para el texto */
    --ag-font-title: "Museo", "museo", "Museo Slab", "museo-slab", "Museo Sans", "museo-sans", Georgia, serif;
    --ag-font-body: "Open Sans", "open-sans", "OpenSans", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-family: var(--ag-font-body);
    width: var(--ag-width, 80%);
    max-width: min(1440px, 100%);
    min-width: 0;
    margin: 0 auto 48px;
    color: var(--ag-ink);
    box-sizing: border-box;
}

.ryag-ag *,
.ryag-ag *::before,
.ryag-ag *::after {
    box-sizing: border-box;
}

.ryag-ag a {
    text-decoration: none;
    box-shadow: none;
}

.ryag-ag input,
.ryag-ag button {
    font-family: var(--ag-font-body);
}

/* Colores por tipo */
.ryag-t--festivales   { --ag-accent: #e4572e; }
.ryag-t--infantil     { --ag-accent: #f2a007; }
.ryag-t--teatro       { --ag-accent: #c2185b; }
.ryag-t--danza        { --ag-accent: #8e44ad; }
.ryag-t--espectaculos { --ag-accent: #d35400; }
.ryag-t--musica       { --ag-accent: #1e88e5; }
.ryag-t--cine         { --ag-accent: #37474f; }
.ryag-t--exposiciones { --ag-accent: #00897b; }
.ryag-t--conferencias { --ag-accent: #5c6bc0; }
.ryag-t--talleres     { --ag-accent: #6aa232; }
.ryag-t--visitas      { --ag-accent: #00a0b4; }
.ryag-t--deportes     { --ag-accent: #2e7d32; }
.ryag-t--ferias       { --ag-accent: #8d6e63; }
.ryag-t--otros        { --ag-accent: #757575; }

/* ---------- Elegir ciudad ---------- */

.ryag-ag__lead {
    font-family: var(--ag-font-title);
    margin: 8px 0 18px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.2px;
}

.ryag-ag__choose-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    gap: 20px;
}

.ryag-ag__choose-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 280px;
    padding: 28px;
    border-radius: var(--ag-radius);
    color: #fff !important;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}

.ryag-ag__choose-card--barcelona { background: linear-gradient(140deg, #ff7a45 0%, #e4572e 45%, #c2185b 100%); }
.ryag-ag__choose-card--madrid    { background: linear-gradient(140deg, #4fc3f7 0%, #1e88e5 45%, #3949ab 100%); }

.ryag-ag__choose-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .2);
}

.ryag-ag__choose-short {
    position: absolute;
    top: 14px;
    right: 22px;
    font-size: 96px;
    font-weight: 900;
    letter-spacing: -4px;
    line-height: 1;
    opacity: .16;
}

.ryag-ag__choose-name {
    font-family: var(--ag-font-title);
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.5px;
}

.ryag-ag__choose-count {
    margin-top: 8px;
    font-size: 15px;
    opacity: .9;
}

/* ---------- Cabecera de la lista ---------- */

.ryag-ag__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin: 0 0 14px;
}

.ryag-ag > .ryag-ag__cities {
    margin: 0 0 16px;
}

.ryag-ag__top .ryag-ag__whens {
    flex: 1 1 auto;
    min-width: min(100%, 560px);
    margin: 0;
}

.ryag-ag__cities {
    min-width: 0;
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: var(--ag-radius);
    background: var(--ag-soft);
}

.ryag-ag__city {
    padding: 13px 24px;
    border-radius: 11px;
    color: var(--ag-ink) !important;
    font-size: 15px;
    font-weight: 600;
    transition: background .15s ease;
}

.ryag-ag__city:hover {
    background: rgba(0, 0, 0, .05);
}

.ryag-ag__city.is-active {
    background: var(--ag-ink);
    color: #fff !important;
}

.ryag-ag__search {
    flex: 0 1 440px;
    display: flex;
    align-items: center;
    width: 440px;
    max-width: 100%;
    margin: 0;
    padding: 0 6px 0 18px;
    border-radius: var(--ag-radius);
    background: var(--ag-soft);
}

.ryag-ag__search input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 54px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 15px;
    font-weight: 400;
    color: var(--ag-ink);
    outline: none;
}

.ryag-ag__search button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--ag-ink);
    cursor: pointer;
}

.ryag-ag__search button:hover {
    background: rgba(0, 0, 0, .06);
}

.ryag-ag__whens {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.ryag-ag__chip {
    display: inline-block;
    padding: 10px 18px;
    border: 0;
    border-radius: 11px;
    background: var(--ag-soft);
    color: var(--ag-ink) !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background .15s ease;
}

.ryag-ag__chip:hover {
    background: #e9e9e9;
}

.ryag-ag__chip.is-active {
    background: var(--ag-ink);
    border-color: var(--ag-ink);
    color: #fff !important;
}

.ryag-ag__chip--free.is-active {
    background: #2e7d32;
}

/* Tipos */
.ryag-ag__types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 22px;
    padding: 0 0 18px;
    border-bottom: 1px solid var(--ag-line);
}

.ryag-ag__type {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px 10px 14px;
    border-radius: 11px;
    background: var(--ag-soft);
    color: var(--ag-ink) !important;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s ease;
}

.ryag-ag__type::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ag-accent);
}

.ryag-ag__type:first-child::before {
    display: none;
}

.ryag-ag__type span {
    color: var(--ag-muted);
    font-size: 12px;
}

.ryag-ag__type:hover {
    background: #ebebeb;
}

.ryag-ag__type.is-active {
    background: var(--ag-accent);
    color: #fff !important;
}

.ryag-ag__type.is-active::before {
    background: #fff;
}

.ryag-ag__type.is-active span {
    color: rgba(255, 255, 255, .8);
}

.ryag-ag__summary {
    margin: 0 0 18px;
    color: var(--ag-muted);
    font-size: 14px;
}

/* ---------- Tarjetas ---------- */

.ryag-ag__grid {
    display: grid;
    /* min(): la columna nunca puede ser más ancha que el hueco disponible */
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 28px 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ryag-ag__card {
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ryag-ag__card::before,
.ryag-ag__card::marker {
    content: none !important;
}

.ryag-ag__link {
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    color: var(--ag-ink) !important;
}

.ryag-ag__media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: var(--ag-radius);
    overflow: hidden;
    background: linear-gradient(145deg, color-mix(in srgb, var(--ag-accent) 70%, #fff) 0%, var(--ag-accent) 100%);
    background-color: var(--ag-accent);
}

.ryag-ag__cover {
    font-family: var(--ag-font-title);
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 12px;
    color: rgba(255, 255, 255, .92);
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.5px;
}

.ryag-ag__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    border-radius: 0;
    transition: transform .5s ease;
}

a.ryag-ag__link:hover .ryag-ag__media img {
    transform: scale(1.04);
}

.ryag-ag__date {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    padding: 6px 8px 7px;
    border-radius: 12px;
    background: #fff;
    color: var(--ag-ink);
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.ryag-ag__date.is-range {
    min-width: 0;
    padding: 8px 11px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.ryag-ag__date b {
    margin: 2px 0;
    font-size: 22px;
    font-weight: 800;
}

.ryag-ag__date small {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--ag-muted);
}

.ryag-ag__free {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 11px;
    border-radius: 9px;
    background: #2e7d32;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.ryag-ag__info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 2px 0;
}

.ryag-ag__when {
    color: var(--ag-accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .1px;
}

.ryag-ag__kind {
    color: var(--ag-accent);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Sin foto, el tipo ya va grande en la portada de color */
.ryag-ag__card.no-img .ryag-ag__kind {
    display: none;
}

.ryag-ag__title {
    font-family: var(--ag-font-title);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.2px;
}

a.ryag-ag__link:hover .ryag-ag__title {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.ryag-ag__meta {
    overflow: hidden;
    color: var(--ag-muted);
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ryag-ag__meta--place {
    color: #444;
}

/* ---------- Vacío, páginas, crédito ---------- */

.ryag-ag__empty {
    padding: 48px 20px;
    border-radius: var(--ag-radius);
    background: var(--ag-soft);
    text-align: center;
}

.ryag-ag__empty p {
    margin: 0 0 14px;
    font-size: 16px;
}

.ryag-ag__pager {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
    margin: 36px 0 8px;
}

.ryag-ag__pageinfo {
    color: var(--ag-muted);
    font-size: 14px;
}

.ryag-ag__credit {
    margin: 24px 0 0;
    font-size: 12px;
    text-align: center;
}

.ryag-ag__credit a {
    color: var(--ag-muted) !important;
}

/* ---------- Tablet ---------- */

@media (max-width: 1024px) {
    .ryag-ag {
        width: auto;
        padding: 0 24px;
    }
}

/* ---------- Móvil ---------- */

@media (max-width: 640px) {
    .ryag-ag {
        padding: 0 16px;
    }

    .ryag-ag__choose-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .ryag-ag__choose-card {
        min-height: 170px;
        padding: 22px;
    }

    .ryag-ag__choose-name {
        font-size: 32px;
    }

    .ryag-ag__choose-short {
        font-size: 72px;
    }

    .ryag-ag__top {
        position: relative;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .ryag-ag__top .ryag-ag__whens {
        min-width: 0;
        margin-left: -16px;
        padding-left: 16px;
    }

    .ryag-ag > .ryag-ag__cities {
        display: flex;
    }

    .ryag-ag__city {
        flex: 1;
        min-width: 0;
        padding: 12px 8px;
        text-align: center;
    }

    /* Buscador: solo la lupa; al tocarla se abre encima */
    .ryag-ag__search {
        flex: 0 0 52px;
        width: 52px;
        height: 52px;
        padding: 0 5px;
        justify-content: center;
    }

    .ryag-ag__search input[type="search"] {
        display: none;
    }

    .ryag-ag__search.is-open {
        position: absolute;
        inset: 0;
        z-index: 3;
        width: auto;
        padding: 0 5px 0 16px;
        justify-content: flex-start;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
        background: #fff;
    }

    .ryag-ag__search.is-open input[type="search"] {
        display: block;
        height: 52px;
    }

    /* Filtros en una fila que se desliza, sin barra visible */
    .ryag-ag__types {
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .ryag-ag__whens,
    .ryag-ag__types {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .ryag-ag__whens::-webkit-scrollbar,
    .ryag-ag__types::-webkit-scrollbar {
        display: none;
    }

    .ryag-ag__types {
        padding-bottom: 14px;
        margin-bottom: 16px;
    }

    .ryag-ag__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }

    .ryag-ag__media {
        aspect-ratio: 16 / 10;
    }

    .ryag-ag__title {
        font-size: 17px;
    }
}
