/* ============================================
   Haru No Tabi Bookshelf - Global Stylesheet
   ============================================ */

/* ---- CSS Variables ---- */
:root {
  --bg-primary: #F5F2EB;
  --bg-secondary: #E8DFD3;
  --text-primary: #2E2E2E;
  --text-secondary: #5A5A5A;
  --accent: #6B4F3C;
  --accent-light: #8B7355;
  --link: #2A5C4A;
  --link-hover: #1D3D31;
  --error: #B85C5C;
  --border: #D4CBC0;
  --white: #FFFFFF;
  --shadow: rgba(46, 46, 46, 0.08);

  --font-serif-ja: "Noto Serif JP", serif;
  --font-serif-en: "Merriweather", serif;
  --font-sans-ja: "Noto Sans JP", sans-serif;
  --font-sans-en: "Source Sans Pro", sans-serif;

  --container-max: 1000px;
  --section-pad: 4rem;
  --content-pad: 1.5rem;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans-ja);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Skip to Content ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--link);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  z-index: 10000;
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* ---- Language Toggle System ---- */
/* Default: Japanese visible, English hidden */
[lang="ja"] {
  display: block;
}

[lang="en"] {
  display: none;
}

/* When English mode is active */
html.lang-en [lang="ja"] {
  display: none;
}

html.lang-en [lang="en"] {
  display: inline;
}

html.lang-en [lang="en"].block-en,
html.lang-en [lang="en"].section-en {
  display: block;
}

/* Inline language spans */
span[lang="ja"],
span[lang="en"] {
  display: inline;
}

html.lang-en span[lang="ja"] {
  display: none;
}

html.lang-en span[lang="en"] {
  display: inline;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-serif-ja);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---- Container ---- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--content-pad);
}

.container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--content-pad);
}

/* ---- Header & Navigation ---- */
.site-header {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.75rem var(--content-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  font-family: var(--font-serif-ja);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1.3;
}

.site-brand small {
  display: block;
  font-family: var(--font-serif-en);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
}

.lang-toggle button {
  background: none;
  border: 1px solid transparent;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-radius: 3px;
  transition: all 0.2s ease;
  font-family: var(--font-sans-ja);
}

.lang-toggle button:hover {
  color: var(--text-primary);
}

.lang-toggle button.active {
  border-color: var(--link);
  color: var(--link);
  font-weight: 600;
}

/* Navigation */
.main-nav {
  display: flex;
  gap: 0.1rem;
}

.main-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  border-radius: 3px;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.main-nav a:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

/* Mobile menu button */
.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  border-radius: 3px;
  font-size: 1rem;
}

/* ---- Hero Section ---- */
.hero {
  position: relative;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(46,46,46,0.75) 0%, rgba(46,46,46,0) 100%);
  padding: 4rem var(--content-pad) 2rem;
}

.hero-text {
  max-width: var(--container-max);
  margin: 0 auto;
}

.hero-text h1 {
  font-family: var(--font-serif-ja);
  font-size: 1.8rem;
  color: var(--white);
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

html.lang-en .hero-text h1 {
  font-family: var(--font-serif-en);
}

.hero-text p {
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
  margin-bottom: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Hero without image (smaller) */
.hero-simple {
  background-color: var(--bg-secondary);
  padding: 3rem var(--content-pad);
  border-bottom: 1px solid var(--border);
}

.hero-simple h1 {
  font-size: 1.7rem;
  margin-bottom: 0.5rem;
}

.hero-simple p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ---- Sections ---- */
.section {
  padding: var(--section-pad) 0;
}

.section-alt {
  background-color: var(--bg-secondary);
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.section-intro {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 700px;
}

/* ---- Info Bands ---- */
.info-band {
  background-color: var(--bg-secondary);
  padding: 1.25rem var(--content-pad);
  border-left: 4px solid var(--link);
  margin-bottom: 1rem;
}

.info-band p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.info-band p:last-child {
  margin-bottom: 0;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  background-color: var(--link);
  color: var(--white);
  text-decoration: none;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  font-family: var(--font-sans-ja);
}

.btn:hover {
  background-color: var(--link-hover);
  color: var(--white);
}

.btn:active {
  transform: translateY(1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--link);
  border: 1.5px solid var(--link);
}

.btn-secondary:hover {
  background-color: var(--link);
  color: var(--white);
}

.btn-small {
  padding: 0.5rem 1.2rem;
  font-size: 0.9rem;
}

/* ---- Tables ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.data-table thead {
  background-color: var(--bg-secondary);
}

.data-table th,
.data-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-family: var(--font-serif-ja);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0.02em;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background-color: rgba(232, 223, 211, 0.4);
}

.data-table a {
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}

.data-table a:hover {
  text-decoration: underline;
}

/* Expandable row details */
.row-details {
  display: none;
  background-color: var(--bg-secondary);
}

.row-details.active {
  display: table-row;
}

.row-details td {
  padding: 1.25rem 1rem;
}

.spot-detail-content {
  padding: 0.5rem 0;
}

.spot-detail-content h4 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.spot-detail-content p {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.row-expandable {
  cursor: pointer;
}

.row-expandable:hover {
  background-color: rgba(232, 223, 211, 0.6);
}

.expand-icon {
  display: inline-block;
  width: 1.2em;
  text-align: center;
  transition: transform 0.2s ease;
  color: var(--accent);
}

.row-expandable[aria-expanded="true"] .expand-icon {
  transform: rotate(90deg);
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.95rem;
}

.form-group .required::after {
  content: " *";
  color: var(--error);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: var(--white);
  color: var(--text-primary);
  font-family: var(--font-sans-ja);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--link);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232E2E2E' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.field-error {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.3rem;
  display: none;
}

.field-error.visible {
  display: block;
}

input.error,
select.error,
textarea.error {
  border-color: var(--error);
}

/* ---- Pricing Bands ---- */
.pricing-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem var(--content-pad);
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 1rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.pricing-band-alt {
  background-color: var(--bg-secondary);
}

.pricing-info {
  flex: 1;
  min-width: 200px;
}

.pricing-info h3 {
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
}

.pricing-info p {
  margin-bottom: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pricing-price {
  font-family: var(--font-serif-en);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

/* ---- FAQ ---- */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}

.faq-item:first-child {
  border-top: 1px solid var(--border);
}

.faq-question {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.faq-toggle {
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.faq-answer {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding-right: 2rem;
}

.faq-answer.collapsed {
  display: none;
}

/* ---- Steps / Timeline ---- */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.step {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.step:first-child {
  padding-top: 0;
}

.step:last-child {
  border-bottom: none;
}

.step-number {
  width: 48px;
  height: 48px;
  background-color: var(--link);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif-en);
  font-size: 1.3rem;
  font-weight: 600;
  flex-shrink: 0;
}

.step-content h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.step-content p {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* ---- Cards (simple) ---- */
.card {
  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card h3 {
  margin-bottom: 0.75rem;
}

.card p:last-child {
  margin-bottom: 0;
}

/* ---- Two-column layout ---- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.two-col .text-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---- Contact Blocks ---- */
.contact-block {
  margin-bottom: 2rem;
}

.contact-block h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.contact-block .label {
  font-weight: 600;
  color: var(--text-secondary);
}

.contact-block p {
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

/* ---- Footer ---- */
.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0.02em;
}

.footer-section p,
.footer-section a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  margin-bottom: 0.4rem;
}

.footer-section a:hover {
  color: var(--link);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.footer-lang-toggle {
  font-size: 0.8rem;
}

/* ---- Cookie Consent ---- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--white);
  border-top: 2px solid var(--link);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  z-index: 9999;
  padding: 1.5rem;
  display: none;
}

.cookie-banner.visible {
  display: block;
}

.cookie-banner-inner {
  max-width: var(--container-max);
  margin: 0 auto;
}

.cookie-banner p {
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.cookie-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.cookie-toggle-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cookie-toggle-item label {
  font-size: 0.9rem;
  cursor: pointer;
}

.cookie-toggle-item input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: var(--link);
}

.cookie-toggle-item .toggle-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.cookie-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--link);
  background: none;
  color: var(--link);
  cursor: pointer;
  border-radius: 3px;
  font-size: 0.85rem;
  font-family: var(--font-sans-ja);
  transition: all 0.2s ease;
}

.cookie-btn:hover {
  background-color: var(--link);
  color: var(--white);
}

.cookie-btn-primary {
  background-color: var(--link);
  color: var(--white);
}

.cookie-btn-primary:hover {
  background-color: var(--link-hover);
}

/* ---- Utility Classes ---- */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.img-rounded { border-radius: 4px; }

.note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 1rem;
  background-color: var(--bg-secondary);
  border-radius: 4px;
  border-left: 3px solid var(--accent);
}

.note p:last-child { margin-bottom: 0; }

/* ---- 404 Page ---- */
.page-404 {
  text-align: center;
  padding: 5rem 1rem;
}

.page-404 h1 {
  font-size: 4rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.page-404 h2 {
  margin-bottom: 1.5rem;
}

/* ---- Search Box (client-side) ---- */
.search-box {
  max-width: 400px;
  margin: 2rem auto;
  display: flex;
  gap: 0.5rem;
}

.search-box input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  font-family: var(--font-sans-ja);
}

.search-box input:focus {
  outline: none;
  border-color: var(--link);
}

/* ---- Star Rating ---- */
.stars {
  color: var(--accent);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* ---- Scroll Fade-in ---- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Responsive: Tablet (768px) ---- */
@media (max-width: 768px) {
  :root {
    --section-pad: 2.5rem;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.35rem; }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.5rem;
    gap: 0;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 0.75rem 1rem;
    border-radius: 3px;
  }

  .menu-btn {
    display: block;
  }

  .hero-image {
    height: 300px;
  }

  .hero-text h1 {
    font-size: 1.4rem;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pricing-band {
    flex-direction: column;
    align-items: flex-start;
  }

  .data-table {
    font-size: 0.85rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.65rem 0.5rem;
  }
}

/* ---- Responsive: Mobile (480px) ---- */
@media (max-width: 480px) {
  :root {
    --content-pad: 1rem;
    --section-pad: 2rem;
  }

  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.15rem; }

  .hero-image {
    height: 240px;
  }

  .hero-text h1 {
    font-size: 1.2rem;
  }

  .site-brand {
    font-size: 0.95rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .step {
    flex-direction: column;
    gap: 0.75rem;
  }

  .step-number {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .cookie-toggles {
    gap: 0.5rem;
  }

  .search-box {
    flex-direction: column;
  }

  .page-404 h1 {
    font-size: 3rem;
  }
}

/* ---- Print Styles ---- */
@media print {
  .site-header,
  .site-footer,
  .cookie-banner,
  .lang-toggle,
  .menu-btn {
    display: none !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.5;
  }

  a {
    text-decoration: none;
    color: var(--text-primary);
  }

  .section {
    padding: 1rem 0;
    page-break-inside: avoid;
  }
}

/* ---- High Contrast Mode Support ---- */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #000000;
    --text-secondary: #333333;
    --border: #666666;
    --link: #004D33;
  }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }
}
