/* Ministry Calendar — Frontend Styles
   Typeface: 'Lora' (serif display) + 'Source Sans 3' (body)
   Theme: warm white / slate / ministry accent colors
   ---------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Lora:wght@500;600&family=Source+Sans+3:wght@400;500;600&display=swap');

.mc-calendar-wrap {
    --mc-bg:        #ffffff;
    --mc-surface:   #f8f7f5;
    --mc-border:    #e4e1db;
    --mc-text:      #2c2825;
    --mc-muted:     #8a8078;
    --mc-accent:    #5b6fa6;
    --mc-radius:    6px;
    --mc-font-body: 'Source Sans 3', sans-serif;
    --mc-font-head: 'Lora', Georgia, serif;

    font-family: var(--mc-font-body);
    color: var(--mc-text);
    background: var(--mc-bg);
    border: 1px solid var(--mc-border);
    border-radius: 10px;
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto 2em;
    box-shadow: 0 2px 16px rgba(0,0,0,.07);
}

/* ── Toolbar ──────────────────────────────────────────────────── */
.mc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    background: var(--mc-surface);
    border-bottom: 1px solid var(--mc-border);
}

.mc-view-toggle { display: flex; gap: 4px; }

.mc-btn {
    font-family: var(--mc-font-body);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border: 1px solid var(--mc-border);
    border-radius: var(--mc-radius);
    background: var(--mc-bg);
    color: var(--mc-text);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    line-height: 1.4;
}
.mc-btn:hover { background: var(--mc-border); }
.mc-btn.active,
.mc-btn[aria-pressed="true"] {
    background: var(--mc-accent);
    color: #fff;
    border-color: var(--mc-accent);
}

.mc-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}
.mc-btn-nav {
    font-size: 20px;
    padding: 2px 10px;
    line-height: 1.2;
}
.mc-current-label {
    font-family: var(--mc-font-head);
    font-size: 16px;
    font-weight: 500;
    min-width: 160px;
    text-align: center;
}
.mc-btn-today { font-size: 12px; padding: 5px 10px; }

/* ── Legend ───────────────────────────────────────────────────── */
.mc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--mc-border);
    background: var(--mc-surface);
}
.mc-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--mc-muted);
    cursor: pointer;
    user-select: none;
    transition: color .15s;
}
.mc-legend-item:hover { color: var(--mc-text); }
.mc-legend-item.mc-dimmed { opacity: .35; }
.mc-legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Body container ───────────────────────────────────────────── */
.mc-body { padding: 0; }

/* ── Month Grid ───────────────────────────────────────────────── */
.mc-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.mc-day-header {
    padding: 8px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mc-muted);
    border-bottom: 1px solid var(--mc-border);
    background: var(--mc-surface);
}
.mc-day-cell {
    min-height: 88px;
    padding: 4px 5px 5px;
    border-right: 1px solid var(--mc-border);
    border-bottom: 1px solid var(--mc-border);
    position: relative;
    background: var(--mc-bg);
    transition: background .12s;
}
.mc-day-cell:nth-child(7n) { border-right: none; }
.mc-day-cell.mc-other-month { background: var(--mc-surface); }
.mc-day-cell.mc-today { background: #eef1f9; }
.mc-day-num {
    font-size: 12px;
    font-weight: 600;
    color: var(--mc-muted);
    margin-bottom: 3px;
    line-height: 1;
}
.mc-day-cell.mc-today .mc-day-num {
    color: var(--mc-accent);
}
.mc-event-pill {
    display: block;
    margin-bottom: 2px;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: opacity .12s, transform .12s;
    line-height: 1.5;
}
.mc-event-pill:hover { opacity: .85; transform: translateX(1px); }
.mc-more-link {
    font-size: 10px;
    font-weight: 700;
    color: var(--mc-muted);
    cursor: pointer;
    padding: 0 4px;
    margin-top: 2px;
    display: block;
}
.mc-more-link:hover { color: var(--mc-accent); }

/* ── List View ────────────────────────────────────────────────── */
.mc-list-view { padding: 8px 0; }
.mc-list-month-group { margin-bottom: 4px; }
.mc-list-month-head {
    font-family: var(--mc-font-head);
    font-size: 13px;
    font-weight: 600;
    color: var(--mc-muted);
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 10px 18px 6px;
    border-bottom: 1px solid var(--mc-border);
    background: var(--mc-surface);
}
.mc-list-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: start;
    gap: 0 14px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--mc-border);
    cursor: pointer;
    transition: background .12s;
}
.mc-list-item:last-child { border-bottom: none; }
.mc-list-item:hover { background: var(--mc-surface); }
.mc-list-date-col {
    text-align: center;
    padding-top: 2px;
}
.mc-list-date-day {
    font-family: var(--mc-font-head);
    font-size: 26px;
    font-weight: 600;
    line-height: 1;
    color: var(--mc-text);
}
.mc-list-date-dow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mc-muted);
}
.mc-list-body-col {}
.mc-list-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}
.mc-list-time {
    font-size: 12px;
    color: var(--mc-muted);
    margin-bottom: 4px;
}
.mc-list-desc {
    font-size: 13px;
    color: var(--mc-muted);
    line-height: 1.45;
}
.mc-list-badge-col { padding-top: 3px; }
.mc-list-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.mc-empty {
    text-align: center;
    color: var(--mc-muted);
    padding: 40px 20px;
    font-size: 14px;
}

/* ── Modal ────────────────────────────────────────────────────── */
.mc-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30,25,20,.45);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.mc-modal-backdrop.mc-modal-open {
    display: flex;
    animation: mc-fade-in .15s ease;
}
@keyframes mc-fade-in { from { opacity:0 } to { opacity:1 } }

.mc-modal {
    background: #fff;
    border-radius: 10px;
    padding: 28px 30px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    animation: mc-slide-up .18s ease;
}
@keyframes mc-slide-up { from { transform:translateY(10px);opacity:0 } to { transform:translateY(0);opacity:1 } }

.mc-modal-close {
    position: absolute;
    top: 12px; right: 14px;
    font-size: 22px;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--mc-muted);
    font-family: var(--mc-font-body);
}
.mc-modal-close:hover { color: var(--mc-text); }

.mc-modal-ministry {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}
.mc-modal-title {
    font-family: var(--mc-font-head);
    font-size: 20px;
    margin: 0 0 8px;
    line-height: 1.3;
}
.mc-modal-meta {
    font-size: 13px;
    color: var(--mc-muted);
    margin-bottom: 12px;
}
.mc-modal-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--mc-text);
    margin: 0;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 600px) {
    .mc-toolbar { flex-direction: column; align-items: flex-start; }
    .mc-current-label { min-width: 120px; font-size: 14px; }
    .mc-day-cell { min-height: 60px; }
    .mc-event-pill { font-size: 9px; padding: 1px 4px; }
    .mc-list-item { grid-template-columns: 48px 1fr; }
    .mc-list-badge-col { display: none; }
    .mc-modal { padding: 20px; }
}
