/* schedule.css — shared look for the public pages (Today's Meetings, All Meetings, Hospital Meetings,
   All Groups, Location Search, About AA, Am I an Alcoholic). Loaded after style.css; the side panel +
   hamburger still come from style.css.
   Default tokens are the green identity (Today, About, self-assessment); body.theme-navy switches to the
   navy band (All Meetings, All Groups, Location Search); body.theme-hospital is the teal wash. */

:root {
    --paper: #F4F6F9;
    --card: #FFFFFF;
    --ink: #1B2A41;
    --ink-2: #3D4A5C;
    --muted: #6B7A8C;
    --faint: #8391A2;
    --line: #E3E8EF;
    --line-2: #EEF2F6;
    --brand: #2C5282;
    --brand-ink: #1E3A5F;
    --brand-soft: #EAF0F8;
    --accent: #38A169;
    --accent-ink: #2F855A;
    --accent-soft: #E8F5E9;
    --accent-line: #BFE3CB;
    --live: #2F855A;
    --live-soft: #E6F4EC;
    --next: #7A5A06;
    --next-soft: #FBF3D5;
    --gold: #C9A227;
    --row-hover: #F6FBF7;
    --row-open: #F1F8F3;
    --wash: #E1F2E6;
    --font-body: 'IBM Plex Sans', 'IBM Plex Sans Devanagari', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Martel', 'IBM Plex Sans Devanagari', Georgia, serif;
    --radius: 14px;
    --rail: 96px;
}

body {
    font-family: var(--font-body);
    background-color: var(--paper);
    /* soft green wash behind the top bar and hero, fading into the page */
    background-image: linear-gradient(180deg, var(--wash) 0%, rgba(244, 246, 249, 0) 100%);
    background-repeat: no-repeat;
    background-size: 100% 480px;
    color: var(--ink-2);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px 56px;
}

/* ---------- top bar ---------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0 4px;
}

.topbar .hamburger {
    border-color: var(--accent-line);
    color: var(--accent-ink);
    background: var(--card);
}

.topbar .hamburger:hover {
    background: var(--accent-ink);
    border-color: var(--accent-ink);
    color: #fff;
    transform: none;
}

.topbar-brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1.2;
    margin-right: auto;
    min-width: 0;
}

.topbar-brand strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.topbar-brand span {
    font-size: 12px;
    color: var(--muted);
}

.lang-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 8px 30px 8px 14px;
    border: 1px solid var(--accent-line);
    border-radius: 999px;
    background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236B7A8C' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    font: 500 13px var(--font-body);
    color: var(--ink-2);
    cursor: pointer;
}

.lang-select:focus-visible {
    outline: 2px solid var(--accent-ink);
    outline-offset: 2px;
}

/* ---------- hero ---------- */
.hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 4px 4px;
}

.hero-text {
    min-width: 0;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-ink);
}

.eyebrow::before {
    content: '';
    width: 22px;
    height: 2px;
    background: var(--accent);
    flex-shrink: 0;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.3rem, 6.5vw, 3.5rem);
    line-height: 1.12;
    color: var(--ink);
    margin: 8px 0 0;
    letter-spacing: -0.01em;
}

/* Devanagari carries marks above the headline — give the display face room */
html:lang(mr) .hero-title,
html:lang(hi) .hero-title {
    line-height: 1.3;
    margin-top: 4px;
}

.hero-sub {
    font-size: 17px;
    font-weight: 500;
    color: var(--ink-2);
    margin-top: 2px;
}

.hero-meta {
    margin-top: 10px;
    font-size: 14.5px;
    color: var(--muted);
}

/* longer intro paragraph under the title (Hospital Meetings, About) */
.hero-lede {
    margin-top: 12px;
    max-width: 62ch;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--ink-2);
}

.hero-note {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--accent-line);
    font-size: 14px;
    color: var(--ink-2);
}

.hero-note a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.hero-note a:hover { text-decoration: underline; }

.hero-links {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.hero-links a {
    color: var(--brand);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
}

.hero-links a:hover {
    border-bottom-color: currentColor;
}

.hero-art {
    height: 64px;
    width: auto;
    opacity: 0.85;
    flex-shrink: 0;
    margin-bottom: 6px;
}

/* ---------- "New to AA?" strip ---------- */
.newhere {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 12px 10px 16px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    border-radius: 12px;
    font-size: 14px;
    color: var(--brand-ink);
}

.newhere-q {
    font-weight: 600;
    margin-right: 4px;
}

.newhere a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    background: var(--card);
    border-radius: 999px;
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid transparent;
    transition: border-color 0.15s;
}

.newhere a:hover,
.newhere a:focus-visible {
    border-color: var(--accent);
    outline: none;
}

.newhere a i {
    font-size: 0.95em;
    color: var(--accent-ink);
}

/* ---------- toolbar (All Meetings) ---------- */
.toolbar {
    margin-top: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
}

.toolbar-search {
    position: relative;
}

.toolbar-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--faint);
    pointer-events: none;
}

.toolbar input,
.toolbar select {
    width: 100%;
    font: 400 15px var(--font-body);
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    color: var(--ink);
}

.toolbar input {
    padding-left: 40px;
}

.toolbar select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 34px;
    background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236B7A8C' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
    cursor: pointer;
    min-width: 150px;
}

.toolbar input:focus,
.toolbar select:focus {
    outline: 2px solid var(--accent-ink);
    outline-offset: 1px;
    border-color: transparent;
}

.results-line {
    margin: 16px 4px 0;
    font-size: 13px;
    color: var(--muted);
}

.results-line strong {
    color: var(--ink);
    font-weight: 600;
}

/* ---------- schedule sections ---------- */
.sched {
    margin-top: 28px;
}

.sched-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 4px 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-ink);
}

.sched-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--accent-line);
}

.sched-count {
    color: var(--muted);
    letter-spacing: 0;
    font-weight: 500;
}

.sched-label a {
    order: 3;
    color: var(--brand);
    text-decoration: none;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 600;
    font-size: 13px;
}

.sched-label a:hover { text-decoration: underline; }

.sched-label button {
    order: 3;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand);
    font: 600 13px var(--font-body);
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

.sched-label button:hover { text-decoration: underline; }

.sched-label button + a { margin-left: 0; }

.sched-list {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.sched-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.sched-empty h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--ink);
    margin-bottom: 6px;
}

.sched-empty a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--accent-ink);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

/* skeleton while loading */
.sched-skeleton {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.sched-skeleton div {
    height: 66px;
    border-top: 1px solid var(--line-2);
    background: linear-gradient(90deg, transparent 0 20%, var(--paper) 40% 60%, transparent 80%) no-repeat;
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}

.sched-skeleton div:first-child { border-top: 0; }

@keyframes shimmer {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

/* ---------- a meeting row ---------- */
.mrow {
    border-top: 1px solid var(--line-2);
}

.mrow:first-child {
    border-top: 0;
}

.mrow > summary {
    list-style: none;
    cursor: pointer;
    outline: none;
}

.mrow > summary::-webkit-details-marker {
    display: none;
}

.mrow > summary::marker {
    content: '';
}

.mrow > summary:focus-visible .mrow-chev {
    box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent-ink);
}

.mrow-summary {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr) 160px 230px auto;
    gap: 0 18px;
    align-items: center;
    padding-right: 14px;
    transition: background-color 0.15s;
}

.mrow > summary:hover .mrow-summary {
    background: var(--row-hover);
}

.mrow[open] > summary .mrow-summary {
    background: var(--row-open);
}

/* time rail */
.mrow-time {
    position: relative;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 15px 14px 15px 20px;
    border-right: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
}

.mrow-time::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    width: 9px;
    height: 9px;
    margin-top: -5px;
    border-radius: 50%;
    background: #C7D0DC;
    border: 2px solid var(--card);
    box-sizing: border-box;
}

.mrow-start {
    font-size: 17px;
    font-weight: 600;
    color: var(--accent-ink);
    line-height: 1.2;
    white-space: nowrap;
}

.mrow-end {
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
}

.mrow-period {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint);
    margin-top: 2px;
}

.mrow-tbd {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    white-space: normal;
    line-height: 1.3;
}

/* name + place */
.mrow-main {
    min-width: 0;
    padding: 14px 0;
}

.mrow-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}

.mrow-place {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.4;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mrow-tag {
    display: inline-block;
    vertical-align: 2px;
    margin-left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
}

.mrow-days {
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.4;
}

/* time shown under the days when the rail is used for something else (distance) */
.mrow-when {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

/* distance rail (Location Search) */
.mrow-dist {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-ink);
    line-height: 1.2;
    white-space: nowrap;
}

.mrow-dist small {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    margin-left: 3px;
    letter-spacing: 0.02em;
}

.mrow-contacts {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.mrow-contact {
    display: flex;
    gap: 8px;
    align-items: baseline;
    font-size: 13px;
    text-decoration: none;
    color: var(--ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mrow-contact-phone {
    color: var(--brand);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.mrow-contact:hover .mrow-contact-phone {
    text-decoration: underline;
}

.mrow-none {
    font-size: 13px;
    color: var(--faint);
}

/* right-hand actions: pin + chevron */
.mrow-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mrow-pin,
.mrow-chev {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--accent-ink);
    border: 1px solid var(--line);
    background: var(--card);
    text-decoration: none;
    font-size: 15px;
    transition: background-color 0.15s, border-color 0.15s, transform 0.2s ease;
}

.mrow-pin:hover,
.mrow-pin:focus-visible {
    background: var(--accent-soft);
    border-color: var(--accent);
    outline: none;
}

.mrow-chev {
    font-size: 13px;
}

.mrow > summary:hover .mrow-chev {
    border-color: var(--accent);
}

.mrow[open] .mrow-chev {
    transform: rotate(180deg);
    background: var(--accent-ink);
    border-color: var(--accent-ink);
    color: #fff;
}

/* status variants */
.mrow.is-live .mrow-time::after {
    background: var(--live);
    animation: pulse 2s ease-out infinite;
}

.mrow.is-live .mrow-tag {
    background: var(--live-soft);
    color: var(--live);
}

.mrow.is-next .mrow-time::after {
    background: var(--gold);
}

.mrow.is-next .mrow-tag {
    background: var(--next-soft);
    color: var(--next);
}

.mrow.is-ended .mrow-time::after {
    background: var(--card);
    border-color: #C7D0DC;
}

.mrow.is-ended .mrow-start,
.mrow.is-ended .mrow-name {
    color: var(--muted);
    font-weight: 500;
}

.mrow.is-ended .mrow-place,
.mrow.is-ended .mrow-end,
.mrow.is-ended .mrow-days {
    color: var(--faint);
}

.mrow.is-ended .mrow-tag {
    background: var(--line-2);
    color: var(--muted);
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(47, 133, 90, 0.45); }
    70%  { box-shadow: 0 0 0 8px rgba(47, 133, 90, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47, 133, 90, 0); }
}

/* expanded panel */
.mrow-panel {
    margin-left: var(--rail);
    border-left: 1px solid var(--line);
    padding: 4px 20px 20px 20px;
    animation: mrow-in 0.18s ease-out;
}

@keyframes mrow-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

.mrow-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px 24px;
    margin: 0 0 14px;
}

.mrow-facts dt {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
}

.mrow-facts dd {
    font-size: 14px;
    color: var(--ink-2);
    margin: 0;
    line-height: 1.45;
}

.mrow-fact-wide {
    grid-column: 1 / -1;
}

.mrow-panel-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--brand-ink);
    font-size: 14px;
    text-decoration: none;
    transition: border-color 0.15s, background-color 0.15s;
}

.chip i {
    color: var(--accent-ink);
    font-size: 0.85em;
}

.chip strong {
    font-weight: 600;
}

.chip span {
    font-variant-numeric: tabular-nums;
}

.chip:hover,
.chip:focus-visible {
    border-color: var(--accent);
    background: var(--accent-soft);
    outline: none;
}

.btn-maps {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--accent-ink);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-left: auto;
    transition: background-color 0.15s;
}

.btn-maps:hover,
.btn-maps:focus-visible {
    background: var(--accent);
    outline: none;
}

.only-narrow {
    display: none;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    :root { --rail: 74px; }

    .hero-art {
        display: none;
    }

    .mrow-summary {
        grid-template-columns: var(--rail) minmax(0, 1fr) auto;
        gap: 0 12px;
    }

    .mrow-days,
    .mrow-contacts {
        display: none;
    }

    .mrow-panel {
        margin-left: 0;
        border-left: 0;
        padding: 14px 16px 18px;
        background: var(--row-open);
        border-top: 1px solid var(--line-2);
    }

    .mrow-facts {
        grid-template-columns: 1fr 1fr;
        gap: 12px 16px;
    }

    .only-narrow {
        display: block;
    }

    .btn-maps {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .page {
        padding: 0 12px 40px;
    }

    .topbar {
        gap: 10px;
    }

    .topbar .hamburger {
        width: 40px;
        height: 40px;
        font-size: 1.05rem;
    }

    .topbar-brand strong {
        font-size: 14px;
    }

    .hero {
        padding-top: 20px;
    }

    .hero-sub {
        font-size: 15.5px;
    }

    .newhere {
        padding: 10px 10px 10px 14px;
    }

    .newhere-q {
        width: 100%;
        margin: 0 0 2px;
    }

    .toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .toolbar-search {
        grid-column: 1 / -1;
    }

    .toolbar select {
        min-width: 0;
    }

    .mrow-time {
        padding: 13px 10px 13px 14px;
    }

    .mrow-start {
        font-size: 16px;
    }

    .mrow-main {
        padding: 12px 0;
    }

    .mrow-name {
        font-size: 15px;
    }

    .mrow-place {
        font-size: 13px;
    }

    .mrow-tag {
        display: block;
        width: max-content;
        margin: 4px 0 0;
    }

    .mrow-pin,
    .mrow-chev {
        width: 36px;
        height: 36px;
    }

    .mrow-panel-actions .btn-maps {
        width: 100%;
        justify-content: center;
        margin-top: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mrow.is-live .mrow-time::after,
    .sched-skeleton div {
        animation: none;
    }

    .mrow-panel {
        animation: none;
    }

    .mrow-pin,
    .mrow-chev,
    .mrow-summary {
        transition: none;
    }
}

/* ---------- navy band identity: All Meetings, All Groups, Location Search ---------- */
body.theme-navy {
    --accent: #2C5282;
    --accent-ink: #1E3A5F;
    --accent-soft: #EAF0F8;
    --accent-line: #C3D3E8;
    --row-hover: #F5F8FC;
    --row-open: #EEF3F9;
    background-image: none;
}

.theme-navy .hero-band {
    margin-top: 12px;
    padding: 6px 28px 24px;
    border-radius: 18px;
    background: linear-gradient(160deg, #1E3A5F 0%, #2C5282 100%);
    color: #fff;
    box-shadow: 0 10px 30px rgba(30, 58, 95, 0.18);
}

.theme-navy .hero {
    padding: 22px 0 4px;
}

.theme-navy .eyebrow {
    color: #A9C4E8;
}

.theme-navy .eyebrow::before {
    background: #A9C4E8;
}

.theme-navy .hero-title {
    color: #fff;
}

.theme-navy .hero-sub {
    color: rgba(255, 255, 255, 0.82);
}

.theme-navy .hero-links a {
    color: #fff;
}

.theme-navy .hero-art {
    filter: brightness(0) invert(1);
    opacity: 0.35;
}

.theme-navy .toolbar {
    margin-top: 18px;
}

.theme-navy .toolbar input,
.theme-navy .toolbar select {
    border-color: transparent;
}

.theme-navy .toolbar input:focus,
.theme-navy .toolbar select:focus {
    outline-color: #A9C4E8;
}

.theme-navy .results-line {
    margin-top: 18px;
}

@media (max-width: 640px) {
    .theme-navy .hero-band {
        padding: 2px 16px 16px;
        border-radius: 14px;
    }
}


/* ---------- Hospital Meetings: teal wash (carried over from the old teal header) ---------- */
body.theme-hospital {
    --accent: #319795;
    --accent-ink: #2C7A7B;
    --accent-soft: #E6FFFA;
    --accent-line: #B2DFDB;
    --row-hover: #F3FBFA;
    --row-open: #EAF7F5;
    --wash: #DDF3F1;
}

/* pulse colour follows the accent on teal pages */
.theme-hospital .mrow.is-live .mrow-time::after {
    background: var(--accent-ink);
}

.theme-hospital .mrow.is-live .mrow-tag {
    background: var(--accent-soft);
    color: var(--accent-ink);
}
