/*
Theme Name: Medal Compass
Author: Your Name
Version: 1.0
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  color: #333;
  background: #FFF8F0;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ===== COLOR TOKENS ===== */
:root {
  --orange: #E07000;
  --orange-light: #F5A623;
  --orange-bg: #FFF3E0;
  --orange-dark: #C05800;
  --brown-footer: #8B4500;
  --gray-light: #F7F7F7;
  --gray-border: #E8E8E8;
  --gray-text: #666;
  --white: #fff;
  --rank-gold: #E8A000;
  --rank-silver: #9E9E9E;
  --rank-bronze: #A0602A;
  --badge-orange: #FF8C00;
  --bg-cream: #FFF8F0;
}

/* ===== HEADER ===== */
.site-header {
  background: #fff !important;
  border-bottom: 1px solid var(--gray-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-bar .site-header {
  top: 32px;
}
@media screen and (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}
body:not(.admin-bar) .site-header {
  top: 0;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 80px;
  gap: 0;
}
.site-logo {
  flex-shrink: 0;
  margin-right: 40px;
}
.site-logo img {
  height: 60px;
  width: auto;
}
.header-nav {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: center;
}
.header-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  white-space: nowrap;
  padding: 8px 12px;
}
.header-nav a:hover { color: var(--orange); }
.header-nav a.active { color: var(--orange); }
.header-nav a.active .nav-icon { color: var(--orange); }
.nav-icon {
  font-size: 20px;
  line-height: 1;
  color: #888;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  margin-left: 40px;
}
.btn-fav,
.btn-search {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--gray-text);
  cursor: pointer;
}
.btn-fav svg { color: #e91e63; }
.btn-search svg { color: #888; }

/* ===== HERO ===== */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: center;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a0a00 0%, #3d1a00 40%, #5c2d00 70%, #2d1000 100%);
  z-index: 0;
}
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 300px 200px at 70% 60%, rgba(255,140,0,0.25) 0%, transparent 70%),
    radial-gradient(ellipse 200px 300px at 85% 40%, rgba(180,60,0,0.3) 0%, transparent 60%);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
  width: 100%;
}
.hero-title {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 12px;
}
.hero-title span { color: var(--orange-light); }
.hero-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.8);
  line-height: 1.8;
}

/* ===== SEARCH CARDS ===== */
.search-section {
  background: #FFF8F0;
  padding: 28px 24px;
  border-bottom: 1px solid var(--gray-border);
}
.search-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.search-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.search-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1.5px solid var(--gray-border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
}
.search-card:hover {
  border-color: var(--orange);
  box-shadow: 0 2px 12px rgba(224,112,0,0.12);
}
.search-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}
.icon-area    { background: #FFF3E0; color: var(--orange); }
.icon-machine { background: #F3EEFF; color: #7C4DFF; }
.icon-maker   { background: #E8F5E9; color: #2E7D32; }
.search-card-text strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #222;
  margin-bottom: 2px;
}
.search-card-text span {
  font-size: 12px;
  color: var(--gray-text);
}

/* ===== SECTION COMMON ===== */
.section { padding: 40px 24px; }
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #222;
}
.section-more {
  font-size: 13px;
  color: var(--orange);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.section-more::after { content: " ›"; }

/* ===== MACHINES ===== */
.machines-section { background: #fff; border-bottom: 1px solid var(--gray-border); }
.machines-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
}
.machine-card {
  cursor: pointer;
  text-align: center;
}
.machine-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
  position: relative;
}
.machine-thumb::before { content: ""; position: absolute; inset: 0; }
.machine-thumb.m1 { background: linear-gradient(135deg, #1a0030 0%, #4a006e 50%, #8B0080 100%); }
.machine-thumb.m2 { background: linear-gradient(135deg, #001a3a 0%, #003080 50%, #0050c0 100%); }
.machine-thumb.m3 { background: linear-gradient(135deg, #003020 0%, #006040 50%, #00a060 100%); }
.machine-thumb.m4 { background: linear-gradient(135deg, #2a1000 0%, #6e2a00 50%, #b04000 100%); }
.machine-thumb.m5 { background: linear-gradient(135deg, #001030 0%, #002060 50%, #004090 100%); }
.machine-thumb.m6 { background: linear-gradient(135deg, #200020 0%, #500050 50%, #800080 100%); }
.machine-thumb.m7 { background: linear-gradient(135deg, #100020 0%, #300060 50%, #6000a0 100%); }
.machine-thumb.m8 { background: linear-gradient(135deg, #003010 0%, #006020 50%, #009040 100%); }
.machine-thumb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: rgba(255,255,255,0.6);
}
.machine-name {
  font-size: 12px;
  color: #333;
  line-height: 1.3;
  font-weight: 500;
}

/* ===== MAIN CONTENT GRID ===== */
.main-content-section {
  background: var(--gray-light);
  border-bottom: 1px solid var(--gray-border);
}
.main-content-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

/* ===== RANKING ===== */
.ranking-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
  #FFF8F0;
}
.ranking-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--gray-border);
  position: relative;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.ranking-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.ranking-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: #e0d0c0;
  position: relative;
  overflow: hidden;
}
.ranking-thumb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.rt1 { background: linear-gradient(135deg, #c0a080, #e0c090); }
.rt2 { background: linear-gradient(135deg, #e0e0e0, #f0f0f0); }
.rt3 { background: linear-gradient(135deg, #c0b090, #d8c8a8); }
.rank-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.rank-1 { background: var(--rank-gold); }
.rank-2 { background: var(--rank-silver); }
.rank-3 { background: var(--rank-bronze); }
.rank-crown {
  position: absolute;
  top: -2px;
  left: 4px;
  font-size: 10px;
}
.ranking-info { padding: 10px 12px; }
.ranking-name {
  font-size: 14px;
  font-weight: 700;
  color: #222;
  margin-bottom: 3px;
  line-height: 1.3;
}
.ranking-location {
  font-size: 12px;
  color: var(--gray-text);
  margin-bottom: 6px;
}
.badge-medal {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #FFF3E0;
  color: var(--orange-dark);
  border: 1px solid #FFD0A0;
  font-weight: 500;
}
.ranking-list-small {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ranking-card-small {
  background: #fff;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}
.rank-num-small {
  font-size: 22px;
  font-weight: 700;
  color: #bbb;
  line-height: 1;
}
.ranking-card-small .ranking-name { font-size: 13px; }
.ranking-card-small .ranking-location { font-size: 11px; margin-bottom: 4px; }

/* ===== NEW SHOPS ===== */
.new-shops-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.new-shop-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-border);
  cursor: pointer;
  align-items: center;
}
.new-shop-item:last-child { border-bottom: none; }
.new-shop-thumb {
  width: 64px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.new-shop-thumb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.ns1 { background: linear-gradient(135deg, #e0d0b0, #f0e8c0); }
.ns2 { background: linear-gradient(135deg, #c0d0e0, #d0e0f0); }
.ns3 { background: linear-gradient(135deg, #d0e0c0, #e0f0d0); }
.new-shop-info { flex: 1; }
.new-shop-name {
  font-size: 14px;
  font-weight: 700;
  color: #222;
  margin-bottom: 2px;
}
.new-shop-location {
  font-size: 12px;
  color: var(--gray-text);
  margin-bottom: 3px;
}
.new-shop-date {
  font-size: 11px;
  color: #aaa;
}

/* ===== ARTICLES ===== */
.articles-section { background: #FFF8F0; }
.articles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.article-card {
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.article-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.article-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
}
.article-thumb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}
.at1 { background: linear-gradient(135deg, #ffd080, #ff9020); }
.at2 { background: linear-gradient(135deg, #ffc040, #e07000); }
.at3 { background: linear-gradient(135deg, #d0a060, #a06020); }
.at4 { background: linear-gradient(135deg, #ffa080, #ff6040); }
.article-body { padding: 10px 0 0; }
.article-title {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  line-height: 1.4;
}

/* ===== MASCOT ===== */
.mascot-area {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  margin-top: -40px;
  pointer-events: none;
  position: relative;
  z-index: 1;
}
.mascot-bubble {
  font-size: 60px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--brown-footer);
  color: rgba(255,255,255,0.9);
  padding: 28px 24px 16px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.footer-nav {
  display: flex;
  gap: 28px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.footer-nav a {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}
.footer-nav a:hover { color: #fff; }
.footer-copy {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}

/* ===== MOBILE NAV ===== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #FFF8F0;
  border-top: 1px solid var(--gray-border);
  z-index: 200;
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
}
.mobile-nav-inner {
  display: flex;
  justify-content: space-around;
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--gray-text);
  padding: 4px 8px;
  cursor: pointer;
}
.mobile-nav-item.active { color: var(--orange); }
.mobile-nav-icon { font-size: 20px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .machines-grid       { grid-template-columns: repeat(4, 1fr); }
  .main-content-grid   { grid-template-columns: 1fr; }
  .articles-grid       { grid-template-columns: repeat(2, 1fr); }
  .ranking-list        { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .site-logo img       { height: 42px; }
  .header-nav          { display: none; }
  .search-grid         { grid-template-columns: 1fr; }
  .machines-grid       { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .ranking-list        { grid-template-columns: 1fr; }
  .ranking-list-small  { grid-template-columns: 1fr; }
  .articles-grid       { grid-template-columns: 1fr 1fr; }
  .hero-title          { font-size: 26px; }
  .mobile-nav          { display: block; }
  body                 { padding-bottom: 70px; }
  .mascot-area         { display: none; }
}

/* ===== AREA PAGE ===== */
.breadcrumb {
  max-width: 1200px; margin: 0 auto; padding: 14px 24px;
  font-size: 13px; color: var(--gray-text);
  display: flex; gap: 8px; align-items: center;
}
.breadcrumb a { color: var(--gray-text); }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb-sep { color: #bbb; }

.main {
  max-width: 1200px; margin: 0 auto; padding: 0 24px 60px;
  position: relative;
}
.page-header {
  background: #fff; border: 1px solid var(--gray-border);
  border-radius: 12px; padding: 24px 28px; margin-bottom: 32px;
  display: flex; align-items: center; gap: 16px;
  position: relative; overflow: hidden;
}
.page-header-icon { font-size: 32px; }
.page-header-text h1 { font-size: 22px; font-weight: 700; color: #222; margin-bottom: 4px; }
.page-header-text p { font-size: 13px; color: var(--gray-text); }
.page-header-mascot {
  position: absolute; right: 20px; top: -10px;
  font-size: 80px; line-height: 1; opacity: 0.9;
}
.two-col { display: grid; grid-template-columns: 1fr 420px; gap: 28px; align-items: start; }
.section-title { font-size: 16px; font-weight: 700; color: #222; margin-bottom: 16px; }

.region-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 32px;
}
.region-card {
  background: #fff; border: 1.5px solid var(--gray-border);
  border-radius: 10px; padding: 14px 16px;
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
  display: flex; align-items: center; justify-content: space-between;
}
.region-card:hover { border-color: var(--orange); box-shadow: 0 2px 10px rgba(224,112,0,0.12); }
.region-card-left { display: flex; align-items: center; gap: 10px; }
.region-icon { font-size: 22px; }
.region-name { font-size: 15px; font-weight: 700; color: #222; }
.region-arrow { font-size: 12px; color: #bbb; }

.pref-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.pref-btn {
  background: #fff; border: 1px solid var(--gray-border);
  border-radius: 6px; padding: 8px 4px;
  font-size: 13px; font-weight: 500; color: #333;
  text-align: center; cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.pref-btn:hover { background: var(--orange-bg); border-color: var(--orange); color: var(--orange-dark); }

.right-col { display: flex; flex-direction: column; gap: 20px; }
.map-box { background: #fff; border: 1px solid var(--gray-border); border-radius: 12px; padding: 16px; }
.map-box-title { font-size: 15px; font-weight: 700; color: #222; margin-bottom: 12px; }
.map-wrap { position: relative; width: 100%; }
.japan-map { width: 100%; height: auto; }

.r-hokkaido { fill: #7EC8A0; }
.r-tohoku   { fill: #A8D8A8; }
.r-kanto    { fill: #F4B860; }
.r-chubu    { fill: #F4D060; }
.r-kinki    { fill: #E8A0C0; }
.r-chugoku  { fill: #A0C0E8; }
.r-shikoku  { fill: #C8B0E0; }
.r-kyushu   { fill: #F4A060; }
.r-okinawa  { fill: #80D0D0; }
.map-region { cursor: pointer; stroke: #fff; stroke-width: 1; transition: opacity 0.15s; }
.map-region:hover { opacity: 0.75; }

.map-label {
  position: absolute; background: #fff; border: 1.5px solid var(--orange);
  border-radius: 20px; padding: 3px 10px;
  font-size: 11px; font-weight: 700; color: var(--orange-dark);
  white-space: nowrap; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1); transition: background 0.12s;
}
.map-label:hover { background: var(--orange-bg); }
.map-label::after { content: " ›"; }

.keyword-box { background: #fff; border: 1px solid var(--gray-border); border-radius: 12px; padding: 20px; }
.keyword-box-title { font-size: 15px; font-weight: 700; color: #222; margin-bottom: 12px; }
.search-row { display: flex; gap: 8px; margin-bottom: 12px; }
.search-input {
  flex: 1; padding: 11px 16px; border: 1.5px solid var(--gray-border);
  border-radius: 8px; font-size: 14px; color: #333;
  outline: none; transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--orange); }
.search-btn {
  background: var(--orange); color: #fff; border: none;
  border-radius: 8px; padding: 0 20px; font-size: 14px; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: background 0.15s;
}
.search-btn:hover { background: var(--orange-dark); }
.keyword-examples { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.keyword-label { font-size: 12px; color: var(--gray-text); }
.keyword-tag {
  background: var(--orange-bg); border: 1px solid #FFD0A0;
  border-radius: 20px; padding: 4px 12px;
  font-size: 12px; color: var(--orange-dark);
  cursor: pointer; transition: background 0.12s;
}
.keyword-tag:hover { background: #FFE0B0; }

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .region-grid { grid-template-columns: repeat(2, 1fr); }
  .pref-grid { grid-template-columns: repeat(5, 1fr); }
  .page-header-mascot { display: none; }
}
@media (max-width: 600px) {
  .region-grid { grid-template-columns: repeat(2, 1fr); }
  .pref-grid { grid-template-columns: repeat(4, 1fr); }
}