/* On this day (2026-11-17, the owner's pick HI7): /on-this-day and /on-this-day/{mm-dd}, views/on_this_day.php.
   Every class starts .otd-. Colours are the site's variables (style.css :root) or plain colours that
   tools/build_dark_css.php turns dark; rerun it after changing a colour here. The calendar's shades are the classes
   .otd-b0 (no note) to .otd-b6 (the most), never a colour written into the page; they are the same in both looks. */

.otd-kicker { font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.otd-head { padding: .8rem 0 .4rem; max-width: 760px; }
.otd-head h1 { color: var(--navy); font-size: clamp(2rem, 4.4vw, 2.8rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: .35rem; }
.otd-head > p { color: var(--muted); font-size: 1.04rem; line-height: 1.6; margin-top: .6rem; }
.otd-muted { color: var(--muted); }
.otd-hero a:focus-visible, .otd-hero select:focus-visible, .otd-hero button:focus-visible, .otd-notes a:focus-visible,
.otd-notes summary:focus-visible, .otd-notes button:focus-visible, .otd-year-cal a:focus-visible, .otd-bl a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* the day */
.otd-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: center; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 1.5rem 1.6rem; margin: 1rem 0 1.4rem; }
.otd-mid { text-align: center; }
.otd-mid h2 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); color: var(--navy); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin: .2rem 0 .35rem; }
.otd-count { font-size: 1.06rem; color: var(--ink); }
.otd-count b { color: var(--accent-strong); }
.otd-todaytag { background: var(--accent-soft); color: var(--accent-strong); border-radius: 99px; padding: .05rem .55rem; letter-spacing: .06em; margin-left: .3rem; }
.otd-nav { border: 1.5px solid var(--accent); color: var(--accent); background: var(--card); border-radius: 12px; padding: .6rem .9rem; font-weight: 700; min-height: 48px; display: inline-flex; gap: .4rem; align-items: center; white-space: nowrap; text-decoration: none; }
.otd-nav:hover { background: var(--accent-soft); }
.otd-chooser { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1rem; align-items: end; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: .3rem; }
.otd-chooser label { display: grid; gap: .2rem; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.otd-chooser select { font: inherit; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); background: var(--card); border: 1.5px solid #c9d4e5; border-radius: 10px; padding: .5rem .7rem; min-height: 46px; min-width: 9rem; }
.otd-go { font: inherit; font-weight: 700; min-height: 46px; padding: .5rem 1rem; border-radius: 10px; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.otd-go:hover { background: var(--accent-strong); }
.otd-back { display: inline-flex; align-items: center; min-height: 46px; padding: 0 .4rem; font-weight: 700; }

/* the notes of the day */
.otd-notes { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 1.4rem 1.6rem 1.6rem; margin-bottom: 1.4rem; }
.otd-year { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1.2rem; padding: 1.1rem 0; border-top: 1px solid var(--line); }
.otd-year:first-child { border-top: 0; padding-top: .2rem; }
.otd-yr b { display: block; font-size: 1.9rem; font-weight: 800; color: var(--navy); line-height: 1; font-variant-numeric: tabular-nums; }
.otd-yr span { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; color: var(--muted); }
.otd-cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.otd-card { border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem; display: grid; gap: .1rem; background: var(--card); align-content: start; min-width: 0; }
.otd-fig { display: block; margin: -.75rem -.9rem .6rem; background: var(--thead); border-radius: 12px 12px 0 0; aspect-ratio: 520 / 300; position: relative; overflow: hidden; }
.otd-fig img { position: absolute; left: .7rem; top: .7rem; width: calc(100% - 1.4rem); height: calc(100% - 1.4rem); object-fit: contain; max-width: none; }
.otd-fig img.otd-noimg { opacity: .8; }
.otd-cterr { color: var(--navy); font-weight: 700; font-size: 1rem; }
.otd-val { font-size: .95rem; }
.otd-var { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; font-weight: 700; text-decoration: none; justify-self: start; padding: .3rem 0; min-height: 32px; display: inline-flex; align-items: center; }
.otd-var:hover { text-decoration: underline; }
.otd-credit { font-size: .8rem; color: var(--muted); }
.otd-cards-s { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem; }
.otd-card-s { padding: .55rem .7rem; }
.otd-card-s .otd-fig { margin: -.55rem -.7rem .45rem; }
.otd-card-s .otd-cterr { display: none; }
.otd-card-s .otd-credit { display: none; }
.otd-empty h3 { color: var(--navy); font-size: 1.2rem; margin-bottom: .4rem; }
.otd-empty p { color: var(--muted); margin-bottom: .9rem; }
.otd-near { display: flex; flex-wrap: wrap; gap: .6rem; }
.otd-near a { border: 1px solid #cfdcfb; background: var(--accent-soft); color: var(--accent-strong); border-radius: 10px; padding: .55rem .9rem; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; }
.otd-near a:hover { text-decoration: underline; }

/* a busy day, by territory */
.otd-bigsum { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 1rem; align-items: center; margin-bottom: 1rem; }
.otd-acts { display: flex; gap: .5rem; }
.otd-acts[hidden] { display: none; }
.otd-acts button { font: inherit; border: 1.5px solid var(--accent); background: var(--card); color: var(--accent); border-radius: 10px; padding: .45rem .9rem; font-weight: 700; min-height: 44px; cursor: pointer; }
details.otd-terr { border-top: 1px solid var(--line); }
details.otd-terr summary { list-style: none; display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 7.5rem 1.2rem; gap: 1rem; align-items: center; padding: .55rem .3rem; cursor: pointer; min-height: 48px; border-radius: 8px; }
details.otd-terr summary::-webkit-details-marker { display: none; }
details.otd-terr summary:hover { background: var(--thead); }
details.otd-terr summary b { color: var(--navy); }
details.otd-terr .otd-year-s { padding: .6rem .3rem .9rem; }
.otd-bar { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.otd-bar i { display: block; height: 16px; background: #2a78d6; border-radius: 0 4px 4px 0; flex: none; }
.otd-bar span { font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; }
.otd-ty { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .84rem; color: var(--muted); text-align: right; }
.otd-chev { color: var(--muted); transition: transform .15s; font-size: 1.3rem; line-height: 1; }
details[open] > summary .otd-chev { transform: rotate(90deg); }

/* the whole year */
.otd-year-cal { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 1.4rem 1.6rem 1.6rem; margin-bottom: 1.4rem; scroll-margin-top: 1rem; }
.otd-year-cal h2, .otd-busy h2 { color: var(--navy); font-size: 1.25rem; font-weight: 800; margin-bottom: .3rem; }
.otd-year-cal > .otd-muted { margin-bottom: .9rem; }
.otd-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: .9rem; }
.otd-legend span { display: inline-flex; gap: .35rem; align-items: center; }
.otd-legend i { width: 16px; height: 16px; border-radius: 4px; display: inline-block; position: relative; }
.otd-b0 { background: var(--card); box-shadow: inset 0 0 0 1px #cdd5e2; }
/* one blue at rising strength, set through --otd-shade so the dark-look builder leaves it alone: on the dark card
   the same strengths read the same way round, the most notes the brightest */
.otd-b1 { --otd-shade: rgba(42, 120, 214, .16); background: var(--otd-shade); }
.otd-b2 { --otd-shade: rgba(42, 120, 214, .32); background: var(--otd-shade); }
.otd-b3 { --otd-shade: rgba(42, 120, 214, .5); background: var(--otd-shade); }
.otd-b4 { --otd-shade: rgba(42, 120, 214, .68); background: var(--otd-shade); }
.otd-b5 { --otd-shade: rgba(42, 120, 214, .84); background: var(--otd-shade); }
.otd-b6 { --otd-shade: rgb(42, 120, 214); background: var(--otd-shade); }
.otd-grid { display: grid; gap: 3px; }
.otd-row { display: grid; grid-template-columns: 2.6rem repeat(31, minmax(0, 1fr)); gap: 3px; align-items: center; }
.otd-ml { font-size: .8rem; font-weight: 700; color: var(--muted); }
.otd-row-h span { font-size: .7rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.otd-cell { display: block; height: 24px; border-radius: 4px; position: relative; }
.otd-cell:hover { box-shadow: 0 0 0 2px var(--accent-strong); z-index: 1; }
.otd-cell.is-sel, .otd-legend i.is-sel { box-shadow: 0 0 0 3px var(--navy); z-index: 2; }
.otd-cell.is-today::after, .otd-legend i.is-today::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #c8962a; box-shadow: 0 0 0 1.5px #fff; }
.otd-phone { display: none; }
.otd-strips { list-style: none; display: grid; gap: 2px; }
.otd-strip { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: .4rem; align-items: center; border-radius: 8px; padding: .25rem .2rem; min-height: 44px; text-decoration: none; }
.otd-strip.is-on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.otd-sb { display: grid; grid-template-columns: repeat(31, minmax(0, 1fr)); gap: 1px; height: 22px; }
.otd-sb i { border-radius: 1px; }
.otd-sb i:not([class]) { background: none; }
.otd-sb i.is-sel { box-shadow: 0 0 0 1.5px var(--navy); position: relative; z-index: 1; }
.otd-month { display: none; }
.otd-month.is-on { display: block; }
.otd-month h3 { color: var(--navy); font-size: 1.05rem; font-weight: 800; margin: 1.1rem 0 .5rem; }
.otd-mg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.otd-mg a { min-height: 46px; border-radius: 8px; display: grid; align-content: center; justify-items: center; padding: .2rem 0; color: var(--ink); line-height: 1.1; text-decoration: none; }
.otd-mg a b { font-size: .95rem; }
.otd-mg a small { font-size: .7rem; min-height: .8rem; }
.otd-mg a.otd-b0 { color: var(--muted); }
.otd-mg a.is-dark { color: #fff; }
.otd-mg a.is-sel { box-shadow: 0 0 0 3px var(--navy); }

/* the busiest days and the figures */
.otd-two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; margin-bottom: 1rem; }
.otd-busy, .otd-facts { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 1.4rem 1.6rem 1.5rem; }
.otd-bl { list-style: none; display: grid; gap: .3rem; margin-top: .8rem; }
.otd-bl a { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .8rem; align-items: center; padding: .35rem .3rem; border-radius: 8px; min-height: 44px; color: var(--ink); text-decoration: none; }
.otd-bl a:hover { background: var(--accent-soft); }
.otd-bl b { font-weight: 700; color: var(--navy); }
.otd-bl .otd-bar i { height: 20px; }
.otd-facts { display: grid; gap: 1rem; }
.otd-facts b { display: block; font-size: 2rem; color: var(--navy); font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.otd-facts span { color: var(--muted); }

@media (max-width: 900px) { .otd-two { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .otd-grid, .otd-legend span:nth-last-child(2) { display: none; }
  .otd-phone { display: block; }
}
@media (max-width: 640px) {
  .otd-hero { grid-template-columns: 1fr 1fr; padding: 1.1rem 1rem; gap: .7rem; }
  .otd-mid { grid-column: 1 / -1; grid-row: 1; }
  .otd-nav { justify-content: center; font-size: .9rem; padding: .6rem .5rem; white-space: normal; text-align: center; }
  .otd-chooser { justify-content: stretch; }
  .otd-chooser label { flex: 1 1 8rem; }
  .otd-chooser select { min-width: 0; width: 100%; }
  .otd-go { flex: 1 1 100%; }
  .otd-back { flex: 1 1 100%; justify-content: center; }
  .otd-notes, .otd-year-cal, .otd-busy, .otd-facts { padding: 1.1rem 1rem 1.2rem; }
  .otd-year { grid-template-columns: 1fr; gap: .6rem; }
  .otd-yr { display: flex; gap: .7rem; align-items: baseline; }
  .otd-yr b { display: inline; font-size: 1.5rem; }
  .otd-cards { grid-template-columns: 1fr; }
  .otd-cards-s { grid-template-columns: 1fr 1fr; }
  details.otd-terr summary { grid-template-columns: minmax(0, 1fr) auto 1rem; gap: .3rem .6rem; }
  details.otd-terr summary .otd-bar { grid-column: 1 / -1; grid-row: 2; }
  .otd-bl a { grid-template-columns: 6.4rem minmax(0, 1fr); }
  .otd-var { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .otd-chev { transition: none; } }
