/* ==========================================================================
   /calendar — month grid with one count per day + the selected day's events
   listed underneath. Scoped to .calx; uses the shared --hero-* tokens.
   ========================================================================== */

.calx {
    --calx-navy: var(--hero-navy, #16213e);
    --calx-gold: #c8871a;
    --calx-yellow: var(--hero-yellow, #f4b942);
    --calx-border: #e7e4df;
    --calx-text: #12151a;
    --calx-text-2: #4b5158;
    --calx-muted: #979ca3;
    --calx-weekend: #fffcf4;
    margin-top: 28px;
    color: var(--calx-text);
}

/* ---- Toolbar ---- */
.calx-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.calx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    min-width: 38px;
    padding: 0 12px;
    border: 1px solid var(--calx-border);
    border-radius: 10px;
    background: #fff;
    color: var(--calx-text);
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
}
.calx-btn:hover { border-color: var(--calx-navy); color: var(--calx-navy); }
.calx-btn-text { font-size: 14px; font-weight: 600; padding: 0 16px; }
.calx-btn.is-active { background: var(--calx-navy); border-color: var(--calx-navy); color: #fff; }
.calx-title {
    margin: 0 8px;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.015em;
    color: var(--calx-navy);
}
.calx-title span { font-weight: 300; color: var(--calx-muted); }
.calx-total { margin-left: auto; font-size: 14px; color: var(--calx-text-2); }
.calx-total b { color: var(--calx-text); }

/* ---- Grid ---- */
.calx-weekdays,
.calx-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}
.calx-weekdays div {
    padding: 0 10px 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    color: var(--calx-muted);
}
.calx-weekdays .is-weekend { color: var(--calx-gold); }

.calx-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    height: 96px;
    padding: 9px 10px;
    border: 1px solid var(--calx-border);
    border-radius: 12px;
    background: #fff;
    color: var(--calx-text);
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}
a.calx-cell:hover { border-color: var(--calx-navy); color: var(--calx-text); box-shadow: 0 4px 14px rgba(22, 33, 62, .08); }
.calx-cell.is-weekend { background: var(--calx-weekend); }
.calx-cell.is-blank { background: transparent; border-color: transparent; }
.calx-cell.is-empty { background: transparent; border-color: #efece7; }
.calx-cell.is-empty .calx-num { color: #b9bcc2; font-weight: 500; }
.calx-cell.is-past { opacity: .5; }

.calx-num {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.calx-num em {
    font-style: normal;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--calx-gold);
}
.calx-count {
    align-self: flex-end;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--calx-navy);
    font-variant-numeric: tabular-nums;
}
.calx-count small {
    margin-left: 4px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--calx-text-2);
}

.calx-cell.is-selected,
a.calx-cell.is-selected:hover { background: var(--calx-navy); border-color: var(--calx-navy); color: #fff; opacity: 1; }
.calx-cell.is-selected .calx-num em { color: var(--calx-yellow); }
.calx-cell.is-selected .calx-count { color: #fff; }
.calx-cell.is-selected .calx-count small { color: #c9d0de; }

/* ---- Selected day ---- */
.calx-day { margin-top: 36px; scroll-margin-top: 90px; }
.calx-day-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.calx-day-head h2 {
    margin: 0;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
    color: var(--calx-navy);
}
.calx-day-head h2 span { font-weight: 300; color: var(--calx-text-2); }
.calx-day-count {
    padding: 4px 11px;
    border-radius: 999px;
    background: #f6ecd8;
    color: #7a4f0b;
    font-size: 13px;
    font-weight: 700;
}

.calx-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.calx-row {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 10px;
    border: 1px solid var(--calx-border);
    border-radius: 12px;
    background: #fff;
    color: var(--calx-text);
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}
.calx-row:hover { border-color: var(--calx-navy); color: var(--calx-text); box-shadow: 0 4px 14px rgba(22, 33, 62, .08); }
.calx-thumb {
    width: 78px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 7px;
    background: #f1efeb;
}
.calx-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.calx-kicker {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--calx-gold);
}
.calx-kicker:empty { display: none; }
.calx-status { color: #b3261e; }
.calx-name {
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.calx-place {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13.5px;
    color: var(--calx-text-2);
}
.calx-place svg { flex: none; color: var(--calx-muted); }

.calx-empty {
    margin-top: 28px;
    padding: 40px 16px;
    border: 1px dashed var(--calx-border);
    border-radius: 12px;
    text-align: center;
    color: var(--calx-text-2);
}
.calx-empty i { display: block; margin-bottom: 8px; font-size: 2rem; color: var(--calx-muted); }

/* ---- Tablet / mobile ---- */
@media (max-width: 991.98px) {
    .calx-list { grid-template-columns: 1fr; }
}
@media (max-width: 767.98px) {
    .calx { margin-top: 18px; }
    .calx-nav { gap: 8px; }
    .calx-title { order: -1; flex-basis: 100%; margin: 0 0 4px; font-size: 1.45rem; }
    .calx-total { font-size: 13px; }
    .calx-weekdays, .calx-grid { gap: 3px; }
    .calx-weekdays div { padding: 0 0 4px; text-align: center; font-size: 10.5px; }
    .calx-cell { height: 58px; padding: 5px 3px 6px; border-radius: 9px; align-items: center; }
    .calx-num { font-size: 13px; }
    .calx-num em { display: none; }
    .calx-cell.is-today:not(.is-selected) .calx-num { color: var(--calx-gold); }
    .calx-count {
        align-self: center;
        display: grid;
        place-items: center;
        min-width: 24px;
        height: 24px;
        padding: 0 6px;
        border-radius: 999px;
        background: #f6e3b8;
        color: #6b4508;
        font-size: 12.5px;
    }
    .calx-count small { display: none; }
    .calx-cell.is-selected .calx-count { background: var(--calx-yellow); color: var(--calx-navy); }
    .calx-day { margin-top: 26px; }
    .calx-day-head h2 { font-size: 1.4rem; }
    .calx-row { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
    .calx-thumb { width: 64px; }
    .calx-name { font-size: 14.5px; }
}

@media (prefers-reduced-motion: reduce) {
    .calx-cell, .calx-row { transition: none; }
}
