/* ── FONTS ── */
@font-face {
  font-family: "SomeTimes";
  src: url("../fonts/SomeTimes-SansSerif.woff?v=2026-10-29") format("woff");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "SomeTimes";
  src: url("../fonts/SomeTimes-serifsans.otf?v=2026-10-29") format("opentype");
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: "SomeTimes";
  src: local("Apple SD Gothic Neo");
  font-weight: normal;
  font-style: normal;
  unicode-range: U+AC00-D7A3, U+3130-318F, U+1100-11FF;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

*::-webkit-scrollbar {
  display: none;
}
* { scrollbar-width: none; }

*::selection {
  background-color: rgb(135, 120, 107);
  color: #000;
}

/* ── BASE ── */
body {
  font-family: "SomeTimes", sans-serif;
  background: #fff;
  color: #222;
  height: 100dvh;
  overflow: hidden;
}

/* ── LAYOUT ── */
#layout {
  display: flex;
  height: 100%;
}

#left {
  width: 60%;
  font-size: 1.6em;
  padding: 0 40px 120px;
  overflow-y: auto;
}

/* top space lives on the views, not on the scrolling #left (keeps sticky offsets simple) */
#stream-view, #list-view { padding-top: 83px; }

/* ── DIVIDER + SCROLLBARS ── */
/* left scrollbar | 1px line | right scrollbar — drag anywhere but a thumb to resize */
#divider {
  flex-shrink: 0;
  display: flex;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
}
.divider-line {
  width: 1px;
  background-color: rgb(135, 120, 107);
}
.scrollbar {
  position: relative;
  width: .5rem;
}
.thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #5498ff;
  cursor: default;
}

#right {
  flex: 1;
  font-size: 1em;
  padding: 0 28px 48px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ── TITLE ── */
.site-title {
  font-size: 1em;
  font-weight: normal;
  line-height: 1.2;
  position: fixed;
  top: 20px;
  left: 13px;
  z-index: 500;
  padding: 20px 28px;
  cursor: pointer;
}
body:has(#list-toggle:checked) .site-title { width: min-content; }   /* moi / moi */
body:has(#list-toggle:checked) #list-view { padding-top: calc(83px + 1.2em); }

/* ── STREAM VIEW ── */
.word-stream {
  line-height: 1.5;
}

.date-word {
  white-space: nowrap;
  position: relative;
}

.date {
  color: #0066ff;
  font-size: 0.5em;
  vertical-align: 0.4em;
}

.note {
  color: rgb(135, 120, 107);
  font-size: 0.7em;
  font-weight: normal;
  margin-right: 4px;
}

/* ── LIST VIEW ── */
#list-view { display: none; }
body:has(#list-toggle:checked) #stream-view { display: none; }
body:has(#list-toggle:checked) #list-view { display: block; }

.word-group {
  position: relative;
  margin-top: 0px;
}

.word-group ul {
  list-style: none;
  line-height: 1.3;
  margin-top: -7px;
  margin-bottom: 20px;
}

/* ── HIGHLIGHTED DAYS ── */
.highlight .date,
.highlight .poem-date {
  background: #0066ff;
  color: #fff;
  padding: 0 0.2em;
}

/* ── DAY EXTRAS: (+) ── */
/* the checkbox is visually hidden but stays reachable with the keyboard */
.more {
  /* color: #0066ff; */
  font-size: 0.7em;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid black;
  display: inline-block;
  height: 1.7rem;
  width: 1.6rem;
  border-radius: .3rem;
  text-align: center;
}
.more::before { content: "+"; }
.more:has(input:checked)::before { content: "−"; }
.more:has(input:focus-visible) { outline: 2px solid #0066ff; outline-offset: 2px; }
.more input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* opened: text and images inline, right before the (−) */
.day-more { display: none; }
.day-more:has(+ .more input:checked) { display: inline; }
.day-text { white-space: pre-line; }
.day-img {
  height: 0.7em;          /* fallback */
  height: 1cap;           /* as tall as the words' capitals */
  width: auto;
  vertical-align: baseline;
}

/* ── TOOLS: stream | list + ? ── */
/* top right of #left, facing the title: sticky so it follows #left's width and stays put when it scrolls */
.left-tools {
  position: sticky;
  top: 0;
  height: 0;
  z-index: 100;
}
.left-tools-inner {
  position: absolute;
  top: 39px;              /* centred on the title's line */
  right: 0;
  display: flex;
  gap: 6px;
}

.view-toggle,
.info-toggle {
  font-family: "SomeTimes", sans-serif;
  font-size: 0.5em;
  color: #222;
  background: #fff;
  border: 1px solid #222;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  height: 32px;
  line-height: 18px;
  white-space: nowrap;
}
.view-toggle {
  position: relative;
  display: block;
  padding: 6px 14px;
}
.info-toggle {
  min-width: 32px;
  padding: 6px 10px;
}
@media (hover: hover) {
  .info-toggle:hover { background: rgb(135, 120, 107); color: #fff; }
}
.view-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.view-toggle:has(input:focus-visible) { outline: 2px solid #0066ff; outline-offset: 2px; }
.vt-stream,
.view-toggle:has(input:checked) .vt-list { color: #0066ff; }
.view-toggle:has(input:checked) .vt-stream { color: inherit; }
/* hover only with a mouse: on touch screens it would stick after a tap */
@media (hover: hover) {
  .view-toggle:hover { background: rgb(135, 120, 107); color: #fff; }
  .view-toggle:hover :is(span.vt-stream, span.vt-list) { color: #fff; }   /* after the blue rules: same weight, wins */
}

/* ── RIGHT COLUMN: POEMS ── */
/* sticky: stays at its place, past poems scroll under it */
#daily-words {
  line-height: 1.5;
  position: sticky;
  top: 0;
  padding-top: 83px;
  padding-bottom: 12px;
  background: #fff;
  z-index: 1;
}

#poems-archive {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.data-error {
  color: #c00;
  font-size: 0.6em;
}

.poem-label {
  display: block;
  color: rgba(110, 98, 88, 0.7);
  margin-bottom: 5px;
}

.poem-line { display: block; }

.poem-rule {
  display: block;
  margin-top: 12px;
  letter-spacing: 0.2em;
}

.poem {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.poem-date {
  align-self: flex-start;
  color: #0066ff;
  font-size: 0.7em;
}

.poem-fi { 
  color: rgba(110, 98, 88, 0.7);
  line-height: 1.5; }

.poem-tr {
  color: #222;
  line-height: 1.5;
}

#info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.95);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.info-box {
  max-width: 500px;
  font-size: 0.9em;
  line-height: 1.7;
  text-align: left;
}

.info-box .ascii { white-space: pre; }

.info-box a {
  color: rgb(135, 120, 107);
  text-decoration: none;
}

.info-box a:hover {
  color: #0066ff;
  cursor: pointer;
}


.poems-toggle {
  font-family: "SomeTimes", sans-serif;
  font-size: 0.5em;
  color: #222;
  background: #fff;
  border: 1px solid #222;
  border-radius: 4px;
  cursor: pointer;
  padding: 6px 14px;
  display: none;          /* shown on small screens only */
  height: 32px;
  line-height: 18px;
  transition: background 0.15s;
  white-space: nowrap;
}
@media (hover: hover) {
  .poems-toggle:hover { background: rgb(135, 120, 107); color: #fff; }
}

#hover-image img {
  display: block;
  width: 320px;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 20px);
  object-fit: contain;
}

.has-img .date::after {
  content: "🖼️";
  font-size: 0.6em;
  margin-left: 3px;
  vertical-align: 0.2em;
}

@media (max-width: 768px) {
  body { overflow: auto; }

  #layout {
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
  }

  #left {
    width: 100% !important;
    font-size: 1.2em;
    padding: 0 20px 80px;
    overflow: visible;
  }

  #stream-view, #list-view { padding-top: 65px; }

  #divider { display: none; }
  #right { display: none; }

  body:has(#list-toggle:checked) #list-view { padding-top: calc(65px + 1.2em); }
  #hover-image img { width: 200px; }

  #daily-words { padding-top: 80px; }


  .left-tools { z-index: 500; }   /* above the open poems panel, like the title */
  .left-tools-inner { top: 16px; }
  .view-toggle,
  .poems-toggle,
  .info-toggle { font-size: 0.65em; }
  .poems-toggle { display: block; }

  .site-title {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 600;
    padding-top: 20px;
    padding-left: 20px;
    width: 38%;
    height: auto;
    }

    #info-overlay {
    align-items: flex-start;
    padding: 40px 40px 40px;
    height: 100%;
    }

    .info-box {
      font-size: 0.8em;
    }

    #right.mobile-open {
      display: flex;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 400;
      overflow-y: auto;
      padding: 0 20px 80px;
      background-color: white;
    }

}
