/*
 * Mountain Lakes Calendar
 *
 * Styled to match the borough site's existing "Community Calendar" sidebar
 * widget: a serif heading with an underline rule, one row per event made of a
 * grey rounded date badge (month / day / weekday) beside the event detail, with
 * the time in the site's maroon accent, the title in dark slate, and the
 * location as "@ place". A small bordered "View Calendar" button closes the list.
 */
 
 

.mlcal {
    --mlcal-ink:     #2f3439;
    --mlcal-muted:   #8a9098;
    --mlcal-maroon:  #9d2b34;
    --mlcal-line:    #e4e7ea;
    --mlcal-badgebg: #f3f4f5;
    --mlcal-head:    #3a4149;
    --mlcal-rule:    #c9ced3;

    color: var(--mlcal-ink);
    font-size: 15px;
    line-height: 1.4;
    max-width: 100%;
}

/* ---- Agenda / sidebar widget ------------------------------------------ */
/* The borough's "Community Calendar" sidebar: one row per event — a rounded
   date badge (navy month bar over a grey day/weekday block) beside the event
   detail in a bordered white card, time and title in the site blue, location
   as "@ place". Scoped to .mlcal-agenda so the month page can reuse the same
   element names with a different treatment.

   The resets below are deliberate: sidebar widgets inherit list bullets, li
   margins, link colours and font sizes from the theme, and any of those will
   pull the widget off the reference look. */

.mlcal-agenda {
    /* Sampled from the borough's own widget. */
    --mlcal-blue:    #3d6b99; /* event time + title + location */
    --mlcal-navy:    #333366; /* date-badge header bar */
    --mlcal-line:    #cccccc; /* badge and card borders */
    --mlcal-badgebg: #f2f2f2; /* badge body */
    --mlcal-stripe:  #f2f2f2; /* strip behind each card */
    --mlcal-daynum:  #333333; /* day number */
    --mlcal-wday:    #6b6b6b; /* weekday label */
    --mlcal-head:    #4a4f57;

    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.35;
    color: var(--mlcal-ink);
    box-sizing: border-box;
}
.mlcal-agenda *, .mlcal-agenda *::before, .mlcal-agenda *::after { box-sizing: inherit; }

.mlcal-agenda-head {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.7rem;
    font-weight: 400;
    color: var(--mlcal-head);
    margin: 0 0 0.4rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--mlcal-rule);
}

/* Theme-proof list reset */
.mlcal-agenda .mlcal-list,
.mlcal-agenda .mlcal-list li {
    list-style: none;
    margin: 0;
    padding: 0;
}
.mlcal-agenda .mlcal-list li::before,
.mlcal-agenda .mlcal-list li::after { content: none; }

.mlcal-agenda .mlcal-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 0.4rem;
    margin: 0 0 0.35rem;             /* small gap between rows, as the image */
    background: var(--mlcal-stripe);
    border-radius: 4px;
}

/* Date badge: navy month header over a grey day/weekday body */
.mlcal-agenda .mlcal-badge {
    flex: 0 0 auto;
    width: 52px;
    text-align: center;
    border: 1px solid var(--mlcal-line);
    border-radius: 4px;
    overflow: hidden;
    background: var(--mlcal-badgebg);
    padding: 0;
    margin: 0;
    line-height: 1;
    display: block;
}

.mlcal-agenda .mlcal-badge-mon {
    display: block;
    background: var(--mlcal-navy);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;      /* "SEP" */
    padding: 4px 0 3px;
    margin: 0;
}

.mlcal-agenda .mlcal-badge-day {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--mlcal-daynum);
    line-height: 1.1;
    padding: 3px 0 1px;
    margin: 0;
}

.mlcal-agenda .mlcal-badge-wday {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;      /* "THU" — was missing */
    color: var(--mlcal-wday);
    padding: 0 0 5px;
    margin: 0;
}

/* Event detail: a bordered white card */
.mlcal-agenda .mlcal-detail {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    background: #fff;
    border: 1px solid var(--mlcal-line);
    border-radius: 4px;
    padding: 0.55rem 0.7rem;
    line-height: 1.35;
    font-size: 15px;
}

/* Theme-proof link styling inside the card */
.mlcal-agenda .mlcal-detail a,
.mlcal-agenda .mlcal-detail a:visited {
    color: var(--mlcal-blue);
    text-decoration: none;
    border: 0;
    box-shadow: none;
    background: none;
}
.mlcal-agenda .mlcal-time { color: var(--mlcal-blue); font-weight: 700; }
.mlcal-agenda .mlcal-name { color: var(--mlcal-blue); font-weight: 400; }
.mlcal-agenda .mlcal-loc  { color: var(--mlcal-blue); font-weight: 400; }
.mlcal-agenda .mlcal-detail a:hover .mlcal-name,
.mlcal-agenda .mlcal-detail a:focus .mlcal-name { text-decoration: underline; }

/* View Calendar button */
.mlcal-agenda .mlcal-more { text-align: right; margin-top: 0.7rem; }

.mlcal-agenda .mlcal-more-btn,
.mlcal-agenda .mlcal-more-btn:visited {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 400;
    color: #333333;
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--mlcal-line);
    border-radius: 4px;
    background: #fff;
    box-shadow: none;
}
.mlcal-agenda .mlcal-more-btn:hover,
.mlcal-agenda .mlcal-more-btn:focus {
    border-color: var(--mlcal-muted);
    background: var(--mlcal-stripe);
    text-decoration: none;
}

/* ---- Month page (view="month") ---------------------------------------- */
/* Matches the full calendar page: toolbar, month/year nav bars above and below
   the grid, day number top-right, blue event links with bold trailing time,
   pale-blue week tint, and a yellow "today" cell. */

.mlcal-monthpage { font-size: 13px; }

/* Toolbar: Categories / Tags */
/* Two dropdown toggles in a bordered bar, as the borough's calendar has it.
   <details>/<summary>, so it opens without JavaScript. */
.mlcal-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    align-items: center;
    border: 1px solid var(--mlcal-line);
    border-radius: 4px;
    padding: 0.6rem 0.9rem;
    margin-bottom: 0.6rem;
}

.mlcal-tool { position: relative; }

.mlcal-tool-toggle {
    color: #3d6c94;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    list-style: none;          /* hide the default disclosure marker */
    padding: 0.1rem 0;
    user-select: none;
}
.mlcal-tool-toggle::-webkit-details-marker { display: none; }
.mlcal-tool-toggle::marker { content: ''; }
.mlcal-tool-toggle:hover { text-decoration: underline; }
.mlcal-tool-toggle:focus-visible { outline: 2px solid var(--mlcal-maroon); outline-offset: 2px; }
.mlcal-tool-ico { opacity: 0.8; font-style: normal; }
.mlcal-tool-on .mlcal-tool-toggle { color: var(--mlcal-maroon); }

/* Caret, rotated when the dropdown is open. */
.mlcal-caret {
    border-top: 4px solid currentColor;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    display: inline-block;
    margin-left: 0.1rem;
    transition: transform 0.12s ease;
}
.mlcal-tool[open] .mlcal-caret { transform: rotate(180deg); }

.mlcal-dropdown {
    position: absolute;
    z-index: 30;
    top: 100%;
    left: 0;
    margin-top: 0.35rem;
    min-width: 14rem;
    max-width: 22rem;
    max-height: 18rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--mlcal-line);
    border-radius: 4px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    padding: 0.25rem 0;
}

.mlcal-dd-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0.8rem;
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--mlcal-ink);
    text-decoration: none;
    white-space: nowrap;
}
.mlcal-dd-item:hover, .mlcal-dd-item:focus { background: var(--mlcal-badgebg); text-decoration: none; }
.mlcal-dd-on { font-weight: 700; color: var(--mlcal-maroon); }
.mlcal-dd-name { overflow: hidden; text-overflow: ellipsis; }
.mlcal-dd-n { opacity: 0.55; font-size: 0.85em; flex: 0 0 auto; }

.mlcal-term-clear { font-size: 0.82rem; color: var(--mlcal-maroon); text-decoration: none; }
.mlcal-term-clear:hover { text-decoration: underline; }

@media ( max-width: 640px ) {
    .mlcal-dropdown { min-width: 12rem; max-width: 90vw; }
}

.mlcal-single-cats { font-size: 0.9rem; margin: 0 0 1.2rem; }
.mlcal-single-cats a { color: var(--mlcal-maroon); text-decoration: none; }
.mlcal-single-cats a:hover { text-decoration: underline; }
.mlcal-field-label { color: var(--mlcal-muted); font-weight: 600; }

/* Navigation bar (rendered above and below the grid) */
.mlcal-nav {
    display: flex;
    gap: 0.4rem;
    align-items: stretch;
    margin: 0.6rem 0;
    flex-wrap: wrap;
}
.mlcal-navbtn {
    font-size: 0.8rem;
    color: #444;
    text-decoration: none;
    border: 1px solid var(--mlcal-line);
    border-radius: 4px;
    padding: 0.4rem 0.7rem;
    background: #fff;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.mlcal-navbtn:hover { background: var(--mlcal-badgebg); }
.mlcal-navnow { font-weight: 700; color: var(--mlcal-ink); }
.mlcal-nav-ico { opacity: 0.85; }

/* Subscribe dropdown, bottom-right under the grid. */
.mlcal-subscribe { display: flex; justify-content: flex-end; margin: .5rem 0 0; }
.mlcal-subscribe-tool .mlcal-tool-toggle {
    border: 1px solid var(--mlcal-line);
    border-radius: 4px;
    padding: .35rem .7rem;
    background: #fff;
    font-size: .82rem;
    color: #444;
}
.mlcal-subscribe-tool .mlcal-tool-toggle:hover { background: var(--mlcal-badgebg); text-decoration: none; }
.mlcal-dropdown-right { left: auto; right: 0; }
/* Opening upward would be nicer, but a downward panel cannot be clipped by the
   page end, and the grid is tall enough that this sits well below the fold. */

/* Grid */
.mlcal-grid { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; }

.mlcal-grid th {
    background: var(--mlcal-badgebg);
    color: #6b7078;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    padding: 0.45rem 0.25rem;
    border: 1px solid var(--mlcal-line);
}

.mlcal-cell, .mlcal-blank {
    border: 1px solid var(--mlcal-line);
    vertical-align: top;
    height: 6.8rem;
    padding: 0.2rem 0.3rem 0.3rem;
    position: relative;
}
.mlcal-blank { background: #fafbfc; }

/* Day number sits top-right, like the reference */
.mlcal-cell-num {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    color: #5a6068;
    margin-bottom: 0.2rem;
}

/* pale blue tint across the top strip of each cell (reference has a light
   blue band under the day number row) */
.mlcal-cell { background: linear-gradient(to bottom, #eff5fb 0, #eff5fb 1.55rem, #fff 1.55rem); }

/* today = pale yellow */
.mlcal-today { background: #fbf8d8 !important; }

/* Events: blue links, bold trailing time, single-line truncation */
.mlcal-cell-events { margin: 0; padding: 0; }
.mlcal-ev {
    font-size: 0.8rem;
    line-height: 1.3;
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mlcal-ev a { color: #2f6fb0; text-decoration: none; }
.mlcal-ev a:hover { text-decoration: underline; }
.mlcal-ev-name { color: #2f6fb0; }
.mlcal-ev b { color: #333; font-weight: 700; }

/* ---- Single event page -------------------------------------------------- */

.mlcal-single-inner { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1rem; }
.mlcal-single-title { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; margin: 0 0 1rem; }
.mlcal-single-meta { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0 0 1.25rem; }
.mlcal-single-meta dt { color: var(--mlcal-muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding-top: 0.15rem; }
.mlcal-single-meta dd { margin: 0; }
.mlcal-single-desc { margin-bottom: 1.5rem; }
.mlcal-single-sub { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mlcal-muted); border-bottom: 1px solid var(--mlcal-rule); padding-bottom: 0.35rem; }
.mlcal-single-dates { list-style: none; margin: 0.6rem 0 1.5rem; padding: 0; }
.mlcal-single-dates li { padding: 0.3rem 0; border-bottom: 1px solid var(--mlcal-line); }
.mlcal-single-dates a { color: var(--mlcal-maroon); text-decoration: none; }
.mlcal-single-dates a:hover { text-decoration: underline; }
.mlcal-draft { font-size: 0.6em; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.15em 0.5em; border: 1px solid currentColor; border-radius: 3px; opacity: 0.65; vertical-align: middle; }
.mlcal-notice { font-size: 0.85rem; padding: 0.5rem 0.7rem; border-left: 3px solid currentColor; opacity: 0.75; margin: 0 0 0.8rem; }

/* ---- Submission form ---------------------------------------------------- */

.mlcal-sub-field { margin: 0 0 .9rem; }
.mlcal-sub-field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .25rem; }
.mlcal-sub-field input, .mlcal-sub-field textarea {
    width: 100%;
    padding: .5rem .6rem;
    border: 1px solid var(--mlcal-line);
    border-radius: 4px;
    font: inherit;
    background: #fff;
    color: var(--mlcal-ink);
    box-sizing: border-box;
}
.mlcal-sub-field input:focus, .mlcal-sub-field textarea:focus { outline: 2px solid var(--mlcal-maroon); outline-offset: 1px; }
.mlcal-sub-row { display: flex; gap: .8rem; }
.mlcal-sub-row .mlcal-sub-field { flex: 1 1 0; min-width: 0; }
.mlcal-req { color: var(--mlcal-maroon); }
.mlcal-sub-check { margin: 0 0 .9rem; }
.mlcal-sub-note { font-size: .88rem; opacity: .8; margin: 1rem 0; }
.mlcal-sub-form button { cursor: pointer; font: inherit; }

/* Policy the submitter must accept. Scrollable rather than collapsed, so it is
   plainly visible that there is something to read before agreeing. */
.mlcal-disclaimer { margin: 1.4rem 0; }
.mlcal-disclaimer-head {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0 0 .5rem;
    color: var(--mlcal-head);
}
.mlcal-disclaimer-text {
    max-height: 15rem;
    overflow-y: auto;
    border: 1px solid var(--mlcal-line);
    border-radius: 4px;
    padding: .8rem 1rem;
    background: var(--mlcal-badgebg);
    font-size: .85rem;
    line-height: 1.5;
}
.mlcal-disclaimer-text:focus-visible { outline: 2px solid var(--mlcal-maroon); outline-offset: 1px; }
.mlcal-disclaimer-text p { margin: 0 0 .7rem; }
.mlcal-disclaimer-text p:last-child { margin-bottom: 0; }
.mlcal-disclaimer-accept { margin-top: .7rem; font-size: .92rem; }

/* Honeypot: off-screen rather than display:none, which some bots detect. */
.mlcal-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.mlcal-sub-errors {
    border-left: 3px solid var(--mlcal-maroon);
    background: rgba(157, 43, 52, .06);
    padding: .7rem .9rem;
    margin: 0 0 1.2rem;
    font-size: .92rem;
}
.mlcal-sub-errors ul { margin: .3rem 0 0; padding-left: 1.2rem; }

.mlcal-sub-done {
    border-left: 3px solid #2e7d46;
    background: rgba(46, 125, 70, .07);
    padding: .9rem 1rem;
    font-size: .95rem;
}
.mlcal-sub-done p { margin: 0 0 .4rem; }
.mlcal-sub-done p:last-child { margin-bottom: 0; }

@media ( max-width: 640px ) {
    .mlcal-sub-row { flex-direction: column; gap: 0; }
}

/* ---- Empty state -------------------------------------------------------- */

.mlcal-empty { color: var(--mlcal-muted); font-style: italic; padding: 0.8rem 0; }

/* ---- Responsive --------------------------------------------------------- */

@media ( max-width: 640px ) {
    .mlcal-cell, .mlcal-blank { height: auto; min-height: 3.5rem; }
    .mlcal-cell-events li { font-size: 0.7rem; }
    .mlcal-single-meta { grid-template-columns: 1fr; gap: 0.1rem 0; }
    .mlcal-single-meta dd { margin-bottom: 0.5rem; }
}
