/* 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;
}

@media (prefers-color-scheme: dark) {
  /* Page background stays cream with navy text. Header, footer and boxes stay navy with cream text. */
  .site-header, .site-footer, .card, .callout, p.disclosure, .author, table.stack, table.stack tr {
    --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;
    color: var(--ink);
  }
  .site-header { background: var(--bg); }
  .site-footer { background: var(--surface); }
}

/* 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;
}
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; }


/* 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; position: relative; }
.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; }

/* ===== v2.1 ===== */
/* CJK fonts: Noto Sans CJK (SIL OFL), subsetted, self-hosted. Loaded only on pages whose root language needs them. */
@font-face { font-family: "Koi JP"; src: url(/fonts/noto-sans-jp-regular.woff) format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Koi JP"; src: url(/fonts/noto-sans-jp-bold.woff) format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Koi TC"; src: url(/fonts/noto-sans-tc-regular.woff) format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Koi TC"; src: url(/fonts/noto-sans-tc-bold.woff) format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Koi HK"; src: url(/fonts/noto-sans-hk-regular.woff) format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Koi HK"; src: url(/fonts/noto-sans-hk-bold.woff) format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
html[lang="ja"] body { font-family: "Koi JP", "Hiragino Sans", "Yu Gothic", Meiryo, "Noto Sans CJK JP", sans-serif; }
html[lang="zh-Hant-TW"] body { font-family: "Koi TC", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", sans-serif; }
html[lang="zh-Hant-HK"] body { font-family: "Koi HK", "PingFang HK", "Microsoft JhengHei", "Noto Sans CJK HK", sans-serif; }
/* CJK text has no spaces: let long runs wrap anywhere that is allowed and keep punctuation off line starts */
html[lang="ja"] body, html[lang^="zh"] body { line-break: strict; word-break: normal; overflow-wrap: anywhere; }
html[lang="ja"] h1, html[lang^="zh"] h1 { line-height: 1.3; }
html[lang^="zh"] body { letter-spacing: .01em; }
body[data-density="compact"] th, body[data-density="compact"] td { padding: .45rem .6rem; }
body[data-density="compact"] .card { padding: .75rem; }
body[data-density="compact"] h2 { font-size: 1.25rem; }
body[data-density="compact"] li { margin: .25rem 0; }

/* Missing evidence labels. Text always names the label. Shape differs, color is never the only signal. */
.ev-official { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ev-press { background: transparent; color: var(--ink); border-color: var(--ink); border-style: dotted; }

/* Disclosure banner under the H1 */
p.disclosure { background: var(--callout-bg); border-left: 4px solid var(--accent); border-radius: .25rem; padding: .6rem .9rem; margin: .75rem 0; font-size: .9rem; line-height: 1.5; }

/* Header menu: no script. Checkbox sits over the Menu button so keyboard focus works. */
.menu-btn { display: none; }
.mt { position: absolute; right: 1rem; top: .75rem; width: 5.5rem; height: 2.75rem; margin: 0; opacity: 0; z-index: 2; cursor: pointer; }
.menu { flex-basis: 100%; }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; min-width: 5.5rem; padding: 0 1rem; border: 2px solid var(--ink); border-radius: .5rem; font-weight: 700; background: transparent; color: var(--ink); }
.mt:focus-visible + .menu-btn { outline: 3px solid var(--focus); outline-offset: 3px; }
.mt:checked + .menu-btn { background: var(--ink); color: var(--bg); }
.menu { display: none; }
.mt:checked ~ .menu { display: block; }
.main-nav ul { flex-direction: column; gap: 0; }
.main-nav a { display: block; padding: .75rem 0; min-height: 2.75rem; }
.lang-nav, .foot-lang { margin-top: .5rem; }
.lang-nav ul, .foot-lang ul { display: flex; flex-wrap: wrap; gap: 0 .25rem; list-style: none; margin: 0; padding: 0; }
.lang-nav a, .lang-nav .cur, .foot-lang a, .foot-lang .cur { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .75rem; border: 1px solid var(--line); border-radius: .5rem; font-size: .9375rem; }
.lang-nav li, .foot-lang li { margin: .15rem 0; }
.lang-nav a, .foot-lang a { color: var(--link); }
.lang-nav .cur, .foot-lang .cur { background: var(--ink); color: var(--bg); font-weight: 700; border-color: var(--ink); }
@media (min-width: 62em) {
  /* Same two-row header in every language: logo and language buttons on row 1, main nav on row 2.
     Layout does not depend on label width, so nothing shifts when the language changes. */
  .menu-btn, .mt { display: none; }
  .header-row { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 1rem; row-gap: 0; }
  .menu { display: contents; }
  .logo { grid-column: 1; grid-row: 1; justify-self: start; }
  .lang-nav { grid-column: 2; grid-row: 1; justify-self: end; margin-top: 0; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; }
  .main-nav ul { flex-direction: row; gap: 0 1.25rem; flex-wrap: wrap; }
  .main-nav li, .lang-nav li { display: flex; line-height: 1.2; }
  .main-nav ul { height: 2.75rem; align-items: center; overflow: hidden; }
  .lang-nav { display: flex; align-items: center; height: 2.75rem; }
  .lang-nav ul { flex-wrap: nowrap; }
  .lang-nav li { margin: 0; }
  .main-nav a { display: inline-flex; align-items: center; box-sizing: border-box; height: 2.75rem; padding: 0; line-height: 1.2; }
}

/* Footer: nav, language links, small print */
.foot-nav ul, .footer-links nav ul { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.foot-nav a, .footer-links a { display: inline-block; padding: .55rem 0; min-height: 2.75rem; }
.footer-brand p { margin: .5rem 0; font-size: .875rem; color: var(--muted); }
.footer-links > * + * { margin-top: .5rem; }
.footer-mail { color: var(--ink); }
@media (min-width: 48em) { .footer-grid { grid-template-columns: 1.4fr 1fr 1.2fr; } }

/* Inline link row (home no-eSIM block) */
ul.inline { display: flex; flex-wrap: wrap; gap: .25rem .5rem; list-style: none; padding: 0; margin: .5rem 0; }
ul.inline li { margin: 0; }
ul.inline a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 .9rem; border: 1px solid var(--line); border-radius: 999px; }
.guide { margin-top: 0; }

/* Phone tables: two fields per row inside each card, long last field full width. Keeps cards short. */
@media (max-width: 47.99em) {
  table.stack tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: .5rem; }
  table.stack tbody th[scope="row"] { grid-column: 1 / -1; }
  table.stack td:last-child, table.stack td:only-of-type { grid-column: 1 / -1; }
  table.stack td[data-label="Cap"], table.stack td[data-label] { min-width: 0; }
}

.px{display:block;font-weight:600}
.px-us{display:block;font-size:.8125rem;color:var(--muted);font-weight:400}
