/* dovland.se: "signal board". One dark theme: petrol board, bone text, amber
   for what is new and what is dated. Headlines in a tall condensed face. */

@font-face {
  font-family: "Sofia Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/sofia-sans.woff2") format("woff2");
}

@font-face {
  font-family: "Sofia Sans Extra Condensed";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("fonts/sofia-sans-extra-condensed.woff2") format("woff2");
}

:root {
  --deep: #0d2b33;
  --deep-2: #123843;
  --deep-3: #1b4a57;
  --bone: #efe9dc;
  --bone-2: #a9bcc0;
  --amber: #ffb224;
  --up: #63d69a;
  --down: #ff8f7d;
  --sans: "Sofia Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --cond: "Sofia Sans Extra Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--deep);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--amber); }
a:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

[hidden] { display: none !important; }

h1, h2 {
  margin: 0;
  font-family: var(--cond);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0.005em;
}

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px 56px;
}

/* The tape: stocks along the very top */

.tape {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  background: var(--deep-2);
  border-bottom: 1px solid var(--deep-3);
}

.tick {
  min-width: 0;
  padding: 10px 14px 9px;
  border-right: 1px solid var(--deep-3);
  font-variant-numeric: tabular-nums;
}

.tick:last-child { border-right: 0; }

.tick-name {
  display: block;
  font-size: 0.78rem;
  color: var(--bone-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tick-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.tick-change { font-weight: 700; font-size: 0.98rem; }

/* A price that changed on refresh lights up once. */
.tick.moved { animation: moved 1.6s ease-out; }

@keyframes moved {
  from { background: var(--deep-3); }
  to { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .tick.moved { animation: none; }
}

.spark { flex: none; display: block; }

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--bone-2); }

/* Head */

.head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 26px 0 0;
  color: var(--bone-2);
}

.head p { margin: 0; }
.name strong { color: var(--bone); font-weight: 700; }
.since { text-align: right; }

.stale { color: var(--amber); font-weight: 700; }

.badge {
  display: inline-block;
  padding: 0 8px;
  background: var(--amber);
  color: var(--deep);
  font-weight: 700;
}

button.badge {
  border: 0;
  border-radius: 0;
  font: inherit;
  font-weight: 700;
  line-height: inherit;
  cursor: pointer;
}

button.badge:hover, button.badge[aria-pressed="true"] { background: var(--bone); }
button.badge:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; }

/* Jump links: only where the lanes stack and Europe is a long scroll away. */
.jump { display: none; }

/* Lead */

.lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 56px;
  align-items: end;
  padding: 18px 0 32px;
}

.lead h1 {
  max-width: 22em;
  font-size: clamp(2.3rem, 4.3vw, 3.9rem);
  text-wrap: balance;
}

.lead-side p { margin: 0; }
.lead-side #lead-summary { color: var(--bone-2); font-size: 1.02rem; }
.lead-link { margin-top: 12px !important; }

.lead-link a {
  font-weight: 700;
  color: var(--amber);
  border-bottom: 2px solid var(--amber);
  padding-bottom: 1px;
}

.lead-link a:hover { color: var(--bone); border-color: var(--bone); }

/* Coming up */

.coming {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--deep-3);
}

.date {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px 22px 16px 0;
}

.date + .date { padding-left: 22px; border-left: 1px solid var(--deep-3); }

.date-day {
  display: block;
  font-family: var(--cond);
  font-weight: 800;
  font-size: 2.3rem;
  line-height: 1;
  color: var(--amber);
  white-space: nowrap;
}

.date-left { display: block; margin-top: 3px; font-size: 0.78rem; white-space: nowrap; }

.date p { margin: 2px 0 0; font-size: 0.9rem; color: var(--bone-2); }
.date p.date-when { margin: 0; }
.date a { border-bottom: 1px solid var(--deep-3); }
.date a:hover { border-color: var(--amber); }

/* Lanes */

.lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--deep-3);
}

.lane { padding: 24px 28px 0 0; min-width: 0; }
.lane + .lane { padding-left: 28px; border-left: 1px solid var(--deep-3); }
.lane:last-child { padding-right: 0; }

.lane h2 { margin-bottom: 14px; font-size: 2.6rem; }

.items ul { list-style: none; margin: 0; padding: 0; }

.story { padding: 12px 0 14px; }
.story + .story { border-top: 1px solid var(--deep-3); }
.story.pictured { padding-top: 0; }

/* Day headings: a bone rule and the day, so the eye finds "today" at once. */
.day {
  margin: 0;
  padding: 7px 0 0;
  border-top: 2px solid var(--bone-2);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--bone-2);
}

.day-today { border-color: var(--amber); color: var(--amber); }
.day-group { margin-top: 6px; }

.meta { margin: 0 0 3px; font-size: 0.8rem; color: var(--bone-2); }
.meta .badge { margin-right: 8px; font-size: 0.76rem; }

.story h3, .story h4 {
  margin: 0 0 5px;
  font-family: var(--sans);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.story.pictured h3 { font-size: 1.3rem; line-height: 1.2; }

/* Headline only (older stories): smaller, so the lane thins out with age. */
.story:not(:has(.text)) { padding: 9px 0 10px; }
.story:not(:has(.text)) h4 { margin: 0; font-size: 0.98rem; font-weight: 600; }

/* What you have already opened steps back. */
.story a:visited, .date-what a:visited { color: var(--bone-2); }
.story a:visited:hover, .date-what a:visited:hover { color: var(--amber); }

.story p.text { margin: 0; font-size: 0.92rem; color: var(--bone-2); }

.empty { margin: 0; color: var(--bone-2); font-size: 0.92rem; }

/* "N new" pressed: only what is new since the last visit stays. */
.only-new .story:not(.is-new),
.only-new .day-group:not(:has(.is-new)) { display: none; }

.lead-image { margin: 0 0 12px; }

/* Every picture is cropped to the same shape, so the three lanes line up. */
.lead-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--deep-2);
}

.lead-image figcaption {
  margin-top: 5px;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--bone-2);
}

.lead-image figcaption a { border-bottom: 1px solid var(--deep-3); }

.notice {
  margin: 28px 0 0;
  padding: 14px 16px;
  background: var(--deep-2);
  border: 1px solid var(--deep-3);
}

/* The last two weeks */

.weeks {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 4px solid var(--bone);
}

.weeks-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.weeks h2 { font-size: 2.6rem; }
.period { margin: 0; color: var(--bone-2); font-size: 0.9rem; }

.weeks-intro {
  margin: 12px 0 0;
  max-width: 46em;
  font-size: 1.2rem;
  line-height: 1.4;
}

.developments {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 32px;
}

.developments li { padding: 16px 0 18px; border-top: 1px solid var(--deep-3); }

.developments h3 { margin: 0 0 6px; font-size: 1.08rem; line-height: 1.25; }
.developments p { margin: 0; font-size: 0.92rem; color: var(--bone-2); }
.developments p.sources { margin-top: 8px; font-size: 0.8rem; }
.sources a { color: var(--bone); border-bottom: 1px solid var(--deep-3); }
.sources a:hover { color: var(--amber); border-color: var(--amber); }

.ai-note { margin: 18px 0 0; font-size: 0.8rem; color: var(--bone-2); }

/* Footer */

.footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--deep-3);
  display: flex;
  justify-content: space-between;
  gap: 32px;
  font-size: 0.8rem;
  color: var(--bone-2);
}

.footer p { margin: 0; }
.footer p:first-child { max-width: 52em; }
.footer p:last-child { text-align: right; flex: none; }

/* Narrower screens */

@media (max-width: 1100px) {
  .tape { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tick:nth-child(5) { border-right: 0; }
  .tick:nth-child(-n + 5) { border-bottom: 1px solid var(--deep-3); }
  .developments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .page { padding: 0 16px 40px; }
  .head { flex-direction: column; gap: 4px; padding-top: 18px; }
  .since { text-align: left; }
  .lead { grid-template-columns: 1fr; gap: 16px; padding-bottom: 24px; }
  .coming { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .date:nth-child(odd) { padding-left: 0; border-left: 0; }
  .date:nth-child(n + 3) { border-top: 1px solid var(--deep-3); }
  .jump {
    display: flex;
    gap: 20px;
    padding: 12px 0 0;
    font-weight: 700;
  }
  .jump a { border-bottom: 2px solid var(--deep-3); }
  .lanes { grid-template-columns: 1fr; }
  .lane, .lane + .lane { padding: 24px 0 0; border-left: 0; }
  .lane, .weeks { scroll-margin-top: 8px; }
  .developments { grid-template-columns: 1fr; }
  .weeks-head { flex-direction: column; gap: 4px; }
  .footer { flex-direction: column; gap: 8px; }
  .footer p:last-child { text-align: left; }
}

@media (max-width: 560px) {
  /* One row you swipe sideways, so the news starts near the top of the phone. */
  .tape {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .tape::-webkit-scrollbar { display: none; }
  .tick { flex: none; width: 37%; scroll-snap-align: start; }
  .tick:nth-child(-n + 5) { border-bottom: 0; }
  .tick:nth-child(5) { border-right: 1px solid var(--deep-3); }
  .coming { grid-template-columns: 1fr; }
  .date, .date + .date { padding-left: 0; border-left: 0; }
  .date + .date { border-top: 1px solid var(--deep-3); }
}
