/*
Theme Name: Gadget Yokocho
Description: Replica of the original Gadget Yokocho blog design. Light/dark follows the device setting (prefers-color-scheme) with no manual toggle.
Version: 1.91
*/

:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #0a0b0d);
  --panel: light-dark(#ffffff, #16181d);
  --panel2: light-dark(#f3f3f3, #1f2229);
  --text: light-dark(#333333, #f2f3f5);
  --sub: light-dark(#777777, #9aa1ab);
  --line: light-dark(#e5e5e5, #2b2e35);
  --masthead-bg: light-dark(#ffffff, #0a0b0d);
  --input-bg: light-dark(#ffffff, #1e2127);
  --nav-active-bg: light-dark(#111111, #ffffff);
  --nav-active-text: light-dark(#ffffff, #111111);
  --band: light-dark(#111111, #262a31);
  --link: light-dark(#333333, #7db3ff);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
* { animation: none !important; transition: none !important; }
a { color: var(--text); text-decoration: none; }
img { max-width: 100%; height: auto; }

/* ---------- Masthead (always dark, measured from the reference) ---------- */
.gy-masthead { background: #232429; height: 50px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.gy-logo { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.gy-masthead .gy-site-title { margin: 0; font-size: 17px; font-weight: 900; font-style: italic; letter-spacing: 0; line-height: 1.2; white-space: nowrap; }
.gy-masthead .gy-site-title a { color: #fff; display: inline-block; }
.gy-masthead .gy-tagline { margin: 0; color: #cfd2d8; font-size: 8px; line-height: 1.5; white-space: nowrap; }
.gy-head-btn { flex: 0 0 auto; width: 40px; background: transparent; border: none; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; }
.gy-head-btn svg { width: 22px; height: 22px; fill: currentColor; }
.gy-menu-btn svg { fill: none; }
.gy-menu-btn span { font-size: 9px; letter-spacing: 0.08em; color: #fff; line-height: 1; }
.gy-head-panel { background: var(--panel); border-bottom: 1px solid var(--line); padding: 14px 16px; }
.gy-menu-list { list-style: none; margin: 0; padding: 0; }
.gy-menu-list li { border-bottom: 1px solid var(--line); }
.gy-menu-list li:last-child { border-bottom: none; }
.gy-menu-list a { display: block; padding: 11px 4px; font-size: 15px; font-weight: 700; color: var(--text); }

/* ---------- Hero ---------- */
.gy-hero { position: relative; line-height: 0; background: #000; }
.gy-hero img { width: 100%; height: auto; aspect-ratio: 2200 / 667; object-fit: cover; display: block; }
.gy-hero-text { position: absolute; left: 0; right: 0; top: 61%; transform: translateY(-50%); line-height: 1.4; }
.gy-hero-inner { padding: 0 16px 0 7%; display: inline-block; }
.gy-hero-title { color: #fff; font-style: italic; font-size: 8vw; font-weight: 900; letter-spacing: 0.04em; text-shadow: 0 2px 16px rgba(0,0,0,.45); margin: 0; }
.gy-hero-sub { margin: 10px 0 0; text-align: center; }
.gy-hero-sub a { color: #fff; font-size: 3vw; font-weight: 500; font-style: italic; letter-spacing: 0.02em; text-shadow: 0 1px 10px rgba(0,0,0,.45); text-decoration: none; }

/* ---------- Nav (dark grid cells, Gajemaga-style) ---------- */
.gy-nav { background: #36373c; }
.gy-nav ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; }
.gy-nav li { min-width: 0; }
.gy-nav a { display: block; background: #2b2c31; color: #fff; font-size: 14px; line-height: 1.15; text-align: center; padding: 10px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gy-nav li:first-child a { font-weight: 900; }
.gy-nav li.gy-active a { background: #3d3e45; font-weight: 900; }
@media (min-width: 821px) {
  .gy-nav ul { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- Layout ---------- */
.gy-wrap { max-width: 1100px; margin: 0 auto; padding: 20px 12px 40px; display: flex; gap: 20px; align-items: flex-start; }
.gy-main { flex: 1 1 auto; min-width: 0; background: var(--panel); border-radius: 10px; padding: 24px 24px 34px; }
.gy-side { flex: 0 0 300px; width: 300px; }

/* ---------- Search area ---------- */
.gy-search-form { position: relative; }
.gy-search-form input[type="search"] { width: 100%; padding: 13px 46px 13px 14px; font-size: 15px; background: var(--input-bg); border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
.gy-search-form input[type="search"]::placeholder { color: var(--sub); }
.gy-search-form button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: var(--sub); cursor: pointer; padding: 6px; display: flex; }
.gy-search-form button svg { width: 20px; height: 20px; fill: currentColor; }
.gy-count { text-align: right; font-size: 14px; color: var(--sub); margin: 10px 0 4px; }

/* ---------- Sections & cards ---------- */
.gy-section-title { position: relative; font-size: 20px; color: light-dark(#222428, #f2f3f5); font-weight: 900; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin: 34px 0 20px; }
.gy-section-title::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 100px; height: 3px; background: var(--text); }
.gy-section-title:first-of-type { margin-top: 22px; }
.gy-rec-wrap { position: relative; }
.gy-rec-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gy-rec-track::-webkit-scrollbar { display: none; }
.gy-card { display: block; flex: 0 0 calc((100% - 32px) / 3); scroll-snap-align: start; }
.gy-rec-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 40px; height: 48px; padding: 0; background: none; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.gy-rec-arrow svg { width: 20px; height: 20px; fill: none; stroke: #9a9a9a; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.gy-rec-prev { left: -4px; }
.gy-rec-next { right: -4px; }
.gy-card .gy-thumb { position: relative; line-height: 0; }
.gy-card .gy-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; display: block; border-radius: 6px; }
.gy-card .gy-card-body { padding: 12px 2px 0; }
.gy-card .gy-card-title { font-size: 15px; font-weight: 800; line-height: 1.4; margin: 0; text-align: center; }
.gy-card-excerpt { color: light-dark(#969696, #9a9a9a); font-size: 12px; line-height: 1.7; margin: 8px 0 0; height: 3.4em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 40%, transparent 96%); mask-image: linear-gradient(#000 40%, transparent 96%); }
.gy-chips { position: absolute; top: 5px; left: 5px; right: 5px; display: flex; flex-wrap: wrap; gap: 5px; }
.gy-chip { background: rgba(0,0,0,.55); color: #fff; font-size: 10px; font-weight: 700; padding: 4px 6px; line-height: 1.4; border-radius: 3px; }
.gy-card-date { position: absolute; right: 8px; bottom: 10px; color: #fff; font-size: 12px; display: flex; align-items: center; gap: 5px; text-shadow: 0 1px 6px rgba(0,0,0,.65); line-height: 1.4; }
.gy-card-date svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.gy-tile { width: 100%; aspect-ratio: 16 / 9; background: #444; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; line-height: 1.4; border-radius: 6px; }
.gy-card .gy-tile { aspect-ratio: 4 / 3; }
.gy-date { font-size: 12px; color: var(--sub); }

/* ---------- Article rows ---------- */
.gy-row { display: flex; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.gy-row .gy-thumb { position: relative; flex: 0 0 240px; width: 240px; line-height: 0; }
.gy-row .gy-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; display: block; border-radius: 6px; }
.gy-row .gy-thumb .gy-chip { position: absolute; top: 8px; left: 8px; }
.gy-row .gy-row-body { flex: 1 1 auto; min-width: 0; }
.gy-row .gy-row-title { font-size: 17px; font-weight: 700; line-height: 1.55; margin: 2px 0 6px; }

/* ---------- Sidebar ---------- */
.gy-widget { background: var(--panel); border-radius: 10px; margin-bottom: 20px; padding: 18px; }
.gy-widget-title { position: relative; font-size: 17px; font-weight: 900; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin: 0 0 14px; }
.gy-widget-title::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 64px; height: 3px; background: var(--text); }
.gy-widget-text { font-size: 14px; line-height: 1.8; }
.gy-recent { list-style: none; margin: 0; padding: 0; }
.gy-recent li { margin-bottom: 12px; }
.gy-recent li:last-child { margin-bottom: 0; }
.gy-recent a { display: flex; gap: 10px; align-items: flex-start; }
.gy-recent img { width: 84px; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; flex: 0 0 84px; border-radius: 4px; }
.gy-recent .gy-recent-title { font-size: 13px; font-weight: 700; line-height: 1.5; }

/* ---------- Article page ---------- */
.gy-back { display: inline-block; border: 2px solid var(--text); color: var(--text); padding: 6px 18px; font-size: 14px; font-weight: 700; margin-bottom: 20px; background: transparent; }
.gy-article-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.gy-chip-static { background: var(--text); color: var(--bg); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 3px; }
.gy-article-title { font-size: 28px; font-weight: 900; line-height: 1.45; margin: 0 0 18px; }
.gy-eyecatch { line-height: 0; margin-bottom: 24px; }
.gy-eyecatch img { width: 100%; display: block; border-radius: 6px; }
.gy-toc { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px 10px; margin: 0 0 28px; }
.gy-toc-title { font-weight: 900; font-size: 16px; margin-bottom: 8px; }
.gy-toc ol { margin: 0 0 8px; padding-left: 22px; }
.gy-toc li { margin: 4px 0; font-size: 14px; }
.gy-toc a { color: var(--text); }

.gy-article { font-size: 16px; line-height: 1.9; }
.gy-article p { margin: 0 0 1.2em; }
.gy-article h2 { background: var(--band); color: #fff; font-size: 21px; font-weight: 900; line-height: 1.5; padding: 12px 16px; margin: 38px 0 18px; border-radius: 4px; }
.gy-article h3 { font-size: 18px; font-weight: 900; border-left: 6px solid var(--text); padding: 2px 0 2px 12px; margin: 30px 0 14px; line-height: 1.5; }
.gy-article ul, .gy-article ol { margin: 0 0 1.2em; padding-left: 24px; }
.gy-article li { margin: 4px 0; }
.gy-article img { display: block; margin: 18px auto; }
.gy-article table { width: 100%; border-collapse: collapse; margin: 18px 0 26px; font-size: 14px; line-height: 1.6; }
.gy-article th, .gy-article td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.gy-article th { background: var(--panel2); font-weight: 700; }
.gy-article a { color: var(--link); text-decoration: underline; }
.gy-tags { margin: 26px 0 6px; font-size: 13px; color: var(--sub); }
.gy-tags a { color: var(--sub); text-decoration: underline; }

/* ---------- Share ---------- */
.gy-share { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0; }
.gy-share a, .gy-share button { display: inline-flex; align-items: center; gap: 7px; color: #fff; font-size: 14px; font-weight: 700; padding: 9px 18px; border: none; cursor: pointer; line-height: 1.4; border-radius: 4px; }
.gy-share svg { width: 16px; height: 16px; fill: currentColor; flex: none; pointer-events: none; }
.gy-toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: light-dark(rgba(25, 25, 25, .68), rgba(255, 255, 255, .88)); color: light-dark(#fff, #111); font-size: 14px; font-weight: 700; padding: 12px 24px; border-radius: 999px; opacity: 0; pointer-events: none; z-index: 200; transition: opacity .6s ease !important; }
.gy-toast.gy-show { opacity: 1; }
.gy-share svg.gy-ico-stroke { fill: none; }
.gy-share .gy-x { background: #000; }
.gy-share .gy-fb { background: #1877f2; }
.gy-share .gy-line { background: #06c755; }
.gy-share .gy-copy { background: #666; }

/* ---------- Buttons / footer / pages ---------- */
.gy-home-btn { display: block; width: 240px; margin: 34px auto 6px; text-align: center; background: var(--panel2); color: var(--text); border: 1px solid var(--line); font-weight: 900; font-size: 16px; padding: 14px 0; border-radius: 4px; }
.gy-related-title { position: relative; font-size: 19px; font-weight: 900; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin: 36px 0 6px; }
.gy-related-title::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 96px; height: 3px; background: var(--text); }
.gy-footer { background: #0d0e11; color: #fff; text-align: center; padding: 30px 16px 36px; }
.gy-footer .gy-footer-title { font-size: 20px; font-weight: 900; letter-spacing: 0.06em; margin-bottom: 12px; }
.gy-footer nav a { color: #fff; font-size: 13px; margin: 0 10px; text-decoration: underline; }
.gy-footer .gy-copyright { color: #999; font-size: 12px; margin-top: 14px; }
.gy-page-title { font-size: 26px; font-weight: 900; margin: 0 0 20px; border-bottom: 3px solid var(--text); padding-bottom: 10px; }
.gy-pagination { margin-top: 26px; text-align: center; }
.gy-pagination .page-numbers { display: inline-block; border: 1px solid var(--text); color: var(--text); padding: 6px 13px; margin: 0 3px; font-size: 14px; }
.gy-pagination .current { background: var(--text); color: var(--bg); }

/* ---------- Contact form ---------- */
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 textarea { width: 100%; background: var(--input-bg); border: 1px solid var(--line); color: var(--text); padding: 10px 12px; font-size: 15px; border-radius: 4px; }
.wpcf7 input[type="submit"] { background: var(--text); color: var(--bg); border: none; font-weight: 900; font-size: 15px; padding: 12px 34px; cursor: pointer; border-radius: 4px; }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .gy-nav a { padding: 10px 2px; }
  .gy-wrap { flex-direction: column; padding: 14px 10px 30px; }
  .gy-main { width: 100%; padding: 18px 16px 26px; }
  .gy-side { flex: none; width: 100%; }
  .gy-card { flex-basis: calc((100% - 16px) / 2); }
  .gy-row { gap: 12px; }
  .gy-row .gy-thumb { flex: 0 0 118px; width: 118px; }
  .gy-row .gy-thumb img { aspect-ratio: 4 / 3; }
  .gy-row .gy-row-title { font-size: 14px; margin-top: 0; }
  .gy-article-title { font-size: 23px; }
  .gy-article h2 { font-size: 19px; }
}

/* ---------- Reading progress (single posts) ---------- */
.gy-progress { position: fixed; left: 0; right: 0; bottom: 0; height: 40px; pointer-events: none; z-index: 60; transition: transform .25s ease !important; }
.gy-progress-bar { position: absolute; left: 0; bottom: 8px; height: 4px; width: 0; background: #DA1725; }
.gy-progress-marker { position: absolute; right: 0; bottom: -8px; width: 0; z-index: 5; }
.gy-progress-face { position: absolute; bottom: 0; left: 0; transform: translateX(-50%); width: 42px; height: 42px; max-width: none; }
.gy-progress-bubble { position: absolute; bottom: 29px; left: 24px; background: #fff; color: #111; border: 1.5px solid #111; border-radius: 8px; font-size: 10px; font-weight: 700; line-height: 1; padding: 4px 7px; white-space: nowrap; }
.gy-progress-marker.gy-flip .gy-progress-bubble { left: auto; right: 24px; }

.gy-progress-goal { position: absolute; right: 0; bottom: 0; z-index: 1; height: 57px; width: auto; max-width: none; }

.gy-progress-start { position: absolute; left: 0; bottom: 0; z-index: 4; height: 42px; width: auto; max-width: none; }
