/* ==========================================================================
   common.css
   Universal header, footer and responsive base.
   Loaded AFTER the per-page stylesheet so shared chrome always wins.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Base / reset
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Offset anchor jumps so the sticky header never covers the target */
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  color: #333;
  background-color: #fff;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

img,
video,
iframe {
  max-width: 100%;
}

img {
  height: auto;
  display: block;
}

/* Stop wide tables and grids blowing out small screens */
table {
  max-width: 100%;
}

a {
  -webkit-tap-highlight-color: transparent;
}

/* --------------------------------------------------------------------------
   2. Universal header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px 40px;
  background: rgba(62, 102, 59, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: padding 0.4s ease, background 0.4s ease, border-color 0.4s ease,
    box-shadow 0.4s ease, transform 0.45s ease;
}

/* Condensed state once the user scrolls */
.site-header.is-stuck {
  padding: 10px 40px;
  background: rgba(50, 82, 48, 0.97);
  border-bottom-color: #2b4a29;
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.12);
}

/* Slide the bar away when scrolling down, bring it back on scroll up */
.site-header.is-hidden {
  transform: translateY(-100%);
}

.site-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
}

.brand-logo {
  text-decoration: none;
  color: #111;
  flex-shrink: 0;
  line-height: 1.25;
  display: flex;
  align-items: center;
  background: #fff;
  padding: 8px 16px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.brand-logo__img {
  display: block;
  height: 44px;
  width: auto;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* Top line: menu + reserve button */
.header-row {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  transition: color 0.25s ease;
}
.nav-item:hover,
.nav-item.is-current {
  color: #ffce7a;
}

.dropdown-icon {
  width: 18px;
  height: 18px;
  background-color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.dropdown-icon svg {
  width: 10px;
  height: 10px;
  stroke: #3e663b;
  stroke-width: 2.5;
  fill: none;
}

/* ---- Dropdown panels ---- */

.has-dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translate(-50%, 10px);
  min-width: 232px;
  padding: 10px;
  list-style: none;
  margin: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.11);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}

.has-dropdown:hover .dropdown-panel,
.has-dropdown:focus-within .dropdown-panel,
.has-dropdown.is-open .dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.has-dropdown:hover .dropdown-icon,
.has-dropdown.is-open .dropdown-icon {
  transform: rotate(180deg);
}

.dropdown-panel a {
  display: block;
  padding: 10px 14px;
  font-size: 13px;
  color: #444;
  text-decoration: none;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.22s ease, color 0.22s ease;
}
.dropdown-panel a:hover {
  background: #f4f8fb;
  color: #3e663b;
}

.address-text {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

.btn-blue-reserve {
  background-color: #fff;
  color: #3e663b;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 30px;
  border-radius: 30px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: background-color 0.25s ease, transform 0.25s ease,
    box-shadow 0.25s ease;
}
.btn-blue-reserve:hover {
  background-color: #ffce7a;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

/* ---- Burger ---- */

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  z-index: 1200;
  flex-shrink: 0;
}
.nav-toggle span {
  position: absolute;
  left: 11px;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.38s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.24s ease, top 0.3s ease;
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }

.nav-toggle.is-active span:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}
.nav-toggle.is-active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.is-active span:nth-child(3) {
  top: 21px;
  transform: rotate(-45deg);
}

/* ---- Mobile drawer ---- */

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(20, 18, 15, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.nav-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1000;
  width: min(360px, 86vw);
  height: 100%;
  height: 100dvh;
  padding: 92px 26px 40px;
  background: #f7f6f4;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
}
.mobile-nav.is-open {
  transform: translateX(0);
}

.mobile-nav__list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}
.mobile-nav__list > li {
  border-bottom: 1px solid #e4e0d8;
  opacity: 0;
  transform: translateX(22px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.mobile-nav.is-open .mobile-nav__list > li {
  opacity: 1;
  transform: translateX(0);
}
/* Stagger the rows as the drawer opens */
.mobile-nav.is-open .mobile-nav__list > li:nth-child(1) { transition-delay: 0.12s; }
.mobile-nav.is-open .mobile-nav__list > li:nth-child(2) { transition-delay: 0.18s; }
.mobile-nav.is-open .mobile-nav__list > li:nth-child(3) { transition-delay: 0.24s; }
.mobile-nav.is-open .mobile-nav__list > li:nth-child(4) { transition-delay: 0.3s; }
.mobile-nav.is-open .mobile-nav__list > li:nth-child(5) { transition-delay: 0.36s; }
.mobile-nav.is-open .mobile-nav__list > li:nth-child(6) { transition-delay: 0.42s; }
.mobile-nav.is-open .mobile-nav__list > li:nth-child(7) { transition-delay: 0.48s; }

.mobile-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 16px 4px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #222;
  text-decoration: none;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.mobile-nav__link .chev {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: #3e663b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s ease;
}
.mobile-nav__link .chev svg {
  width: 11px;
  height: 11px;
  stroke: #fff;
  stroke-width: 2.5;
  fill: none;
}
.mobile-nav__link[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.mobile-nav__sub {
  list-style: none;
  margin: 0;
  padding: 0 0 0 10px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.mobile-nav__sub.is-open {
  max-height: 420px;
}
.mobile-nav__sub a {
  display: block;
  padding: 12px 4px;
  font-size: 13.5px;
  color: #5a5a5a;
  text-decoration: none;
}
.mobile-nav__sub a:hover {
  color: #3e663b;
}

.mobile-nav__cta {
  display: block;
  padding: 15px;
  margin-bottom: 18px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: #3e663b;
  border-radius: 30px;
}
.mobile-nav__address {
  font-size: 11.5px;
  line-height: 1.8;
  color: #777;
}

/* --------------------------------------------------------------------------
   3. Header responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .nav-links { gap: 18px; }
  .header-row { gap: 18px; }
}

@media (max-width: 992px) {
  .site-header,
  .site-header.is-stuck { padding: 12px 20px; }
  .nav-links { display: none; }
  .btn-blue-reserve { display: none; }
  .address-text { display: none; }
  .nav-toggle { display: block; }
  .header-right { flex-direction: row; align-items: center; }
  html { scroll-padding-top: 76px; }
}

@media (min-width: 993px) {
  /* Drawer is a small-screen affordance only */
  .mobile-nav,
  .nav-backdrop { display: none; }
}

@media (max-width: 480px) {
  .brand-logo__img { height: 36px; }
}

/* --------------------------------------------------------------------------
   4. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background-color: #f7f3e9;
  padding: 80px 40px 40px;
  width: 100%;
  color: #333;
}
.footer-container {
  max-width: 1100px;
  margin: 0 auto;
}

.reserve-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 50px;
}
.reserve-left { max-width: 600px; }
.title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.orange-square {
  width: 12px;
  height: 12px;
  background-color: #f09600;
  border-radius: 2px;
  flex-shrink: 0;
}
.site-footer .title-en {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: #555;
  line-height: 1;
}
.site-footer .title-jp {
  font-size: 14px;
  font-weight: 700;
  color: #555;
  margin-bottom: 24px;
}
.reserve-desc {
  font-size: 14px;
  color: #555;
  line-height: 1.8;
}
.reserve-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 280px;
  flex-shrink: 0;
}

.btn-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 56px;
  background-color: #f09600;
  color: #fff;
  text-decoration: none;
  border-radius: 50px;
  padding: 0 6px 0 28px;
  transition: transform 0.25s ease, background-color 0.25s ease,
    box-shadow 0.25s ease;
}
.btn-pill:hover {
  background-color: #e08b00;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(240, 150, 0, 0.28);
}
.btn-pill-wide {
  max-width: 420px;
  margin-bottom: 30px;
}
.btn-label {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.btn-icon-circle {
  width: 44px;
  height: 44px;
  background-color: #f7f6f4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-icon-circle svg {
  width: 18px;
  height: 18px;
  stroke: #f09600;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.divider-line {
  width: 100%;
  height: 1px;
  background-color: #ded7c8;
  margin-bottom: 60px;
}
.footer-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  margin-bottom: 80px;
  align-items: start;
}
.clinic-brand-sub {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}
.clinic-brand-title {
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #333;
  margin-bottom: 24px;
}

.hours-card {
  background-color: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  max-width: 420px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}
/* Let the timetable scroll rather than overflow on narrow screens */
.hours-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.hours-table {
  width: 100%;
  min-width: 320px;
  border-collapse: collapse;
  text-align: center;
  font-size: 12px;
}
.hours-table th,
.hours-table td { padding: 8px 4px; }
.hours-table tr:not(:last-child) td,
.hours-table tr:not(:last-child) th {
  border-bottom: 1px solid #f0f0f0;
}
.time-col {
  text-align: left;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
}
.dot-open {
  width: 10px;
  height: 10px;
  background-color: #f09600;
  border-radius: 50%;
  display: inline-block;
}
.text-closed { color: #aaa; font-size: 13px; }
.hours-note {
  margin-top: 14px;
  font-size: 10.5px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
}
.star-icon { color: #3e663b; }

.map-box {
  width: 100%;
  height: 340px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}
.map-box iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 600px;
  margin-bottom: 60px;
}
.nav-col-title {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin-bottom: 16px;
}
.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
}
.nav-list a {
  text-decoration: none;
  font-size: 11.5px;
  color: #666;
  transition: color 0.25s ease;
}
.nav-list a:hover { color: #f09600; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 24px;
  font-size: 11px;
  color: #777;
}
.footer-sublinks { display: flex; gap: 16px; }
.footer-sublinks a { text-decoration: none; color: #777; }

/* --------------------------------------------------------------------------
   5. Footer responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .site-footer { padding: 56px 20px 30px; }
  .reserve-header { flex-direction: column; gap: 30px; }
  .reserve-buttons,
  .btn-pill-wide { width: 100%; max-width: 100%; }
  .footer-main-grid { grid-template-columns: 1fr; gap: 40px; margin-bottom: 50px; }
  .footer-nav { grid-template-columns: repeat(2, 1fr); gap: 26px; margin-bottom: 40px; }
  .divider-line { margin-bottom: 40px; }
  .site-footer .title-en { font-size: 30px; }
  .map-box { height: 260px; }
}

@media (max-width: 560px) {
  .footer-nav { grid-template-columns: 1fr; }
  .footer-bottom {
    flex-direction: column-reverse;
    align-items: flex-start;
    text-align: left;
  }
  .btn-label { font-size: 14px; }
  .btn-pill { padding-left: 20px; }
  .hours-card { padding: 16px; }
}

/* --------------------------------------------------------------------------
   6. Global small-screen safety net
   Keeps legacy fixed-width page sections inside the viewport.
   -------------------------------------------------------------------------- */

@media (max-width: 992px) {
  /* Any grid declared with fixed multi-columns collapses sensibly */
  .concept-cards,
  .services-grid,
  .facility-grid,
  .choose-grid,
  .footer-main-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .concept-cards,
  .services-grid,
  .facility-grid,
  .choose-grid {
    grid-template-columns: 1fr !important;
  }

  /* Two-column flex layouts stack */
  .about-container,
  .concept-container,
  .reserve-header {
    flex-direction: column !important;
  }

  /* Wide data tables scroll instead of overflowing */
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .site-footer { padding: 44px 16px 26px; }
}


/* ==========================================================================
   HOMEPAGE OVERLAY HEADER
   --------------------------------------------------------------------------
   The homepage header sits on top of the hero image. It is transparent at
   the top of the page, with the site's existing green used for the CTA.
   ========================================================================== */

.homepage-page .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
}

.homepage-page .site-header.is-stuck {
  /* Keep the header readable after the hero while scrolling. */
  background: rgba(62, 102, 59, 0.96);
  border-bottom-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.12);
}

.homepage-page .brand-logo {
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.homepage-page .btn-blue-reserve {
  background-color: #3e663b;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.homepage-page .btn-blue-reserve:hover {
  background-color: #2f4d2c;
  color: #fff;
}

.homepage-page .dropdown-icon {
  background-color: #3e663b;
}

.homepage-page .dropdown-icon svg {
  stroke: #fff;
}

.homepage-page .nav-item:hover,
.homepage-page .nav-item.is-current {
  color: #fff;
}

.homepage-page .location-badge {
  top: 92px;
}

/* Fluid header sizing so the overlay remains comfortable at intermediate
   desktop widths instead of relying on fixed spacing. */
.homepage-page .site-header {
  padding-inline: clamp(18px, 3vw, 40px);
}

.homepage-page .site-header__inner {
  gap: clamp(14px, 2vw, 24px);
}

@media (max-width: 1180px) {
  .homepage-page .nav-links {
    gap: 16px;
  }

  .homepage-page .header-row {
    gap: 16px;
  }

  .homepage-page .btn-blue-reserve {
    padding-inline: 22px;
  }
}

@media (max-width: 992px) {
  .homepage-page .site-header,
  .homepage-page .site-header.is-stuck {
    position: absolute;
    padding: 10px 16px;
    background: transparent;
    border-bottom-color: transparent;
    box-shadow: none;
  }

  .homepage-page .site-header.is-hidden {
    transform: translateY(-100%);
  }

  .homepage-page .brand-logo__img {
    height: clamp(34px, 8vw, 42px);
  }

  .homepage-page .nav-toggle {
    display: block;
  }

  .homepage-page .location-badge {
    top: 64px;
  }
}

@media (max-width: 480px) {
  .homepage-page .site-header,
  .homepage-page .site-header.is-stuck {
    padding-inline: 12px;
  }

  .homepage-page .brand-logo__img {
    height: 34px;
    max-width: 62vw;
  }

  .homepage-page .nav-toggle {
    width: 42px;
    height: 42px;
  }
}
