/* Website layer, added by tools/build.py to site/<id>/index.html and site/index.html only; never in the PDFs.
   The book look stays in wego_manual.css. Here: the top bar, the side contents (a drawer under 1024 px),
   the page as a white sheet, and the landing page. Colours are wego_manual.css variables; fonts Pretendard. */
.wm-bar, .wm-toc, .wm-scrim{ display:none; }

@media screen {
  html, body{ background:#eef1f7; }
  body{ margin:0; }
  [data-toc]{ visibility:hidden; }                         /* page numbers belong to the PDF */
  h2[id], .colophon[id]{ scroll-margin-top:72px; }               /* lands below the 48 px bar */
  h1[data-mark]{ scroll-margin-top:118px; }                      /* … with the CHAPTER label above it */

  /* top bar */
  .wm-bar{ display:flex; align-items:center; gap:16px; position:sticky; top:0; z-index:30; height:48px; padding:0 20px;
           background:var(--navy); color:#c3cde0; font:600 13px/1 "Pretendard",sans-serif; }
  .wm-bar a{ color:#fff; text-decoration:none; white-space:nowrap; }
  .wm-bar .wm-home{ color:#c3cde0; }
  .wm-bar .wm-home:hover{ color:#fff; }
  .wm-bar .wm-title{ flex:1; min-width:0; color:#fff; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .wm-bar .wm-ver{ white-space:nowrap; }
  .wm-bar .wm-pdf{ background:var(--blue); border-radius:6px; padding:8px 12px; }
  .wm-menu{ display:none; font:inherit; color:#fff; background:rgba(255,255,255,.12); border:0; border-radius:6px;
            padding:8px 12px; cursor:pointer; }

  /* page as a sheet, side contents beside it */
  .wm-layout{ display:flex; justify-content:center; align-items:flex-start; gap:28px; padding:24px 16px 56px; }
  .wm-main{ flex:none; width:200mm; box-sizing:border-box; padding:0 12mm 24mm; background:#fff;
            box-shadow:0 0 0 1px var(--rule), 0 6px 24px rgba(10,20,40,.06); zoom:1.2; }
  .wm-main .chapter, .wm-main .front{ margin-top:14mm; }

  .wm-toc{ font:500 13px/1.45 "Pretendard",sans-serif; color:var(--ink2); background:#fff; border-radius:10px;
           box-shadow:0 0 0 1px var(--rule); padding:14px 10px 18px; box-sizing:border-box; }
  .wm-toc-h{ font-weight:700; font-size:12px; letter-spacing:.08em; color:var(--ink3); padding:0 8px 8px; }
  .wm-toc .wm-toc-home{ display:none; padding:6px 8px 12px; margin-bottom:8px; border-bottom:1px solid var(--rule);
                        border-radius:0; color:var(--blue); font-weight:700; }
  .wm-toc a{ display:block; color:inherit; text-decoration:none; border-radius:6px; }
  .wm-toc a:hover{ color:var(--blue); background:var(--soft); }
  .wm-t1{ padding:6px 8px; font-weight:600; color:var(--ink); }
  .wm-n{ display:inline-block; min-width:26px; color:var(--blue); font-weight:800; font-variant-numeric:tabular-nums; }
  .wm-t2{ padding:4px 8px 4px 34px; font-size:12.5px; }
  .wm-toc a.on{ color:var(--blue); background:var(--blue-dim); font-weight:700; }
  .wm-ch > summary{ list-style:none; display:flex; align-items:center; cursor:pointer; }
  .wm-ch > summary::-webkit-details-marker{ display:none; }
  .wm-ch > summary .wm-t1{ flex:1; }
  .wm-ch > summary::after{ content:""; flex:none; width:6px; height:6px; margin:0 8px; border:solid var(--ink3);
                           border-width:0 2px 2px 0; transform:rotate(-45deg); transition:transform .15s; }
  .wm-ch[open] > summary::after{ transform:rotate(45deg); }
}

/* docs layout: contents column beside the page, sticky under the bar, own scroll */
@media screen and (min-width: 1024px) {
  .wm-toc{ display:block; position:sticky; top:72px; width:260px; flex:none; max-height:calc(100vh - 96px); overflow:auto; }
}
@media screen and (min-width: 1024px) and (max-width: 1279px) { .wm-main{ zoom:.9; } .wm-toc{ width:230px; } }
@media screen and (min-width: 1280px) and (max-width: 1439px) { .wm-main{ zoom:1.05; } }

/* narrow: the contents open as a drawer from the bar button; tap outside, Esc or an entry closes it */
@media screen and (max-width: 1023px) {
  .wm-menu{ display:inline-block; }
  .wm-layout{ display:block; }                             /* a flex item would grow to its widest table */
  .wm-main{ zoom:1; margin:0 auto; }
  .wm-toc{ display:block; position:fixed; z-index:40; top:48px; left:0; bottom:0; width:min(320px, 86vw); overflow:auto;
           border-radius:0; transform:translateX(-105%); transition:transform .2s; }
  body.wm-open .wm-toc{ transform:none; box-shadow:0 0 40px rgba(10,20,40,.3); }
  body.wm-open .wm-scrim{ display:block; position:fixed; z-index:35; inset:48px 0 0 0; background:rgba(10,20,40,.45); }
}
@media screen and (max-width: 820px) {
  .wm-bar{ gap:10px; padding:0 12px; }
  .wm-bar .wm-ver, .wm-bar .wm-home{ display:none; }
  .wm-toc .wm-toc-home{ display:block; }                   /* the bar's WeGo 도서관 link is hidden here */
  .wm-layout{ padding:0; }
  .wm-main{ width:auto; padding:0 16px 40px; box-shadow:none; }
  .wm-main .cover{ width:auto; height:auto; }
  .wm-main .cover .hero{ position:static; height:auto; width:72%; margin:6mm auto 0; }   /* below the text, not over it */
  .wm-main table.t{ display:block; overflow-x:auto; }
}

@media print {
  .wm-bar, .wm-toc, .wm-scrim{ display:none !important; }
  .wm-layout{ display:block; padding:0; }
  .wm-main{ zoom:1; width:auto; padding:0; box-shadow:none; }
}

/* landing page (site/index.html) */
@media screen {
  .wm-landing{ font:400 15px/1.55 "Pretendard",sans-serif; color:var(--ink); }
  .lp-wrap{ max-width:1180px; margin:0 auto; padding:0 20px; }
  .lp-head{ background:radial-gradient(120% 140% at 85% 0%, #1b4fa0 0%, var(--navy) 55%); color:#c3cde0; padding:40px 0 44px; }
  .lp-logo{ display:inline-block; background:#fff; border-radius:12px; padding:10px 16px; }
  .lp-logo img{ height:34px; display:block; }
  .lp-head h1{ color:#fff; font-size:32px; font-weight:800; line-height:1.2; margin:22px 0 8px; }
  .lp-head p{ margin:0; font-size:16px; }
  .lp-grid{ max-width:760px; margin:0 auto; padding:28px 20px 12px; display:grid; gap:22px; grid-template-columns:1fr; }
  .lp-card{ background:#fff; border-radius:14px; overflow:hidden; display:grid; grid-template-columns:170px minmax(0, 1fr);
            box-shadow:0 0 0 1px var(--rule), 0 8px 28px rgba(10,20,40,.07); }
  .lp-thumb{ background:var(--navy); display:flex; justify-content:center; align-items:flex-start; padding:22px 0; }
  .lp-thumb img{ width:126px; height:auto; border-radius:3px; box-shadow:0 8px 24px rgba(0,0,0,.35); }
  .lp-body{ padding:16px 18px 18px; }
  .lp-body h3{ font-size:19px; font-weight:800; margin:0 0 8px; border:0; padding:0; }
  .lp-body ul{ list-style:none; margin:0; padding:0; }
  .lp-body li{ display:flex; align-items:center; gap:12px; padding:10px 0; border-top:1px solid var(--rule); }
  .lp-meta{ flex:1; min-width:0; }
  .lp-meta b{ font-weight:700; margin-right:6px; }
  .lp-lang{ display:inline-block; font-size:11px; font-weight:800; color:var(--blue); background:var(--blue-dim);
            border-radius:4px; padding:1px 6px; vertical-align:1px; }
  .lp-facts{ display:block; font-size:12.5px; color:var(--ink3); font-variant-numeric:tabular-nums; }
  .lp-btns{ display:flex; gap:6px; flex:none; }
  .lp-btns a{ white-space:nowrap; text-decoration:none; font-weight:700; font-size:13px; border-radius:7px; padding:8px 12px; }
  .lp-web{ background:var(--blue); color:#fff; }
  .lp-pdf{ color:var(--blue); box-shadow:inset 0 0 0 1.5px var(--blue); }
  .lp-foot{ color:var(--ink3); font-size:13px; padding:18px 0 36px; }
  .lp-foot p{ margin:4px 0; }
  .lp-foot a{ color:var(--ink2); }
}
@media screen and (min-width: 1080px) { .lp-grid{ max-width:1180px; grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media screen and (max-width: 560px) {
  .lp-grid{ padding:20px 12px; }
  .lp-card{ grid-template-columns:1fr; }
  .lp-thumb{ height:200px; padding:20px 0 0; overflow:hidden; }
  .lp-thumb img{ width:180px; border-radius:4px 4px 0 0; }
  .lp-head h1{ font-size:26px; }
}

/* landing search: one box in the header, hits replace the cards while typing */
@media screen {
  .lp-q{ display:block; width:100%; max-width:620px; margin:22px 0 0; padding:13px 16px; font:inherit; font-size:16px;
         border:0; border-radius:10px; background:#fff; color:var(--ink); box-shadow:0 6px 20px rgba(0,0,0,.25); }
  .lp-q:focus{ outline:3px solid #8fb8ff; }
  .lp-grid[hidden], .lp-hits[hidden], .lp-cats[hidden]{ display:none; }
  .lp-cats{ display:flex; flex-wrap:wrap; gap:8px; margin:16px 0 0; }
  .lp-cats a{ color:#fff; text-decoration:none; font-size:13.5px; font-weight:700; border-radius:999px; padding:6px 14px;
    box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.35); }
  .lp-cats a:hover{ background:rgba(255,255,255,.12); }
  .lp-cats span{ opacity:.6; font-weight:600; margin-left:6px; }
  .lp-cat{ grid-column:1 / -1; font-size:21px; font-weight:800; color:var(--ink); margin:18px 0 -8px; padding:0; border:0;
    scroll-margin-top:16px; }
  .lp-cat:first-child{ margin-top:0; }
  .lp-hits{ max-width:900px; margin:0 auto; padding:22px 20px 8px; }
  .lp-n{ color:var(--ink3); font-size:13px; margin:0 0 10px; }
  .lp-hit{ display:block; background:#fff; border-radius:10px; padding:12px 16px; margin:0 0 10px; text-decoration:none; color:var(--ink2);
           box-shadow:0 1px 3px rgba(10,20,40,.08); }
  .lp-hit:hover{ box-shadow:0 0 0 2px var(--blue); }
  .lp-hit b{ display:block; color:var(--ink); font-size:16px; margin:2px 0 4px; }
  .lp-hb{ font-size:12px; font-weight:700; color:var(--blue); }
  .lp-hs{ display:block; font-size:13.5px; line-height:1.55; color:var(--ink3); }
}
