/* ==========================================================================
   BUCHI Ryugaku — Core Global Stylesheet
   ========================================================================== */

:root {
  --buchi-navy: #123668;
  --buchi-soft-navy: #EAF0F6;
  --buchi-orange: #DC7B03;
  --buchi-white: #FFFFFF;
  --buchi-off-white: #F7F8F6;
  --buchi-ink: #111827;
  --buchi-muted: #4B5563;
  --buchi-border: #E5E7EB;
  --buchi-subtle-bg: #F3F4F6;
}

/* Global Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Noto Sans JP", sans-serif;
  color: var(--buchi-ink);
  background-color: var(--buchi-white);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

/* Typography Base Defaults */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--buchi-navy);
  line-height: 1.3;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.25rem;
  color: #374151;
}

a {
  color: var(--buchi-navy);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--buchi-orange);
}

/* Container Utility (Fluid & Accessible Layout) */
.buchi-container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  box-sizing: border-box;
}

.buchi-container--reading {
  max-width: 800px;
}

/* Section Padding Consistency */
.buchi-section {
  padding-top: clamp(3.5rem, 7vw, 6rem);
  padding-bottom: clamp(3.5rem, 7vw, 6rem);
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.buchi-section--bg-subtle {
  background-color: var(--buchi-off-white);
}

.buchi-section--bg-navy {
  background-color: var(--buchi-navy);
  color: var(--buchi-white);
}

/* Kicker / Editorial Tagline Header */
.buchi-kicker {
  display: inline-block;
  font-family: "Manrope", sans-serif;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--buchi-orange);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.buchi-kicker--navy {
  color: #60A5FA;
}

/* Buttons Component Base */
.buchi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  box-sizing: border-box;
  text-align: center;
}

.buchi-btn--primary {
  background-color: var(--buchi-orange);
  color: var(--buchi-white);
  border: 2px solid var(--buchi-orange);
}

.buchi-btn--primary:hover {
  background-color: var(--buchi-navy);
  border-color: var(--buchi-navy);
  color: var(--buchi-white);
  transform: translateY(-1px);
}

.buchi-btn--secondary {
  background-color: transparent;
  color: var(--buchi-navy);
  border: 2px solid var(--buchi-navy);
}

.buchi-btn--secondary:hover {
  background-color: var(--buchi-navy);
  color: var(--buchi-white);
}

.buchi-btn--navy {
  background-color: var(--buchi-navy);
  color: var(--buchi-white);
}

.buchi-btn--navy:hover {
  background-color: var(--buchi-orange);
  color: var(--buchi-white);
}

.buchi-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 700;
  color: var(--buchi-orange);
}

.buchi-link-arrow:hover {
  text-decoration: underline;
}

img, video, iframe, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --------------------------------------------------------------------------
   Scroll Reveal Animation (Safe Progressive Enhancement - No White Blank)
   -------------------------------------------------------------------------- */
.buchi-reveal {
  opacity: 1; /* Default to visible so content NEVER disappears if JS is delayed */
  transform: none;
}

/* Apply opacity hide ONLY when JS has confirmed IntersectionObserver readiness */
html.js-ready .buchi-reveal:not(.is-revealed) {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

html.js-ready .buchi-reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Disable animations for users who prefer reduced motion or print */
@media (prefers-reduced-motion: reduce), print {
  .buchi-reveal,
  html.js-ready .buchi-reveal:not(.is-revealed) {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Editorial Table Styles for Program Comparison */
.buchi-support-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2.5rem 0;
  border: 1px solid var(--buchi-border);
  border-radius: 4px;
}
