@import "./tokens.css";

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo,
    sans-serif;
  font-size: 13px;
  line-height: 1.55;
  color: #222;
  background: #f5f5f5;
}

a {
  color: #1a5aa8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.frame {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 12px;
  padding-right: 12px;
}

/* Top bar */
.topbar {
  background: #fff;
  border-bottom: 1px solid #d0d0d0;
  font-size: 12px;
  color: #666;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
}

.topbar-note {
  color: #888;
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 2px solid #1a4f8c;
  padding-bottom: 0;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 12px;
}

.brand {
  font-size: 28px;
  font-weight: 800;
  color: #1a4f8c;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
  color: #143d6e;
}

.search {
  flex: 1;
  min-width: 220px;
  max-width: 520px;
  display: flex;
  border: 2px solid #1a4f8c;
}

.search input {
  flex: 1;
  border: 0;
  padding: 8px 10px;
  font-size: 14px;
  background: #f0f0f0;
  color: #888;
}

.search button {
  border: 0;
  background: #1a4f8c;
  color: #fff;
  padding: 0 16px;
  font-weight: 700;
  opacity: 0.55;
  cursor: not-allowed;
}

.header-links {
  display: flex;
  gap: 14px;
  font-size: 12px;
  font-weight: 600;
}

.gnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding: 8px 12px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #333;
}

.gnav a {
  color: #333;
}

.gnav a.is-current,
.gnav a:hover {
  color: #1a4f8c;
}

.gnav-more {
  margin-left: auto;
  font-weight: 500;
  color: #888;
  font-size: 12px;
}

.crumbs {
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 12px;
  color: #666;
}

.crumbs .sep {
  margin: 0 4px;
  color: #999;
}

/* 3-column: left nav + center + TV rail */
.layout-3 {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 220px;
  gap: 12px;
  align-items: start;
  padding-bottom: 40px;
}

.col-left,
.col-right {
  width: auto;
  min-width: 0;
}

.col-center {
  min-width: 0;
  overflow-x: auto;
}

.nav-size-stack {
  display: flex;
  flex-direction: column;
}

.nav-size-group {
  border-bottom: 1px solid #e0e0e0;
}

.nav-size-group:last-child {
  border-bottom: 0;
}

.nav-size-label {
  padding: 10px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  color: #666;
  letter-spacing: 0.04em;
}

/* Right rail: horizontal scrolling TV CTA */
.tv-rail {
  display: flex;
  align-items: center;
  width: 100%;
  height: 56px;
  min-height: 56px;
  margin-bottom: 12px;
  padding: 0;
  overflow: hidden;
  background: #1a4f8c;
  border: 1px solid #143d6e;
  color: #fff !important;
  text-decoration: none !important;
  box-sizing: border-box;
}

.tv-rail:hover {
  background: #143d6e;
  text-decoration: none !important;
}

.tv-rail-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: tv-marquee 14s linear infinite;
}

.tv-rail:hover .tv-rail-track {
  animation-play-state: paused;
}

.tv-rail-text {
  flex-shrink: 0;
  padding: 0 1.4em;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.3;
  white-space: nowrap;
}

@keyframes tv-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tv-rail-track {
    animation: none;
  }
}

.box {
  background: #fff;
  border: 1px solid #ccc;
  margin-bottom: 12px;
}

.box-soft {
  background: #fff;
}

.box-head {
  background: #f0f0f0;
  border-bottom: 1px solid #ccc;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 13px;
}

.box-body {
  margin: 0;
  padding: 10px;
  font-size: 12px;
  color: #555;
  line-height: 1.6;
}

.box-foot {
  margin: 0;
  padding: 8px 10px 10px;
  font-size: 12px;
  border-top: 1px solid #eee;
}

.side-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-nav > li {
  border-bottom: 1px solid #e8e8e8;
}

.side-nav > li:last-child {
  border-bottom: 0;
}

.side-nav a {
  display: block;
  padding: 8px 10px;
  color: #1a5aa8;
  font-size: 12px;
  line-height: 1.45;
}

.side-nav a:hover,
.side-nav a.is-active {
  background: #eef5fc;
  text-decoration: none;
}

.side-nav-sub {
  list-style: none;
  margin: 0;
  padding: 0 0 6px;
}

.side-nav-sub a {
  padding: 3px 10px 3px 22px;
  font-size: 12px;
  color: #555;
}

.side-nav.compact a {
  padding: 6px 10px;
  font-size: 12px;
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
}

.rail-list li {
  margin-bottom: 8px;
}

.rail-model {
  display: block;
  font-weight: 700;
  color: #333;
}

.howto {
  margin: 0;
  padding: 10px 10px 10px 28px;
  font-size: 12px;
  color: #444;
  line-height: 1.7;
}

/* Center panels */
.panel {
  background: #fff;
  border: 1px solid #ccc;
  margin-bottom: 12px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #ddd;
}

.panel-head.border-accent {
  border-bottom: 2px solid #c62828;
}

.panel-title,
.panel-head h1,
.panel-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.panel-meta,
.panel-lede {
  margin: 0;
  padding: 0 14px 10px;
  color: #666;
  font-size: 12px;
}

.panel-head + .panel-lede,
.panel-head + .disclaimer-inline {
  padding-top: 10px;
}

.disclaimer-inline {
  margin: 0;
  padding: 10px 14px;
  background: #fff8e8;
  border-bottom: 1px solid #eee;
  font-size: 12px;
  color: #664;
}

.hero-band {
  background: linear-gradient(90deg, #1a4f8c, #2a6bb0);
  color: #fff;
  padding: 22px 20px;
  margin-bottom: 12px;
  border: 1px solid #143d6e;
}

.hero-band h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
}

.hero-band p {
  margin: 0;
  font-size: 13px;
  opacity: 0.95;
}

.home-size-stack {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #ddd;
}

.home-size-group {
  border-bottom: 1px solid #ddd;
}

.home-size-label {
  margin: 0;
  padding: 12px 14px 6px;
  font-size: 13px;
  font-weight: 700;
  color: #1a4f8c;
  background: #f7f7f7;
}

.home-size-label a {
  color: #1a4f8c;
  text-decoration: none;
}

.home-size-label a:hover {
  text-decoration: underline;
}

.home-cat-stack {
  display: flex;
  flex-direction: column;
}

.home-cat-stack .home-cat {
  border-bottom: 1px solid #eee;
}

.home-cat-stack .home-cat:last-child {
  border-bottom: 0;
}

.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: #ddd;
  border-top: 1px solid #ddd;
}

.home-cat {
  display: block;
  padding: 14px 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.home-cat:hover {
  background: #eef5fc;
  text-decoration: none;
}

.home-cat-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #1a5aa8;
  margin-bottom: 4px;
}

.home-cat-meta {
  display: block;
  font-size: 11px;
  color: #777;
}

/* Rank panels */
.rank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 12px 14px 16px;
}

.rank-panel {
  border: 1px solid #e0e0e0;
  background: #fafafa;
}

.rank-panel-title {
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid #e0e0e0;
  background: #fff;
}

.muted {
  font-weight: 500;
  color: #888;
  font-size: 11px;
}

.rank-list {
  padding: 4px 0;
}

.rank-row {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  align-items: flex-start;
}

.rank-row:last-child {
  border-bottom: 0;
}

.rank-badge {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  background: #eee;
  border: 1px solid #ccc;
}

.rank-row:nth-child(1) .rank-badge,
.prod-list > .prod-card:nth-child(1) .rank-badge {
  background: #f5c518;
  border-color: #d4a80a;
  color: #fff;
}

.rank-row:nth-child(2) .rank-badge,
.prod-list > .prod-card:nth-child(2) .rank-badge {
  background: #c0c0c0;
  border-color: #a8a8a8;
  color: #fff;
}

.rank-row:nth-child(3) .rank-badge,
.prod-list > .prod-card:nth-child(3) .rank-badge {
  background: #cd7f32;
  border-color: #b06b28;
  color: #fff;
}

.prod-list {
  padding: 4px 0;
}

.prod-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.prod-card:last-child {
  border-bottom: 0;
}

.prod-card-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.prod-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border: 1px solid #e0e0e0;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.prod-thumb img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
}

.prod-thumb.is-empty {
  background: #f3f3f3;
}

.prod-card-body {
  min-width: 0;
  flex: 1;
}

.prod-line1 {
  font-size: 14px;
  font-weight: 700;
  color: #222;
  line-height: 1.4;
}

.prod-specs {
  margin-top: 4px;
  font-size: 12px;
  color: #555;
}

.prod-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: #444;
}

.prod-price {
  color: #c00;
  font-weight: 700;
}

.prod-price.is-empty {
  color: #999;
  font-weight: 500;
}

.prod-card-cta {
  flex-shrink: 0;
  padding-left: 0;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  min-width: 118px;
}

.prod-cta {
  display: inline-block;
  padding: 4px 10px;
  line-height: 1.25;
  background: #1a4f8c;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #143d6e;
  white-space: nowrap;
  text-align: center;
}

.prod-cta:hover {
  background: #143d6e;
}

.prod-cta-analysis {
  background: #c45c26;
  border-color: #a34a1c;
}

.prod-cta-analysis:hover {
  background: #a34a1c;
}

.prod-cta-buy {
  background: #1a4f8c;
  border-color: #143d6e;
}

.prod-cta-rakuten {
  background: #bf0000;
  border-color: #9a0000;
}

.prod-cta-rakuten:hover {
  background: #9a0000;
}

.prod-cta.is-disabled {
  background: #ccc;
  border-color: #bbb;
  color: #666 !important;
  font-weight: 500;
}

@media (max-width: 720px) {
  .prod-card {
    flex-wrap: wrap;
  }

  .prod-card-cta {
    width: 100%;
    margin-left: 34px;
  }
}

.rank-model {
  font-weight: 700;
  font-size: 13px;
}

.rank-name {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}

/* Topic tabs + items */
.topic-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 12px;
}

.topic-tabs a {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid #ccc;
  background: #f7f7f7;
  font-size: 12px;
  font-weight: 700;
  color: #333;
  text-decoration: none;
}

.topic-tabs a:hover {
  background: #1a4f8c;
  border-color: #1a4f8c;
  color: #fff;
  text-decoration: none;
}

.axis-block {
  scroll-margin-top: 12px;
  padding: 16px 14px 8px;
  border-top: 1px solid #e5e5e5;
}

.axis-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
  color: #1a4f8c;
}

.bucket-block {
  margin-bottom: 16px;
}

.bucket-head {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
}

.bucket-note {
  margin: 0 0 8px;
  font-size: 11px;
  color: #777;
}

.item-list {
  border-top: 1px solid #e0e0e0;
}

.item-card {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e8e8e8;
  background: #fff;
}

.item-card:hover {
  background: #fafcff;
}

.item-left {
  flex: 1;
  min-width: 200px;
}

.item-right {
  width: 160px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  align-content: start;
  border-left: 1px solid #eee;
  padding-left: 12px;
}

.item-model {
  font-size: 15px;
  font-weight: 800;
  color: #1a5aa8;
  margin-bottom: 2px;
}

.item-model a {
  color: #1a5aa8;
  font-weight: 800;
}

.item-name {
  font-size: 12px;
  color: #555;
  margin-bottom: 6px;
}

.item-summary {
  font-size: 13px;
  color: #222;
  line-height: 1.55;
  margin-bottom: 6px;
}

.item-meta {
  font-size: 11px;
  color: #777;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 10px;
  color: #888;
}

.stat-val {
  font-size: 16px;
  font-weight: 800;
  color: #333;
}

.bucket-chip {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #555;
  background: #f0f0f0;
  border: 1px solid #ddd;
  padding: 3px 6px;
  text-align: center;
}

/* Footer */
.site-footer {
  background: #2c2c2c;
  color: #bbb;
  padding: 28px 0 20px;
  border-top: 4px solid #1a4f8c;
  font-size: 12px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  padding-bottom: 20px;
}

.footer-grid h4 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 13px;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-grid li {
  margin-bottom: 6px;
}

.footer-grid a {
  color: #bbb;
}

.footer-grid a:hover {
  color: #fff;
}

.footer-copy {
  border-top: 1px solid #444;
  padding-top: 12px;
  text-align: center;
  font-size: 11px;
  color: #888;
}

/* Sandwich hook article (center column) */
.sandwich-panel .sandwich-lede {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.75;
}

.sandwich-panel .sandwich-lede strong {
  font-weight: 700;
}

.sandwich-panel h2 {
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #ddd;
  font-size: 15px;
  line-height: 1.4;
}

.cta-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 12px 0 20px;
  padding: 12px;
  border: 1px solid #ccc;
  background: #fff;
}

.cta-card-media {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border: 1px solid #e0e0e0;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-card-media img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.cta-card-media.is-empty {
  background: #f0f0f0;
}

.cta-card-body {
  min-width: 0;
  flex: 1;
}

.cta-card-kicker {
  font-size: 11px;
  color: #666;
  margin-bottom: 4px;
}

.cta-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.cta-card-specs {
  margin-top: 4px;
  font-size: 12px;
  color: #555;
}

.cta-card-price {
  margin-top: 6px;
  font-size: 13px;
  color: #c00;
  font-weight: 700;
}

.cta-card-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 720px) {
  .cta-card {
    flex-direction: column;
  }
}

@media (max-width: 960px) {
  .layout-3 {
    grid-template-columns: 1fr;
  }

  .col-left,
  .col-right {
    width: 100%;
  }

  .tv-rail {
    height: 52px;
    min-height: 52px;
  }

  .tv-rail-text {
    font-size: 13px;
    letter-spacing: 0.06em;
  }

  .item-right {
    width: 100%;
    border-left: 0;
    border-top: 1px solid #eee;
    padding-left: 0;
    padding-top: 8px;
    grid-template-columns: repeat(4, 1fr);
  }

  .bucket-chip {
    grid-column: 1 / -1;
  }
}
