/* Birthdays and Wedding Anniversaries lists (Pages/Birthdays, Pages/Anniversaries, Shared/CalendarFilters).
   Global rather than scoped because the filter bar is its own component shared by both pages.
   Each page sets its accent (--acc / --acc-2); each month section sets its own colour (--mc). */

.cal {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.cal--bday { --acc: #D6336C; --acc-2: #F76707; --acc-soft: #FFF0F5; }
.cal--wed  { --acc: #9C36B5; --acc-2: #C2255C; --acc-soft: #F8F0FC; }

/* ---- hero ---- */
.cal__hero {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 18px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--acc) 0%, var(--acc-2) 100%);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.cal__hero-art {
    flex: none;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.2);
}

.cal__hero-title { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; }
.cal__hero-text { margin: 4px 0 0; font-size: 0.82rem; line-height: 1.4; opacity: 0.95; }

.cal__hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 0;
}

.cal__hero-stats span {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.74rem;
    font-weight: 700;
}

/* ---- filter bar ---- */
.calf { display: flex; flex-direction: column; gap: 10px; }

/* Name box + a square binoculars button beside it. Fixed 48px height so nothing moves on tap. */
.calf__find { display: flex; gap: 8px; margin: 0; height: 48px; }

.calf__go {
    flex: none;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: var(--acc);
    color: #fff;
    display: grid;
    place-items: center;
}

.calf__go:active { transform: scale(0.95); }

/* 16px text: anything smaller and iPhone Safari zooms the whole page when the box is tapped
   (the "jerk"). The focus ring is a shadow, not a thicker border, so the box never changes size. */
.calf__search {
    flex: 1;
    min-width: 0;
    height: 48px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}

.calf__search:focus {
    outline: none;
    border-color: var(--acc);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 25%, transparent);
}

/* 13 chips in a 7-column grid: All + Jan–Jun on top, Jul–Dec below. Fits a narrow phone, no scrolling. */
.calf__months {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calf__chip {
    position: relative;
    padding: 7px 0;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 700;
}

.calf__chip--on {
    background: var(--acc);
    border-color: var(--acc);
    color: #fff;
}

/* A small dot marks the current month. */
.calf__chip--now::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--acc-2);
}

.calf__chip--on.calf__chip--now::after { background: #fff; }

.calf__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.calf__day {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-soft);
}

.calf__day select {
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-size: 16px;   /* below 16px iPhone zooms the page on tap */
}

.calf__today, .calf__clear {
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
}

.calf__clear { margin-left: auto; color: var(--acc); border-color: transparent; background: transparent; }

/* ---- results ---- */
.cal__summary { margin: 0; font-size: 0.78rem; color: var(--text-mute); }

.cal__notice, .cal__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 0;
    color: var(--text-mute);
    text-align: center;
}

.cal__empty span { font-size: 2.4rem; }
.cal__empty p { margin: 0; }

.cal__month { display: flex; flex-direction: column; gap: 8px; }

.cal__month-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0 0;
    padding: 8px 14px;
    border-radius: 12px;
    background: var(--mc);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.cal__month-count {
    padding: 1px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    font-size: 0.76rem;
}

.cal__list { display: flex; flex-direction: column; gap: 8px; }

.cal__card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--mc);
    text-decoration: none;
    color: inherit;
}

.cal__card--today {
    background: linear-gradient(135deg, var(--acc-soft) 0%, var(--surface) 100%);
    border-color: var(--acc);
    border-left-color: var(--acc);
    box-shadow: 0 4px 14px rgba(214, 51, 108, 0.18);
}

.cal__badge {
    flex: none;
    width: 50px;
    height: 54px;
    border-radius: 12px;
    background: var(--mc);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cal__badge-day { font-size: 1.35rem; font-weight: 800; }
.cal__badge-mon { margin-top: 3px; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.92; }

.cal__body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.cal__name { font-weight: 700; font-size: 0.92rem; color: var(--text); }
.cal__name--wife { display: flex; align-items: center; gap: 5px; }
.cal__heart { font-size: 0.72rem; }

.cal__sub {
    font-size: 0.75rem;
    color: var(--text-mute);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal__when {
    flex: none;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.cal__when--today { background: var(--acc); border-color: var(--acc); color: #fff; }

/* One colour per month, used by the month header, the date badge and the card's edge. */
.cal__month--m1  { --mc: #1C7ED6; }
.cal__month--m2  { --mc: #D6336C; }
.cal__month--m3  { --mc: #2F9E44; }
.cal__month--m4  { --mc: #E67700; }
.cal__month--m5  { --mc: #AE3EC9; }
.cal__month--m6  { --mc: #0C8599; }
.cal__month--m7  { --mc: #E8590C; }
.cal__month--m8  { --mc: #4263EB; }
.cal__month--m9  { --mc: #C2255C; }
.cal__month--m10 { --mc: #B35C00; }
.cal__month--m11 { --mc: #7048E8; }
.cal__month--m12 { --mc: #C92A2A; }

@media (prefers-color-scheme: dark) {
    .cal--bday { --acc-soft: #3A1626; }
    .cal--wed  { --acc-soft: #2E1A38; }
    .cal__hero { box-shadow: none; }
    .cal__card--today { box-shadow: none; }
}
