/* ========================================
   JAPANESE-SPECIFIC OVERRIDES
   ======================================== */

/* Global Japanese text handling */
body {
  word-break: normal; /* Allow proper character-based wrapping for Japanese */
  line-break: strict; /* Enforce kinsoku-shori (prohibition rules) for professional Japanese typography */
}

@media (min-width: 768px) {
  body {
    word-break: keep-all;
  }
}

/* ========================================
   MOBILE CONTENT-WITH-IMAGE FIX
   ======================================== */

/* Fix mobile scrolling issue by providing more height for content */
@media (max-width: 768px) {
  .content-with-image {
    height: 880px; /* Increase height on mobile to accommodate content */
  }
}

/* Enhanced Japanese Font Stacks */
:root {
  /* Heading font stack - Yu Mincho Pr6N with fallbacks */
  --font-heading-ja: 'Yu Mincho Pr6N', 'Yu Mincho', 'YuMincho', 'Hiragino Mincho ProN', 'Hiragino Mincho Pro', 'Times New Roman', serif;
  
  /* Body text font stack - Helvetica Neue */
  --font-body-ja: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
  
  /* Accordion font stack - IBM Plex Sans JP */
  --font-accordion-ja: 'IBM Plex Sans JP', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
  
  /* Font weights mapping for Japanese */
  --font-weight-light-ja: 300;
  --font-weight-regular-ja: 400;
  --font-weight-medium-ja: 500;
  --font-weight-semibold-ja: 600;
  --font-weight-bold-ja: 700;
}

/* Apply Helvetica Neue to all body text elements */
body,
.btn,
.body-text,
.body-lg,
.body-sm,
.body-text--large,
.body-text--small,
.subheading,
.sans-serif-3xs,
.section__description,
.btn__text,
.case-study__subtitle,
.case-study__section-text,
.content-block__description,
.feature-card__description,
.process-step__description,
.footer__link,
.footer__copyright,
.cta-card__description,
.dual-cta-card__description,
.accordion__title,
.accordion__text {
  font-family: var(--font-body-ja);
  /* word-break: keep-all; */
  line-break: strict;
}

/* Apply Yu Mincho Pr6N to all heading elements */
.heading1,
.heading2,
.heading3,
.heading4,
.heading5,
.hero__title,
.section__title,
.section__title_left,
.case-study__title,
.content-block__title,
.feature-card__title,
.process-step__title,
.cta-card__title {
  font-family: var(--font-heading-ja);
}

.dual-cta-card__title {
  font-family: 'Recoleta', serif;
}

/* Apply IBM Plex Sans JP to accordion elements */
.accordion__title,
.accordion__text {
  font-family: var(--font-accordion-ja);
}

/* Balanced headings for modern browsers with Japanese text support */
@supports (text-wrap: balance) and (word-break: auto-phrase) {
  .heading1,
  .heading2,
  .heading3,
  .heading4,
  .heading5,
  .hero__title,
  .section__title,
  .section__title_left,
  .case-study__title,
  .content-block__title,
  .feature-card__title,
  .process-step__title,
  .cta-card__title,
  .dual-cta-card__title {
    text-wrap: balance;
    word-break: auto-phrase;
  }
}

/* Specific font weight adjustments for Japanese headings */
.heading1 {
  font-weight: var(--font-weight-regular-ja);
  line-height: 1.2; /* Tighter for large Japanese headlines */
  letter-spacing: 0.01em;
}

.heading2 {
  font-weight: var(--font-weight-semibold-ja);
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.heading3 {
  font-weight: var(--font-weight-semibold-ja);
  line-height: 1.3;
  letter-spacing: 0.005em;
}

.heading4,
.heading5 {
  font-weight: var(--font-weight-medium-ja);
  line-height: 1.35;
  letter-spacing: 0.005em;
}

/* Body text optimizations */
.body-lg {
  font-weight: var(--font-weight-regular-ja);
  line-height: 1.6; /* More breathing room for Japanese */
  letter-spacing: 0.01em;
}

.body-text,
.body-sm {
  font-weight: var(--font-weight-regular-ja);
  line-height: 1.55;
  letter-spacing: 0.005em;
}

/* Hero section Japanese adjustments */
.hero__title {
  line-height: 1.25; /* Balanced for Japanese headlines */
  letter-spacing: 0.015em;
  font-weight: var(--font-weight-regular-ja);
}

.hero__description {
  line-height: 1.6; /* Generous spacing for readability */
  font-weight: var(--font-weight-regular-ja);
  letter-spacing: 0.01em;
}

@media (max-width: 767px) {

    .hero__bg-img {
        width: 18vw;
    }
  
    /* Hero background image mobile positions */
    .hero__bg-img--1 {
      top: 20%;
      left: 5%;
    }
  
    .hero__bg-img--2 {
      top: 85%;
      left: 15%;
    }
  
    .hero__bg-img--3 {
      top: 62%;
      left: 0%;
    }
  
    .hero__bg-img--4 {
      top: 60%;
      right: 0%;
    }
  
    .hero__bg-img--5 {
      top: 25%;
      right: 0%;
    }
  
    .hero__bg-img--6 {
      top: 12%;
      right: 35%;
    }
  }

  @media (max-height: 750px) {

    .hero__bg-img {
        width: 18vw;
    }
  
    .hero__bg-img--2 {
      top: 87%;
      left: 15%;
    }
  
    .hero__bg-img--3 {
      top: 65%;
      left: 0%;
    }
/*   
    .hero__bg-img--6 {
      top: 62%;
      right: 0%;
    } */
  }

/* Section titles */
.section__title,
.section__title_left {
  line-height: 1.3;
  letter-spacing: 0.01em;
  font-weight: var(--font-weight-regular-ja);
}

.section__description {
  line-height: 1.6;
  font-weight: var(--font-weight-regular-ja);
}

/* Button text adjustments for Japanese */
.btn__text {
  font-weight: var(--font-weight-bold-ja);
  letter-spacing: 0.02em;
}

.dual-cta-card .btn__text {
  word-break: keep-all;
}

/* FAQ Japanese text spacing - IBM Plex Sans JP */
.accordion__title {
  line-height: 1.4;
  letter-spacing: 0.005em;
  font-weight: var(--font-weight-regular-ja);
}

.accordion__text {
  line-height: 1.65;
  font-weight: var(--font-weight-regular-ja);
}

/* Case study Japanese text */
.case-study__title {
  line-height: 1.3;
  font-weight: var(--font-weight-normal-ja);
  letter-spacing: 0.005em;
  word-break: keep-all;
}

.case-study__subtitle {
  font-weight: var(--font-weight-medium-ja);
  letter-spacing: 0.01em;
  word-break: keep-all;
}

@media (max-width: 586px){
  .case-study__subtitle {
    font-size: 12px;
  }
}

.case-study__section-text {
  line-height: 1.45;
  font-weight: var(--font-weight-bold-ja);
  font-family: var(--font-body-ja);
}

.testimonial-card__text {
  font-weight: var(--font-weight-regular-ja);
  font-style: normal; /* Remove italic for Japanese quotes */
  font-family: Zen Kaku Gothic Antique;
  font-size: 16px;
  text-align: left;
  line-height: 120%;
  letter-spacing: 0%;
  vertical-align: middle;
  /* Center the text element within the card while keeping text left-aligned */
  align-self: center;
  max-width: 90%; /* Prevent text from touching card edges */
}

@media (max-width: 768px){
  .testimonial-card__text {
    font-size: 22px;
    align-self: center;
    max-width: 90%;
  }
}

@media (min-width: 768px) and (max-width: 1279px) {
  .testimonial-card__text {
    word-break: normal;
  }
}


/* Content block Japanese adjustments */
.content-block__title {
  line-height: 1.35;
  font-weight: var(--font-weight-semibold-ja);
}

.content-block__description {
  line-height: 1.6;
  font-weight: var(--font-weight-regular-ja);
}

/* Feature card Japanese text */
.feature-card__title {
  font-weight: var(--font-weight-medium-ja);
  line-height: 1.35;
}

@media (max-width: 767px) {
  .feature-card__title {
    word-break: keep-all;
  }
}

@media (max-width: 586px){
  .feature-card__title {
    max-width: 400px;
  }
}

.feature-card__description {
  line-height: 1.6;
  font-weight: var(--font-weight-regular-ja);
  word-break: keep-all;
}

@media (max-width: 480px) {
  .feature-card {
    padding: 24px 0px;
  }
}

@media (max-width: 480px) {
  .feature-card__description {
    font-size: 15px;
  }
}

/* Process step Japanese text */
.process-step__title {
  line-height: 1.4;
  font-weight: var(--font-weight-bold-ja);
  font-family: var(--font-body-ja);
}

.process-step__description {
  line-height: 1.5;
  font-weight: var(--font-weight-regular-ja);
}

/* Footer Japanese adjustments */
.footer__link,
.footer__copyright {
  letter-spacing: 0.01em;
  font-weight: var(--font-weight-regular-ja);
}

/* CTA cards */
.cta-card__title,
.dual-cta-card__title {
  font-weight: var(--font-weight-bold-ja);
  line-height: 1.3;
}

.cta-card__description,
.dual-cta-card__description {
  font-weight: var(--font-weight-regular-ja);
  line-height: 1.55;
}

/* Mobile Japanese text adjustments */
@media (max-width: 768px) {
  .hero__title {
    line-height: 1.3; /* Slightly more relaxed on mobile */
    font-size: 24px
  }
  
  .heading2 {
    line-height: 1.3;
    font-size: clamp(1.5rem, 4vw, 2rem);
    word-break: keep-all;
  }
  
  .accordion__title {
    line-height: 1.45;
  }
  
  .body-lg {
    line-height: 1.65; /* Extra breathing room on mobile */
  }
}

/* Font loading optimization */
@media (prefers-reduced-motion: no-preference) {
  html {
    font-display: swap; /* Improve loading performance */
  }
}

/* High DPI/Retina display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
}

/* Showrooms Section Background */
.section--showrooms {
  background-color: #EADBDB;
}

/* Showrooms Navigation - Match process carousel positioning exactly */
.showrooms-carousel__nav {
  display: none; /* Hidden by default on large screens (≥1280px) */
  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 10;
  height: 60px;
  width: calc(100% - 96px);
  max-width: 1280px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Show arrows when screen is below 1280px (same as process carousel) */
@media (max-width: 1279px) {
  .showrooms-carousel__nav {
    display: flex;
  }
}

/* Showrooms Container - Match process-steps-carousel exactly */
.showrooms-carousel {
  width: 100%;
  position: relative;
  /* Removed max-width to allow full viewport width */
}

/* Showroom Cards Styling */
.showroom-card {
  background-color: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 284px;
}

.showroom-card__image {
  width: 100%;
  height: 214px;
  overflow: hidden;
}

.showroom-card__title {
  font-family: var(--font-body-ja);
  font-weight: var(--font-weight-bold-ja);
  font-size: 18px;
}

.showroom-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showroom-card__content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.showroom-card__contact {
    padding-bottom: 24px;
}

.showroom-card__maps-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #006361;
  text-decoration: underline;
  font-weight: 700;
}

.showroom-card__details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.showroom-card__detail {
  display: flex;
}

.showroom-card__address {
  font-size: 14px;
}

/* Empty slide for centering on large screens */
.showroom-card--empty {
  width: 0 !important;
  min-width: 0 !important;
  flex: none !important;
  overflow: hidden;
  pointer-events: none;
  margin: 0 !important;
  padding: 0 !important;
}

@media (min-width: 1280px) {
    .splide__track{
        margin-left: 8px;
    }
}

/* Mobile-specific fixes for showroom cards */
@media (max-width: 640px) {
  .showroom-card {
    max-width: 284px; /* Account for padding and gaps */
    min-width: 280px;
  }
  
  /* Ensure proper overflow handling for the carousel */
  .showrooms-carousel {
    overflow: hidden;
  }
  
  .showrooms-carousel .splide__track {
    overflow: visible;
  }
}

@media (max-width: 480px) {
  .showroom-card {
    max-width: 284px; /* Smaller margin for very small screens */
    min-width: 280px;
  }
}

/* Responsive navigation controls - Match process carousel exactly */
@media (max-width: 768px) {
  .showrooms-carousel__nav {
    width: calc(100% - 48px);
  }
}

@media (max-width: 480px) {
  .showrooms-carousel__nav {
    width: calc(100% - 32px);
  }
}

/* ========================================
   FEATURE CARDS RESPONSIVE LAYOUT
   ======================================== */

/* Feature card header container */
.feature-card__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Icon centering */
.feature-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Desktop and Mobile: Column layout (default) */
.feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.feature-grid {
    display: flex;
    gap: 10px;
}

/* Tablet: Row layout */
@media (min-width: 768px) and (max-width: 1255px) {
  .feature-grid {
    display: flex;
    flex-direction: column;
    gap: 48px;
    align-items: center;
  }
  
  .feature-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 32px;
    max-width: 800px;
    margin: 0 auto;
  }
  
  .feature-card__header {
    flex-shrink: 0;
    min-width: 280px;
    align-items: flex-start;
  }
  
  .feature-card__description {
    flex: 1;
    text-align: left;
    margin: 0;
  }
}
   
@media (min-width: 820px) and (max-width: 1279px) {
  .feature-card__header {
    flex-shrink: 0;
    min-width: 280px;
    width: 335px;
    align-items: flex-start;
  }
}