/**
 * Nanban Landing Compact — tight mobile/desktop spacing (loads LAST)
 * Fixes double padding, excess min-heights, duplicate blocks
 */

/* ═══ HERO — no forced viewport trap ═══ */
html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero {
  min-height: 0 !important;
  height: auto !important;
  padding-bottom: 0 !important;
  justify-content: flex-start !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-stage {
  width: min(1180px, calc(100% - 20px)) !important;
  padding-top: calc(62px + env(safe-area-inset-top, 0px)) !important;
  gap: 14px !important;
  padding-bottom: 12px !important;
}

@media (min-width: 1024px) {
  html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-stage {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.75fr) !important;
    gap: 20px !important;
    align-items: stretch !important;
  }
}

/* Single padding source when stage wraps content */
html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-stage .nb-hero-content {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: clamp(14px, 2.5vw, 22px) clamp(16px, 3vw, 28px) clamp(14px, 2vw, 20px) !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-content:not(.nb-hero-stage *) {
  padding-top: calc(68px + env(safe-area-inset-top, 0px)) !important;
}

/* Tighter type rhythm */
html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-kicker {
  margin-bottom: 0.65rem !important;
  font-size: 0.62rem !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-title {
  margin-bottom: 0.65rem !important;
  font-size: clamp(1.65rem, 5.5vw, 3.25rem) !important;
  line-height: 1.08 !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra #nbHeroSchoolName,
html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-school-name {
  font-size: clamp(1.75rem, 6.5vw, 3.5rem) !important;
  line-height: 1.06 !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-journey-rail {
  margin-bottom: 0.75rem !important;
  padding: 8px 10px !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-sub {
  margin-bottom: 0.85rem !important;
  font-size: 0.88rem !important;
  line-height: 1.55 !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-trust-chips {
  margin-bottom: 0.45rem !important;
  gap: 6px !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-contact {
  margin-bottom: 0.45rem !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-glass-cta {
  padding: 10px !important;
  margin-bottom: 0.75rem !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-cta {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  margin-bottom: 0 !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-cta .nb-btn-primary {
  grid-column: 1 / -1 !important;
  min-height: 46px !important;
  padding: 12px 16px !important;
  font-size: 0.88rem !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-cta .nb-btn-outline {
  min-height: 42px !important;
  padding: 10px 12px !important;
  font-size: 0.72rem !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-stats {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px !important;
  margin-top: 0.75rem !important;
}

@media (min-width: 640px) {
  html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-stats {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-cta {
    grid-template-columns: auto auto auto auto !important;
    display: flex !important;
    flex-wrap: wrap !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-cta .nb-btn-primary {
    grid-column: auto !important;
  }
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-stat {
  padding: 10px 8px !important;
  border-radius: 12px !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-stat strong {
  font-size: 0.95rem !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-stat span {
  font-size: 0.62rem !important;
}

/* Duplicate trust row — hidden (chips already show this) */
html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-trust {
  display: none !important;
}

/* Scroll hint — hide (saves bottom gap) */
html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-scroll {
  display: none !important;
}

/* Cinema panel — compact + photo fill */
html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-cinema-panel {
  min-height: 0 !important;
  aspect-ratio: 16 / 10 !important;
  max-height: 280px !important;
  border-radius: 20px !important;
}

@media (min-width: 1024px) {
  html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-cinema-panel {
    aspect-ratio: 4 / 5 !important;
    max-height: none !important;
    min-height: 320px !important;
  }
}

@media (max-width: 1023px) {
  html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-cinema-panel {
    order: 2 !important;
    max-height: 200px !important;
    aspect-ratio: 2.2 / 1 !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-stage .nb-hero-content {
    order: 1 !important;
  }
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-cinema-panel::after {
  top: 10px !important;
  right: 10px !important;
  font-size: 8px !important;
  padding: 4px 8px !important;
}

/* ═══ PHOTO GALLERY MOSAIC ═══ */
.nb-photo-gallery {
  padding: clamp(32px, 5vw, 56px) clamp(16px, 4vw, 40px) !important;
  max-width: 1180px;
  margin: 0 auto;
  background: #f3f0eb;
}

.nb-photo-gallery .nb-section-head {
  text-align: center;
  margin-bottom: clamp(20px, 3vw, 32px);
}

.nb-photo-gallery .nb-section-kicker {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0d9488;
  margin: 0 0 8px;
}

.nb-photo-gallery .nb-section-title {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 3.5vw, 2rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
}

.nb-photo-gallery .nb-section-lead {
  margin: 0 auto;
  max-width: 42ch;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.55;
}

.nb-photo-mosaic {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: auto;
  gap: 8px;
}

@media (min-width: 768px) {
  .nb-photo-mosaic {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 140px 140px;
    gap: 10px;
  }
}

.nb-photo-tile {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #e2e8f0;
  min-height: 120px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.nb-photo-tile img,
.nb-bento-photo img,
.nb-cinema-photo-collage img {
  width: 100%;
  height: 100%;
  min-height: 100px;
  object-fit: cover;
  display: block;
  background: #e2e8f0;
}

.nb-bento-photo {
  min-height: 88px;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

.nb-photo-tile img {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.nb-photo-tile:hover img {
  transform: scale(1.06);
}

.nb-photo-tile__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 10px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.75));
}

@media (min-width: 768px) {
  .nb-photo-tile--hero {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 100%;
  }

  .nb-photo-tile--wide {
    grid-column: span 2;
  }
}

/* Cinema photo collage behind animation */
.nb-cinema-photo-collage {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  opacity: 0.35;
  filter: saturate(1.05);
}

.nb-cinema-photo-collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nb-cinema-photo-collage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(236, 253, 245, 0.75));
  pointer-events: none;
}

#loginScreen .nb-hero-cinema-panel .nb-docomo-scene {
  z-index: 2;
}

/* Bento card photos */
.nb-bento-photo {
  width: 100%;
  height: 108px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.nb-bento-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (min-width: 768px) {
  .nb-bento-photo {
    height: 120px;
  }
}

/* ═══ SECTIONS — less vertical air ═══ */
html.nb-ivory-theme #loginScreen.nb-ultra .nb-section {
  padding: clamp(40px, 7vw, 72px) clamp(16px, 4vw, 40px) !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-section-head {
  margin-bottom: clamp(20px, 3vw, 32px) !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-section-title {
  font-size: clamp(1.35rem, 3.2vw, 2.1rem) !important;
  line-height: 1.15 !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-enquiry-wrap {
  padding: clamp(40px, 7vw, 72px) clamp(16px, 4vw, 32px) !important;
}

html.nb-ivory-theme #loginScreen.nb-ultra .nb-marquee-band {
  padding: 10px 0 !important;
}

/* Nav compact mobile */
@media (max-width: 768px) {
  html.nb-ivory-theme #loginScreen.nb-ultra .nb-nav-links {
    gap: 4px !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-nav-btn {
    padding: 8px 10px !important;
    font-size: 0.62rem !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-nav-a {
    display: none !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-sub {
    display: none !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-journey-rail {
    margin-bottom: 0.5rem !important;
    padding: 6px 8px !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-journey-step {
    font-size: 7px !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-journey-step em {
    width: 22px !important;
    height: 22px !important;
    font-size: 9px !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-trust-chips {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 2px !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-trust-chip {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    font-size: 0.65rem !important;
    padding: 5px 10px !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-stats {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 4px !important;
    margin-top: 0.5rem !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-stat {
    padding: 6px 4px !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-stat strong {
    font-size: 0.72rem !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-stat span {
    font-size: 0.55rem !important;
    line-height: 1.2 !important;
  }

  html.nb-ivory-theme #loginScreen.nb-ultra .nb-hero-cinema-panel {
    max-height: 140px !important;
    aspect-ratio: 2.4 / 1 !important;
  }
}
