/*!
 * app.css - LP enhancements (performance, SEO, accessibility)
 * Generated: 2026-03-03
 */

/* Visually hidden (screen-reader only) */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Picture wrapper */
.responsive-picture,
.responsive-picture img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* First view list spacing (was inline style) */
.page-index .mv-benefits {
  padding-top: 30px;
}

/* Embedded form (Tayori etc.) - responsive height */
.iframe-scroll-container {
  width: 100%;
  /* Responsive height: keep page balanced while reducing inner scroll */
  height: clamp(1000px, 160vh, 1800px);
}
@media (min-width: 768px) {
  .iframe-scroll-container {
    height: clamp(900px, 140vh, 1600px);
  }
}
@media (min-width: 1024px) {
  .iframe-scroll-container {
    height: clamp(850px, 120vh, 1400px);
  }
}
/* Prefer dynamic viewport units where supported (mobile address bar aware) */
@supports (height: 100dvh) {
  .iframe-scroll-container {
    height: clamp(1000px, 160dvh, 1800px);
  }
  @media (min-width: 768px) {
    .iframe-scroll-container {
      height: clamp(900px, 140dvh, 1600px);
    }
  }
  @media (min-width: 1024px) {
    .iframe-scroll-container {
      height: clamp(850px, 120dvh, 1400px);
    }
  }
}
.iframe-scroll-container > iframe.embed-form {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}


/* Lazy load section animation */
.lazy-load-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .4s ease, transform .4s ease;
  will-change: opacity, transform;
}
.lazy-load-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Municipality logo slider */
.logo-heading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}
.logo-heading {
  font-size: 24px;
  color: #61C5E9;
  font-weight: 700;
  text-align: center;
}
.logo-heading-container::before,
.logo-heading-container::after {
  content: "";
  display: block;
  width: 20px;
  border-bottom: 2px solid #61C5E9;
  margin: 0 10px;
}

.slider {
  width: 100%;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
  padding-bottom: 80px;
}
.slide-track {
  display: flex;
  align-items: center;
  width: max-content;
  gap: 15px;
  animation: scroll 30s linear infinite;
}
.slide {
  width: 127px;
  height: 58px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 767px) {
  .logo-heading {
    font-size: 4.53vw;
  }
  .logo-heading-container::before,
  .logo-heading-container::after {
    width: 5.33vw;
    margin: 0 2vw;
  }
}

/* Portal selection popup (index only) */
.portal-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.6);
}
.portal-popup[hidden] {
  display: none;
}
.portal-popup__dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: 10px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  text-align: center;
}
.portal-popup__title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  color: #333;
}
.portal-popup__link {
  display: block;
  margin: 0 0 10px;
  border: 1px solid #007bff;
  padding: 12px;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.portal-popup__link:hover,
.portal-popup__link:focus {
  background: #f5f5f5;
  outline: none;
}
.portal-popup__link--mirafeel {
  border-color: #007bff;
  color: #007bff;
}
.portal-popup__link--goon {
  border-color: #28a745;
  color: #28a745;
}
.portal-popup__link--genki {
  border-color: #28a745;
  color: #28a745;
}
.portal-popup__close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

/* Replace JS matchHeight with CSS stretching (desktop) */
@media (min-width: 768px) {
  /* index: flow cards */
  .page-index .cnt_06 ul {
    display: flex;
    align-items: stretch;
    gap: 36px;
  }
  .page-index .cnt_06 li {
    display: flex;
    flex-direction: column;
    margin-right: 0 !important;
  }
  .page-index .cnt_06 li dl {
    flex: 1;
  }

  /* municipality: cards that previously relied on matchHeight */
  .page-municipality .cnt_03 ul {
    display: flex;
    align-items: stretch;
    gap: 31px;
    justify-content: flex-start;
  }
  .page-municipality .cnt_03 li {
    display: flex;
    flex-direction: column;
    margin-right: 0 !important;
  }
  .page-municipality .cnt_03 li dl {
    flex: 1;
  }

  .page-municipality .cnt_05 ul {
    display: flex;
    align-items: stretch;
    justify-content: center;
  }
  .page-municipality .cnt_05 li {
    display: flex;
    flex-direction: column;
  }
  .page-municipality .cnt_05 li dl {
    flex: 1;
  }

  .page-municipality .cnt_06 ul {
    display: flex;
    align-items: stretch;
    justify-content: center;
  }
  .page-municipality .cnt_06 li {
    display: flex;
    flex-direction: column;
  }
  .page-municipality .cnt_06 li dl {
    flex: 1;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .lazy-load-section {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .slide-track {
    animation: none !important;
  }
}
