/**
 * EmergeThrive Public Classes — Monthly Calendar Grid
 *
 * Palette (matches emergethrive.com):
 *   Background:  #1a1a1a (page), #222222 (cells)
 *   Text:        #f8f5f0 (cream)
 *   Accent:      #2d5016 (forest green)
 *   Muted:       #999999
 */

/* ── Container ─────────────────────────────────────────────── */

.ete-calendar {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #f8f5f0;
}

.ete-calendar *,
.ete-calendar *::before,
.ete-calendar *::after {
    box-sizing: border-box;
}

/* ── Header ────────────────────────────────────────────────── */

.ete-calendar-header {
    text-align: center;
    margin-bottom: 16px;
}

.ete-header-graphic {
    display: block;
    width: 250px;
    height: 143px;
    margin: 0 auto 8px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.ete-calendar-title {
    font-size: 1.6rem !important;
    font-weight: 800 !important;
    color: #f8f5f0 !important;
    margin: 0 0 2px 0 !important;
    padding: 0 !important;
    letter-spacing: 0.02em;
    line-height: 1.2 !important;
}

.ete-calendar-subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    color: rgba(248, 245, 240, 0.7);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin: 0 0 4px 0;
    padding: 0;
}

.ete-calendar-week {
    display: block;
    font-size: 0.9rem;
    color: #2d5016;
    font-weight: 400;
    text-align: center;
    margin-bottom: 16px;
    background: #f8f5f0;
    padding: 8px 16px;
    border-radius: 8px;
}

/* ── View Selector ─────────────────────────────────────────── */

.ete-view-selector {
    margin-top: 10px;
}

.ete-select {
    appearance: none;
    -webkit-appearance: none;
    background: #f8f5f0;
    color: #2d5016;
    border: 2px solid #2d5016;
    border-radius: 9999px;
    padding: 8px 36px 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%232d5016' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.ete-select:hover {
    background-color: #f0ece5;
}

.ete-select:focus {
    border-color: #1a3a0e;
}

.ete-select option {
    background: #f8f5f0;
    color: #2d5016;
}

/* ── Featured Series Card ─────────────────────────────────── */

.ete-series-card {
    background: linear-gradient(135deg, #1a3a0e 0%, #0e3545 100%);
    border-radius: 14px;
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid rgba(248, 245, 240, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.ete-series-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ete-series-header:hover {
    background: rgba(248, 245, 240, 0.04);
}

.ete-series-header-text {
    flex: 1;
    min-width: 0;
}

.ete-series-title {
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    color: #f8f5f0 !important;
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}

.ete-series-subtitle {
    font-size: 0.9rem;
    font-style: italic;
    color: rgba(248, 245, 240, 0.65);
    margin: 0 0 10px 0;
}

.ete-series-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: rgba(248, 245, 240, 0.55);
}

.ete-series-dot {
    margin: 0 2px;
}

.ete-series-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.ete-series-toggle-icon {
    font-size: 0.8rem;
    color: rgba(248, 245, 240, 0.4);
    transition: transform 0.3s ease;
}

.ete-series-open .ete-series-toggle-icon {
    transform: rotate(180deg);
}

/* Expandable body */
.ete-series-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 24px;
}

.ete-series-open .ete-series-body {
    max-height: 5000px;
    padding: 0 24px 24px;
}

.ete-series-sessions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 4px;
    border-top: 1px solid rgba(248, 245, 240, 0.1);
}

.ete-session {
    background: rgba(248, 245, 240, 0.06);
    border-radius: 10px;
    padding: 20px;
    border-left: 3px solid rgba(248, 245, 240, 0.2);
}

.ete-session-number {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(248, 245, 240, 0.4);
    margin-bottom: 4px;
}

.ete-session-title {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #f8f5f0 !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
}

.ete-session-theme {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #f8f5f0;
    background: rgba(248, 245, 240, 0.12);
    padding: 3px 10px;
    border-radius: 9999px;
    margin-bottom: 6px;
}

.ete-session-date {
    font-size: 0.8rem;
    color: rgba(248, 245, 240, 0.5);
    margin-bottom: 10px;
}

.ete-session-desc {
    font-size: 0.9rem;
    color: rgba(248, 245, 240, 0.7);
    line-height: 1.7;
}

.ete-session-desc p {
    margin: 0 0 10px 0;
}

.ete-session-desc p:last-child {
    margin-bottom: 0;
}

.ete-series-bottom-action {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(248, 245, 240, 0.1);
}

.ete-series-bottom-action .ete-btn {
    padding: 14px 32px;
    font-size: 1rem;
}

/* Mobile adjustments for series card */
@media (max-width: 768px) {
    .ete-series-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 18px;
    }

    .ete-series-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .ete-series-header-actions .ete-btn {
        flex: 1;
        text-align: center;
    }

    .ete-series-title {
        font-size: 1.15rem !important;
    }

    .ete-series-meta {
        font-size: 0.75rem;
    }

    .ete-series-body {
        padding: 0 18px;
    }

    .ete-series-open .ete-series-body {
        padding: 0 18px 18px;
    }

    .ete-session {
        padding: 14px;
    }
}

/* ── Legend ─────────────────────────────────────────────────── */

.ete-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    justify-content: center;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f5f0;
    border-radius: 10px;
    border: 1px solid #2d5016;
}

.ete-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #2d5016;
}

.ete-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.ete-legend-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 9999px;
    background: rgba(45, 80, 22, 0.1);
    color: #2d5016;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Monthly Grid ──────────────────────────────────────────── */

.ete-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: rgba(248, 245, 240, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

/* Day-of-week headers */
.ete-dow-header {
    background: #2d5016;
    color: #f8f5f0;
    text-align: center;
    padding: 10px 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Day cells */
.ete-day-cell {
    background: #f8f5f0;
    min-height: 100px;
    padding: 6px;
    position: relative;
    vertical-align: top;
}

.ete-day-cell.ete-day-empty {
    background: #ece8e1;
}

.ete-day-cell.ete-day-outside {
    background: #e5e0d8;
    opacity: 0.5;
}

.ete-month-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2d5016;
    margin-bottom: 1px;
}

.ete-day-cell.ete-today {
    background: #f0ece5;
    box-shadow: inset 0 0 0 2px #2d5016;
}

.ete-day-number {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 4px;
}

.ete-today .ete-day-number {
    color: #f8f5f0;
    background: #2d5016;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Events inside day cells */
.ete-day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ete-day-event {
    border-radius: 4px;
    padding: 5px 7px;
    cursor: default;
    transition: opacity 0.15s ease;
}

.ete-day-event:hover {
    opacity: 0.85;
}

.ete-day-event-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.ete-day-event-link:hover {
    text-decoration: none;
}

.ete-day-event-name {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #f8f5f0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ete-day-event-time {
    display: block;
    font-size: 0.65rem;
    color: #f0ece5;
    line-height: 1.3;
}

/* ── Event List (always visible, below grid) ──────────────── */

.ete-event-list-heading {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #f8f5f0 !important;
    margin: 28px 0 16px !important;
    padding: 0 !important;
    text-align: center;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ete-event-list {
    display: block;
}

.ete-event-day {
    margin-bottom: 20px;
}

.ete-event-day-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f8f5f0;
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(248, 245, 240, 0.12);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ete-event-item {
    background: #222222;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ete-event-item-main {
    flex: 1;
    min-width: 0;
}

.ete-event-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: #f8f5f0;
    margin-bottom: 2px;
}

.ete-event-item-time {
    font-size: 0.9rem;
    color: rgba(248, 245, 240, 0.7);
    margin-bottom: 2px;
}

.ete-event-item-location {
    font-size: 0.8rem;
    color: #999999;
    margin-bottom: 0;
}

/* ── ICS Download Link ────────────────────────────────────── */

.ete-ics-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
    color: rgba(248, 245, 240, 0.5);
    text-decoration: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}

.ete-ics-link:hover {
    color: #f8f5f0;
    background: rgba(248, 245, 240, 0.1);
}

.ete-event-item .ete-ics-link {
    font-size: 1.3rem;
}

.ete-modal-ics-wrap {
    text-align: center;
    padding: 0 24px 20px;
}

.ete-modal-ics-btn {
    font-size: 0.85rem;
    color: rgba(248, 245, 240, 0.5);
    gap: 4px;
}

.ete-event-item.ete-clickable:hover {
    background: #2a2a2a;
}

/* ── Buttons / Badges (shared) ─────────────────────────────── */

.ete-btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
    margin-top: 6px;
}

.ete-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.ete-btn-register {
    background: #2d5016;
    color: #f8f5f0;
}

.ete-btn-join {
    background: #f8f5f0;
    color: #2d5016;
}

.ete-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 6px;
}

.ete-badge-open {
    border: 1px solid rgba(248, 245, 240, 0.2);
    color: rgba(248, 245, 240, 0.5);
}

/* ── Logo in empty cells ───────────────────────────────────── */

.ete-day-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ete-logo-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.ete-logo-img {
    max-width: 60px;
    max-height: 60px;
    opacity: 0.35;
}

/* ── Clickable events ──────────────────────────────────────── */

.ete-clickable {
    cursor: pointer;
}

.ete-day-event.ete-clickable:hover {
    opacity: 0.85;
    transform: scale(1.03);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* (removed — replaced by .ete-event-item.ete-clickable:hover) */

/* ── Modal ─────────────────────────────────────────────────── */

.ete-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: ete-fade-in 0.2s ease;
}

@keyframes ete-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ete-modal {
    background: #1e1e1e;
    border-radius: 14px;
    max-width: 480px;
    width: 100%;
    position: relative;
    overflow: hidden;
    animation: ete-slide-up 0.25s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes ete-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.ete-modal-color-bar {
    height: 6px;
    width: 100%;
}

.ete-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(248, 245, 240, 0.5);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.ete-modal-close:hover {
    color: #f8f5f0;
    background: rgba(248, 245, 240, 0.1);
}

.ete-modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f8f5f0;
    margin: 0;
    padding: 24px 24px 8px;
}

.ete-modal-date {
    font-size: 0.95rem;
    color: rgba(248, 245, 240, 0.7);
    padding: 0 24px;
    margin-bottom: 2px;
}

.ete-modal-time {
    font-size: 0.95rem;
    color: rgba(248, 245, 240, 0.7);
    padding: 0 24px;
    margin-bottom: 8px;
}

.ete-modal-location {
    font-size: 0.85rem;
    color: #999;
    padding: 0 24px;
    margin-bottom: 8px;
}

.ete-modal-desc {
    font-size: 0.9rem;
    color: rgba(248, 245, 240, 0.6);
    line-height: 1.6;
    padding: 8px 24px 0;
    border-top: 1px solid rgba(248, 245, 240, 0.08);
    margin-top: 8px;
}

.ete-modal-action {
    padding: 16px 24px 24px;
}

.ete-modal-action .ete-btn {
    display: block;
    text-align: center;
    padding: 12px 24px;
    font-size: 0.95rem;
}

.ete-modal-action .ete-badge {
    display: block;
    text-align: center;
}

/* ── Empty state ───────────────────────────────────────────── */

.ete-empty {
    text-align: center;
    color: rgba(248, 245, 240, 0.5);
    font-size: 1rem;
    padding: 40px 20px;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 768px) {
    .ete-month-grid {
        gap: 1px;
    }

    .ete-day-cell {
        min-height: 48px;
        padding: 3px;
    }

    .ete-day-number {
        font-size: 0.65rem;
        margin-bottom: 2px;
    }

    .ete-today .ete-day-number {
        width: 18px;
        height: 18px;
        line-height: 18px;
        font-size: 0.6rem;
    }

    .ete-day-event {
        padding: 2px 3px;
        border-radius: 3px;
    }

    .ete-day-event-name {
        font-size: 0.5rem;
    }

    .ete-day-event-time {
        display: none;
    }

    .ete-dow-header {
        padding: 6px 2px;
        font-size: 0.6rem;
    }

    .ete-legend {
        justify-content: flex-start;
    }

    .ete-logo-img {
        max-width: 30px;
        max-height: 30px;
    }
}

@media (min-width: 769px) and (max-width: 960px) {
    .ete-day-cell {
        min-height: 80px;
        padding: 4px;
    }

    .ete-day-event-name {
        font-size: 0.65rem;
    }

    .ete-day-event-time {
        display: none;
    }
}
