/* koisim.com styles. One file, no imports, no third-party hosts. */

:root {
  --bg: #FAF6EF;
  --surface: #FFFFFF;
  --ink: #1F2A44;
  --muted: #5B6270;
  --accent: #C2371F;
  --on-accent: #FFFFFF;
  --link: #1F6F78;
  --line: #D8D0BF;
  --focus: #1F2A44;
  --callout-bg: #F1EBDD;
  --ev-tested-bg: #1F6F78;
  --ev-tested-fg: #FFFFFF;
  --ev-reported-fg: #3B4A9C;
  --ev-reported-bd: #3B4A9C;
  --ev-provider-bg: #E9E5DB;
  --ev-provider-fg: #1F2A44;
  --lh: 1.6;
  --section-gap: 2rem;
  --pad: 1rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1F2A44;
    --surface: #28355A;
    --ink: #FAF6EF;
    --muted: #B9C0CF;
    --accent: #EE6A4D;
    --on-accent: #1F2A44;
    --link: #5CBFC7;
    --line: #46547C;
    --focus: #FAF6EF;
    --callout-bg: #2D3B63;
    --ev-tested-bg: #5CBFC7;
    --ev-tested-fg: #1F2A44;
    --ev-reported-fg: #B4BEFA;
    --ev-reported-bd: #B4BEFA;
    --ev-provider-bg: #3A4870;
    --ev-provider-fg: #FAF6EF;
  }
}

/* Density can change per language. Japanese pages later use the compact setting. */
body[data-density="compact"] {
  --lh: 1.5;
  --section-gap: 1.25rem;
  --pad: .75rem;
  font-size: .9375rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: var(--lh);
  overflow-wrap: break-word;
}
/* Font stacks for later languages. Noto Sans CJK files are not shipped yet, so these fall back to system fonts. */
:lang(ja) { font-family: "Noto Sans CJK JP", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif; }
:lang(zh-Hant-TW), :lang(zh-TW) { font-family: "Noto Sans CJK TC", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; }
:lang(zh-Hant-HK), :lang(zh-HK) { font-family: "Noto Sans CJK HK", "Noto Sans HK", "PingFang HK", "Microsoft JhengHei", sans-serif; }

img { max-width: 100%; }
a { color: var(--link); text-decoration: underline; text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: .25rem;
}
main:focus { outline: none; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--callout-bg); padding: .05rem .3rem; border-radius: .25rem; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; z-index: 10; background: var(--ink); color: var(--bg); padding: .75rem 1rem; }
.skip:focus { left: 0; }

.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1rem; }

/* Disclosure strip */
.disclosure { background: var(--callout-bg); border-bottom: 1px solid var(--line); font-size: .875rem; line-height: 1.45; }
.disclosure p { max-width: 62rem; margin: 0 auto; padding: .5rem 1rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1rem; padding-top: .75rem; padding-bottom: .5rem; }
.logo { display: inline-block; }
.logo img { display: block; width: 140px; height: auto; }
.main-nav ul { display: flex; flex-wrap: wrap; gap: 0 .9rem; list-style: none; margin: 0; padding: 0; }
.main-nav a { display: inline-block; padding: .55rem 0; color: var(--ink); text-decoration: none; font-size: .95rem; }
.main-nav a:hover { text-decoration: underline; }
.main-nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: .3em; }

/* Headings and text */
h1 { font-size: clamp(1.65rem, 5.2vw, 2.5rem); line-height: 1.2; margin: 1rem 0 .5rem; }
h2 { font-size: 1.35rem; line-height: 1.3; margin: 0 0 .5rem; }
h3 { font-size: 1.1rem; line-height: 1.35; margin: 1.25rem 0 .25rem; }
h4 { font-size: 1rem; margin: 1rem 0 .25rem; }
p { margin: .5rem 0 .75rem; }
ul, ol { padding-left: 1.25rem; }
li { margin: .35rem 0; }
section { margin-top: var(--section-gap); }
main .wrap { padding-bottom: 1rem; }
.lede { font-size: 1.1rem; max-width: 40rem; }
.note { color: var(--muted); font-size: .9rem; }
.dates { display: flex; flex-wrap: wrap; gap: .1rem 1rem; color: var(--muted); font-size: .9rem; margin: .5rem 0; }
.crumbs { font-size: .875rem; color: var(--muted); margin-top: 1rem; }
.page-head h1 { margin-top: .5rem; }
.callout { background: var(--callout-bg); border-left: 4px solid var(--accent); padding: .75rem 1rem; border-radius: .25rem; }

/* Buttons and picker */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: .5rem 1rem; border-radius: .5rem; border: 2px solid var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; text-align: center; }
.btn:hover { text-decoration: underline; }
.btn-quiet { background: transparent; border-color: var(--link); color: var(--link); }
.hero { margin-top: 1rem; }
.picker h2 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
.picker ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; list-style: none; margin: 0; padding: 0; }
.picker li { margin: 0; }
.picker .btn { width: 100%; padding: .5rem .25rem; }

/* Photo tiles: three portrait tiles, one per destination */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; list-style: none; margin: 1rem 0; padding: 0; }
.tile { position: relative; margin: 0; display: flex; flex-direction: column; }
.tile picture, .tile img { display: block; width: 100%; height: auto; }
.tile img { aspect-ratio: 3 / 4; object-fit: cover; border-radius: .5rem; }
.tile-name { margin-top: .4rem; font-weight: 700; }
.tile-name::after { content: ""; position: absolute; inset: 0; }
.tile:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: .5rem; }
.tile-name:focus-visible { outline: none; }
.tile-cap { font-size: .8125rem; line-height: 1.35; color: var(--muted); }

/* Evidence labels. Text always says the label, color is never the only signal. */
.ev { display: inline-block; font-size: .8125rem; font-weight: 700; line-height: 1.25; padding: .1rem .5rem; border-radius: 999px; border: 2px solid transparent; }
.ev-tested { background: var(--ev-tested-bg); color: var(--ev-tested-fg); }
.ev-reported { background: transparent; color: var(--ev-reported-fg); border-color: var(--ev-reported-bd); }
.ev-provider { background: var(--ev-provider-bg); color: var(--ev-provider-fg); border-color: var(--ev-provider-fg); border-style: dashed; }
.label-list { list-style: none; padding: 0; }
.label-list li { margin: .75rem 0; }

/* Tables: stacked cards on phones, normal tables on wide screens, no sideways scroll */
.table-wrap { margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; vertical-align: top; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
thead th { font-size: .875rem; color: var(--muted); }
tbody th[scope="row"] { font-weight: 700; }
@media (max-width: 47.99em) {
  table.stack, table.stack tbody, table.stack tr, table.stack th, table.stack td { display: block; width: 100%; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack tr { background: var(--surface); border: 1px solid var(--line); border-radius: .5rem; margin-bottom: .75rem; padding: .25rem 0; }
  table.stack th, table.stack td { border-bottom: 0; padding: .35rem .75rem; }
  table.stack td[data-label]::before, table.stack th[data-label]::before { content: attr(data-label); display: block; font-size: .8125rem; font-weight: 700; color: var(--muted); }
  table.stack tbody th[scope="row"] { font-size: 1.05rem; }
}
@media (min-width: 48em) {
  table.stack { background: var(--surface); border: 1px solid var(--line); }
}

/* Cards, facts, galleries, figures */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; padding: var(--pad); margin: 1rem 0; }
.card h3 { margin-top: 0; font-size: 1.25rem; }
.facts { display: grid; grid-template-columns: 1fr; gap: .1rem; margin: .5rem 0; }
.facts dt { font-weight: 700; margin-top: .6rem; }
.facts dd { margin: 0; }
@media (min-width: 40em) {
  .facts { grid-template-columns: 11rem 1fr; gap: .5rem 1rem; }
  .facts dt { margin-top: 0; }
}
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; list-style: none; padding: 0; margin: 1rem 0; }
.gallery li { margin: 0; }
@media (min-width: 48em) { .gallery { grid-template-columns: repeat(3, 1fr); } }
figure { margin: 0; }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: .5rem; }
figcaption { font-size: .8125rem; line-height: 1.4; color: var(--muted); margin-top: .3rem; }
.shot { max-width: 260px; margin: 1rem 0; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: .5rem; }

/* Footnotes */
.footnotes { font-size: .875rem; }
.footnotes ol { padding-left: 1.25rem; }
.footnotes li { overflow-wrap: anywhere; }
sup.fnref { line-height: 0; }
sup.fnref a { text-decoration: none; padding: 0 .1rem; font-weight: 700; }

/* Author block */
.author { margin-top: 2.5rem; padding: var(--pad); background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; }
.author h2 { font-size: 1rem; margin-top: 0; }
.author-grid { display: grid; grid-template-columns: 80px 1fr; gap: 1rem; align-items: start; }
.author-grid img { display: block; width: 80px; height: 80px; border-radius: 50%; }
.author-grid-large { grid-template-columns: 1fr; }
.author-grid-large img { width: 120px; height: 120px; }
@media (min-width: 40em) {
  .author-grid-large { grid-template-columns: 160px 1fr; }
  .author-grid-large img { width: 160px; height: 160px; }
}
.author-name { font-weight: 700; margin: 0; }

/* Footer */
.site-footer { margin-top: 3rem; border-top: 1px solid var(--line); background: var(--surface); padding: 1.5rem 0; font-size: .9375rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.footer-brand img { display: block; width: 96px; height: auto; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1rem; }
.site-footer li a { display: inline-block; padding: .4rem 0; }
.footer-mail { margin: 0; }
@media (min-width: 48em) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; align-items: start; } }

/* v2.0: visible table captions and the "On this page" list */
table.stack caption:not(.sr) { text-align: left; font-weight: 700; padding: .6rem .75rem; caption-side: top; }
@media (max-width: 47.99em) { table.stack caption:not(.sr) { display: block; padding: .5rem .25rem; } }
.jump { margin: 1.25rem 0; }
.jump h2 { font-size: 1.05rem; margin-bottom: .4rem; }
.jump ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem .5rem; }
.jump a { display: inline-block; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 999px; min-height: 2.75rem; line-height: 2rem; }
