.gtexd-event-hub {
    width: 100%;
    margin: 0;
    padding: 32px;
}

/* Header: geometria specifica Event Hub; colori/tipografia arrivano da GTExD UI Core. */
.gtexd-event-hub__hero {
    padding: 0 0 36px;
    margin-bottom: 28px;
}

.gtexd-event-hub__hero h1 {
    color: #F5F5F5;
    font-size: 32px;
    line-height: 1;
    text-transform: uppercase;
}

.gtexd-event-hub__hero p {
    margin: 26px 0 0;
    line-height: 1.45;
}

/* La colonna del prossimo evento non deve più allungarsi fino al fondo del calendario. */
.gtexd-event-hub__primary {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr);
    gap: 20px;
    align-items: start;
}

.gtexd-event-hub__calendar-shell,
.gtexd-event-hub__next,
.gtexd-event-hub__selected,
.gtexd-event-hub__upcoming {
    background: var(--gtexd-color-surface);
}

.gtexd-event-hub__calendar-shell { overflow: hidden; }

.gtexd-event-hub__calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: var(--gtexd-panel);
    border-bottom: 1px solid var(--gtexd-line);
}

.gtexd-event-hub__calendar-toolbar h2 {
    margin: 0;
    flex: 1;
    font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
    font-size: 27px;
    line-height: 1;
    letter-spacing: .03em;
    color: #fff;
}

.gtexd-event-hub__calendar-toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.gtexd-event-hub__nav,
.gtexd-event-hub__today {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    border: 1px solid #43505f !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #fff !important;
    min-width: 38px;
    height: 34px;
    box-shadow: none !important;
    cursor: pointer;
    vertical-align: middle;
}

.gtexd-event-hub__nav {
    width: 38px;
    padding: 0 !important;
    font-size: 22px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-indent: 0 !important;
}
.gtexd-event-hub__today { padding: 0 12px !important; font-size: 11px !important; font-weight: 800 !important; letter-spacing: .05em; line-height: 1 !important; }
.gtexd-event-hub__nav:hover,
.gtexd-event-hub__today:hover { border-color: var(--gtexd-red) !important; color: var(--gtexd-red) !important; }

.gtexd-event-hub__weekdays,
.gtexd-event-hub__calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.gtexd-event-hub__weekdays {
    background: #131820;
    border-bottom: 1px solid var(--gtexd-line);
}

.gtexd-event-hub__weekdays span {
    padding: 9px 6px;
    text-align: center;
    font-size: 10px;
    color: var(--gtexd-muted);
    font-weight: 800;
    letter-spacing: .06em;
}

.gtexd-event-hub__day {
    position: relative;
    min-height: 92px;
    padding: 9px 8px;
    border-right: 1px solid #242c35;
    border-bottom: 1px solid #242c35;
    background: #10151a;
    overflow: hidden;
}

.gtexd-event-hub__day:nth-child(7n) { border-right: 0; }
.gtexd-event-hub__day.is-outside { opacity: .34; }
.gtexd-event-hub__day.is-today { box-shadow: inset 0 0 0 1px var(--gtexd-red); }

.gtexd-event-hub__day-number {
    color: #dfe3e8;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.gtexd-event-hub__day-events { display: grid; gap: 4px; }

.gtexd-event-hub__cal-event,
.gtexd-event-hub button.gtexd-event-hub__cal-event {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 2px 1px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 2px !important;
    box-shadow: none !important;
    color: #edf1f5 !important;
    cursor: pointer;
    text-align: left !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    text-transform: none !important;
}
.gtexd-event-hub__cal-event:hover,
.gtexd-event-hub__cal-event:focus {
    background: rgba(207,32,39,.09) !important;
    color: #fff !important;
    outline: none !important;
}
.gtexd-event-hub__cal-dot {
    display: block;
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    margin-top: 2px;
    border: 1.5px solid var(--gtexd-red);
    border-radius: 50%;
    background: transparent;
}
.gtexd-event-hub__cal-event.is-official .gtexd-event-hub__cal-dot { background: var(--gtexd-red); }
.gtexd-event-hub__cal-event.is-external .gtexd-event-hub__cal-dot { background: transparent; }
.gtexd-event-hub__cal-copy {
    display: block;
    min-width: 0;
    flex: 1 1 auto;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: normal;
}
.gtexd-event-hub__cal-title {
    display: inline;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}
.gtexd-event-hub__cal-time,
.gtexd-event-hub__cal-round {
    display: inline;
    margin-right: 4px;
    color: #aeb7c1;
    font-size: .92em;
    font-weight: 500;
}
.gtexd-event-hub__cal-round { color: #d8dde3; font-weight: 700; }

.gtexd-event-hub__more {
    border: 0;
    background: transparent;
    color: var(--gtexd-muted);
    padding: 2px 0;
    font-size: 9px;
    cursor: pointer;
    text-align: left;
}

.gtexd-event-hub__legend {
    display: flex;
    gap: 18px;
    padding: 11px 14px;
    background: var(--gtexd-panel);
    color: var(--gtexd-muted);
    font-size: 10px;
}
.gtexd-event-hub__legend span { display: inline-flex; gap: 7px; align-items: center; }
.gtexd-event-hub__legend i { width: 8px; height: 8px; display: inline-block; border-radius: 50%; flex: 0 0 8px; }
.gtexd-event-hub__legend i.is-official { background: var(--gtexd-red); border: 1px solid var(--gtexd-red); }
.gtexd-event-hub__legend i.is-external { border: 1.5px solid var(--gtexd-red); background: transparent; }

.gtexd-event-hub__next { padding: 18px; align-self: start; }

/* CARD: struttura base, border e surface arrivano da GTExD UI Core. */
.gtexd-event-card { cursor: pointer; }
.gtexd-event-card:focus { outline: none; }

.gtexd-event-card__visual { min-height: 0; }

.gtexd-event-hub__selected-visual {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(224,36,43,.14), rgba(0,0,0,.08) 48%, rgba(0,0,0,.64)),
        radial-gradient(circle at 70% 25%, #26313d 0, #151c23 36%, #0c1014 75%);
    border-bottom: 1px solid var(--gtexd-line);
}

.gtexd-event-card__visual::after,
.gtexd-event-hub__selected-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(5,7,10,.04) 0%, rgba(5,7,10,.02) 55%, rgba(5,7,10,.48) 100%);
}

.gtexd-event-card__cover {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.gtexd-event-card__visual-fallback {
    position: absolute;
    left: 18px;
    bottom: 16px;
    z-index: 2;
    color: rgba(255,255,255,.78);
    font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .04em;
}

.gtexd-event-card__brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-height: 36px;
    padding: 5px 9px;
    background: rgba(7,9,12,.90);
    border: 1px solid #343e49;
    backdrop-filter: blur(3px);
}

.gtexd-event-card__visual > .gtexd-event-card__brand,
.gtexd-event-hub__selected-visual > .gtexd-event-card__brand {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
}

.gtexd-event-card__track-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    height: 36px;
    min-height: 36px;
    max-width: 132px;
    padding: 4px 8px;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(255,255,255,.58);
    box-shadow: 0 4px 16px rgba(0,0,0,.22);
    backdrop-filter: blur(2px);
}
.gtexd-event-card__track-badge img {
    display: block;
    width: auto;
    height: auto;
    max-width: 116px;
    max-height: 24px;
    object-fit: contain;
}

.gtexd-event-card__brand.is-logo img {
    display: block;
    width: auto;
    max-width: 105px;
    max-height: 24px;
    object-fit: contain;
}
.gtexd-event-card__brand.is-gran-turismo-logo img {
    max-width: 118px;
    max-height: 25px;
    filter: brightness(0) invert(1);
}
.gtexd-event-card__brand.is-text {
    color: #fff;
    border-color: var(--gtexd-red);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
}

.gtexd-event-card__body { padding: 16px; }

/* Il titolo usa il componente tipografico Core; qui resta solo lo spacing Event Hub. */
.gtexd-event-card__event-title,
.gtexd-event-hub__selected-title {
    display: block !important;
    margin-bottom: 13px !important;
    padding: 0 !important;
    background: transparent !important;
    text-transform: none !important;
}

.gtexd-event-card__meta span { color: #fff; width: 16px; text-align: center; flex: 0 0 16px; }
.gtexd-event-card__body p { color: var(--gtexd-muted); line-height: 1.5; font-size: 13px; margin: 14px 0 18px; }

/* Evento selezionato: immagine pulita a sinistra, dati a destra. */
.gtexd-event-hub__selected {
    margin-top: 20px;
    padding: 20px;
    scroll-margin-top: 90px;
}
.gtexd-event-hub__selected[hidden] { display: none !important; }

.gtexd-event-hub__selected-card {
    display: grid;
    grid-template-columns: minmax(340px, .9fr) minmax(0, 1.7fr);
    align-items: stretch;
}
.gtexd-event-hub__selected-visual {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    min-height: 255px;
    border-bottom: 0;
    border-right: 1px solid var(--gtexd-line);
}
.gtexd-event-hub__selected-body { padding: 24px 26px; }
.gtexd-event-hub__selected-topline { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.gtexd-event-hub__selected-topline .gtexd-event-card__brand { position: static; }
.gtexd-event-hub__selected-title { font-size: 31px !important; margin-bottom: 15px !important; }
.gtexd-event-hub__selected-meta { display: flex; flex-wrap: wrap; gap: 5px 20px; }
.gtexd-event-hub__selected-body > p { color: #b8c1cc; line-height: 1.6; font-size: 14px; }
.gtexd-event-hub__selected-organizer { margin: 16px 0; color: var(--gtexd-muted); font-size: 12px; }
.gtexd-event-hub__selected-actions { margin-top: 20px; }


.gtexd-event-hub__upcoming { margin-top: 20px; padding: 20px; }
.gtexd-event-hub__cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.gtexd-event-hub__cards .gtexd-event-card { height: 100%; display: flex; flex-direction: column; }
.gtexd-event-hub__cards .gtexd-event-card__visual { aspect-ratio: 16 / 9; }
.gtexd-event-hub__cards .gtexd-event-card__body { display: flex; flex-direction: column; flex: 1; }
.gtexd-event-hub__cards .gtexd-event-card__event-title { font-size: 24px !important; }
.gtexd-event-hub__cards .gtexd-event-hub__button { margin-top: auto; align-self: flex-start; }

.gtexd-event-card--featured .gtexd-event-card__visual { aspect-ratio: 16 / 9; }
.gtexd-event-card--featured .gtexd-event-card__event-title { font-size: 29px !important; }

.gtexd-event-hub__empty,
.gtexd-event-hub-error {
    padding: 26px;
    border: 1px solid var(--gtexd-line, #303945);
    background: #11161c;
    color: #9ba6b4;
}

@media (max-width: 1050px) {
    .gtexd-event-hub__primary { grid-template-columns: 1fr; }
    .gtexd-event-hub__next { order: 2; }
    .gtexd-event-hub__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .gtexd-event-hub { padding: 18px; }
    .gtexd-event-hub__day { min-height: 76px; padding: 6px 5px; }
    .gtexd-event-hub__day-number { font-size: 10px; }
    .gtexd-event-hub__cal-event,
    .gtexd-event-hub button.gtexd-event-hub__cal-event { gap: 4px !important; padding: 2px 0 !important; font-size: 8px !important; line-height: 1.2 !important; }
    .gtexd-event-hub__cal-dot { flex-basis: 6px; width: 6px; height: 6px; margin-top: 2px; }
    .gtexd-event-hub__cal-time,
    .gtexd-event-hub__cal-round { margin-right: 3px; }
    .gtexd-event-hub__legend { flex-wrap: wrap; }
    .gtexd-event-hub__selected-card { grid-template-columns: 1fr; }
    .gtexd-event-hub__selected-visual { min-height: 0; aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--gtexd-line); }
    .gtexd-event-hub__cards { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .gtexd-event-hub { padding: 14px; }
    .gtexd-event-hub__hero h1 { font-size: 32px; }
    .gtexd-event-hub__calendar-toolbar { padding: 12px; }
    .gtexd-event-hub__calendar-toolbar h2 { font-size: 21px; }
    .gtexd-event-hub__today { display: none; }
    .gtexd-event-hub__day { min-height: 62px; }
    .gtexd-event-hub__weekdays span { font-size: 8px; padding: 7px 2px; }
    .gtexd-event-hub__next,
    .gtexd-event-hub__selected,
    .gtexd-event-hub__upcoming { padding: 14px; }
}


@media (max-width: 640px) {
    .gtexd-event-card__track-badge {
        top: 10px;
        left: 10px;
        max-width: 108px;
        min-height: 30px;
        padding: 4px 6px;
    }
    .gtexd-event-card__track-badge img {
        max-width: 94px;
        max-height: 34px;
    }
}


/* Abbonamento al calendario pubblico GTExD. */
.gtexd-event-hub__subscribe {
    margin-top: 20px;
    padding: 20px;
    background: var(--gtexd-color-surface);
}

.gtexd-event-hub__subscribe-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    padding: 24px;
}

.gtexd-event-hub__subscribe-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin: 0 auto;
    border: 2px solid var(--gtexd-red);
    border-radius: 50%;
    color: var(--gtexd-red);
}
.gtexd-event-hub__subscribe-icon svg {
    width: 36px;
    height: 36px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.gtexd-event-hub__subscribe-icon svg path:last-child { fill: currentColor; stroke: none; }

.gtexd-event-hub__subscribe-title {
    margin: 0 0 7px;
    color: #fff;
    font-family: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.05;
    text-transform: uppercase;
}
.gtexd-event-hub__subscribe-copy p {
    max-width: 820px;
    margin: 0 0 18px;
    color: #b8c1cc;
    font-size: 13px;
    line-height: 1.55;
}
.gtexd-event-hub__subscribe-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 16px;
}
.gtexd-event-hub__ical-copy,
.gtexd-event-hub button.gtexd-event-hub__ical-copy {
    appearance: none !important;
    -webkit-appearance: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #cbd2d9 !important;
    cursor: pointer;
    font-family: Inter, Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: .04em !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
    text-transform: uppercase !important;
}
.gtexd-event-hub__ical-copy:hover,
.gtexd-event-hub__ical-copy:focus { color: #fff !important; outline: none !important; }
.gtexd-event-hub__ical-status {
    min-height: 1em;
    color: #9ba6b4;
    font-size: 11px;
}

.gtexd-event-hub__subscribe-help {
    margin-top: 10px;
    color: #7f8996;
    font-size: 11px;
    line-height: 1.45;
}

@media (max-width: 760px) {
    .gtexd-event-hub__subscribe-card { grid-template-columns: 1fr; text-align: center; }
    .gtexd-event-hub__subscribe-copy p { margin-left: auto; margin-right: auto; }
    .gtexd-event-hub__subscribe-actions { justify-content: center; }
}

@media (max-width: 520px) {
    .gtexd-event-hub__subscribe { padding: 14px; }
    .gtexd-event-hub__subscribe-card { padding: 18px 14px; gap: 16px; }
    .gtexd-event-hub__subscribe-icon { width: 64px; height: 64px; }
    .gtexd-event-hub__subscribe-title { font-size: 22px; }
}
