/* The directory (it was the sitemap): an early-00s portal page (Yahoo! Japan / old homepage feel). Deliberately unlike the rest of
   the site. Pale blue boxes, blue links, a touch of red, small text, Hamza's AnkaCoder font. */
@font-face { font-family: "AnkaCoder"; src: url("/assets/fonts/AnkaCoder-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "AnkaCoder"; src: url("/assets/fonts/AnkaCoder-Bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "AnkaCoder"; src: url("/assets/fonts/AnkaCoder-Italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "AnkaCoder"; src: url("/assets/fonts/AnkaCoder-BoldItalic.woff") format("woff"); font-weight: 700; font-style: italic; font-display: swap; }

:root { --link: #1d3fbb; --visited: #6a3d9a; --red: #ff0033; --box: #f3f6fc; --line: #c8d3ea; --head: #e3eaf8; --ink: #222; --mute: #777; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "AnkaCoder", ui-monospace, monospace; font-size: 13px; line-height: 1.5; color: var(--ink); background: #fff; }
a { color: var(--link); }
a:visited { color: var(--visited); }
a:hover { color: var(--red); }
button { font: inherit; color: inherit; }
h2 { font-size: inherit; margin: 0; }

.page { max-width: 980px; margin: 0 auto; padding: 10px 12px 0; }

/* top: little links either side of the logo */
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 6px 0 10px; }
.top ul { list-style: none; margin: 0; padding: 0; font-size: 12px; line-height: 1.7; }
.top-r { text-align: right; color: var(--mute); }
.logo { display: flex; flex-direction: column; align-items: center; text-decoration: none; }
.logo img { display: block; width: 120px; height: auto; }

/* three columns: issue list and Kanis XL; contents and schedule; next issue, weather and ads */
.cols { display: grid; grid-template-columns: 190px minmax(0, 1fr) 250px; gap: 12px; align-items: start; }
.box { background: var(--box); border: 1px solid var(--line); }
.box-h { display: flex; justify-content: space-between; padding: 4px 8px; background: var(--head); border-bottom: 1px solid var(--line); font-weight: 700; font-size: 12px; }
.box-h::before { content: "◆ "; color: var(--red); margin-right: 4px; }
.box-h { justify-content: flex-start; }
.box-h-r { margin-left: auto; font-weight: 400; color: var(--mute); }

.side-list { list-style: none; margin: 0; padding: 4px 0; }
.side-i { all: unset; cursor: pointer; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px 8px; white-space: nowrap; }
.side-icon { width: 28px; display: flex; align-items: center; justify-content: center; flex: none; }
.side-icon img { display: block; }
.side-no { color: var(--link); text-decoration: underline; }
.side-date { color: var(--mute); font-size: 11px; }
.side-i:hover .side-no, .side-i:focus-visible .side-no { color: var(--red); }
.side-i[aria-current="true"] { background: #fff; }
.side-i[aria-current="true"] .side-no { color: var(--ink); text-decoration: none; font-weight: 700; }
.new { display: inline-block; background: var(--red); color: #fff; font-size: 9px; font-weight: 700; line-height: 1; padding: 2px 4px 1px; border-radius: 6px; vertical-align: 1px; }

/* main box: Yahoo-style tabs */
.main { background: #fff; min-height: 320px; }
.tabs { display: flex; background: var(--head); border-bottom: 1px solid var(--line); }
.tab { all: unset; cursor: pointer; padding: 6px 16px; font-size: 12px; color: var(--link); border-right: 1px solid var(--line); }
.tab:hover { color: var(--red); }
.tab[aria-selected="true"] { background: #fff; color: var(--ink); font-weight: 700; margin-bottom: -1px; border-bottom: 1px solid #fff; }
.iss { padding: 10px 14px 14px; }
.iss-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px dotted var(--line); }
.iss-icon img { display: block; }
.iss-date { font-weight: 400; font-size: 11px; color: var(--mute); }
.iss-read, .iss-soon { margin-left: auto; font-weight: 400; font-size: 12px; }
.iss-soon { color: var(--mute); }
.list { list-style: none; margin: 0; padding: 0; columns: 2 220px; column-gap: 20px; }
.list > li { position: relative; break-inside: avoid; padding: 2px 0 2px 1.2em; }
.list > li::before { content: "・"; color: var(--red); position: absolute; left: 0; top: 2px; }
.list > li.has-sub::before { content: ""; }
.list li.ph { color: #9aa0ad; }
.sub-t { all: unset; cursor: pointer; position: absolute; left: -6px; top: 0; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; color: var(--link); vertical-align: middle; border-radius: 2px; }
.sub-t:hover { color: var(--red); background: var(--box); }
.sub-t:focus-visible { outline: 1px solid var(--red); }
.tri { display: inline-block; font-size: 13px; line-height: 1; transition: transform .12s; }
.sub-t[aria-expanded="true"] .tri { transform: rotate(90deg); }
.sub { list-style: square; margin: 4px 0 6px; padding-left: 1.6em; font-size: 12px; max-height: 260px; overflow: auto; background: var(--box); border: 1px solid var(--line); padding-top: 4px; padding-bottom: 4px; }
.ph-note { margin: 12px 0 0; font-size: 11px; color: var(--mute); }
.tab-about { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.tab-about[hidden], .tab-contents[hidden], .iss[hidden], .sub[hidden] { display: none; }
.ab-cover { width: 120px; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border: 1px solid var(--line); }
.ab-date { margin: 0 0 6px; font-weight: 700; width: 100%; flex: 0 0 auto; order: -1; }
.ab-blurb { margin: 0; flex: 1 1 200px; }

.left, .mid, .gadgets { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* Kanis XL */
.xl-list { list-style: none; margin: 0; padding: 4px 8px 6px; }
.xl-list li { padding: 2px 0; }
.xl-list li.ph { color: #9aa0ad; }
.box-h a { color: inherit; }
/* issue 6: each chapter with its sections */
.list > li.chap { break-inside: avoid; }
.parts { list-style: none; display: flex; flex-wrap: wrap; gap: 0 10px; margin: 1px 0 3px; padding: 0; font-size: 12px; }
/* the schedule (the homepage's) */
.sch { padding: 8px 12px 12px; }
.sch p { margin: 0 0 8px; }
.sch-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; }
.sch-list li { display: contents; }
.sch-list li.sch-y { display: block; grid-column: 1 / -1; font-weight: 700; margin-top: 6px; color: var(--red); }
.sch-d { color: var(--mute); }
/* next issue and the weather: plain text */
.gad-p { margin: 0; padding: 8px 10px 10px; font-size: 13px; }

/* iv. barcode that reshuffles: bottom right of the page, in the footer */
.bar { all: unset; cursor: pointer; box-sizing: border-box; display: grid; grid-template-columns: repeat(8, 1fr); width: 140px; aspect-ratio: 2 / 1; border: 4px solid #111; background: #fff; flex: none; }
.bar span { background: #fff; transition: background-color .08s; }
.bar span.on { background: #111; }
.bar:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* fake banner ads: fade one to the next; pressing shows a note (styled like the crossword help box) */
.ad { position: relative; }
.ad-b { all: unset; cursor: pointer; display: grid; width: 100%; aspect-ratio: 951 / 414; border: 1px solid #2b2b2b; background: #eee; box-sizing: border-box; }
.ad-b img { grid-area: 1 / 1; display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.ad-b img.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .ad-b img { transition: none; } }
.ad-b:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.ad-note { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5; margin: 0; padding: 10px 12px; background: #fff; border: 1px solid #111; font-size: 12px; line-height: 1.4; box-shadow: 2px 2px 0 rgba(0,0,0,.12); }
.ad-note[hidden] { display: none; }

.foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 18px 0 0; padding: 12px 0 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--mute); line-height: 1.8; }
.foot-t { margin: 0; }

/* tablets: the right column moves under the rest */
@media (max-width: 860px) {
  .cols { grid-template-columns: 180px minmax(0, 1fr); }
  .gadgets { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* phones: everything stacked */
@media (max-width: 600px) {
  .top { grid-template-columns: 1fr; text-align: center; }
  .top-l, .top-r { display: flex; justify-content: center; gap: 14px; text-align: center; }
  .top-l { order: 2; } .top-r { order: 3; }
  .cols { grid-template-columns: 1fr; }
  .side-list { display: grid; grid-template-columns: 1fr 1fr; }
  .gadgets { grid-template-columns: 1fr; }
  .list { columns: 1; }
}
