:root {
    --cmp-blue: #15267e;
    --cmp-blue-strong: #0f1b57;
    --cmp-red: #ff385c;
    --cmp-bg: #f3f6fb;
    --cmp-line: #dbe4f0;
    --cmp-text: #163057;
    --cmp-muted: #64748b;
    --cmp-white: #ffffff;
    --cmp-past: #d9dee8;
    --cmp-shadow: 0 18px 48px rgba(21, 38, 126, 0.12);
    --cmp-radius-xl: 30px;
    --cmp-radius-lg: 22px;
    --cmp-radius-md: 16px;
}

.cmp-home,
.cmp-hub,
.cmp-event-single {
    color: var(--cmp-text);
}

.cmp-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.cmp-section-heading h1,
.cmp-section-heading h2 {
    margin: 0;
    color: var(--cmp-blue);
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 900;
    line-height: 1.05;
}

.cmp-section-heading p {
    margin: 8px 0 0;
    max-width: 760px;
    color: var(--cmp-muted);
}

.cmp-section-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(21, 38, 126, 0.08);
    color: var(--cmp-blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cmp-link-more {
    color: var(--cmp-blue);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.cmp-nav-btn,
.cmp-scroll-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    background: var(--cmp-blue);
    color: var(--cmp-white);
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(21, 38, 126, 0.18);
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.cmp-nav-btn:hover,
.cmp-scroll-btn:hover {
    transform: translateY(-1px);
}

.cmp-nav-btn:disabled,
.cmp-scroll-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.cmp-empty-state {
    padding: 18px;
    border-radius: var(--cmp-radius-lg);
    border: 1px dashed var(--cmp-line);
    background: rgba(255, 255, 255, 0.8);
    color: var(--cmp-muted);
    text-align: center;
}

.cmp-empty-state--panel,
.cmp-empty-state--month,
.cmp-empty-state--month-search {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cmp-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.cmp-card {
    position: relative;
    display: flex;
    gap: 14px;
    align-items: center;
    min-height: 122px;
    border-radius: 999px;
    border: 3px solid var(--cmp-blue);
    background: var(--cmp-white);
    box-sizing: border-box;
    box-shadow: 0 10px 24px rgba(21, 38, 126, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
}

.cmp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(21, 38, 126, 0.12);
}

.cmp-card--compact {
    min-width: 380px;
    max-width: 380px;
}

.cmp-card--full {
    width: 100%;
}

.cmp-card__logo-wrap {
    width: 112px;
    min-width: 112px;
    display: flex;
    justify-content: center;
    margin-left: -4px;
}

.cmp-card__logo {
    width: 108px;
    height: 108px;
    border-radius: 999px;
    border: 3px solid var(--cmp-blue);
    background: var(--cmp-white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.cmp-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: var(--cmp-white);
}

.cmp-card__logo.no-image span {
    color: var(--cmp-blue);
    font-size: 14px;
    font-weight: 800;
}

.cmp-card__body {
    flex: 1;
    min-width: 0;
    padding: 14px 22px 14px 0;
}

.cmp-card__badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.cmp-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cmp-pill--cmp {
    background: rgba(21, 38, 126, 0.1);
    color: var(--cmp-blue);
}

.cmp-pill--status {
    background: rgba(21, 38, 126, 0.08);
    color: var(--cmp-blue);
}

.cmp-pill--en-curso {
    background: rgba(255, 56, 92, 0.16);
    color: #9f1239;
}

.cmp-pill--pasado {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.cmp-card__title {
    margin: 0 0 8px;
    color: inherit;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.15;
}

.cmp-card__date,
.cmp-card__place {
    color: inherit;
    font-size: 13px;
    line-height: 1.3;
}

.cmp-card__place {
    margin-top: 2px;
    margin-bottom: 4px;
    opacity: 0.9;
}

.cmp-card__date {
    opacity: 0.92;
}

.cmp-card--futuro {
    background: var(--cmp-white);
    border-color: var(--cmp-blue);
}

.cmp-card--pasado {
    background: var(--cmp-past);
    border-color: #b9c3d2;
    color: var(--cmp-blue);
}

.cmp-card--pasado .cmp-card__logo {
    border-color: #b9c3d2;
}

.cmp-card--en-curso {
    background: var(--cmp-blue);
    border-color: var(--cmp-red);
    color: var(--cmp-white);
    animation: cmpPulse 1.25s ease-in-out infinite;
}

.cmp-card--en-curso .cmp-card__logo {
    border-color: var(--cmp-red);
    box-shadow: 0 0 0 8px rgba(255, 56, 92, 0.16);
}

.cmp-card--cmp::after {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px dashed rgba(21, 38, 126, 0.18);
    border-radius: 999px;
    pointer-events: none;
}

.cmp-card--en-curso.cmp-card--cmp::after {
    border-color: rgba(255, 255, 255, 0.28);
}

.cmp-home {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 10px 8px;
}

.cmp-home__toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 14px;
}

.cmp-home__labels {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.cmp-home__label {
    min-width: 120px;
    text-align: center;
    color: var(--cmp-blue);
}

.cmp-home__label--side {
    font-size: 14px;
    font-weight: 600;
}

.cmp-home__label--current {
    min-width: 210px;
    padding: 12px 24px;
    border-radius: 999px;
    background: var(--cmp-blue);
    color: var(--cmp-white);
    font-size: 22px;
    font-weight: 900;
    box-shadow: 0 14px 30px rgba(21, 38, 126, 0.16);
}

.cmp-home__viewport {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 12px;
    align-items: center;
}

.cmp-home__panels {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.cmp-home__panel {
    display: none;
    min-width: 0;
    overflow: hidden;
}

.cmp-home__panel.is-active {
    display: block;
}

.cmp-home__track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 6px 2px 10px;
    scrollbar-width: none;
    scroll-behavior: smooth;
    min-width: 0;
}

.cmp-home__track > .cmp-card-link {
    flex: 0 0 auto;
}

.cmp-home__track::-webkit-scrollbar {
    display: none;
}

.cmp-hub {
    max-width: 1500px;
    margin: 0 auto;
    padding: 10px 14px 20px;
}

.cmp-section-heading--hub {
    margin-bottom: 20px;
}

.cmp-hub__toolbar,
.cmp-hub__year-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cmp-hub__toolbar {
    justify-content: space-between;
    margin-bottom: 14px;
}

.cmp-hub__year-pills {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cmp-year-pill {
    padding: 10px 16px;
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(21, 38, 126, 0.04);
    color: var(--cmp-blue);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.cmp-year-pill.is-active {
    background: var(--cmp-blue);
    border-color: #93c5fd;
    color: var(--cmp-white);
    box-shadow: 0 12px 24px rgba(21, 38, 126, 0.16);
}

.cmp-hub__search {
    min-width: 280px;
}

.cmp-hub__search-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--cmp-line);
    border-radius: 999px;
    box-sizing: border-box;
}

.cmp-hub__block-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.cmp-hub__board {
    display: none;
}

.cmp-hub__board.is-active {
    display: block;
}

.cmp-hub__months {
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.cmp-hub__months.is-active {
    display: grid;
}

.cmp-hub__month {
    border: 2px solid var(--cmp-blue);
    border-radius: var(--cmp-radius-xl);
    background: var(--cmp-white);
    overflow: hidden;
    min-height: 740px;
}

.cmp-hub__month-head {
    min-height: 72px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cmp-blue);
    color: var(--cmp-white);
    font-size: 22px;
    font-weight: 900;
    text-align: center;
}

.cmp-hub__month--past-month {
    border-color: #98a3c4;
    background: #eef2f8;
}

.cmp-hub__month--past-month .cmp-hub__month-head {
    background: #66728d;
}

.cmp-hub__month--current-month {
    box-shadow: var(--cmp-shadow);
}

.cmp-hub__month-body {
    padding: 18px;
}

.cmp-hub__month-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cmp-event-single {
    max-width: 1240px;
    margin: 0 auto;
    padding: 22px 14px 40px;
}

.cmp-event-single__hero {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 28px;
    margin-bottom: 28px;
    padding: 24px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(21, 38, 126, 0.05), rgba(255, 255, 255, 0.95));
    border: 1px solid var(--cmp-line);
}

.cmp-event-single__media {
    display: flex;
    align-items: start;
    justify-content: center;
}

.cmp-event-single__logo {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
    border-radius: 28px;
    border: 1px solid var(--cmp-line);
    background: var(--cmp-white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cmp-event-single__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cmp-event-single__title {
    margin: 0 0 14px;
    color: var(--cmp-blue);
    font-size: clamp(32px, 3vw, 48px);
    line-height: 1.05;
}

.cmp-event-single__summary {
    margin: 0 0 18px;
    color: var(--cmp-muted);
    font-size: 16px;
    line-height: 1.6;
}

.cmp-event-single__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.cmp-event-single__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.cmp-event-single__meta-item {
    padding: 14px 16px;
    border-radius: var(--cmp-radius-md);
    background: var(--cmp-white);
    border: 1px solid var(--cmp-line);
}

.cmp-event-single__meta-label {
    display: block;
    margin-bottom: 6px;
    color: var(--cmp-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cmp-event-single__links,
.cmp-event-single__share,
.cmp-event-single__related-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cmp-event-single__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid var(--cmp-line);
    background: var(--cmp-white);
    color: var(--cmp-blue);
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
}

.cmp-event-single__button--primary {
    background: var(--cmp-blue);
    border-color: var(--cmp-blue);
    color: var(--cmp-white);
}

.cmp-event-single__button--registration {
    background: linear-gradient(135deg, #ff4a66, #ff244b);
    border-color: #ff244b;
    color: var(--cmp-white);
    box-shadow: 0 12px 24px rgba(255, 36, 75, 0.22);
}

.cmp-event-single__content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
    gap: 24px;
}

.cmp-event-single__content-grid--single {
    grid-template-columns: 1fr;
}

.cmp-event-single__sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.cmp-event-single__panel {
    padding: 22px;
    border-radius: 24px;
    border: 1px solid var(--cmp-line);
    background: var(--cmp-white);
}

.cmp-event-single__panel h2,
.cmp-event-single__panel h3 {
    margin-top: 0;
    color: var(--cmp-blue);
}

.cmp-event-map {
    width: 100%;
    height: 320px;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 14px;
}

.cmp-event-single__related {
    margin-top: 28px;
}

.cmp-event-single__credit {
    margin-top: 30px;
    padding: 20px 12px 8px;
    display: flex;
    justify-content: center;
    width: 100%;
    text-align: center;
    color: var(--cmp-blue);
    font-size: 13px;
    font-weight: 700;
}

.cmp-event-single__related-grid .cmp-card-link {
    flex: 1 1 280px;
}

@keyframes cmpPulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 56, 92, 0.42), 0 10px 24px rgba(21, 38, 126, 0.12);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 56, 92, 0.12), 0 18px 34px rgba(21, 38, 126, 0.16);
    }
}

@media (max-width: 1100px) {
    .cmp-hub__months.is-active {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cmp-event-single__content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .cmp-home {
        max-width: 100%;
        padding: 10px 0 8px;
        overflow: hidden;
    }

    .cmp-section-heading {
        align-items: stretch;
    }

    .cmp-home .cmp-section-heading {
        padding: 0 14px;
    }

    /* Toolbar: botones pequeños + label centrado */
    .cmp-home__toolbar {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 8px;
        align-items: center;
        margin-bottom: 12px;
        padding: 0 14px;
    }

    .cmp-home__month-prev {
        grid-column: 1;
        grid-row: 1;
        justify-self: center;
    }

    .cmp-home__labels {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center;
        gap: 0;
    }

    .cmp-home__month-next {
        grid-column: 3;
        grid-row: 1;
        justify-self: center;
    }

    .cmp-home__label--side {
        display: none !important;
    }

    .cmp-home__viewport {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .cmp-scroll-btn {
        display: none;
    }

    .cmp-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }

    .cmp-home__label--current {
        min-width: auto;
        width: auto;
        max-width: 100%;
        padding: 10px 16px;
        font-size: clamp(16px, 5vw, 20px);
        line-height: 1.15;
        white-space: nowrap;
    }

    .cmp-home__track {
        gap: 12px;
        padding: 8px 14px 12px;
        scroll-padding: 0 14px;
    }

    /* Cada tarjeta ocupa casi todo el ancho visible */
    .cmp-home__track > .cmp-card-link {
        flex: 0 0 auto;
        width: calc(100vw - 56px);
        max-width: 320px;
    }

    /* Tarjeta compacta: quitar el min-width del diseño escritorio */
    .cmp-card--compact {
        min-width: 0;
    }

    /* Tarjeta: forzar layout horizontal y esquinas normales */
    .cmp-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        border-radius: 20px;
        min-height: 0;
        padding: 10px;
        gap: 10px;
    }

    /* Logo: tamaño fijo, sin margen negativo del diseño píldora */
    .cmp-card__logo-wrap {
        flex: 0 0 80px;
        width: 80px;
        min-width: 80px;
        max-width: 80px;
        margin-left: 0;
    }

    .cmp-card__logo {
        width: 76px;
        height: 76px;
    }

    /* Cuerpo: toma el espacio restante, sin desbordamiento */
    .cmp-card__body {
        flex: 1 1 0%;
        min-width: 0;
        overflow: hidden;
        padding: 4px 0;
    }

    .cmp-card__title {
        font-size: 14px;
    }

    .cmp-card__date,
    .cmp-card__place {
        font-size: 12px;
    }

    .cmp-card--cmp::after {
        inset: 4px;
        border-radius: 15px;
    }

    .cmp-hub__months.is-active {
        grid-template-columns: 1fr;
    }

    .cmp-hub__month {
        min-height: auto;
    }

    .cmp-event-single__hero {
        grid-template-columns: 1fr;
    }

    .cmp-event-single__meta {
        grid-template-columns: 1fr;
    }

    .cmp-event-single__sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .cmp-card--compact {
        min-width: 0;
    }

    .cmp-card--full {
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }

    .cmp-card {
        gap: 10px;
        min-height: 0;
        padding: 12px;
        border-radius: 28px;
    }

    .cmp-card__logo-wrap {
        width: 82px;
        min-width: 82px;
        margin-left: 0;
    }

    .cmp-card__logo {
        width: 78px;
        height: 78px;
    }

    .cmp-card__body {
        padding: 4px 2px;
    }

    .cmp-card__badges {
        gap: 6px;
        margin-bottom: 6px;
    }

    .cmp-pill {
        min-height: 23px;
        padding: 3px 8px;
        font-size: 9.5px;
    }

    .cmp-card__title {
        margin-bottom: 6px;
        font-size: 15px;
        line-height: 1.18;
    }

    .cmp-card__date,
    .cmp-card__place {
        font-size: 12px;
        line-height: 1.25;
    }

    .cmp-card--cmp::after {
        inset: 5px;
        border-radius: 24px;
    }

    .cmp-section-heading,
    .cmp-hub__toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .cmp-hub {
        padding-left: 10px;
        padding-right: 10px;
    }

    .cmp-hub__month-body {
        padding: 14px;
    }

    .cmp-event-single {
        padding-left: 10px;
        padding-right: 10px;
    }

    .cmp-event-single__hero,
    .cmp-event-single__panel {
        padding: 18px;
        border-radius: 22px;
    }
}
