@import url('https://fonts.googleapis.com/css2?family=Bowlby+One+SC&family=DM+Mono:wght@400;500&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,700&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  --cream: #f5ead7;
  --paper: #fffaf0;
  --ink: #2c1811;
  --coffee: #4d2618;
  --pumpkin: #e15b23;
  --squash: #f28c31;
  --cranberry: #9d3325;
  --moss: #4b552f;
  --leaf: #b94124;
  --gold: #d99a32;
  --line: #d8c6aa;
  --muted: #806c5b;
}

* { box-sizing: border-box; }
html { background: var(--cream); }
body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--cream) !important;
  background-image:
    radial-gradient(circle at 12% 19%, rgba(225, 91, 35, .10) 0 1px, transparent 1.5px),
    radial-gradient(circle at 87% 38%, rgba(75, 85, 47, .10) 0 1px, transparent 1.5px) !important;
  background-size: 15px 15px, 19px 19px !important;
  color: var(--ink) !important;
  font-family: 'DM Sans', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
}

/* Fall stays calm even when the shared weather script changes modes. */
#rain-canvas { display: none !important; }
body::before,
body::after {
  content: '';
  position: fixed;
  z-index: 0;
  pointer-events: none;
  opacity: .72;
  background: var(--leaf);
  clip-path: polygon(50% 0, 62% 28%, 89% 12%, 75% 42%, 100% 50%, 73% 60%, 87% 89%, 58% 73%, 50% 100%, 39% 73%, 10% 89%, 26% 59%, 0 50%, 27% 42%, 12% 12%, 40% 28%);
}
body::before { width: 110px; height: 110px; top: 12vh; left: -45px; transform: rotate(-21deg); }
body::after { width: 74px; height: 74px; right: -24px; bottom: 11vh; transform: rotate(33deg); background: var(--gold); }

main {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 80px;
  position: relative;
  z-index: 1;
}

header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    'season season season'
    'date clock nav';
  align-items: end;
  column-gap: 18px;
  row-gap: 4px;
  min-height: 190px;
  padding: 28px 190px 27px 31px;
  margin-bottom: 30px;
  overflow: hidden;
  border: 4px solid var(--ink);
  background: var(--pumpkin);
  color: var(--paper);
}
header::before {
  content: 'AUTUMN DESK';
  grid-area: season;
  color: var(--ink);
  font-family: 'Bowlby One SC', Impact, sans-serif;
  font-size: clamp(2.8rem, 7.5vw, 7.2rem);
  line-height: .8;
  letter-spacing: -.075em;
  white-space: nowrap;
  text-shadow: 4px 4px 0 var(--paper);
}
header::after {
  content: '';
  position: absolute;
  width: 104px;
  height: 72px;
  right: 42px;
  bottom: 28px;
  border: 8px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 27px 27px;
  background: var(--coffee);
  box-shadow: 0 -14px 0 -5px var(--paper), 76px 7px 0 -17px var(--pumpkin), 76px 7px 0 -9px var(--ink);
}

#date {
  grid-area: date;
  color: var(--ink);
  font-family: 'DM Sans', Arial, sans-serif;
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
#clock {
  grid-area: clock;
  color: var(--paper) !important;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2.45rem, 4.3vw, 4.2rem);
  line-height: .85;
  letter-spacing: -.055em;
  white-space: nowrap;
}
.clock-seconds { font-family: 'DM Mono', monospace; font-size: .28em; letter-spacing: 0; margin-left: .16em; vertical-align: .2em; }
.eink-switch {
  position: absolute;
  z-index: 2;
  top: 38px;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
  right: 42px;
  font-family: 'DM Sans', Arial, sans-serif;
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
}
.eink-switch:hover { color: var(--paper); border-color: var(--paper); }

.layout { display: grid; grid-template-columns: 294px minmax(0, 1fr); align-items: start; gap: 28px; }
.sidebar { position: sticky; top: 20px; }
.feed-area { min-width: 0; }
.block {
  position: relative;
  margin: 0 0 28px;
  padding: 22px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--line);
}
.block-label {
  margin: -22px -22px 17px;
  padding: 10px 16px 9px;
  border-bottom: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper) !important;
  font-family: 'Bowlby One SC', Impact, sans-serif;
  font-size: .94rem;
  letter-spacing: .035em;
  line-height: 1.1;
  text-transform: uppercase;
}
.block-label a { color: inherit; text-decoration: none; }
.block-label a:hover { color: #ffd174; }

/* The small side stack reads as an autumn field notebook, not a dashboard panel. */
#weather-block { overflow: hidden; padding-top: 25px; background-color: var(--moss); background-image: url('assets/fall-pumpkin.png'); background-repeat: no-repeat; background-position: right 9px bottom 7px; background-size: clamp(76px, 14vw, 128px); color: var(--paper) !important; box-shadow: 7px 7px 0 var(--gold); }
/* The supplied pumpkin is a background illustration, so weather content stays compact. */
#weather-block::after { display: none; }
#weather-block::before { display: none; }
#weather-block .block-label, .weather-body { position: relative; z-index: 1; }
#weather-block .block-label { background: var(--coffee); color: #ffe7b5 !important; }
.weather-body { display: block; min-height: 0; }
.weather-info { min-width: 0; }
.weather-temp { position: relative; display: inline-block; color: var(--paper); font-family: 'DM Serif Display', Georgia, serif; font-size: 3.65rem; letter-spacing: -.07em; line-height: .84; }
.unit { position: absolute; top: .14em; left: 100%; margin-left: .48rem; color: #f7ce78; font-family: 'DM Sans', sans-serif; font-size: 1.14rem; letter-spacing: 0; white-space: nowrap; }
.weather-icon { position: absolute; z-index: 2; top: 2px; left: calc(43% - 6px); right: auto; font-size: 4rem; line-height: 1; filter: saturate(.82) sepia(.12); }
.weather-meta, .weather-row { color: #f3dcc2; font-family: 'DM Sans', Arial, sans-serif; font-size: .9rem; font-weight: 700; }
.weather-meta { margin-top: 13px; }
.weather-row { display: flex; flex-wrap: wrap; gap: 8px 15px; margin-top: 8px; }
.weather-row svg { margin-right: 5px; vertical-align: -2px; }
@media (min-width: 761px) {
  #weather-block { background-size: 96px; }
  .weather-icon { top: 2px; left: calc(43% - 6px); right: auto; font-size: 3.15rem; }
}

#cities-block { padding-bottom: 15px; background: #f5d58b; }
.cities-list { display: grid; gap: 0; }
.city-row { display: grid; grid-template-columns: minmax(0, 1fr) 5.1ch max-content; column-gap: 14px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid rgba(44,24,17,.34); }
.city-row:last-child { border: 0; }
.city-name { font-family: 'DM Sans', Arial, sans-serif; font-size: .9rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.city-time, .city-temp { color: var(--coffee); font-family: 'DM Serif Display', Georgia, serif; font-size: 1.15rem; line-height: 1; }
.city-weather { display: inline-flex; align-items: baseline; gap: 6px; }
.city-temp { min-width: 3.3ch; }
.city-emoji { width: 1.4em; font-family: 'DM Sans', Arial, sans-serif; font-size: .9rem; font-weight: 700; }

#sunset-alert-block { background: var(--cranberry); color: var(--paper); box-shadow: 6px 6px 0 var(--gold); }
#sunset-alert-block .block-label { background: var(--coffee); }
.sunset-countdown { font-family: 'DM Serif Display', Georgia, serif; font-size: 1.75rem; line-height: 1.1; }
.sunset-sub { margin-top: 6px; font-family: 'DM Mono', monospace; font-size: .69rem; }

#news-block { padding: 27px 28px 12px; border-width: 3px; background: #fff7e8; box-shadow: 8px 8px 0 var(--pumpkin); }
#news-block .block-label { margin: -27px -28px 18px; background: var(--pumpkin); color: var(--ink) !important; font-size: 1.4rem; }
#news-list, .block ul { margin: 0; padding: 0; list-style: none; }
li { position: relative; margin: 0; padding: 0 0 13px 20px; }
li::before { content: '✦'; position: absolute; left: 0; top: .18em; color: var(--pumpkin); font-size: .62em; }
.archive-marker { display: inline-block; margin-right: .36rem; color: var(--pumpkin); font-family: 'DM Mono', monospace; font-size: .78em; font-weight: 500; letter-spacing: -.04em; }
ul a, .benedict-item a:not(.benedict-source) { color: var(--ink); font-size: 1.02rem; font-weight: 700; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
ul a:hover, .benedict-item a:not(.benedict-source):hover { color: var(--cranberry); text-decoration-color: var(--cranberry); }
.feed-date, .meta { display: block; margin-top: 3px; color: var(--muted); font-family: 'DM Mono', monospace; font-size: .66rem; letter-spacing: .035em; }
.loading { color: var(--muted); font-family: 'DM Mono', monospace; font-size: .74rem; }

#benedict-block { padding: 0; overflow: hidden; border-color: var(--coffee); background: var(--coffee); color: var(--paper); box-shadow: 8px 8px 0 var(--cranberry); }
#benedict-block .block-label { margin: 0; padding: 16px 23px; border: 0; background: var(--coffee); color: #ffcf70 !important; font-size: 1.45rem; }
#benedict-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 2px solid #81513f; }
.benedict-item { min-height: 135px; padding: 19px 21px 20px; border-right: 1px solid #81513f; border-bottom: 1px solid #81513f; }
.benedict-item:nth-child(2n) { border-right: 0; }
.benedict-item h3 { margin: 0 0 8px; color: #ffcf70; font-family: 'DM Serif Display', Georgia, serif; font-size: 1.5rem; font-weight: 400; line-height: 1; letter-spacing: -.02em; }
.benedict-item p { margin: 0; color: #f7e7d2; font-size: .88rem; line-height: 1.42; }
.benedict-source { display: inline-block; margin-left: 5px; color: #ffcf70; font-family: 'DM Mono', monospace; font-size: .65rem; letter-spacing: .04em; text-decoration: underline; text-underline-offset: 2px; text-transform: uppercase; }
.benedict-source:hover { color: var(--paper); }

.author-grid, .feed-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.author-grid { margin-bottom: 28px; }
.author-grid .block, .feed-grid .block { min-height: 168px; margin-bottom: 0; padding: 18px 17px 9px; box-shadow: 5px 5px 0 var(--line); }
.author-grid .block-label, .feed-grid .block-label { margin: -18px -17px 14px; padding: 9px 12px; font-family: 'Bowlby One SC', Impact, sans-serif; font-size: .94rem; font-weight: 400; letter-spacing: .035em; line-height: 1.1; }
.author-grid li, .feed-grid li { padding-left: 15px; padding-bottom: 11px; }
.author-grid li::before, .feed-grid li::before { font-size: .48em; }
.author-grid ul a, .feed-grid ul a { font-size: .87rem; line-height: 1.26; }
.author-grid .feed-date, .feed-grid .feed-date, .author-grid .meta, .feed-grid .meta { font-size: .58rem; }
.author-grid .block:nth-child(3n + 1) .block-label, .feed-grid .block:nth-child(3n + 1) .block-label { background: var(--moss); }
.author-grid .block:nth-child(3n + 2) .block-label, .feed-grid .block:nth-child(3n + 2) .block-label { background: var(--pumpkin); color: var(--ink) !important; }
.author-grid .block:nth-child(3n) .block-label, .feed-grid .block:nth-child(3n) .block-label { background: var(--gold); color: var(--ink) !important; }
/* Keep every row on a shared baseline; the colour rhythm provides enough movement. */
.author-grid .block, .feed-grid .block { transform: none; }

@media (max-width: 1080px) {
  header { padding-right: 150px; }
  .layout { grid-template-columns: 270px minmax(0, 1fr); }
  .author-grid, .feed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 761px) and (max-width: 1080px) {
  .city-row { grid-template-columns: minmax(0, 1fr) 4.8ch max-content; column-gap: 8px; }
  .city-name { font-size: .78rem; }
  .city-time, .city-temp { font-size: 1rem; }
}
@media (max-width: 760px) {
  main { width: min(100% - 28px, 600px); padding-top: 14px; }
  header {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: 'season season season' 'date navone navtwo' 'clock clock clock';
    min-height: 228px;
    padding: 20px 18px 22px;
    row-gap: 7px;
  }
  header::before { max-width: 285px; font-size: clamp(2.35rem, 12vw, 3.25rem); line-height: .86; white-space: normal; text-shadow: 3px 3px 0 var(--paper); }
  header::after { top: 14px; right: 9px; bottom: auto; transform: scale(.48); transform-origin: top right; }
  #date { font-size: .76rem; }
  #clock { font-size: clamp(3.25rem, 15vw, 4.7rem); }
  .eink-switch { position: static; align-self: center; font-size: .82rem; }
  .eink-switch:first-of-type { grid-area: navtwo; }
  .layout { display: block; }
  .sidebar { position: static; }
  .author-grid, .feed-grid { grid-template-columns: 1fr; gap: 20px; }
  .author-grid { margin-bottom: 20px; }
  .author-grid .block, .feed-grid .block, .author-grid .block:nth-child(n), .feed-grid .block:nth-child(n) { min-height: 0; transform: none; }
  #benedict-list { grid-template-columns: 1fr; }
  .benedict-item, .benedict-item:nth-child(2n) { border-right: 0; }
  .weather-temp { font-size: 3.5rem; }
  .city-row { column-gap: 11px; }
  .city-weather { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
