/* tabiadvisory.com - warm travel advisor brand */

:root {
  --sunset-50:  #FFF8F0;
  --sunset-100: #FBEEDC;
  --sunset-200: #F5D5B3;
  --sunset-300: #EBB988;
  --sunset-400: #E89B66;
  --sunset-500: #E97451;
  --sunset-600: #C45A3A;
  --sunset-700: #8B3A22;

  --warm-text:   #2A1F1A;
  --warm-muted:  #6B5848;
  --warm-border: #E5D5C5;
  --warm-bg:     #FFFBF5;

  --accent-teal: #2A8E84;
  --accent-leaf: #4A7C59;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans JP', 'Helvetica Neue', Arial, sans-serif;
  color: var(--warm-text);
  background-color: var(--warm-bg);
  line-height: 1.75;
}
h1, h2, h3, h4 {
  font-family: 'Noto Serif JP', 'Times New Roman', serif;
  letter-spacing: 0.02em;
  color: var(--warm-text);
}
a { color: var(--sunset-600); }
a:hover { color: var(--sunset-700); }

.bg-sunset    { background-color: var(--sunset-500); }
.bg-sunset-soft { background-color: var(--sunset-100); }
.bg-cream     { background-color: var(--sunset-50); }
.text-sunset  { color: var(--sunset-500); }
.text-muted   { color: var(--warm-muted); }
.border-warm  { border-color: var(--warm-border); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2rem;
  background-color: var(--sunset-500);
  color: white;
  font-weight: 600;
  border-radius: 9999px;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
  box-shadow: 0 4px 12px rgba(233, 116, 81, 0.25);
}
.btn-primary:hover {
  background-color: var(--sunset-600);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(233, 116, 81, 0.35);
  color: white;
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2rem;
  background-color: transparent;
  color: var(--sunset-600);
  font-weight: 600;
  border: 2px solid var(--sunset-500);
  border-radius: 9999px;
  transition: all 0.15s;
}
.btn-outline:hover {
  background-color: var(--sunset-500);
  color: white;
}

.section {
  padding-top: 4rem;
  padding-bottom: 4rem;
}
.container-narrow { max-width: 960px; margin: 0 auto; padding: 0 1.25rem; }
.container-wide   { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

.hero {
  background: linear-gradient(135deg, #FFF8F0 0%, #FBEEDC 50%, #F5D5B3 100%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(233, 116, 81, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-with-image {
  position: relative;
  min-height: 560px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-with-image::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(255,251,245,0.96) 0%, rgba(251,238,220,0.85) 45%, rgba(245,213,179,0.45) 100%);
  z-index: 0;
}
.hero-with-image > * { position: relative; z-index: 1; }
.hero-plane {
  position: absolute; z-index: 1;
  opacity: 0.5;
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(-12deg); }
  50% { transform: translate(15px, -10px) rotate(-8deg); }
}

.country-card-img {
  background: white;
  border: 1px solid var(--warm-border);
  border-radius: 1rem;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.country-card-img:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(139, 58, 34, 0.12);
  color: inherit;
}
.country-card-img .img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-color: var(--sunset-100);
}
.country-card-img .img-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(42,31,26,0.55) 0%, rgba(42,31,26,0.15) 50%, transparent 100%);
}
.country-card-img .flag {
  position: absolute;
  top: 0.6rem; left: 0.6rem;
  width: 50px;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  z-index: 2;
  display: block;
}
.country-card-img .name {
  position: absolute;
  bottom: 0.5rem; left: 0.8rem;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  z-index: 2;
}
.country-card-img .body {
  padding: 0.85rem 1rem 1rem;
}
.country-card-img .body p {
  color: var(--warm-muted);
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 0;
}

.country-detail-hero {
  position: relative;
  min-height: 380px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: white;
}
.country-detail-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(42,31,26,0.85) 0%, rgba(42,31,26,0.35) 60%, rgba(42,31,26,0.15) 100%);
}
.country-detail-hero > * { position: relative; z-index: 1; }
.country-detail-hero h1 { color: white; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.country-detail-hero p { color: rgba(255,255,255,0.92); text-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.country-detail-hero .flag-large {
  width: 92px;
  height: auto;
  margin-bottom: 1rem;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
  display: block;
}

.card {
  background: white;
  border: 1px solid var(--warm-border);
  border-radius: 1rem;
  padding: 1.75rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(139, 58, 34, 0.08);
}

.site-header {
  background: rgba(255, 251, 245, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--warm-border);
  position: sticky; top: 0; z-index: 50;
}
.brand-logo {
  display: inline-flex;
  align-items: center;
}
.brand-logo img {
  height: 60px;
  width: auto;
  display: block;
}
.brand-logo-footer img {
  height: 50px;
  width: auto;
  display: block;
}
.nav-link {
  font-size: 0.92rem;
  color: var(--warm-text);
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: 0.4rem;
  transition: all 0.15s;
}
.nav-link:hover {
  background-color: var(--sunset-100);
  color: var(--sunset-700);
}

.site-footer {
  background-color: var(--warm-text);
  color: var(--sunset-50);
  padding: 3rem 0 2rem;
}
.site-footer a { color: var(--sunset-200); }
.site-footer a:hover { color: white; }

table.simple-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
table.simple-table th, table.simple-table td {
  border: 1px solid var(--warm-border);
  padding: 0.7rem 1rem;
  text-align: left;
}
table.simple-table th {
  background: var(--sunset-100);
  font-weight: 600;
}

.lang-switch {
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--warm-border);
  border-radius: 9999px;
  color: var(--warm-muted);
}
.lang-switch.active {
  background: var(--sunset-500);
  color: white;
  border-color: var(--sunset-500);
}

/* Hamburger button + mobile drawer (hidden on desktop) */
.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--warm-text);
  padding: 0.4rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 0.4rem;
}
.hamburger-btn:hover { background: var(--sunset-100); }
.mobile-drawer {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(42, 31, 26, 0.5);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.drawer-panel {
  position: absolute;
  top: 0; right: 0;
  width: 78%;
  max-width: 320px;
  height: 100vh;
  background: white;
  padding: 4rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -8px 0 24px rgba(0,0,0,0.15);
}
.drawer-close {
  position: absolute;
  top: 0.9rem; right: 1.1rem;
  background: transparent;
  border: none;
  padding: 0.4rem;
  cursor: pointer;
  color: var(--warm-text);
}
.drawer-link {
  display: block;
  padding: 0.85rem 0.5rem;
  font-size: 1rem;
  color: var(--warm-text);
  border-bottom: 1px solid var(--warm-border);
  text-decoration: none;
}
.drawer-link:hover { color: var(--sunset-600); }
.drawer-cta {
  background: var(--sunset-500);
  color: white !important;
  border-radius: 9999px;
  text-align: center;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  font-weight: 600;
  border-bottom: none;
}
.drawer-lang {
  border-bottom: none;
  text-align: center;
  color: var(--warm-muted);
  font-size: 0.9rem;
}
body.menu-open .mobile-drawer {
  display: block;
  opacity: 1;
}
body.menu-open .drawer-panel {
  transform: translateX(0);
}
body.menu-open { overflow: hidden; }

/* ============================================
   Mobile (≤ 768px)
   ============================================ */
@media (max-width: 768px) {
  .mobile-hide { display: none !important; }

  /* Container narrower padding */
  .container-narrow, .container-wide { padding: 0 1rem; }

  /* Header: bigger logo, hamburger menu */
  .site-header .container-wide {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }
  .brand-logo img { height: 50px !important; }
  .header-right { gap: 0.4rem !important; }
  .site-header .header-cta { display: none !important; }
  .site-header .lang-switch { display: none !important; }
  .hamburger-btn { display: inline-flex !important; }

  /* Hero: smaller padding/text */
  .hero-with-image { min-height: 0; }
  .hero-with-image .container-wide > div {
    padding: 2rem 0 !important;
    max-width: 100% !important;
  }
  .hero-with-image h1,
  .hero h1 { font-size: 1.7rem !important; line-height: 1.4 !important; }
  .hero-with-image p,
  .hero p { font-size: 0.95rem !important; }

  /* Sections - tighter vertical rhythm */
  .section { padding-top: 2.2rem !important; padding-bottom: 2.2rem !important; }
  h2 { font-size: 1.4rem !important; }
  h3 { font-size: 1.1rem !important; }

  /* Stats bar: 4 → 2 cols */
  body > section[style*="background:var(--sunset-500)"] .container-wide,
  body > section[style*="background: var(--sunset-500)"] .container-wide {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem 0.5rem !important;
  }

  /* All other grids: collapse to 1 column */
  section .container-wide > div[style*="grid-template-columns:repeat(3,1fr)"],
  section .container-wide > div[style*="grid-template-columns: repeat(3,1fr)"],
  section .container-narrow > div[style*="grid-template-columns:repeat(2,1fr)"],
  section .container-narrow > div[style*="grid-template-columns: repeat(2,1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Country card grid: keep 2 cols for visual interest */
  section.bg-cream .container-wide > div[style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  /* Country cards mobile: image height halved (4:3 → 16:10 wider/shorter) */
  .country-card-img .img-wrap { aspect-ratio: 16 / 10 !important; }
  .country-card-img .name { font-size: 0.85rem !important; bottom: 0.4rem !important; left: 0.6rem !important; }
  .country-card-img .body { padding: 0.6rem 0.7rem 0.8rem !important; }
  .country-card-img .body p { font-size: 0.78rem !important; }
  .country-card-img .flag { width: 32px !important; top: 0.4rem !important; left: 0.4rem !important; }

  /* Country detail hero — shorter and smaller text */
  .country-detail-hero { min-height: 240px !important; }
  .country-detail-hero h1 { font-size: 1.5rem !important; line-height: 1.3 !important; }
  .country-detail-hero p { font-size: 0.95rem !important; }
  .country-detail-hero .flag-large { width: 60px !important; margin-bottom: 0.6rem !important; }

  /* Tables: horizontal scroll for wide tables */
  table.simple-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 0.85rem;
  }

  /* Footer: 4 cols → 1 col (cleaner stacked layout on mobile) */
  .site-footer > div > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  .site-footer .brand-logo-footer img { height: 44px !important; }
  .site-footer ul { line-height: 2 !important; }
  .site-footer { padding: 2rem 0 1.5rem !important; }

  /* CTA section text */
  section[style*="linear-gradient(135deg,#E97451"] h2 {
    font-size: 1.4rem !important;
  }
  section[style*="linear-gradient(135deg,#E97451"] p { font-size: 0.95rem !important; }

  /* Forms */
  .container-narrow form.card { padding: 1.2rem !important; }

  /* btn full-width on mobile for primary CTA in hero */
  .hero-with-image .flex.gap-3 { flex-direction: column; }
  .hero-with-image .flex.gap-3 > a { width: 100%; text-align: center; }
}

/* Very small screens: stack country cards to 1 column */
@media (max-width: 420px) {
  section.bg-cream .container-wide > div[style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: 1fr !important;
  }
  .stat-icon { width: 28px !important; height: 28px !important; }
}
