/* =========================
  Events Hub (scoped-ish)
  ========================= */
:root {
    --bg: #f6f7fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e5e7eb;
    --soft: #f1f5f9;
    --accent: #2563eb;
    --shadow: 0 10px 30px rgba(15,23,42,.10);
    --shadow2: 0 20px 50px rgba(15,23,42,.16);
    --r: 14px;
    --r2: 10px;
    --pad: 18px;
    --gap: 14px;
    --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

/* =========================
  COMPACT OVERRIDES
  (reduces "opened up" spacing)
  ========================= */
/* calendar spacing */
.cal-grid {
    border-spacing: 4px;
}

    .cal-grid td {
        height: 120px; 
        padding: 6px;
        border-radius: 12px;
    }


/* header/day names */
.cal-grid thead th {
    padding: 0 4px 4px; 
    font-size: 14px;
}

.cal-grid {
    table-layout: fixed;
    width: 100%;
}



/* calendar header */
.cal-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.cal-nav {
    width: 40px;
    height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 27px;
    font-weight: 700;
    color: #334155;
    padding: 0;
    outline: none;
    box-shadow: none;
}

    .cal-nav:focus-visible {
        outline: 3px solid #000;
        outline-offset: 3px;
    }

.cal-title {
    min-width: 140px;
    text-align: center;
    font-weight: 600;
    color: #0f172a;
    padding: 0px;
    border-radius: 999px;
    background: none;
    border: none;
    font-size: 1.125rem;
    line-height: 1.75rem;
}
/* calendar table */
.cal-grid-wrap {
    background: transparent;
}

.cal-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 10px;
}

    .cal-grid thead th {
        font-size: 12px;
        color: #64748b;
        font-weight: 750;
        text-transform: none;
        padding: 0 6px 6px;
        text-align: left;
        width: 18.285%;
    }

    .cal-grid td {
        vertical-align: top;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: var(--r);
        height: 155px;
        padding: 10px;
        box-shadow: 0 1px 0 rgba(15,23,42,.02);
        position: relative;
        overflow: hidden;
        transition: box-shadow .18s ease, transform .18s ease;
        width: 18.285%;
    }


        .cal-grid td.is-out {
            background: #fafafa;
            color: #9aa3af;
        }

.card-highlight {
    position: relative;
    border: 1px solid var(--hl, #f5c400);
    border-radius: 14px;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    box-shadow: 0 8px 24px rgba(var(--hl-rgb), .25);
}

    .card-highlight::before,
    .card-highlight::after {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        z-index: 0;
    }

    .card-highlight::before {
        background: radial-gradient(circle at top right, rgba(var(--hl-rgb), .35), transparent 40%);
    }

    .card-highlight::after {
        background: radial-gradient(circle at bottom left, rgba(var(--hl-rgb), .02), transparent 50%);
    }
    .card-highlight:hover{
        transform:translateY(-5px);
    }
    
    .far::before {
    font-family: 'Font Awesome 5 Pro' !important;
    font-weight: 400 !important ;
}

.list-thumb{
    position:relative;
    z-index:4;
}
.list-body {
    position: relative;
    z-index: 3;
}

    .list-thumb img {
        display: block;
        position: relative;
        z-index: 5;
    }

.cat-dd {
    position: relative;
    display: inline-block;
}


#catDdList label 
{
    display: flex;
    align-items: center;
    margin: 7px 0;
    white-space: nowrap;
}

#catDdPanel
{
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 9999;
    padding: 8px;
    background: #fff;
    border: 1px solid #d0d0d0;
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
    min-width: 133px;
    min-height: 23px;
    margin-top: -3px;
}


.cat-reset-item
{
    text-align: left;
    padding: 8px 10px;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    white-space: nowrap;
}

    .cat-reset-item:hover
    {
        background: rgba(0,0,0,0.06);
    }

.content__area
{
    width: 100% !important;
    margin: 0 auto !important;
}

.day-top 
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.day-num 
{
    font-weight: 800;
    font-size: 14px;
    color: #0f172a;
}


.day-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(37,99,235,.08);
    color: var(--accent);
    border: 1px solid rgba(37,99,235,.18);
}
/* event cards inside day */
.day-events {
    display: flex;
    flex-direction: column;
    gap: 0px;
    font-size: 0.75rem;
    line-height: 1rem;
}

.ev-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ev-card {
    color: inherit;
    display: flex;
    gap: 8px;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    padding: 6px;
    overflow: hidden;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
    width: 100%;
    min-width: 0;
    border: solid 0.5px;
    border-radius: 3px;
    margin-bottom: 5px;
}

    .ev-card.is-past {
        opacity: 0.7;
    }

    .ev-card.is-today {
        opacity: 1;
        filter: none;
        border-color: #1e88e5;
    }

    .ev-card.is-future {
        opacity: 1;
        filter: none;
    }

    .ev-card:hover {
        color: inherit;
        text-decoration: underline;
    }

.ev-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(37,99,235,.9);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.events-hub {
    color: var(--text);
    background: transparent;
}

.ev-meta {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    font-weight: 700;
    font-size: 10px;
}

.ev-thumb {
    width: 100%;
    height: 70px;
    background-size: cover;
    background-color: #e2e8f0;
    flex: 0 0 auto;
    border: solid 0.5px;
    border-radius: 3px;
}

    .ev-thumb.placeholder {
        background-image: linear-gradient(135deg, rgba(37,99,235,.18), rgba(99,102,241,.16));
    }


.ev-title {
    font-size: 12px;
    font-weight: 750;
    line-height: 1.25;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* floating popover */
.ev-pop {
    position: fixed;
    z-index: 9999;
    width: 320px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow2);
    display: none;
}

    .ev-pop.show {
        display: block;
    }
.ev-pop-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(37,99,235,.08);
}
 

.ev-pop-meta {
    margin-top: 8px;
    font-size: 13px;
    color: #475569;
    font-weight: 650;
    display: flex;
    flex-direction: column;
    gap: 4px;
}


.ev-pop-media {
    height: 150px;
    background-size: cover;
    background-position: center;
    background-color: #e2e8f0;
}

.ev-pop-body {
    padding: 14px 14px 12px;
}

.ev-pop-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.ev-pop-title {
    font-weight: 900;
    font-size: 18px;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.ev-pop-star {
    color: #f59e0b;
    font-size: 21px;
    opacity: .95;
}


.ev-pop-text {
    margin-top: 10px;
    font-size: 13px;
    color: #334155;
    line-height: 1.35;
    max-height: 72px;
    overflow: hidden;
}



.ev-body {
    min-width: 0; /* kritik */
}


.event-popover {
    position: fixed;
    z-index: 99999;
    transform: none;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 0 !important;
    margin-right: auto;
}

.filter-label {
    font-size: 13px;
    font-weight: 650;
    color: #475569;
    margin-right: 2px;
}

.filter-select {
    appearance: none;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 9px 34px 9px 12px;
    font-weight: 600;
    color: #334155;
    box-shadow: 0 1px 0 rgba(15,23,42,.02);
    background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%), linear-gradient(to right, transparent, transparent);
    background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%, 0 0;
    background-size: 5px 5px, 5px 5px, 100% 100%;
    background-repeat: no-repeat;
}



/* header */
.hub-actions{
    margin-left:auto;
}
.hub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 6px 0 10px;
}

.hub-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hub-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: #2f6fe4;
    color: #fff;
    border-radius: 8px;
    box-shadow: none;
    font-size: 14px;
}

.hub-title h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -0.01em;
}

/* filters */
.hub-filters {
    margin: 8px 0 14px;
    display:flex;
}


/* panels */
.hub-panel {
    display: none;
}

    .hub-panel.active {
        display: block;
    }



h2.cal-title{
    margin:0;
    font-size:1.125rem;
    line-height:1.75rem;
    font-weight:600;
    font-family:inherit;
}
h3.ev-title {
    margin: 0;
}
h3.list-title {
    margin: 0 0 6px 0;
}
h3.ev-pop-title {
    margin: 0;
}
.is-out .day-num {
    color: #94a3b8;
}

.is-mobile .view-tabs,
.is-mobile .calendar-toggle,
.is-mobile .map-toggle {
    display: none !important;
}




.h-4 {
    height: 1rem;
}
.w-4 {
    width: 1rem;
}
/* list view */
.list-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}
.list-body {
    min-width: 0;
    flex: 1 1 auto;
}
.list-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(15,23,42,.06);
    overflow: hidden;
    display: flex;
    gap: 14px;
    padding: 14px;
    align-items: flex-start;
}
.list-category {
    display: inline-flex;
    font-family: inherit;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1rem;
    color: rgb(30 64 175 / var(--tw-text-opacity, 1));
    padding: 4px 10px;
    margin: 4px 0 6px 0;
    font-weight: 600;
    background-color: #dbeeff;
    width: fit-content;
    border-radius: 5px;
}

.list-head {
    display: flex;
    align-items: center;
}

.list-link {
    margin-top: 10px;
    display: inline-flex;
    align-items:center;
    line-height:1;
    font-weight: 900;
    text-decoration: none;
}

.list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #475569;
    font-weight: 650;
    font-size: 15px;
    margin-bottom: 6px;
}
.list-star {
    margin-left: 8px;
    color: #f5c400;
    font-size: 1.05em;
    line-height: 1;
}

.list-star {
    margin-left: 8px;
    color: #f5c400;
    font-size: 1.3em;
    line-height: 1;
}

.list-title {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.01em;
    margin: 0 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.list-text {
    color: #334155;
    font-size: 14px;
    line-height: 1.35;
    max-height: 40px;
    overflow: hidden;
}



.list-title {
    margin: 0; 
}
.list-thumb{
    max-width:284px;
    height:100%;
    aspect-ratio:2/1;
    overflow:hidden;
    border-radius:14px;
    align-self:stretch;
}
.list-thumb img{
    width:100%!important;
    height:100%!important;
    object-fit:cover;
    display:block;
}


/*PAGINATION*/

.list-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 0 6px;
}

.list-pagination-info {
    color: #64748b;
    font-weight: 600;
    font-size: 14px;
}

.list-pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-page-btn,
.list-page-num {
    border: 1px solid #cbd5e1;
    background: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

    .list-page-num:disabled {
        opacity: 0.6;
        cursor: default;
    }

    .list-page-btn:disabled {
        opacity: 0.4;
        cursor: default;
    }

.list-page-numbers {
    display: flex;
    gap: 6px;
}
.list-star {
    margin-bottom: 5px;
}


/* map view */
.map-wrap {
    margin-top: 10px;
}

#map-canvas {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    min-height: 420px;
    background: #eef1f4;
}
    /* background layer */
    #map-canvas .map-bg {
        position: absolute;
        inset: 0;
        pointer-events: none;
        background-image: radial-gradient(rgba(0,0,0,.07) 1px, rgba(0,0,0,0) 1px),
        /* main road (horizontal) */
        linear-gradient( to bottom, rgba(0,0,0,0) 48%, rgba(0,0,0,.10) 48%, rgba(0,0,0,.10) 52%, rgba(0,0,0,0) 52% ),
        /* river (diagonal-ish) */
        linear-gradient( 75deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 58%, rgba(66,120,164,.28) 58%, rgba(66,120,164,.28) 70%, rgba(0,0,0,0) 70%, rgba(0,0,0,0) 100% ),
        /* base wash */
        linear-gradient(#f3f5f7, #eceff3);
        /* dots size */
        background-size: 18px 18px, /* dots */
        100% 100%, /* road */
        100% 100%, /* river */
        100% 100%; /* base */
        background-position: 0 0, 0 0, 0 0, 0 0;
        filter: saturate(.9) contrast(.98);
        opacity: .95;
    }

    #map-canvas .map-label {
        position: absolute;
        z-index: 2;
        font-size: 12px;
        letter-spacing: .12em;
        text-transform: uppercase;
        color: rgba(0,0,0,.35);
        background: rgba(255,255,255,.35);
        padding: 4px 8px;
        border-radius: 8px;
        pointer-events: none;
    }

    #map-canvas .map-label--tl {
        left: 16px;
        top: 16px;
    }

    #map-canvas .map-label--br {
        right: 16px;
        bottom: 16px;
    }

    #map-canvas .pin {
        z-index: 3;
    }



.map-note {
    position: absolute;
    left: 14px;
    bottom: 14px;
    font-size: 12px;
    font-weight: 800;
    color: #64748b;
    background: rgba(255,255,255,.75);
    border: 1px solid rgba(148,163,184,.35);
    padding: 8px 10px;
    border-radius: 999px;
}
.meta-date,
.meta-time {
    display: block;
}
.meta-item {
    display: inline-flex;
    align-items: center;
}
.meta-item::before {
    content: "";
    width: 1em;
    height: 1em;
    display: inline-block;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin-right: .4em;
}

.meta-item.date::before {
    background-image: url("/icons/calendar.svg");
}

.meta-item.time::before {
    background-image: url("/icons/clock.svg");
}

.meta-item.location::before {
    background-image: url("/icons/location.svg");
}

.meta-item.listlocation::before {
    background-image: url("/icons/location.svg");
}

.meta-item.listlocation {
    width: 100%;
} 

.meta-location {
    width: 100%;
    margin-top: 0px;
}
.more-btn {
    margin-top: 2px;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 800;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 10px;
    text-align: left;
}

/* pin container */
.pin {
    position: absolute;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -100%) rotate(-45deg);
    border-radius: 50% 50% 50% 0;
    background: #1F51FF;
    box-shadow: 0 6px 14px rgba(0,0,0,.18);
    cursor: pointer;
}

    .pin::before {
        content: "";
        position: absolute;
        inset: 4px;
        background: #fff;
        border-radius: 50%;
        transform: rotate(-45deg);
    }

    .pin::after {
        content: "";
        position: absolute;
        width: 6px;
        height: 6px;
        left: 50%;
        top: 50%;
        background: #1F51FF;
        border-radius: 50%;
        transform: translate(-50%, -50%) rotate(-45deg);
    }
.pop-row {
    display: inline-flex;
    align-items: center;
}
/* Reset ALL filters toggle */
.reset-toggle {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
}

.reset-toggle__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.reset-toggle__label {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    background: transparent;
}
/* Keep text on one line */
.reset-toggle__text {
    white-space: nowrap;
    font-size: 14px;
    line-height: 1;
    color: #334155;
    font-weight: 550;
}
/* Knob track */
.reset-toggle__knob {
    width: 34px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,.25);
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    background: #00718F;
}
    /* Knob */
    .reset-toggle__knob::after {
        content: "";
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: white;
        position: absolute;
        top: 50%;
        left: 2px;
        transform: translateY(-50%);
        transition: left .15s ease;
    }

.reset-toggle__input:checked + .reset-toggle__label .reset-toggle__knob::after {
    left: 16px;
}


/* view toggle */
.view-toggle {
    display: inline-flex;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}
.vt-btn {
    border: 0;
    background: transparent;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 650;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

    .vt-btn::before {
        content: "";
        width: 1.1em;
        height: 1.1em;
        display: inline-block;
        background-repeat: no-repeat;
        background-size: contain;
        margin-right: .4em;
    }

    .vt-btn.calendar::before {
        background-image: url("/icons/calendarbtn.svg");
    }

    .vt-btn.list::before {
        background-image: url("/icons/listbtn.svg");
    }

    .vt-btn.active {
        background: #fff;
        color: var(--accent);
        box-shadow: 0 2px 10px rgba(15,23,42,.10);
    }


/* responsive */
@media (max-width: 768px) {
    .cal-grid {
        border-spacing: 8px;
    }

        .cal-grid td {
            height: 140px;
        }

    .cal-header {
        justify-content: center;
    }
    .card-highlight::before,
    .card-highlight::after {
        display: none;
    }

    .card-highlight .list-body {
        background: radial-gradient( circle at 95% 70%, rgba(var(--hl-rgb), .25), transparent 75% );
    }
    .ev-pop {
        width: 92vw;
    }

    .events-list .event-card {
        width: 100%;
        padding: 12px;
    }

    .events-list .event-title {
        font-size: 16px;
        line-height: 1.2;
    }

    .events-list .event-meta {
        font-size: 14px;
    }
    /* ---------- Mobile filter bar layout fix (Town / Categories / Reset All) ---------- */
    .hub-filters .filter-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "label label"
            "town  cat"
            "reset reset";
        gap: 10px 10px;
        align-items: center;
        width: 100%;
    }
    /* "Filters" label */
    .hub-filters .filter-label {
        grid-area: label;
        margin: 0;
    }
    /* Town select */
    .hub-filters #filterTown {
        grid-area: town;
        width: 100%;
        min-width: 0;
    }
    /* Category dropdown wrapper */
    .hub-filters #catDd {
        grid-area: cat;
        width: 100%;
        min-width: 0;
    }
    /* Category button full width */
    .hub-filters #catDdBtn {
        width: 100%;
        min-width: 0;
    }
    /* Reset all toggle row */
    .hub-filters .reset-toggle {
        grid-area: reset;
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }
    /* Keep single line + ellipsis where needed */
    .hub-filters .filter-select,
    .hub-filters #catDdBtn,
    .hub-filters #filterTown,
    .hub-filters .reset-toggle__text {
        font-size: 13px;
        white-space: nowrap;
    }

    .hub-filters #catDdBtn,
    .hub-filters #filterTown {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .content__area {
        width: 100% !important;
        margin: 0 auto !important;
    }
    .hub-actions {
        margin-left: 0;
    }

    .hub-filters {
        display: inline-block;
        align-items: flex-start;
        width: 100%;
    }

    .hub-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .list-card {
        flex-direction: column;
        align-items: stretch;
    }

    .list-img {
        width: 100%;
        height: 160px;
    }
    .list-pagination-info
    {
        display:none;
    }
    .list-thumb {
        position: relative;
        z-index: 5;
        max-width: 100%;
    }


}
