/* =====================================================
   OT Events Manager — Frontend Styles
   ===================================================== */

:root {
    --ot-accent:       #2563eb;
    --ot-accent-hover: #1d4ed8;
    --ot-accent-light: #eff6ff;
    --ot-text:         #1f2937;
    --ot-muted:        #6b7280;
    --ot-border:       #e5e7eb;
    --ot-bg-light:     #f9fafb;
    --ot-white:        #ffffff;
    --ot-radius:       8px;
    --ot-shadow:       0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --ot-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* ── Wrapper ── */
.ot-events-wrap {
    max-width: 1200px;
    margin: 0 auto;
    font-family: inherit;
    padding: 0 4px;
    box-sizing: border-box;
}

/* ── Grid layout (default) — wraps up to 3 per row on desktop ──
   Flexbox instead of a fixed 3-column grid: cards keep a natural
   width (min 300px, capped at 380px) instead of stretching to fill
   whatever grid columns happen to be unused, and a partial row
   (e.g. a single event) centers instead of being stranded on the
   left with a large empty gap beside it. */
.ot-events-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ot-events-list .ot-event-card {
    flex: 1 1 300px;
    max-width: 380px;
}

/* ── List layout — horizontal cards ── */
.ot-layout-list .ot-events-list {
    justify-content: flex-start;
    gap: 16px;
}

.ot-layout-list .ot-event-card {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
    flex-direction: row;
    border-radius: 14px;
    min-height: 140px;
}

.ot-layout-list .ot-card-header {
    width: 200px;
    height: auto;
    min-height: 140px;
    border-radius: 14px 0 0 14px;
    flex-shrink: 0;
}

.ot-layout-list .ot-card-date-badge {
    top: 12px;
    left: 12px;
}

.ot-layout-list .ot-card-cat-icon {
    bottom: 12px;
    right: -16px;
}

.ot-layout-list .ot-card-body {
    padding: 20px 20px 16px;
    justify-content: center;
}

.ot-layout-list .ot-card-excerpt {
    -webkit-line-clamp: 2;
}

/* ══════════════════════════════
   Event Card
   ══════════════════════════════ */
.ot-event-card {
    display: flex;
    flex-direction: column;
    background: var(--ot-white);
    border-radius: 16px;
    overflow: visible;   /* allow badges to overflow the card top */
    box-shadow: 0 2px 16px rgba(0,0,0,0.09);
    border: 1px solid var(--ot-border);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    position: relative;
}

.ot-event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 32px rgba(0,0,0,0.14);
}

/* ── Card header (image / coloured banner) ── */
.ot-card-header {
    position: relative;
    height: 185px;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--ot-accent);
}

.ot-card-header-link {
    display: block;
    height: 100%;
}

.ot-card-header-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.ot-event-card:hover .ot-card-header-img {
    transform: scale(1.04);
}

/* Dark gradient overlay on image */
.ot-card-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient( to bottom, rgba(0,0,0,0.28) 0%, rgba(0,0,0,0.05) 60% );
    pointer-events: none;
}

/* Placeholder when no image */
.ot-card-header-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient( 135deg, var(--ot-accent) 0%, var(--ot-accent-hover) 100% );
    opacity: 0.92;
}

/* ── Date badge (top-left, overlapping image) ── */
.ot-card-date-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--ot-accent);
    color: var(--ot-white);
    border-radius: 10px;
    padding: 10px 13px;
    text-align: center;
    min-width: 54px;
    line-height: 1;
    box-shadow: 0 3px 12px rgba(0,0,0,0.25);
    z-index: 2;
}

.ot-card-date-day {
    display: block;
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1;
}

.ot-card-date-sep {
    display: block;
    height: 1px;
    background: rgba(255,255,255,0.35);
    margin: 5px 0 4px;
}

.ot-card-date-month {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 700;
    opacity: 0.92;
}

.ot-card-date-year {
    display: block;
    font-size: 0.65rem;
    opacity: 0.7;
    margin-top: 2px;
}

/* ── Category icon badge (bottom-right of image, overlapping) ── */
.ot-card-cat-icon {
    position: absolute;
    bottom: 5px;
    right: 16px;
    width: 42px;
    height: 42px;
    background: var(--ot-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--ot-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 3;
}

.ot-card-cat-icon svg {
    width: 18px;
    height: 18px;
    color: var(--ot-white);
    flex-shrink: 0;
}

/* ── Price ribbon (top-right of image) ── */
.ot-card-price-ribbon {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(17, 24, 39, 0.72);
    backdrop-filter: blur(2px);
    color: var(--ot-white);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 6px 11px;
    border-radius: 20px;
    line-height: 1;
    z-index: 2;
    max-width: calc(100% - 90px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Card body ── */
.ot-card-body {
    padding: 28px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Category label pill */
.ot-card-category {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f5f0e8;
    color: #8B6432;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    padding: 4px 10px 4px 8px;
    border-radius: 4px;
    margin-bottom: 11px;
    width: fit-content;
}

.ot-card-category svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: #8B6432;
}

/* Title */
.ot-card-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--ot-text);
    margin: 0 0 10px;
    line-height: 1.35;
}

.ot-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.ot-card-title a:hover {
    color: var(--ot-accent);
}

/* Accent underline */
.ot-card-title-line {
    width: 30px;
    height: 3px;
    background: var(--ot-accent);
    border-radius: 2px;
    margin-bottom: 13px;
    flex-shrink: 0;
}

/* Excerpt */
.ot-card-excerpt {
    font-size: 0.875rem;
    color: var(--ot-muted);
    line-height: 1.65;
    margin: 0 0 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta row */
.ot-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--ot-border);
}

.ot-card-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--ot-muted);
    font-weight: 500;
}

.ot-card-meta-item svg {
    width: 14px;
    height: 14px;
    color: var(--ot-accent);
    flex-shrink: 0;
}

/* Website link reuses the meta-item look but is an actual link */
a.ot-card-meta-link {
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

a.ot-card-meta-link:hover,
a.ot-card-meta-link:focus {
    color: var(--ot-accent);
    text-decoration: underline;
}

/* ── Custom HTML injected via Settings → Custom Code ── */
.ot-card-custom-html {
    margin: 0 0 14px;
}

.ot-card-custom-html:empty {
    display: none;
}

.ot-card-custom-html--top {
    margin: 0;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}

/* View Details button — outlined style */
.ot-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1.5px solid var(--ot-accent);
    color: var(--ot-accent);
    background: transparent;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    margin-top: auto;
}

.ot-card-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.ot-card-btn:hover,
.ot-card-btn:focus {
    background: var(--ot-accent);
    color: var(--ot-white);
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(37,99,235,0.28);
}

.ot-card-btn:hover svg {
    transform: translateX(3px);
}

/* ── No Events ── */
.ot-no-events {
    color: var(--ot-muted);
    font-style: italic;
    padding: 32px 0;
    text-align: center;
    grid-column: 1 / -1;
}

/* ── Shared btn (single event page) ── */
.ot-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ot-accent);
    color: var(--ot-white);
    text-decoration: none;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s ease;
    border: none;
    cursor: pointer;
}

.ot-btn:hover,
.ot-btn:focus {
    background: var(--ot-accent-hover);
    color: var(--ot-white);
    text-decoration: none;
}

/* ══════════════════════════════
   Single Event Page
   ══════════════════════════════ */

.ot-single-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.ot-single-event {
    padding-bottom: 60px;
}

/* ── Breadcrumb ── */
.ot-event-breadcrumb {
    font-size: 0.84rem;
    margin-bottom: 20px;
}

.ot-event-breadcrumb a {
    color: var(--ot-accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    transition: gap 0.15s ease;
}

.ot-event-breadcrumb a:hover {
    gap: 8px;
    text-decoration: none;
}

.ot-breadcrumb-arrow {
    display: inline-flex;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── Header ── */
.ot-event-header {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--ot-border);
}

.ot-event-header .ot-event-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--ot-text);
    line-height: 1.25;
}

.ot-event-header-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ot-accent-light);
    color: var(--ot-accent);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 32px;
    flex-wrap: wrap;
}

.ot-header-date-icon {
    display: inline-flex;
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.ot-header-date-icon svg,
.ot-breadcrumb-arrow svg {
    width: 100%;
    height: 100%;
}

.ot-header-time {
    color: var(--ot-muted);
    font-weight: 500;
}

/* ── Featured Image ── */
.ot-event-featured-image {
    margin-bottom: 32px;
    border-radius: calc( var(--ot-radius) * 1.5 );
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}

.ot-event-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 460px;
    object-fit: cover;
}

/* ── Body (two-column layout) ── */
.ot-event-body {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 36px;
    align-items: start;
}

/* ── Details Sidebar ── */
.ot-event-details-sidebar {
    background: var(--ot-white);
    border: 1px solid var(--ot-border);
    border-radius: calc( var(--ot-radius) * 1.5 );
    overflow: hidden;
    position: sticky;
    top: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.ot-sidebar-heading {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ot-white);
    font-weight: 700;
    margin: 0;
    padding: 14px 20px;
    background: var(--ot-accent);
}

.ot-details-list {
    margin: 0;
    padding: 8px 0;
}

.ot-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--ot-border);
    transition: background 0.15s ease;
}

.ot-detail-row:last-child {
    border-bottom: none;
}

.ot-detail-row:hover {
    background: var(--ot-bg-light);
}

/* Icon circle */
.ot-detail-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--ot-accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ot-detail-icon-wrap svg {
    width: 18px;
    height: 18px;
    color: var(--ot-accent);
    stroke: currentColor;
}

.ot-detail-text {
    flex: 1;
    min-width: 0;
}

.ot-detail-row dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ot-muted);
    font-weight: 700;
    margin-bottom: 3px;
}

.ot-detail-row dd {
    margin: 0;
    font-size: 0.92rem;
    color: var(--ot-text);
    font-weight: 600;
    word-break: break-word;
}

/* ── Website Button ── */
.ot-event-website-wrap {
    padding: 16px 20px;
    border-top: 1px solid var(--ot-border);
    background: var(--ot-bg-light);
}

.ot-btn-full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--ot-accent);
    color: var(--ot-white);
    text-decoration: none;
    padding: 12px 20px;
    border-radius: var(--ot-radius);
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37,99,235,0.25);
}

.ot-btn-full:hover,
.ot-btn-full:focus {
    background: var(--ot-accent-hover);
    color: var(--ot-white);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}

.ot-btn-full svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── Event Description ── */
.ot-event-description {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--ot-text);
}

.ot-event-description h2,
.ot-event-description h3 {
    margin-top: 1.5em;
    color: var(--ot-text);
}

.ot-event-description p:first-child {
    margin-top: 0;
}

/* ── No description placeholder ── */
.ot-no-description {
    color: var(--ot-muted);
    font-style: italic;
    padding: 24px;
    background: var(--ot-bg-light);
    border-radius: var(--ot-radius);
    border: 1px dashed var(--ot-border);
    text-align: center;
}

/* ══════════════════════════════
   Archive Page
   ══════════════════════════════ */

.ot-archive-header {
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--ot-accent);
}

.ot-archive-title {
    margin: 0;
    font-size: 1.8rem;
    color: var(--ot-text);
}

/* ══════════════════════════════
   Widget
   ══════════════════════════════ */

.ot-widget-events {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ot-widget-event-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--ot-border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ot-widget-event-item:last-child {
    border-bottom: none;
}

.ot-widget-date {
    font-size: 0.75rem;
    color: var(--ot-accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ot-widget-title {
    font-size: 0.9rem;
    color: var(--ot-text);
    text-decoration: none;
    font-weight: 500;
    line-height: 1.4;
}

.ot-widget-title:hover {
    color: var(--ot-accent);
}

.ot-widget-location {
    font-size: 0.78rem;
    color: var(--ot-muted);
}

.ot-widget-all-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--ot-accent);
    text-decoration: none;
    font-weight: 600;
}

.ot-widget-all-link:hover {
    text-decoration: underline;
}

.ot-widget-no-events {
    font-size: 0.875rem;
    color: var(--ot-muted);
    font-style: italic;
}

/* ══════════════════════════════
   Responsive
   ══════════════════════════════ */

@media ( max-width: 640px ) {

    /* Cards naturally wrap to 1 column on mobile via flex-basis on
       .ot-event-card — no grid-template-columns override needed. */

    .ot-layout-list .ot-event-card {
        flex-direction: column;
    }

    .ot-layout-list .ot-card-header {
        width: 100%;
        height: 160px;
        border-radius: 14px 14px 0 0;
    }

    .ot-layout-list .ot-card-cat-icon {
        bottom: -16px;
        right: 16px;
    }

    .ot-card-header {
        height: 160px;
    }

    /* Single event */
    .ot-event-body {
        grid-template-columns: 1fr;
    }

    .ot-event-details-sidebar {
        position: static;
        order: -1;
    }

    .ot-event-header .ot-event-title {
        font-size: 1.5rem;
    }

    .ot-event-header-date {
        font-size: 0.875rem;
        padding: 6px 12px;
    }

    .ot-detail-row {
        padding: 10px 16px;
        gap: 12px;
    }

    .ot-event-website-wrap {
        padding: 14px 16px;
    }
}
