/* ── Enroute Blocks Frontend CSS ─────────────────────────────────────────── */

.ebl-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 1350px;
    margin: 0 auto;
}
@media (max-width: 900px) { .ebl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .ebl-grid { grid-template-columns: 1fr; } }

/* All rows the same height (= tallest card); every block stretches to fill its row.
   Not on phones, where the blocks are stacked in one column. */
@media (min-width: 601px) {
    .ebl-grid { grid-auto-rows: 1fr; align-items: stretch; }
}

.ebl-span2 { grid-column: span 2; }
@media (max-width: 600px) { .ebl-span2 { grid-column: span 1; } }

/* ── Standard card (offer / blog / guide) ─────────────────────────────────── */
.ebl-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}
.ebl-card:hover { text-decoration: none; }

/* Image box */
.ebl-img {
    display: block;
    width: 100%;
    aspect-ratio: 434 / 280;
    overflow: hidden;
    background: #c2dcef;
    position: relative;
    flex-shrink: 0;
}
.ebl-img img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border: none;
    margin: 0;
    padding: 0;
}


/* Band */
.ebl-band {
    display: block;
    padding: 0.75rem 1rem 1rem;
    flex: 1;
}
.ebl-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(0,0,0,0.6);
    font-family: Montserrat, sans-serif;
    line-height: 1.4;
    margin: 0;
    text-decoration: none;
}
.ebl-title {
    display: block;
    margin: 0;
    padding-top: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    color: #111827;
    font-family: Montserrat, sans-serif;
    text-decoration: none;
}
.ebl-subtitle {
    display: block;
    margin: 0;
    padding-top: 8px;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #1f2937;
    font-family: Montserrat, sans-serif;
    text-decoration: none;
}

/* Remove underline from ALL links inside the grid */
.ebl-grid a,
.ebl-grid a:hover,
.ebl-grid a:visited {
    text-decoration: none;
}

/* ── Custom wide card ────────────────────────────────────────────────────── */
.ebl-card--custom {
    display: flex;
    flex-direction: row;
    overflow: hidden;
}
.ebl-custom-img {
    flex: 0 0 50%;
    width: 50%;
    overflow: hidden;
    background: #e5e7eb;
    position: relative;
}
.ebl-custom-img img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
.ebl-custom-text {
    flex: 1;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* title/text at the top */
    overflow: hidden;
}
.ebl-custom-title {
    margin: 0 0 12px;
    padding-top: 0 !important;
    margin-top: 0 !important;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: Montserrat, sans-serif;
    line-height: 1.2;
    color: #111;
    text-decoration: none;
}
.ebl-custom-desc {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #1f2937;
    font-family: Montserrat, sans-serif;
}
.ebl-custom-desc p { margin: 0 0 12px; }
.ebl-custom-desc p:last-child { margin-bottom: 0; }

@media (max-width: 600px) {
    .ebl-card--custom { flex-direction: column; }
    .ebl-custom-img { flex: none; width: 100%; padding-top: 56.25%; }
}

/* Guide card: image fills full card, band overlaid at bottom */
.ebl-card--guide {
    position: relative;
    /* Establish height same as offer card image ratio */
    padding-top: calc(100% * 280 / 434);
}
/* Image fills the entire card */
.ebl-card--guide .ebl-img {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: unset;
    flex-shrink: 0;
}
.ebl-card--guide .ebl-img img {
    object-position: center top;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0; left: 0;
}
/* Band sits over the bottom of the image */
.ebl-card--guide .ebl-band {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    flex: none;
}
.ebl-card--guide .ebl-title {
    padding-top: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ebl-guide-link {
    display: block;
    text-align: right;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111 !important;
    text-decoration: none !important;
    font-family: Montserrat, sans-serif;
    margin-top: 0.5rem;
}

/* Custom block link */
.ebl-custom-link {
    display: block;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0,0,0,0.2);
    font-size: 0.875rem;
    font-weight: 600;
    color: #111;
    text-decoration: none;
    font-family: Montserrat, sans-serif;
}
.ebl-custom-link:hover { text-decoration: underline; }

/* Override theme prose styles inside grid */
.ebl-custom-img img {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
.ebl-custom-title {
    margin-block-end: 12px !important;
}

/* Placeholder */
.ebl-placeholder {
    padding: 2rem;
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    text-align: center;
    color: #6b7280;
    font-family: Montserrat, sans-serif;
    font-size: 0.9rem;
}

/* Event card: image + band; title/meta at top, link to events page at the bottom */
.ebl-card--event .ebl-img { text-decoration: none; }
.ebl-card--event .ebl-band {
    display: flex;
    flex-direction: column;
}
/* Event title is a link: same look as the offer title (.ebl-title), unaffected by theme/prose link styles */
.ebl-grid .ebl-card--event a.ebl-title,
.ebl-grid .ebl-card--event a.ebl-title:hover,
.ebl-grid .ebl-card--event a.ebl-title:visited {
    display: block !important;
    margin: 0 !important;
    padding-top: 12px !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    color: #111827 !important;
    font-family: Montserrat, sans-serif !important;
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
}
.ebl-card--event .ebl-guide-link {
    margin-top: auto;
    padding-top: 0.75rem;
}

/* ── Slideshow (above the grid) ─────────────────────────────────────────────
   Text panel = width of one grid column, image = the other two columns. */
.ebl-slideshow {
    position: relative;
    max-width: 1350px;
    margin: 0 auto 1rem;
    display: grid;
    overflow: hidden;
}
.ebl-slide {
    grid-area: 1 / 1;                 /* all slides stacked, fade between them */
    display: grid;
    grid-template-columns: calc((100% - 2rem) / 3) 1fr;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s;
}
.ebl-slide.is-active { opacity: 1; visibility: visible; }
.ebl-slide-text {
    display: flex;
    align-items: center;
    padding: 2rem 2rem 3.5rem;
    box-sizing: border-box;
}
.ebl-slide-inner { width: 100%; }
.ebl-slideshow .ebl-slide-title {
    margin: 0 0 1.25rem !important;
    font-family: Montserrat, sans-serif;
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.25;
    color: #111;
}
.ebl-slideshow .ebl-slide-title a { color: inherit !important; text-decoration: none !important; }
.ebl-slideshow .ebl-slide-title a:hover { text-decoration: underline !important; }
.ebl-slide-body {
    font-family: Montserrat, sans-serif;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #111;
}
.ebl-slide-body p { margin: 0 0 1em; }
.ebl-slide-body p:last-child { margin-bottom: 0; }
.ebl-slide-body a { color: inherit; text-decoration: underline; }
/* Image fills the full slide height (also when the text is taller);
   the ::before keeps the 1264:690 proportion as minimum height. */
.ebl-slide-img {
    position: relative;
    background: #e5e7eb;
    overflow: hidden;
}
.ebl-slide-img::before {
    content: '';
    display: block;
    padding-top: calc(690 / 1264 * 100%);
}
.ebl-slide-img a { position: absolute; inset: 0; display: block; }
.ebl-slide-img img {
    position: absolute; inset: 0;
    width: 100%; height: 100% !important;
    max-width: none;
    object-fit: cover; object-position: center;
    display: block; margin: 0 !important;
}
/* Dots: bars at the bottom of the text panel */
.ebl-slide-dots {
    position: absolute;
    left: 0; bottom: 1rem;
    width: calc((100% - 2rem) / 3);
    display: flex; justify-content: center; gap: 0.35rem;
    z-index: 2;
}
.ebl-slide-dot {
    width: 2.25rem; height: 5px;
    padding: 0; border: none; border-radius: 0;
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
}
.ebl-slide-dot.is-active { background: rgba(0, 0, 0, 0.6); }
@media (max-width: 900px) {
    .ebl-slide { grid-template-columns: calc((100% - 1rem) / 2) 1fr; }
    .ebl-slide-dots { width: calc((100% - 1rem) / 2); }
}
@media (max-width: 600px) {
    .ebl-slide { grid-template-columns: 1fr; }
    .ebl-slide-img { order: -1; }       /* image on top, text below */
    .ebl-slide-dots { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .ebl-slide { transition: none; } }

/* ── Logo carousel ─────────────────────────────────────────────────────────── */
.ebl-logos {
    width: 100%;
    margin: 2.5rem 0 0;
    padding: 1.75rem 0;
    box-sizing: border-box;
}
.ebl-logos.has-lines { border-top: 1px solid #111; border-bottom: 1px solid #111; }
.ebl-logos-viewport { overflow: hidden; width: 100%; }
.ebl-logos-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: max-content;
    min-width: 100%;
}
.ebl-logos.is-scrolling .ebl-logos-track {
    justify-content: flex-start;
    min-width: 0;
    will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
    .ebl-logos.is-scrolling .ebl-logos-viewport { overflow-x: auto; }
}
.ebl-logo { flex: 0 0 auto; margin: 0 !important; padding: 0 !important; list-style: none !important; }
.ebl-logo::before { content: none !important; }
.ebl-logo a { display: block; line-height: 0; }
.ebl-logo img {
    display: block;
    height: auto;
    width: auto;
    max-height: 5.5rem;
    max-width: 11rem;
    object-fit: contain;
}
@media (max-width: 600px) {
    .ebl-logos-track { gap: 2rem; }
    .ebl-logo img { max-height: 4rem; max-width: 8rem; }
}
