/* ============================================
   HP Renewal - Responsive Rules
   Mobile-first: 500px / 768px / 900px
   ============================================ */

/* --- Mobile (default, < 500px) --- */

/* Prevent horizontal overflow on mobile */
html {
  overflow-x: hidden;
}

.hp-branch {
  grid-template-columns: 1fr;
}

.hp-branch__card {
  padding: var(--hp-space-xl) var(--hp-space-lg);
}

.hp-dept-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: var(--hp-space-sm);
}

.hp-articles {
  grid-template-columns: 1fr;
}

.hp-grid--2,
.hp-grid--3,
.hp-grid--4 {
  grid-template-columns: 1fr;
}

.hp-doctor {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hp-doctor__photo {
  width: 160px;
  min-width: auto;
}

.hp-concerns {
  grid-template-columns: 1fr;
}

.hp-section {
  padding-top: var(--hp-space-2xl);
  padding-bottom: var(--hp-space-2xl);
}

.hp-section__title {
  font-size: var(--hp-font-size-xl);
}

.hp-cta-banner__title {
  font-size: var(--hp-font-size-xl);
}

.hp-hours {
  font-size: var(--hp-font-size-xs);
}

.hp-hours th,
.hp-hours td {
  padding: var(--hp-space-xs) var(--hp-space-sm);
}

/* Show fixed CTA on mobile */
.hp-fixed-cta {
  display: block;
}

.hp-infobar {
  flex-direction: column;
  gap: var(--hp-space-sm);
  text-align: center;
}

/* Hide on mobile */
.hp-hide-mobile {
  display: none;
}

/* Show on desktop only */
.hp-show-desktop {
  display: none;
}

/* --- Mobile-specific enhancements --- */

.hp-page__content,
.hp-single__content,
.hp-entry-content,
.hp-archive__container {
  min-width: 0;
}

.hp-btn {
  white-space: normal;
}

/* Section heading dual-line: smaller on mobile */
.hp-section-heading__en {
  font-size: 1rem;
}

.hp-section-heading__ja {
  font-size: 1.75rem;
}

/* Pill buttons: full-width on mobile */
.hp-text-center .hp-btn--pill {
  min-width: 80%;
  max-width: 100%;
}

/* Contact tel/fax on mobile */
.hp-contact-tel {
  font-size: 16px;
  line-height: 1.6;
}

/* Footer sitemap: 1 column on mobile, reduce gap */
.hp-footer__sitemap {
  gap: 20px;
}

.hp-footer__sitemap-title {
  font-size: 13px;
}

.hp-footer__sitemap-nav a {
  font-size: 13px;
  padding: 5px 0;
  min-height: 36px;
  display: flex;
  align-items: center;
}

/* Footer logo: smaller on mobile */
.hp-footer__logo {
  height: 36px;
}

/* Page-top button: above fixed CTA on mobile */
.hp-pagetop {
  bottom: 92px;
}

/* Fixed CTA: prevent text truncation on small screens */
.hp-fixed-cta__inner {
  gap: 6px;
}

.hp-fixed-cta__btn {
  font-size: 12px;
  padding: 0.65rem 0.35rem;
  white-space: nowrap;
  min-width: 0;
}

.hp-fixed-cta__btn svg {
  flex-shrink: 0;
}

/* Tables: horizontal scroll wrapper on mobile */
.hp-entry-content table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Images in content: edge-to-edge on mobile */
.hp-entry-content img {
  border-radius: var(--hp-radius-sm);
}

/* Archive header: smaller on mobile */
.hp-archive__title {
  font-size: var(--hp-font-size-xl);
}

/* Page title: smaller on mobile */
.hp-page__title {
  font-size: var(--hp-font-size-xl);
}

/* Single: reduced spacing on mobile */
.hp-single__header {
  padding-top: var(--hp-space-lg);
  padding-bottom: var(--hp-space-md);
}

.hp-single__title {
  font-size: var(--hp-font-size-xl);
}

/* Author box: stack on very small screens */
.hp-single__author {
  flex-direction: column;
  gap: var(--hp-space-xs);
  align-items: flex-start;
}

/* Post navigation: stack on mobile */
.hp-post-nav {
  flex-direction: column;
  gap: var(--hp-space-lg);
}

.hp-post-nav__item--next {
  text-align: left;
}

/* --- Small Tablet (>= 500px) --- */
@media (min-width: 500px) {
  .hp-dept-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hp-grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .hp-articles {
    grid-template-columns: repeat(2, 1fr);
  }

  .hp-concerns {
    grid-template-columns: repeat(2, 1fr);
  }

  .hp-section-heading__ja {
    font-size: 2.25rem;
  }

  .hp-text-center .hp-btn--pill {
    min-width: auto;
    max-width: none;
  }

  .hp-single__author {
    flex-direction: row;
    align-items: center;
  }

  .hp-post-nav {
    flex-direction: row;
  }

  .hp-post-nav__item--next {
    text-align: right;
  }

  .hp-single__title {
    font-size: var(--hp-font-size-2xl);
  }

  .hp-archive__title {
    font-size: var(--hp-font-size-2xl);
  }

  .hp-page__title {
    font-size: var(--hp-font-size-2xl);
  }
}

/* --- Tablet (>= 768px) --- */
@media (min-width: 768px) {
  .hp-branch {
    grid-template-columns: repeat(3, 1fr);
  }

  .hp-dept-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: var(--hp-space-md);
  }

  .hp-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .hp-articles {
    grid-template-columns: repeat(3, 1fr);
  }

  .hp-section {
    padding-top: var(--hp-space-3xl);
    padding-bottom: var(--hp-space-3xl);
  }

  .hp-section__title {
    font-size: var(--hp-font-size-2xl);
  }

  .hp-cta-banner__title {
    font-size: var(--hp-font-size-2xl);
  }

  .hp-doctor {
    flex-direction: row;
    text-align: left;
  }

  .hp-doctor__photo {
    width: 200px;
    min-width: 200px;
  }

  .hp-infobar {
    flex-direction: row;
  }

  /* Show on tablet+ */
  .hp-hide-mobile {
    display: initial;
  }

  /* Hide fixed CTA on tablet+ */
  .hp-fixed-cta {
    display: none;
  }

  .hp-section-heading__ja {
    font-size: 2.8rem;
  }

  .hp-footer__logo {
    height: 44px;
  }

  .hp-footer__sitemap-title {
    font-size: 14px;
  }

  .hp-footer__sitemap-nav a {
    font-size: 13px;
    padding: 4px 0;
  }

  .hp-pagetop {
    bottom: 24px;
  }

  .hp-entry-content table {
    display: table;
    overflow-x: visible;
  }

  .hp-entry-content img {
    border-radius: var(--hp-radius-md);
  }
}

/* --- Desktop (>= 900px) --- */
@media (min-width: 900px) {
  .hp-grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .hp-section {
    padding-top: var(--hp-space-4xl);
    padding-bottom: var(--hp-space-4xl);
  }

  .hp-container {
    padding-left: var(--hp-space-xl);
    padding-right: var(--hp-space-xl);
  }

  .hp-show-desktop {
    display: initial;
  }
}
