/* =============================================================
   festival-styles.css
   Styles for new_troubadours_festival.html
   ============================================================= */


/* =============================================================
   1. OVERVIEW PANELS  (past / current / upcoming)
   ============================================================= */

.festival-panel-details {
    background: white;
    border-radius: 8px;
    margin-bottom: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.festival-panel-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1b5e20 0%, #388e3c 100%);
    color: white;
    cursor: pointer;
    user-select: none;
    list-style: none;
    font-weight: 600;
    font-size: 1rem;
}

.festival-panel-summary::-webkit-details-marker { display: none; }

.festival-panel-summary::after {
    content: '▸';
    margin-left: auto;
    transition: transform 0.25s ease;
}

.festival-panel-details[open] > .festival-panel-summary::after {
    transform: rotate(90deg);
}

.festival-panel-hint {
    font-size: 0.75em;
    opacity: 0.7;
    font-weight: 400;
}

.festival-panel-body {
    padding: 16px 20px 20px;
    border-top: 3px solid #1b5e20;
}

/* Grid of festival overview cards */
.festival-cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.festival-overview-card {
    background: #f1f8e9;
    border: 1px solid #a5d6a7;
    border-left: 4px solid #2e7d32;
    border-radius: 6px;
    padding: 14px 18px;
    min-width: 220px;
    flex: 1 1 220px;
    max-width: 380px;
    transition: background 0.15s, box-shadow 0.15s;
}

.festival-overview-card:hover {
    background: #e8f5e9;
    box-shadow: 0 2px 8px rgba(46,125,50,0.2);
}

.festival-card-name {
    font-weight: 700;
    font-size: 1rem;
    color: #1b5e20;
    margin-bottom: 2px;
}

.festival-card-short {
    font-size: 0.82em;
    color: #666;
    margin-bottom: 5px;
}

.festival-card-dates {
    font-size: 0.85em;
    color: #444;
    margin-bottom: 3px;
}

.festival-card-location {
    font-size: 0.82em;
    color: #555;
    font-style: italic;
    margin-bottom: 4px;
}

.festival-card-event-count {
    display: inline-block;
    margin-top: 6px;
    background: #c8e6c9;
    color: #1b5e20;
    border-radius: 10px;
    padding: 2px 10px;
    font-size: 0.78em;
    font-weight: 600;
}


/* =============================================================
   2. CONTROLS / SELECTOR
   ============================================================= */

.festival-controls {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.festival-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.festival-selector label {
    font-weight: 600;
}

.festival-selector select {
    flex: 1;
    min-width: 200px;
}

.share-container {
    margin-top: 12px;
}

.btn-primary {
    background-color: #2e7d32;
}
.btn-primary:hover { background-color: #1b5e20; }

.btn-secondary {
    background-color: #2196F3;
}
.btn-secondary:hover { background-color: #1565c0; }

.btn-reset {
    background: #fff;
    color: #555;
    border: 1px solid #ccc;
    padding: 6px 14px;
    font-size: 13px;
}
.btn-reset:hover { background: #f5f5f5; }

.back-link {
    display: inline-block;
    margin: 16px 0;
    color: #2e7d32;
    text-decoration: none;
    font-size: 0.9em;
}
.back-link:hover { text-decoration: underline; }


/* =============================================================
   3. FESTIVAL HEADER
   ============================================================= */

.festival-header {
    background: white;
    padding: 24px 30px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.festival-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1b5e20;
    margin: 0 0 4px;
    text-align: left;
    font-style: normal;
}

.festival-subtitle {
    font-size: 1rem;
    color: #666;
    font-style: italic;
    margin-bottom: 10px;
}

.festival-status-banner {
    padding: 8px 14px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.festival-banner-past    { background: #f5f5f5; color: #666; }
.festival-banner-future  { background: #e8f5e9; color: #1b5e20; }
.festival-banner-current { background: #fff9c4; color: #f57f17; }

.festival-meta-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    align-items: flex-start;
}

.festival-date-range {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
}

.festival-venue-line {
    font-size: 0.9em;
    color: #555;
    font-style: italic;
}

.festival-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.festival-ext-link {
    display: inline-block;
    padding: 6px 14px;
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.88em;
    font-weight: 600;
    transition: background 0.15s;
}
.festival-ext-link:hover { background: #c8e6c9; }

.festival-ticket-link {
    background: #fff8e1;
    color: #e65100;
    border-color: #ffcc80;
}
.festival-ticket-link:hover { background: #ffe0b2; }

.festival-flyer-img {
    max-width: 400px;
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    margin: 12px 0;
}

.festival-description {
    line-height: 1.6;
    color: #333;
    margin: 14px 0 0;
}

.festival-performers {
    margin-top: 16px;
}

.festival-performer-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.festival-performer-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f1f8e9;
    border: 1px solid #c8e6c9;
    border-radius: 20px;
    padding: 4px 12px;
}

.festival-performer-link {
    color: #2e7d32;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
}
.festival-performer-link:hover { text-decoration: underline; }

.festival-performer-role {
    font-size: 0.75em;
    color: #888;
    font-style: italic;
}

.festival-performers-tbc {
    font-size: 0.82em;
    color: #888;
    font-style: italic;
    align-self: center;
    padding: 4px 10px;
}


/* =============================================================
   4. LAYOUT  (map + events list side-by-side)
   ============================================================= */

.page-festival .layout-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 1024px) {
    .page-festival .layout-container {
        grid-template-columns: 1fr;
    }
}

.map-toolbar {
    margin-bottom: 8px;
}

.festival-events-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-height: 650px;
    overflow-y: auto;
}

.festival-section {
    background: white;
    padding: 20px 24px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.festival-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.festival-section-heading {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #1b5e20;
    font-style: normal;
}

.festival-no-events {
    color: #888;
    font-style: italic;
    font-size: 0.9em;
}

/* Linked event cards */
.festival-linked-event {
    margin-bottom: 12px;
}

.festival-event-showname {
    font-size: 1em;
    font-weight: 600;
    margin-top: 4px;
    color: rgba(255,255,255,0.95);
}

.event.special .festival-event-showname,
.event.music  .festival-event-showname {
    color: rgba(255,255,255,0.95);
}

.festival-tour-badge {
    display: inline-block;
    margin-top: 4px;
    margin-bottom: 2px;
    text-decoration: none;
    color: rgba(255,255,255,0.9) !important;
    font-size: 0.78em;
}

.date-past {
    opacity: 0.65;
}


/* =============================================================
   5. CLASHFINDER
   ============================================================= */

.clashfinder-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88em;
}

.clashfinder-controls select {
    padding: 5px 8px;
    font-size: 0.9em;
}

/* Type legend — small colour-coded key shown above the clashfinder,
   mirroring the printed programme's colour key. */
.cf-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 12px;
    font-size: 0.82em;
}

.cf-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #555;
}

.cf-legend-swatch {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 3px;
    flex: 0 0 auto;
}

/* Scrollable outer wrapper */
.clashfinder-outer {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* The grid itself — columns set inline by JS */
.clashfinder-grid {
    display: grid;
    min-width: 600px;
    font-size: 0.82em;
    position: relative;
}

/* Header row: blank corner + one cell per stage */
.cf-header-row {
    display: contents;
}

.cf-corner {
    background: #f5f5f5;
    border-right: 1px solid #ddd;
    border-bottom: 2px solid #bbb;
    padding: 8px 10px;
    font-weight: 700;
    color: #555;
    position: sticky;
    left: 0;
    z-index: 3;
}

.cf-stage-header {
    background: #1b5e20;
    color: white;
    padding: 8px 10px;
    font-weight: 700;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.2);
    border-bottom: 2px solid #145214;
}

/* Time axis column */
.cf-time-cell {
    background: #f9f9f9;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #eee;
    padding: 4px 8px;
    color: #666;
    font-size: 0.85em;
    text-align: right;
    white-space: nowrap;
    position: sticky;
    left: 0;
    z-index: 2;
}

/* Stage slot cells — the "canvas" cells behind positioned events */
.cf-slot-cell {
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    position: relative;
    background: #fafafa;
    min-height: 20px;
}

.cf-slot-cell:nth-child(even) {
    background: #f5f5f5;
}

/* Day divider row spanning full width */
.cf-day-divider {
    background: linear-gradient(135deg, #1b5e20, #388e3c);
    color: white;
    font-weight: 700;
    font-size: 0.9em;
    padding: 6px 12px;
    letter-spacing: 0.04em;
    /* grid-column set inline by JS to span all columns */
}

/*
   Event blocks — absolutely positioned inside .cf-stage-col
   top/height set in px by JS based on time calculations.
*/
.cf-event {
    position: absolute;
    left: 3px;
    right: 3px;
    border-radius: 4px;
    padding: 4px 6px;
    overflow: hidden;
    cursor: pointer;
    transition: filter 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    z-index: 1;
}

.cf-event:hover {
    filter: brightness(1.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    z-index: 10;
}

/* Types */
.cf-event-special {
    background: linear-gradient(135deg, #43a047, #66bb6a);
    border: 1px solid #2e7d32;
    color: white;
}

.cf-event-music {
    background: linear-gradient(135deg, #443cd7, #8e9df3);
    border: 1px solid #1006c6;
    color: white;
}

.cf-event-schedule {
    background: linear-gradient(135deg, #546e7a, #78909c);
    border: 1px solid #37474f;
    color: white;
}

/* Programme category types — colours echo the printed festival
   programme's own colour key so the on-site grid and the paper
   running order read as the same system. */
.cf-event-storywalk {
    background: linear-gradient(135deg, #6fae5e, #93c47d);
    border: 1px solid #4b7a3e;
    color: white;
}

.cf-event-firepit_stories {
    background: linear-gradient(135deg, #2461d8, #5e87ee);
    border: 1px solid #1a3fa8;
    color: white;
}

.cf-event-talk_film {
    background: linear-gradient(135deg, #e6c668, #fff1cc);
    border: 1px solid #c9a227;
    color: #4a3b00;
}

.cf-event-family {
    background: linear-gradient(135deg, #ad5680, #c17aa0);
    border: 1px solid #7a3a59;
    color: white;
}

.cf-event-storytelling_shows {
    background: linear-gradient(135deg, #d96666, #e08888);
    border: 1px solid #a33d3d;
    color: white;
}

.cf-event-group_telling {
    background: linear-gradient(135deg, #e0a000, #fabb04);
    border: 1px solid #a87600;
    color: #3a2900;
}

.cf-event-storyround {
    background: linear-gradient(135deg, #d8b9c7, #ead1dc);
    border: 1px solid #b08097;
    color: #4a2e3a;
}

.cf-event-workshop {
    background: linear-gradient(135deg, #8d7cc4, #b4a7d6);
    border: 1px solid #5e4d96;
    color: white;
}

.cf-event-spoken_word {
    background: linear-gradient(135deg, #a4c98f, #d9ead3);
    border: 1px solid #6f9c57;
    color: #2a3a1f;
}

.cf-event-past {
    opacity: 0.55;
}

.cf-event-title {
    font-weight: 700;
    font-size: 0.9em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-event-performer {
    font-size: 0.78em;
    opacity: 0.88;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-event-time {
    font-size: 0.72em;
    opacity: 0.75;
    margin-top: 2px;
}

/* Tooltip shown on hover / click */
.cf-tooltip {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 100;
    min-width: 200px;
    max-width: 280px;
    pointer-events: none;
    font-size: 0.88em;
    color: #333;
}

.cf-tooltip-title    { font-weight: 700; margin-bottom: 3px; }
.cf-tooltip-perf     { font-style: italic; color: #555; margin-bottom: 3px; }
.cf-tooltip-time     { color: #777; font-size: 0.9em; }
.cf-tooltip-stage    { color: #999; font-size: 0.85em; margin-top: 2px; }
.cf-tooltip-link     { display: block; margin-top: 6px; color: #1565c0; text-decoration: none; font-size: 0.85em; }
.cf-tooltip-link:hover { text-decoration: underline; }

/* No-schedule placeholder */
.cf-empty {
    padding: 20px;
    text-align: center;
    color: #888;
    font-style: italic;
}

@media (max-width: 768px) {
    .festival-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .festival-meta-row {
        flex-direction: column;
        gap: 6px;
    }

    .festival-performer-list {
        flex-direction: column;
        gap: 6px;
    }
}


/* =============================================================
   6. CLASHFINDER DAY WRAPPER + UNTIMED ITEMS
   ============================================================= */

.clashfinder-day-wrapper {
    margin-bottom: 24px;
}

.cf-day-banner {
    background: linear-gradient(135deg, #1b5e20, #388e3c);
    color: white;
    font-weight: 700;
    font-size: 0.92em;
    padding: 7px 14px;
    letter-spacing: 0.03em;
    border-radius: 4px 4px 0 0;
}

.cf-stage-overlay {
    position: absolute;
    /* left/width set by JS */
}

.cf-untimed-section {
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
    padding: 10px 14px;
    background: #fafafa;
}

.cf-untimed-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 8px;
}

.cf-untimed-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px;
    padding: 5px 10px;
    margin-bottom: 5px;
    color: white;
    font-size: 0.85em;
}

.cf-untimed-card.cf-event-special  { background: #43a047; }
.cf-untimed-card.cf-event-music    { background: #443cd7; }
.cf-untimed-card.cf-event-schedule { background: #546e7a; }
.cf-untimed-card.cf-event-storywalk          { background: #6fae5e; }
.cf-untimed-card.cf-event-firepit_stories    { background: #2461d8; }
.cf-untimed-card.cf-event-talk_film          { background: #c9a227; }
.cf-untimed-card.cf-event-family             { background: #ad5680; }
.cf-untimed-card.cf-event-storytelling_shows { background: #d96666; }
.cf-untimed-card.cf-event-group_telling      { background: #e0a000; }
.cf-untimed-card.cf-event-storyround         { background: #c596ab; }
.cf-untimed-card.cf-event-workshop           { background: #8d7cc4; }
.cf-untimed-card.cf-event-spoken_word        { background: #7da361; }

.cf-untimed-title { font-weight: 600; }
.cf-untimed-perf  { opacity: 0.85; font-style: italic; }
.cf-untimed-stage {
    font-size: 0.8em;
    opacity: 0.75;
    margin-left: auto;
    padding-left: 10px;
    white-space: nowrap;
}


/* =============================================================
   7. LINK COLOURS ON COLOURED EVENT CARDS
   Ensure performer, venue and other links read as white
   (not browser-default blue) on the green/blue card gradients.
   ============================================================= */

.festival-linked-event .event-performer-link,
.festival-linked-event .event-performer {
    color: inherit;
    text-decoration: none;
    font-style: italic;
}

.festival-linked-event .event-performer-link:hover {
    text-decoration: underline;
}

.festival-linked-event .venue-link,
.festival-linked-event .event-location a {
    color: inherit;
    text-decoration: none;
}

.festival-linked-event .venue-link:hover {
    text-decoration: underline;
}

/* venue-page-link "i" pill — white on coloured cards */
.festival-linked-event .venue-page-link {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.2);
}

.festival-linked-event .venue-page-link:hover {
    background: rgba(255,255,255,0.35);
    color: #fff;
}

/* event-location italic text */
.festival-linked-event .event-location {
    color: rgba(255,255,255,0.85);
}

/* touring badge link on tour-date cards */
.festival-linked-event .festival-tour-badge {
    color: rgba(255,255,255,0.9) !important;
    text-decoration: none;
}

/* Derived performer names on overview cards */
.festival-card-performers {
    font-size: 0.8em;
    color: #444;
    margin-top: 6px;
    line-height: 1.4;
}
