/* ==========================================================================
   Responsive Design - breakpoint overrides layered above core styles
   ========================================================================== */

@layer overrides {

/* ========== Large screens ========== */
@media (min-width: 1200px) {
  .container-wide {
    max-width: var(--container-wide-max-width);
    padding: 0 var(--container-padding);
  }

  .container {
    max-width: var(--container-max-width);
    padding: 0 var(--container-padding);
  }

  .nav {
    padding: 0 var(--container-padding);
  }

  .logo-image {
    height: var(--logo-height);
    max-width: var(--logo-max-width-large);
  }

  .nav-links li {
    margin-right: var(--spacing-lg);
  }
}

@media (max-width: 1200px) {
  .container-wide {
    max-width: 100%;
    padding: 0 var(--container-padding);
  }

  .container {
    max-width: 100%;
  }

  .nav {
    padding: 0 var(--container-padding);
  }
}

/* ========== Tablet & below (≤992px) ========== */
@media (max-width: 992px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100vw;
    box-sizing: border-box;
  }

  :root {
    --header-height: var(--header-height-mobile);
    --scroll-offset: var(--scroll-offset-mobile);
    --heading-h2-size: clamp(1.8rem, 5.2vw, 2.9rem);
    --heading-h2-margin: clamp(2.75rem, 5.5vw, 4rem);
    --heading-h2-padding: clamp(0.7rem, 1.9vw, 1rem);
  }

  body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-feature-settings: "palt";
    -webkit-font-feature-settings: "palt";
  }

  .container,
  .container-wide {
    max-width: 100%;
    padding: 0 var(--container-padding-mobile);
    box-sizing: border-box;
  }

  section {
    padding: var(--section-padding-mobile) 0;
  }

  body.header-loaded {
    scroll-padding-top: var(--scroll-offset-mobile);
  }

  /* タイポグラフィの読みやすさ */
  p:not(.faq-question):not(.faq-answer p):not(.contact-intro p) {
    line-height: 1.7;
    margin-bottom: 1em;
    text-align: left;
    word-break: auto-phrase;
    overflow-wrap: break-word;
  }

  .contact-intro p {
    line-height: 1.6;
    margin-bottom: 1em;
    text-align: center;
    word-break: auto-phrase;
    overflow-wrap: break-word;
  }

  h1:not(#faq h1):not(#faq h2):not(#faq h3),
  h2:not(#faq h1):not(#faq h2):not(#faq h3),
  h3:not(#faq h1):not(#faq h2):not(#faq h3) {
    line-height: 1.4;
    word-break: auto-phrase;
    overflow-wrap: break-word;
  }

  br {
    display: block;
    margin: 0;
    padding: 0;
    line-height: 0.5;
    height: 0.5em;
  }

  .section-title,
  .section-subtitle,
  .section-description,
  .program-card h3,
  .program-card h4,
  .program-card p,
  .text-primary,
  .text-highlight,
  .text-highlight-primary,
  .text-highlight-success,
  .text-highlight-warning,
  .text-highlight-purple {
    word-break: auto-phrase;
    overflow-wrap: break-word;
  }

  /* ヘッダー */
  .header {
    padding: 12px 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  }

  .nav {
    padding: 0 var(--container-padding-mobile);
    position: relative;
    max-width: none;
    margin: 0;
  }

  .logo-image {
    height: 85px;
    max-width: 380px;
  }

  /* 料金・費用・カード */
  .price-tables {
    flex-direction: column;
    gap: var(--spacing-lg);
    align-items: center;
    text-align: center;
  }

  .price-card,
  .price-header,
  .price-body,
  .price-item,
  .price-label,
  .price-amount,
  .entry-fees,
  .entry-fees h4,
  .fee-items-container,
  .fee-item,
  .fee-label,
  .fee-amount {
    text-align: center;
  }

  .price-item,
  .fee-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    width: 100%;
  }

  .fee-items-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: center;
  }

  .entry-fees {
    margin: 0 auto;
    max-width: 100%;
  }

  /* その他コンテンツ */
  .news-item {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-md);
  }

  .booking-frame {
    margin: var(--spacing-xl) 0;
  }

  footer a {
    font-size: var(--font-size-sm);
  }
}

/* ========== Small screens (≤480px) ========== */
@media (max-width: 480px) {
  html,
  body {
    overflow-x: hidden;
    position: relative;
    max-width: 100vw;
    box-sizing: border-box;
  }

  :root {
    --header-height: 85px;
    --scroll-offset: 105px;
    --heading-h2-size: clamp(1.65rem, 6vw, 2.25rem);
    --heading-h2-margin: clamp(2.25rem, 6vw, 3rem);
    --heading-h2-padding: clamp(0.6rem, 1.8vw, 0.9rem);
  }

  body {
    font-size: 14px;
    line-height: 1.6;
  }

  .container,
  .container-wide {
    max-width: 100%;
    padding: 0 20px;
    margin: 0 auto;
    box-sizing: border-box;
  }

  h1:not(#faq h1):not(#faq h2):not(#faq h3) {
    font-size: clamp(24px, 5.5vw, 32px);
    line-height: 1.3;
  }

  h3:not(#faq h1):not(#faq h2):not(#faq h3) {
    font-size: clamp(18px, 4vw, 22px);
    line-height: 1.4;
  }

  .section-subtitle,
  .section-description {
    font-size: clamp(14px, 3.5vw, 16px);
    line-height: 1.6;
    text-align: center;
  }

  .company-table th,
  .company-table td {
    font-size: 14px;
    padding: 12px 8px;
  }

  .business-text,
  .content-section p,
  .program-card .content-section p {
    font-size: 14px;
    line-height: 1.7;
    text-align: left;
    word-break: auto-phrase;
    overflow-wrap: break-word;
  }

  .contact-intro p {
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
  }

  /* ヘッダー */
  .header {
    padding: 8px 0;
  }

  .nav {
    padding: 0 20px;
    max-width: none;
  }

  .logo-image {
    height: 70px;
    max-width: 300px;
  }

  .mobile-menu-btn {
    display: flex;
    order: 3;
  }

  .nav-links {
    padding: 60px 20px 20px;
  }

  .nav-links .nav-link {
    font-size: 18px;
    padding: 12px 20px;
  }

  body.header-loaded {
    padding-top: var(--header-height);
  }

  /* 天気ウィジェット */
  .weather-info {
    flex-direction: column;
    gap: var(--spacing-xs);
    text-align: center;
    padding: var(--spacing-sm);
    margin: var(--spacing-md) 0;
  }

  .weather-icon {
    font-size: 24px;
    margin-bottom: var(--spacing-xs);
  }

  .weather-text {
    font-size: 14px;
    line-height: 1.4;
  }

  /* 料金コンテンツ微調整 */
  .price-tables {
    gap: 25px;
  }

  .price-header {
    padding: 22px 20px;
  }

  .price-item {
    padding: 14px;
    border-radius: 12px;
    gap: 7px;
  }

  .price-label {
    font-size: 14px;
  }

  .price-amount {
    font-size: 24px;
  }

  .price-amount small {
    font-size: 14px;
  }

  .entry-fees {
    padding: 40px 20px;
    border-radius: 20px;
  }

  .entry-fees h4 {
    font-size: 18px;
    margin-bottom: 20px;
  }

  .fee-item {
    padding: 16px 15px;
    border-radius: 12px;
  }

  .fee-label {
    font-size: 12px;
  }

  .fee-amount {
    font-size: 24px;
  }

  /* フッター */
  .footer {
    padding: var(--spacing-lg) 0;
  }

  .footer a {
    font-size: 13px;
  }

  .footer p,
  .footer-bottom p {
    font-size: 12px;
    line-height: 1.5;
    margin: var(--spacing-xs) 0;
    color: white;
  }
}

/* ========== Desktop navigation reset (≥993px) ========== */
@media (min-width: 993px) {
  .mobile-menu-btn {
    display: none;
  }

  .nav-links {
    transform: none;
    opacity: 1;
    visibility: visible;
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    padding: 0;
    gap: var(--spacing-sm);
    box-shadow: none;
    overflow: visible;
  }

  .nav-links li {
    width: auto;
    max-width: none;
  }

  .nav-links li:last-child {
    margin-left: 24px;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }

  .nav-links .nav-link {
    display: inline-block;
    width: auto;
    text-align: left;
    font-size: var(--font-size-base);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: none;
  }
}

/* ========== Print styles ========== */
@media print {
  * {
    background: white;
    color: black;
    box-shadow: none;
    text-shadow: none;
  }

  .header,
  .nav,
  .mobile-menu-btn {
    display: none;
  }

  section {
    page-break-inside: avoid;
    padding: 20px 0;
  }

  h1,
  h2,
  h3 {
    page-break-after: avoid;
    margin-top: 0;
  }
}

/* ========== Accessibility ========== */
@media (prefers-contrast: high) {
  :root {
    --primary-blue: #0066cc;
    --primary-orange: #ff4500;
    --primary-teal: #008080;
    --gray-dark: #000000;
    --gray-medium: #333333;
    --gray-light: #e2e8f0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }
}

}
