/* ===== jptrip.syproject.co.kr — 여행일본어 ===== */
:root {
  --bg: #0F2027;
  --bg-soft: #16303A;
  --paper: #F3ECDA;
  --paper-soft: #EAE0C4;
  --ink: #1C2B2E;
  --ink-soft: #4A5C5E;
  --vermilion: #C43D2C;
  --vermilion-dark: #9E2E20;
  --gold: #C9A15A;
  --line: rgba(243, 236, 218, 0.14);
  --line-soft: rgba(28, 43, 46, 0.12);
  --shadow: 0 12px 30px rgba(6, 16, 20, 0.35);
  --radius: 14px;
  --font-display: "Shippori Mincho", serif;
  --font-body: "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--font-body);
  line-height: 1.6;
  background-image:
    radial-gradient(circle at 12px 12px, rgba(243,236,218,0.05) 2px, transparent 2.5px);
  background-size: 26px 26px;
}

body.light {
  --bg: #F3ECDA;
  --bg-soft: #EAE0C4;
  --paper: #FFFDF7;
  --ink: #1C2B2E;
  color: var(--ink);
}
body.light .site-header,
body.light .cat-hero,
body.light .hero { color: var(--ink); }
body.light .phrase-card { color: var(--ink); }

a { color: inherit; text-decoration: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(15, 32, 39, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
body.light .site-header { background: rgba(243, 236, 218, 0.92); }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--vermilion);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  transform: rotate(-6deg);
  box-shadow: 0 3px 8px rgba(196,61,44,0.5);
}
.brand-text { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: 0.5px; }
.brand-text em { color: var(--gold); font-style: normal; }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--line);
  color: inherit;
  border-radius: 999px;
  width: 38px; height: 38px;
  cursor: pointer;
  font-size: 16px;
}

/* ---------- hero (index) ---------- */
.hero {
  position: relative;
  padding: 56px 20px 44px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 0 100%, transparent 22px, var(--bg) 22.5px),
    radial-gradient(circle at 44px 100%, transparent 22px, var(--bg) 22.5px);
  background-size: 44px 44px;
  background-repeat: repeat-x;
  background-position: bottom;
  opacity: 0.55;
  pointer-events: none;
}
.hero-kana {
  font-family: var(--font-display);
  color: var(--gold);
  letter-spacing: 6px;
  margin: 0 0 10px;
  font-size: 14px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.35;
}
.hero-sub {
  max-width: 520px;
  margin: 0 auto 26px;
  color: var(--paper-soft);
  font-size: 15px;
}
body.light .hero-sub { color: var(--ink-soft); }

.search-wrap { max-width: 480px; margin: 0 auto; position: relative; }
.hero-search-wrap { margin-bottom: 8px; }
.search-input {
  width: 100%;
  padding: 15px 18px;
  border-radius: 999px;
  border: 2px solid var(--gold);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  font-family: var(--font-body);
  outline: none;
}
.search-input::placeholder { color: #8b8266; }

.search-results {
  max-width: 640px;
  margin: 18px auto 0;
  text-align: left;
  display: grid;
  gap: 10px;
}
.search-results .result-hit {
  background: var(--paper);
  color: var(--ink);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: block;
}
.search-results .result-cat {
  font-size: 12px;
  color: var(--vermilion-dark);
  font-weight: 700;
  margin-bottom: 4px;
}
.search-results .result-kr { font-weight: 700; margin-bottom: 4px; }
.search-results .result-jp { font-family: var(--font-display); font-size: 15px; margin-bottom: 2px; }
.search-results .result-pron { font-size: 13px; color: var(--ink-soft); }
.search-empty { text-align: center; color: var(--paper-soft); padding: 14px; }

/* ---------- category grid ---------- */
.cat-grid-section { padding: 10px 20px 50px; max-width: 980px; margin: 0 auto; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}
.section-head h2 { font-family: var(--font-display); font-size: 22px; margin: 0; }
.fav-toggle {
  background: transparent; border: 1px solid var(--gold); color: var(--gold);
  border-radius: 999px; padding: 8px 16px; font-size: 13px; cursor: pointer;
  font-family: var(--font-body);
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.cat-card {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cat-card:hover, .cat-card:focus-visible { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(6,16,20,0.4); }
.cat-card .hanko {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--vermilion);
  font-size: 20px;
  margin-bottom: 8px;
  transform: rotate(-4deg);
}
.cat-card-name { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.cat-card-kana { font-size: 12px; color: var(--vermilion-dark); }
.cat-card-desc { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

/* ---------- favorites ---------- */
.fav-section { max-width: 980px; margin: 0 auto; padding: 0 20px 60px; }
.fav-section h2 { font-family: var(--font-display); font-size: 22px; }
.fav-empty { color: var(--paper-soft); }

/* ---------- category page hero ---------- */
.cat-hero { max-width: 900px; margin: 0 auto; padding: 30px 20px 10px; }
.back-link { font-size: 13px; color: var(--gold); display: inline-block; margin-bottom: 16px; }
.cat-hero-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.cat-hero .hanko {
  width: 58px; height: 58px; min-width: 58px;
  border-radius: 50%; background: var(--vermilion);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; transform: rotate(-5deg);
  box-shadow: 0 6px 16px rgba(196,61,44,0.4);
}
.cat-kana { color: var(--gold); font-size: 12px; margin: 0 0 4px; letter-spacing: 2px; }
.cat-hero h1 { font-family: var(--font-display); font-size: clamp(22px, 4vw, 30px); margin: 0 0 4px; }
.cat-desc { font-size: 13px; color: var(--paper-soft); margin: 0; }
body.light .cat-desc { color: var(--ink-soft); }

.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 6px; }
.subnav-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
}
.subnav-chip:hover { border-color: var(--gold); color: var(--gold); }

.no-result { text-align: center; padding: 30px; color: var(--paper-soft); }

/* ---------- sentence sections ---------- */
.sub-section { max-width: 900px; margin: 0 auto; padding: 30px 20px 6px; }
.sub-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 19px;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold);
}
.sub-num { font-size: 18px; }

.phrase-list {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.phrase-card {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border-radius: 12px;
  padding: 16px 44px 16px 16px;
  box-shadow: var(--shadow);
}
.phrase-kr { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.phrase-jp { font-family: var(--font-display); font-size: 17px; margin-bottom: 3px; }
.phrase-hira { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.phrase-pron { font-size: 13px; color: var(--vermilion-dark); font-weight: 600; }
.pron-tag {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  background: var(--vermilion); color: #fff;
  border-radius: 4px; padding: 1px 5px;
  margin-right: 6px;
  vertical-align: middle;
}
.card-actions {
  position: absolute; top: 10px; right: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.icon-btn {
  background: transparent; border: none; cursor: pointer;
  font-size: 16px; color: var(--ink-soft); padding: 4px;
  line-height: 1;
}
.fav-btn.active { color: var(--vermilion); }
.icon-btn:hover { color: var(--vermilion); }

.phrase-card.hidden-by-search { display: none; }
.phrase-card.has-note { grid-column: 1 / -1; }

.phrase-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--gold);
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  align-items: baseline;
}
.note-title {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  color: var(--vermilion-dark);
  margin-bottom: 2px;
}
.note-item {
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.note-item b { color: var(--ink); font-weight: 700; margin-right: 2px; }
.note-pron { color: var(--vermilion-dark); font-weight: 600; }

/* ---------- pager ---------- */
.cat-pager {
  max-width: 900px; margin: 20px auto 60px; padding: 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.pager-home { color: var(--gold); }

/* ---------- zoom overlay (show to staff) ---------- */
.zoom-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 32, 39, 0.96);
  display: flex; align-items: center; justify-content: center;
  padding: 30px;
}
.zoom-overlay[hidden] { display: none; }
.zoom-close {
  position: absolute; top: 20px; right: 20px;
  background: transparent; border: 1px solid var(--paper);
  color: var(--paper); width: 40px; height: 40px; border-radius: 50%;
  font-size: 16px; cursor: pointer;
}
.zoom-content { text-align: center; color: var(--paper); max-width: 90%; }
.zoom-kr { font-size: 16px; color: var(--gold); margin-bottom: 18px; }
.zoom-jp { font-family: var(--font-display); font-size: clamp(30px, 8vw, 56px); margin: 0 0 14px; line-height: 1.4; }
.zoom-hira { font-size: 18px; color: var(--paper-soft); margin-bottom: 10px; }
.zoom-pron { font-size: 16px; color: var(--vermilion); font-weight: 700; }

/* ---------- footer ---------- */
.site-footer {
  text-align: center; padding: 30px 20px 50px;
  font-size: 12px; color: var(--paper-soft);
}
body.light .site-footer { color: var(--ink-soft); }

/* ---------- responsive ---------- */
@media (max-width: 480px) {
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .phrase-list { grid-template-columns: 1fr; }
  .cat-hero-row { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
