/* ==========================================================================
   Expo Calendar — page-specific styles
   Uses the shared design tokens (--navy, --green, etc.) defined inline on
   expo-calendar.html, same as exhibitions.css does for upcoming-exhibitions.
   ========================================================================== */

/* ---- Hero ---- */
.ec-hero { background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, #0a0a8f 100%); padding: 64px 0 48px; position: relative; overflow: hidden; }
.ec-hero::before { content: ''; position: absolute; top: -30%; right: -8%; width: 420px; height: 420px; border-radius: 50%; background: rgba(165,213,73,0.06); }
.ec-hero .container { position: relative; z-index: 2; }
.ec-hero h1 { color: var(--white); font-size: 2.2rem; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.5px; }
.ec-hero p { color: rgba(255,255,255,0.6); font-size: 1rem; max-width: 620px; line-height: 1.8; margin-bottom: 20px; }
.ec-hero-link { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-family: var(--font-heading); font-weight: 600; font-size: 0.88rem; }
.ec-hero-link svg { width: 15px; height: 15px; }
.ec-hero-link:hover { color: var(--green-light); }

/* ---- Toolbar ---- */
.ec-toolbar-section { padding: 28px 0; background: var(--blue-bg); border-bottom: 1px solid var(--gray-border); }
.ec-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ec-search-wrap { position: relative; flex: 1 1 220px; min-width: 200px; }
.ec-search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.ec-toolbar input[type="text"], .ec-toolbar select {
    width: 100%; padding: 11px 14px 11px 38px; border-radius: 10px; border: 1.5px solid var(--gray-border);
    background: var(--white); font-family: var(--font-body); font-size: 0.9rem; color: var(--text-dark);
    transition: var(--transition);
}
.ec-toolbar select { padding-left: 14px; cursor: pointer; flex: 1 1 160px; min-width: 150px; }
.ec-toolbar input:focus, .ec-toolbar select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0,0,128,0.08); }
.ec-reset-btn {
    padding: 11px 20px; border-radius: 10px; border: 1.5px solid var(--gray-border); background: var(--white);
    font-family: var(--font-heading); font-weight: 600; font-size: 0.85rem; color: var(--text-body); cursor: pointer;
    transition: var(--transition); white-space: nowrap;
}
.ec-reset-btn:hover { border-color: var(--navy); color: var(--navy); }

/* ---- Calendar header (month nav) ---- */
.ec-calendar-section { padding: 40px 0 80px; }
.ec-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.ec-cal-nav { display: flex; align-items: center; gap: 12px; }
.ec-nav-btn {
    width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--gray-border); background: var(--white);
    display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); color: var(--navy);
}
.ec-nav-btn:hover { border-color: var(--navy); background: var(--navy); color: var(--white); }
.ec-nav-btn svg { width: 17px; height: 17px; }
#ecMonthLabel { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 800; color: var(--navy); min-width: 200px; text-align: center; }
.ec-today-btn {
    padding: 9px 18px; border-radius: 50px; border: 1.5px solid var(--green); background: var(--green-glow);
    color: var(--navy); font-family: var(--font-heading); font-weight: 700; font-size: 0.82rem; cursor: pointer; transition: var(--transition);
}
.ec-today-btn:hover { background: var(--green); }
#ecMonthCount { font-size: 0.88rem; color: var(--text-muted); font-weight: 600; }

/* ---- Grid ---- */
.ec-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.ec-weekdays span {
    text-align: center; font-family: var(--font-heading); font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 8px 0;
}
.ec-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.ec-cell {
    background: var(--white); border: 1.5px solid var(--gray-border); border-radius: var(--radius-sm);
    min-height: 100px; padding: 7px; display: flex; flex-direction: column; gap: 5px;
    text-align: left; cursor: default; font-family: var(--font-body); transition: var(--transition);
    min-width: 0; width: 100%;
}
.ec-cell--empty { background: transparent; border: none; }
.ec-cell--today { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.ec-cell--has-events { cursor: pointer; }
.ec-cell--has-events:hover { border-color: var(--green); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.ec-cell-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.ec-cell-num { font-family: var(--font-heading); font-weight: 700; font-size: 0.85rem; color: var(--navy); flex-shrink: 0; }
.ec-cell--today .ec-cell-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: var(--white); font-size: 0.75rem;
}
.ec-cell-count {
    display: none; flex-shrink: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 50px;
    background: var(--green-glow); color: var(--navy); font-family: var(--font-heading);
    font-size: 0.66rem; font-weight: 800; align-items: center; justify-content: center;
}
.ec-cell-pills { display: flex; flex-direction: column; gap: 3px; overflow: hidden; min-width: 0; }
.ec-pill {
    display: block; font-size: 0.66rem; font-weight: 600; color: var(--navy);
    background: var(--gray-warm); border-left: 3px solid var(--ec-dot, var(--navy));
    padding: 2px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0;
}
.ec-pill--approx { border-left-style: dashed; color: var(--text-body); font-style: italic; }
.ec-pill--more { color: var(--text-muted); border-left-color: var(--gray-border); font-weight: 700; font-style: normal; }

/* ---- Legend ---- */
.ec-legend-note { margin-top: 16px; font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.ec-legend-note svg { width: 15px; height: 15px; color: var(--navy); flex-shrink: 0; }

/* ---- Modal ---- */
.ec-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,32,0.55); backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 20px;
}
.ec-modal-overlay[hidden] { display: none; }
.ec-modal-card {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    max-width: 560px; width: 100%; max-height: 82vh; display: flex; flex-direction: column; overflow: hidden;
}
.ec-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; border-bottom: 1px solid var(--gray-border); flex-shrink: 0; }
.ec-modal-head h3 { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin: 0; }
.ec-modal-close-btn { width: 32px; height: 32px; border-radius: 8px; border: none; background: var(--gray-warm); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: var(--transition); flex-shrink: 0; }
.ec-modal-close-btn:hover { background: var(--gray-border); color: var(--navy); }
.ec-modal-close-btn svg { width: 16px; height: 16px; }
.ec-modal-body { padding: 10px 16px; overflow-y: auto; }
.ec-modal-item {
    display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 5px;
    padding: 14px 10px; border-bottom: 1px solid var(--gray-border);
}
.ec-modal-item:last-child { border-bottom: none; }
.ec-modal-item--link { cursor: pointer; border-radius: var(--radius-sm); transition: var(--transition); }
.ec-modal-item--link:hover { background: var(--blue-bg); }
.ec-modal-item-head { grid-column: 1; grid-row: 1; display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.ec-modal-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.ec-modal-item-head h4 { font-size: 0.92rem; font-weight: 700; color: var(--navy); margin: 0; line-height: 1.4; overflow-wrap: break-word; }
.ec-modal-meta { grid-column: 1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding-left: 19px; font-size: 0.78rem; color: var(--text-muted); }
.ec-modal-sector { background: var(--gray-warm); padding: 2px 8px; border-radius: 50px; font-weight: 600; }
.ec-modal-approx { color: #C05621; font-weight: 600; }
.ec-modal-arrow { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--green); flex-shrink: 0; font-size: 1.1rem; }

/* ---- TBA section ---- */
.ec-tba-section { padding: 56px 0 88px; background: var(--blue-bg); }
.ec-tba-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.ec-tba-head h2 { font-size: 1.3rem; font-weight: 700; color: var(--navy); margin: 0; }
.ec-tba-head span { font-size: 0.85rem; color: var(--text-muted); }
.ec-tba-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ec-tba-item { display: flex; flex-direction: column; gap: 4px; background: var(--white); border: 1px solid var(--gray-border); border-radius: var(--radius-sm); padding: 14px 16px; transition: var(--transition); }
.ec-tba-item--link:hover { border-color: var(--green); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.ec-tba-name { font-family: var(--font-heading); font-size: 0.88rem; font-weight: 700; color: var(--navy); }
.ec-tba-meta { font-size: 0.76rem; color: var(--text-muted); }
.ec-tba-empty { color: var(--text-muted); font-size: 0.9rem; grid-column: 1 / -1; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .ec-cell { min-height: 56px; }
    .ec-pill { display: none; }
    .ec-cell-count { display: inline-flex; }
}
@media (max-width: 640px) {
    .ec-hero h1 { font-size: 1.6rem; }
    .ec-toolbar { gap: 10px; }
    .ec-search-wrap { flex: 1 1 100%; }
    .ec-toolbar select { flex: 1 1 auto; }
    .ec-reset-btn { flex: 0 0 auto; }
    .ec-weekdays span { font-size: 0.58rem; letter-spacing: 0.02em; padding: 6px 0; }
    .ec-grid { gap: 4px; }
    .ec-cell { min-height: 48px; padding: 5px; gap: 2px; }
    .ec-cell-num { font-size: 0.72rem; }
    .ec-cell--today .ec-cell-num { width: 19px; height: 19px; font-size: 0.66rem; }
    .ec-cell-count { min-width: 16px; height: 16px; font-size: 0.58rem; padding: 0 4px; }
    #ecMonthLabel { font-size: 1.1rem; min-width: 0; }
    .ec-cal-header { justify-content: center; text-align: center; }
    .ec-cal-nav { flex-wrap: wrap; justify-content: center; }
    .ec-modal-card { max-height: 88vh; }
    .ec-modal-head { padding: 18px 18px; }
    .ec-tba-list { grid-template-columns: 1fr; }
}
