/* "On this day in science" (src/platform/daily-history.ts): aside card on the home page and category hubs and the
   /on-this-day pages. The image has width/height attributes plus aspect-ratio, so lazy loading never shifts layout. */

/* Placement: the 'hero' copy sits beside the hero text from 1100px (replacing the hero illustration), the 'foot' copy
   follows the main content below 1100px. Exactly one is displayed (display:none also hides the other from assistive
   technology and keeps its lazy image from loading). */
.uw-day-hero { display: none; }
@media (min-width: 1100px) {
  .has-day > .hero-grid { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .95fr); align-items: start; }
  .has-day > .hero-grid > .hero-art { display: none; }
  .has-day .uw-day-hero { display: block; margin: 0; }
  .uw-day-foot { display: none; }
}

.uw-day {
  margin: 0 0 var(--sp-6, 24px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl, 16px);
  box-shadow: var(--shadow-1); overflow: hidden; color: var(--ink);
}
.uw-day-h { margin: 0; padding: 14px 18px 12px; font-size: var(--fs-sm, .875rem); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.uw-day-img { display: block; width: 100%; height: auto; aspect-ratio: 1024 / 683; object-fit: cover; background: var(--surface-2); }
.uw-day-body { padding: 14px 18px 16px; }
.uw-day-meta { margin: 0 0 6px; font-size: var(--fs-sm, .875rem); color: var(--muted); }
.uw-day-title { margin: 0 0 6px; font-size: 1.12rem; line-height: 1.3; }
.uw-day-summary { margin: 0 0 10px; color: var(--ink-2); font-size: .95rem; }
.uw-day-links, .uw-day-all { margin: 0; font-size: .95rem; }
.uw-day-all { margin-top: 6px; }
.uw-day-en { font-size: var(--fs-sm, .875rem); color: var(--muted); }
.uw-day a { font-weight: 600; }
[dir="rtl"] .uw-day-all [aria-hidden="true"] { display: inline-block; transform: scaleX(-1); }
:root[data-theme="dark"] .uw-day-img, :root[data-theme="dark"] .uw-otd-entry img { filter: brightness(.86); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .uw-day-img, :root:not([data-theme="light"]) .uw-otd-entry img { filter: brightness(.86); } }

/* Tablet: picture beside the text. */
@media (min-width: 640px) and (max-width: 1099px) {
  .uw-day-foot { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); grid-template-rows: auto 1fr; }
  .uw-day-foot .uw-day-h { grid-column: 1 / -1; }
  .uw-day-foot .uw-day-img { height: 100%; }
}

/* /on-this-day pages */
.uw-otd { padding-block: var(--sp-6, 24px); }
.uw-otd h1 { margin-top: 0; }
.uw-otd-today { margin-block: var(--sp-5, 20px); }
.uw-otd-entry { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0 0 var(--sp-5, 20px); padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl, 16px); }
.uw-otd-entry img { display: block; width: 100%; height: auto; aspect-ratio: 1024 / 683; border-radius: var(--r-lg, 12px); background: var(--surface-2); }
.uw-otd-entry h3 { margin: 0 0 6px; }
.uw-otd-entry p { margin: 0 0 8px; }
@media (min-width: 760px) {
  .uw-otd-entry { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; }
  .uw-otd-entry:not(.uw-otd-big) { grid-template-columns: minmax(0, .6fr) minmax(0, 1.6fr); }
}
.uw-otd-archive ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.uw-otd-archive li a, .uw-otd-archive li span, .uw-otd-archive li strong { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.uw-otd-archive li a { text-decoration: none; font-weight: 600; }
.uw-otd-day { margin: 0 0 var(--sp-5, 20px); }
.uw-otd-day h2 { font-size: var(--fs-lg, 1.25rem); margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.uw-otd-day ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.uw-otd-day li h3 { margin: 0 0 4px; font-size: 1.05rem; }
.uw-otd-day li p { margin: 0 0 4px; }
