/**
 * JobJepang responsive foundation
 *
 * A shared editorial system for every template. This file intentionally loads
 * after page CSS: old templates keep their semantic markup while width, type,
 * spacing, media, grids, navigation, CTA and footer follow one contract.
 */

/* ============================================================
   Document, measure and reusable primitives
   ============================================================ */

html {
  scroll-behavior: auto;
  scroll-padding-top: 104px;
}

body {
  color: var(--jj-text-primary);
  background: var(--jj-bg-white);
  font-size: var(--jj-body-size);
  line-height: var(--jj-body-leading);
  font-feature-settings: "palt" 1;
  font-kerning: normal;
  line-break: strict;
}

.jj-container,
.jj-strong-hero-inner,
.jj-page-gj-hero-inner {
  width: min(var(--jj-container-max), calc(100% - (2 * var(--jj-gutter))));
  max-width: var(--jj-container-max);
  margin-inline: auto;
  padding-inline: 0;
}

.jj-container-narrow,
.jj-page-gaikokujin-slim {
  width: min(var(--jj-reading-max), calc(100% - (2 * var(--jj-gutter))));
  max-width: var(--jj-reading-max);
  margin-inline: auto;
  padding-inline: 0;
}

.jj-section,
.jj-strong-section,
.jj-page-gaikokujin-section,
.jj-page-gj-section,
.jj-page-seido-section,
.jj-co-section,
.jj-contact-form-section,
.jj-contact-info {
  padding-block: var(--jj-section-space);
}

.jj-section-head,
.jj-section-head-tight,
.jj-page-gj .jj-section-head {
  width: min(100%, 790px);
  max-width: 790px;
  margin: 0 0 clamp(36px, 4vw, 52px);
  text-align: left;
}

.jj-section-head .jj-section-lede,
.jj-section-lede {
  max-width: 46rem;
  margin-top: 16px;
  color: var(--jj-text-muted);
  font-size: 16px;
  line-height: var(--jj-body-leading);
}

.jj-h1,
.jj-fp-h1,
.jj-strong-hero-h1,
.jj-contact-hero-h1,
.jj-co-hero-h1,
.jj-page-gj-h1,
.jj-page-seido-h1,
.jj-page-gaikokujin-h1 {
  font-size: var(--jj-h1-size);
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: -0.025em;
}

.jj-h2,
.jj-section-head .jj-h2,
.jj-page-gj .jj-section-head .jj-h2 {
  font-size: var(--jj-h2-size);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
}

.jj-h3 {
  font-size: var(--jj-h3-size);
  line-height: 1.55;
}

.jj-body,
main p,
main li,
main dd {
  overflow-wrap: break-word;
}

main img {
  border-radius: 0;
}

.jj-card,
main [class*="-card"],
main [class*="-item"],
main details,
.jj-table-scroll,
.jj-page-gj-comparison-wrap,
.jj-page-seido-table-scroll {
  border-radius: 0;
  box-shadow: none;
}

/* ============================================================
   Header
   ============================================================ */

.jj-noticebar {
  min-height: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 15px;
  padding: 6px var(--jj-gutter);
  color: #fff;
  background: var(--jj-deep);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: center;
}

.jj-noticebar strong {
  padding-right: 15px;
  border-right: 1px solid rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

.jj-noticebar a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
}

.jj-site-header {
  position: sticky;
  top: 0;
  z-index: var(--jj-z-sticky);
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--jj-line);
  box-shadow: none;
}

body.admin-bar .jj-site-header {
  top: 32px;
}

.jj-site-header-inner {
  min-height: 78px;
  gap: 24px;
  padding-block: 0;
}

.jj-site-header-brand {
  display: grid;
  gap: 3px;
}

.jj-site-logo-tagline {
  color: #56636b;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.jj-site-logo-img img,
.the-custom-logo-link img,
.custom-logo-link img {
  width: 182px;
  max-width: 182px;
  height: auto;
}

.jj-mega-nav-list {
  gap: 0;
}

.jj-mega-nav-trigger,
.jj-mega-nav-link {
  min-height: 48px;
  padding-inline: 11px;
  border-radius: 0;
  color: #303b42;
  font-size: 13px;
  font-weight: 600;
}

.jj-mega-panel {
  margin-top: 0;
  border-radius: 0;
  box-shadow: 0 10px 24px rgba(21, 56, 78, 0.08);
}

.jj-mega-panel-list a,
.jj-mega-col-featured,
.jj-mega-overall-link {
  border-radius: 0;
}

.jj-site-header-cta-btn {
  min-height: 48px;
  background: #fff;
  color: var(--jj-primary);
  border: 1px solid var(--jj-primary);
}

.jj-site-header-cta-btn:hover {
  background: var(--jj-primary);
  color: #fff;
  box-shadow: none;
}

/* ============================================================
   Buttons, links and content media
   ============================================================ */

.jj-btn {
  min-height: 52px;
  padding: 0 24px;
  border-radius: 2px;
  font-size: 15px;
  line-height: 1.5;
}

.jj-btn-primary {
  background: #b94824;
}

.jj-btn-primary:hover {
  background: #963819;
  box-shadow: none;
  transform: none;
}

.jj-btn.jj-site-header-cta-btn {
  min-height: 48px;
  color: var(--jj-primary);
  background: #fff;
  border: 1px solid var(--jj-primary);
}

.jj-btn.jj-site-header-cta-btn:hover {
  color: #fff;
  background: var(--jj-primary);
  border-color: var(--jj-primary);
}

.jj-mega-nav-link.jj-mega-nav-link--beginner {
  min-height: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 6px;
  padding: 8px 12px;
  color: var(--jj-cta-bg);
  background: #fff2e8;
  border: 1px solid #f0d7c4;
  font-size: 12px;
  font-weight: 700;
}

.jj-mega-nav-link.jj-mega-nav-link--beginner::before,
.jj-footer-beginner::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 1.25em;
  height: 1.25em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23F7D64A' stroke='%23fff' stroke-width='1.25' stroke-linejoin='round' d='M3 2.5 12 8v13.5l-9-5.4z'/%3E%3Cpath fill='%2347A447' stroke='%23fff' stroke-width='1.25' stroke-linejoin='round' d='m21 2.5-9 5.5v13.5l9-5.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.jj-mega-nav-link.jj-mega-nav-link--beginner:hover {
  color: #fff;
  background: var(--jj-cta-bg);
  border-color: var(--jj-cta-bg);
}

.jj-btn-secondary {
  color: var(--jj-primary);
  background: #fff;
  border-color: var(--jj-primary);
}

.jj-btn-secondary:hover {
  color: #fff;
  background: var(--jj-primary);
  transform: none;
}

.jj-link,
.jj-fp-section-link a {
  text-underline-offset: 4px;
}

.jj-tag-new,
.jj-fp-why-role,
.jj-page-gj-hero-caption {
  border-radius: 2px;
}

.jj-fp-hero-img,
.jj-page-gaikokujin-hero-photo img,
.jj-page-gj-hero-img,
.jj-strong-hero-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* ============================================================
   Front page
   ============================================================ */

.jj-fp-hero {
  padding-block: var(--jj-section-space-compact);
  overflow: hidden;
  background: #fff;
  border-top: 5px solid var(--jj-primary);
}

.jj-fp-hero-grid {
  grid-template-columns: minmax(0, 1.06fr) minmax(380px, 0.94fr);
  gap: clamp(48px, 5vw, 64px);
  align-items: center;
}

.jj-fp-h1 {
  margin: 0;
  color: var(--jj-deep);
  font-size: clamp(2rem, 1.6rem + 2vw, 3.25rem);
}

.jj-fp-h1 .jj-nowrap {
  display: block;
  white-space: nowrap;
}

.jj-fp-h1 .jj-nowrap:last-child {
  display: block;
  color: var(--jj-primary);
}

.jj-fp-hero-lede {
  max-width: 40rem;
  margin: 26px 0 0;
  color: var(--jj-text-secondary);
  font-size: 17px;
  line-height: 1.9;
}

.jj-fp-hero-trust {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--jj-line);
  border-bottom: 1px solid var(--jj-line);
  border-radius: 0;
  margin: 25px 0 0;
}

.jj-fp-hero-trust li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  line-height: 1.4;
}

.jj-fp-hero-trust li:first-child {
  padding-left: 0;
}

.jj-fp-hero-trust li + li {
  border-left: 1px solid var(--jj-line);
}

.jj-fp-hero-trust li::after {
  display: none;
}

.jj-fp-hero-trust strong {
  color: var(--jj-primary);
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.jj-fp-hero-trust strong small {
  margin-left: 2px;
  font-size: 12px;
  letter-spacing: 0;
}

.jj-fp-hero-trust li > span {
  color: var(--jj-deep);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
}

.jj-fp-hero-ctas {
  align-items: center;
  gap: 24px;
  margin: 27px 0 12px;
}

.jj-fp-hero-ctas .jj-btn {
  min-height: 56px;
  font-size: 15px;
}

.jj-fp-hero-link {
  display: inline-block;
  padding-bottom: 3px;
  color: var(--jj-primary);
  border-bottom: 1px solid currentColor;
  font-weight: 600;
  text-decoration: none;
}

.jj-fp-hero-note {
  display: block;
  color: #6e777d;
  font-size: 11px;
  line-height: 1.7;
}

.jj-fp-hero-photo {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
}

.jj-fp-hero-photo::before {
  content: "";
  position: absolute;
  inset: -12px 12px 12px -12px;
  z-index: 0;
  background: var(--jj-pale);
}

.jj-fp-hero-img {
  position: relative;
  z-index: 1;
  height: 100%;
  border-radius: 0;
  object-position: var(--jj-hero-object-position, 50% 50%);
}

.jj-fp-hero-photo-tag {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  margin: 0;
  padding: 10px 13px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: rgba(21, 56, 78, 0.92);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.jj-fp-hero-photo-tag .jj-fp-pin {
  background: #fff;
}

.jj-beginner-lead {
  padding-block: 40px;
  background: #fff;
  border-top: 1px solid var(--jj-soft-line);
}

.jj-beginner-lead-inner {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: var(--jj-grid-gap);
  padding: 28px 0 28px 28px;
  border: 0;
  border-left: 4px solid var(--jj-accent);
  box-shadow: none;
}

.jj-beginner-lead-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.jj-fp-why-grid,
.jj-fp-num-grid,
.jj-fp-prog-grid,
.jj-fp-ind-grid,
.jj-fp-edu-grid,
.jj-fp-hub-grid {
  gap: 0;
  border-top: 2px solid var(--jj-deep);
}

.jj-fp-why-card,
.jj-fp-num-card,
.jj-fp-prog-card,
.jj-fp-ind-card,
.jj-fp-edu-card,
.jj-fp-hub-card {
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--jj-line);
  border-bottom: 1px solid var(--jj-line);
  border-radius: 0;
  box-shadow: none;
}

.jj-fp-why-card,
.jj-fp-num-card {
  padding: 28px 24px;
  text-align: left;
}

.jj-fp-num-note {
  border-radius: 0;
}

.jj-fp-compare-table-wrap,
.jj-fp-compare-card {
  border-radius: 0;
  box-shadow: none;
}

.jj-fp-faq-list,
.jj-fp-faq-item {
  border-radius: 0;
}

.jj-fp-faq-list {
  border-top: 2px solid var(--jj-deep);
}

.jj-fp-faq-item {
  border: 0;
  border-bottom: 1px solid var(--jj-line);
}

/* ============================================================
   Lower-page heroes and flexible sections
   ============================================================ */

.jj-strong-hero,
.jj-co-hero,
.jj-contact-hero,
.jj-page-seido-hero,
.jj-page-gaikokujin-hero,
.jj-page-gj-hero {
  padding-block: var(--jj-section-space-compact);
  background: #fff;
  border-top: 5px solid var(--jj-primary);
  border-bottom: 1px solid var(--jj-line);
  text-align: left;
}

.jj-page-gaikokujin-hero {
  border-top-color: var(--jj-accent);
}

.jj-strong-hero-inner {
  max-width: var(--jj-container-max);
}

.jj-strong-hero-h1,
.jj-strong-hero-sub {
  max-width: 38rem;
}

.jj-strong-hero-sub,
.jj-strong-principle-body,
.jj-strong-issue-body,
.jj-page-seido-lead,
.jj-page-seido-detail p,
.jj-page-seido-about-body p {
  font-size: 16px;
  line-height: var(--jj-body-leading);
}

.jj-contact-hero-h1,
.jj-contact-hero-lede {
  margin-left: 0;
  margin-right: 0;
}

.jj-contact-reassurance {
  max-width: var(--jj-reading-max);
  margin-left: 0;
  padding: 18px 0;
  justify-content: flex-start;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--jj-line);
  border-bottom: 1px solid var(--jj-line);
  border-radius: 0;
}

.jj-page-gaikokujin-hero-grid,
.jj-page-gj-hero-grid {
  grid-template-columns: minmax(0, 1.06fr) minmax(380px, 0.94fr);
  gap: clamp(48px, 5vw, 64px);
}

.jj-page-gaikokujin-h1,
.jj-page-gj-h1 {
  color: var(--jj-deep);
}

.jj-page-gaikokujin-lead,
.jj-page-gj-lead {
  font-size: 17px;
  line-height: 1.9;
}

.jj-page-gaikokujin-two {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: var(--jj-grid-gap);
}

.jj-page-gaikokujin-cases,
.jj-page-gaikokujin-cards,
.jj-page-gaikokujin-pain,
.jj-page-gj-stats-grid,
.jj-page-gj-challenges-grid,
.jj-page-gj-solutions-grid,
.jj-page-gj-occupations-grid,
.jj-page-gj-related-grid,
.jj-page-seido-overview-grid,
.jj-co-cards,
.jj-co-msg-grid,
.jj-contact-info-list {
  gap: 0;
  border-top: 2px solid var(--jj-deep);
}

.jj-page-gaikokujin-case-card,
.jj-page-gaikokujin-cards article,
.jj-page-gaikokujin-pain article,
.jj-page-gj-stat,
.jj-page-gj-challenge-card,
.jj-page-gj-solution-card,
.jj-page-gj-occupation-card,
.jj-page-gj-related-card,
.jj-page-seido-overview-card,
.jj-co-card,
.jj-co-msg,
.jj-contact-info-item {
  border: 0;
  border-right: 1px solid var(--jj-line);
  border-bottom: 1px solid var(--jj-line);
  border-radius: 0;
  box-shadow: none;
}

.jj-strong-principles-list {
  gap: 0;
  border-top: 2px solid var(--jj-deep);
}

.jj-strong-principle-card,
.jj-strong-issue-card {
  border: 0;
  border-bottom: 1px solid var(--jj-line);
  border-radius: 0;
  box-shadow: none;
}

.jj-strong-issues-grid {
  gap: 0;
  border-top: 2px solid var(--jj-deep);
}

.jj-strong-issue-card {
  border-right: 1px solid var(--jj-line);
}

.jj-co .jj-h2 {
  text-align: left;
}

.jj-co-badges {
  gap: 0;
  border-top: 2px solid var(--jj-deep);
  border-bottom: 1px solid var(--jj-line);
}

.jj-co-badge {
  border: 0;
  border-right: 1px solid var(--jj-line);
  border-radius: 0;
  box-shadow: none;
}

.jj-co-badge:last-child {
  border-right: 0;
}

.jj-co-overview {
  border-radius: 0;
}

.jj-contact-form {
  border: 0;
  border-top: 2px solid var(--jj-deep);
  border-bottom: 1px solid var(--jj-line);
  border-radius: 0;
  padding: clamp(28px, 4vw, 48px) 0;
}

.jj-contact-form .wpforms-field input,
.jj-contact-form .wpforms-field textarea,
.jj-contact-form .wpforms-field select,
.jj-contact-form button[type="submit"].wpforms-submit {
  border-radius: 2px !important;
}

.jj-page-seido-overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.jj-page-seido-choose-item,
.jj-page-seido-faq-item,
.jj-page-gj-faq-item {
  border-radius: 0;
  box-shadow: none;
}

/* ============================================================
   WordPress-first shared content pages
   ============================================================ */

.jj-content-breadcrumb {
  display: flex;
  gap: 10px;
  padding-block: 18px;
  color: var(--jj-text-muted);
  font-size: 12px;
}

.jj-content-breadcrumb a {
  color: var(--jj-primary);
}

.jj-content-hero {
  padding-block: var(--jj-section-space-compact);
  border-top: 5px solid var(--jj-primary);
  border-bottom: 1px solid var(--jj-line);
}

.jj-content-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(380px, 0.94fr);
  gap: clamp(48px, 5vw, 64px);
  align-items: center;
}

.jj-content-hero-copy {
  max-width: 42rem;
}

.jj-content-hero-copy .jj-h1 {
  margin: 14px 0 0;
  color: var(--jj-deep);
}

body.page-id-48 .jj-content-hero-copy .jj-h1 {
  text-wrap: balance;
}

.jj-content-hero-lede {
  margin: 22px 0 28px;
  color: var(--jj-text-secondary);
  font-size: 17px;
  line-height: 1.9;
}

.jj-content-hero-photo {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
}

.jj-content-hero-photo::before {
  content: "";
  position: absolute;
  inset: -12px 12px 12px -12px;
  background: var(--jj-pale);
}

.jj-content-hero-photo img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
}

.jj-content-intro {
  padding-block: clamp(42px, 6vw, 72px);
}

.jj-content-intro p {
  margin: 0;
  color: var(--jj-deep);
  font-size: clamp(1.2rem, 1rem + 0.6vw, 1.5rem);
  font-weight: 600;
  line-height: 1.9;
}

.jj-content-note {
  margin-top: 24px;
  padding: 18px 0;
  color: var(--jj-text-muted);
  border-top: 1px solid var(--jj-line);
  border-bottom: 1px solid var(--jj-line);
  font-size: 13px;
  line-height: 1.8;
}

.jj-content-items {
  border-top: 2px solid var(--jj-deep);
}

.jj-content-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 20px;
  padding-block: 28px;
  border-bottom: 1px solid var(--jj-line);
}

.jj-content-item-number {
  color: var(--jj-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.jj-content-item .jj-h3,
.jj-content-item .jj-body {
  margin: 0;
}

.jj-content-item .jj-body {
  margin-top: 8px;
  color: var(--jj-text-secondary);
  line-height: 1.9;
}

.jj-content-sources {
  padding-block: 40px;
  border-top: 1px solid var(--jj-line);
}

.jj-content-sources ul {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}

.jj-content-sources a {
  color: var(--jj-primary);
}

.jj-content-sources small {
  color: var(--jj-text-muted);
}

/* ============================================================
   Shared CTA and footer
   ============================================================ */

.jj-footer-cta,
.jj-page-gj-final-cta,
.jj-page-seido-final-cta,
.jj-co-cta {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-block: var(--jj-section-space-compact);
  color: #fff;
  background: var(--jj-primary);
  border: 0;
  border-top: 8px solid var(--jj-deep);
  border-radius: 0;
  text-align: left;
}

.jj-footer-cta > .jj-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--jj-grid-gap);
}

.jj-footer-cta-kicker {
  display: block;
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.jj-footer-cta-h {
  margin: 0;
  color: #fff;
  text-align: left;
}

.jj-footer-cta-lede {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.8);
}

.jj-footer-cta-btns {
  grid-column: 2;
}

.jj-footer-cta .jj-btn-primary {
  color: var(--jj-deep);
  background: #fff;
}

.jj-footer-cta .jj-btn-primary:hover {
  color: #fff;
  background: var(--jj-deep);
}

.jj-site-footer {
  color: var(--jj-text-primary);
  background: #f2f4f4;
  border-top: 1px solid var(--jj-line);
}

.jj-footer-sitemap {
  padding-block: 60px 32px;
}

.jj-footer-sitemap-grid {
  grid-template-columns: 2fr repeat(3, minmax(0, 1fr));
  gap: clamp(32px, 4vw, 48px);
}

.jj-footer-sitemap-nav {
  display: contents;
}

.jj-footer-sitemap-list {
  gap: 11px;
}

.jj-footer-brand-logo {
  display: inline-block;
  line-height: 0;
}

.jj-footer-brand-logo img {
  width: 184px;
  height: auto;
}

.jj-footer-brand strong {
  display: block;
  margin: 21px 0 13px;
  color: var(--jj-deep);
  font-size: 15px;
}

.jj-footer-brand p {
  margin: 0;
  color: var(--jj-text-muted);
  font-size: 12px;
  line-height: 1.8;
}

.jj-footer-beginner {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding-bottom: 3px;
  color: var(--jj-cta-bg);
  border-bottom: 1px solid currentColor;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.jj-footer-info-grid {
  grid-template-columns: 1.5fr 1fr;
}

.jj-footer-bottom {
  border-color: #cfd5d8;
}

.jj-footer-disclaimer {
  color: var(--jj-text-muted);
}

/* ============================================================
   Tablet and mobile
   ============================================================ */

@media (max-width: 1099.98px) {
  .jj-site-header-cta {
    display: none;
  }

  .jj-mega-toggle {
    display: inline-flex;
    border-radius: 0;
  }

  .jj-site-nav {
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  .jj-mega-nav {
    position: static;
  }

  .jj-mega-nav-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: var(--jj-z-dropdown);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 0;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--jj-line);
    border-radius: 0;
    box-shadow: 0 10px 24px rgba(21, 56, 78, 0.08);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  .jj-mega-nav.is-mobile-open .jj-mega-nav-list {
    display: flex;
  }

  .jj-mega-nav-trigger,
  .jj-mega-nav-link {
    width: 100%;
    justify-content: space-between;
  }

  .jj-mega-nav-link.jj-mega-nav-link--beginner {
    justify-content: flex-start;
    margin: 0 0 8px;
    padding: 12px 10px;
    border: 0;
    border-left: 3px solid var(--jj-cta-bg);
  }

  .jj-mega-panel {
    position: static;
    min-width: 0;
    margin: 0 0 8px;
    padding: 8px;
    border: 0;
    background: var(--jj-bg-section-alt);
    box-shadow: none;
  }

  .jj-mega-panel-cols {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .jj-page-gaikokujin-hero-grid,
  .jj-page-gj-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .jj-page-gaikokujin-hero-copy,
  .jj-page-gj-hero-text {
    max-width: var(--jj-reading-max);
  }

  .jj-page-gaikokujin-hero-photo img,
  .jj-page-gj-hero-img {
    aspect-ratio: 16 / 10;
  }

  .jj-beginner-lead-inner {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  }

  .jj-page-gaikokujin-two {
    grid-template-columns: minmax(0, 1fr);
  }

  .jj-footer-sitemap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jj-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 899.98px) {
  .jj-fp-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .jj-fp-hero-copy {
    max-width: var(--jj-reading-max);
  }

  .jj-fp-hero-photo,
  .jj-fp-hero-img {
    aspect-ratio: 16 / 10;
  }

  .jj-content-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .jj-content-hero-photo {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 767.98px) {
  html {
    scroll-padding-top: 76px;
  }

  body.admin-bar .jj-site-header {
    top: 46px;
  }

  .jj-noticebar {
    padding-inline: var(--jj-gutter);
    font-size: 11px;
  }

  .jj-noticebar strong {
    padding-right: 0;
    border-right: 0;
  }

  .jj-noticebar a {
    display: none;
  }

  .jj-noticebar span {
    display: none;
  }

  .jj-site-header-inner {
    min-height: 68px;
  }

  .jj-site-logo-img img,
  .the-custom-logo-link img,
  .custom-logo-link img {
    width: 154px;
    max-width: 154px;
    height: auto;
  }

  .jj-section-head,
  .jj-section-head-tight,
  .jj-page-gj .jj-section-head {
    margin-bottom: 32px;
  }

  .jj-fp-hero {
    padding-block: 40px 48px;
  }

  .jj-fp-hero-grid {
    gap: 0;
    align-items: start;
  }

  .jj-fp-hero-copy {
    display: contents;
    max-width: none;
  }

  .jj-h1,
  .jj-fp-h1,
  .jj-strong-hero-h1,
  .jj-contact-hero-h1,
  .jj-co-hero-h1,
  .jj-page-gj-h1,
  .jj-page-seido-h1,
  .jj-page-gaikokujin-h1 {
    font-size: clamp(1.8rem, 8vw, 2.25rem);
    line-height: 1.42;
  }

  .jj-fp-hero .jj-eyebrow {
    order: 1;
    margin: 0 0 12px;
  }

  .jj-fp-h1 {
    order: 2;
    margin: 0 0 24px;
  }

  .jj-fp-hero-photo {
    order: 6;
    width: 100%;
    margin: 12px 0 0;
  }

  .jj-h2,
  .jj-section-head .jj-h2,
  .jj-page-gj .jj-section-head .jj-h2 {
    font-size: clamp(1.65rem, 7vw, 2rem);
  }

  .jj-fp-hero-lede,
  .jj-page-gaikokujin-lead,
  .jj-page-gj-lead,
  .jj-contact-hero-lede {
    font-size: 16px;
  }

  .jj-fp-hero-lede {
    order: 3;
    margin: 0 0 24px;
  }

  .jj-fp-hero-ctas,
  .jj-page-gaikokujin-hero-cta {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .jj-fp-hero-ctas {
    order: 4;
    margin: 0 0 24px;
  }

  .jj-fp-hero-ctas .jj-btn,
  .jj-page-gaikokujin-hero-cta .jj-btn {
    width: 100%;
  }

  .jj-fp-hero-trust {
    order: 5;
    grid-template-columns: minmax(0, 1fr);
    margin: 0 0 24px;
  }

  .jj-fp-hero-trust li,
  .jj-fp-hero-trust li:first-child {
    padding: 13px 0;
    border-left: 0;
    border-bottom: 1px solid var(--jj-soft-line);
  }

  .jj-fp-hero-trust li {
    gap: 8px;
  }

  .jj-fp-hero-trust strong {
    font-size: 29px;
  }

  .jj-fp-hero-trust li:last-child {
    border-bottom: 0;
  }

  .jj-fp-hero-link {
    align-self: flex-start;
  }

  .jj-fp-hero-note {
    order: 7;
    margin: 16px 0 0;
  }

  .jj-content-hero-copy {
    max-width: none;
  }

  .jj-content-hero-lede {
    font-size: 16px;
  }

  .jj-content-hero-photo {
    margin-top: 8px;
  }

  .jj-content-item {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
  }

  .jj-beginner-lead-inner {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 0 0 20px;
  }

  .jj-beginner-lead-photo img {
    aspect-ratio: 16 / 10;
  }

  .jj-fp-why-grid,
  .jj-fp-num-grid,
  .jj-fp-prog-grid,
  .jj-fp-ind-grid,
  .jj-fp-edu-grid,
  .jj-fp-hub-grid,
  .jj-page-gaikokujin-cases,
  .jj-page-gaikokujin-cards,
  .jj-page-gaikokujin-pain,
  .jj-page-gj-stats-grid,
  .jj-page-gj-challenges-grid,
  .jj-page-gj-solutions-grid,
  .jj-page-gj-occupations-grid,
  .jj-page-gj-related-grid,
  .jj-page-seido-overview-grid,
  .jj-co-cards,
  .jj-co-msg-grid,
  .jj-contact-info-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .jj-fp-why-card,
  .jj-fp-num-card,
  .jj-fp-prog-card,
  .jj-fp-ind-card,
  .jj-fp-edu-card,
  .jj-fp-hub-card,
  .jj-page-gaikokujin-case-card,
  .jj-page-gaikokujin-cards article,
  .jj-page-gaikokujin-pain article,
  .jj-page-gj-stat,
  .jj-page-gj-challenge-card,
  .jj-page-gj-solution-card,
  .jj-page-gj-occupation-card,
  .jj-page-gj-related-card,
  .jj-page-seido-overview-card,
  .jj-co-card,
  .jj-co-msg,
  .jj-contact-info-item,
  .jj-strong-issue-card {
    border-right: 0;
  }

  .jj-strong-principle-card {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 16px;
    padding: 28px 0;
  }

  .jj-strong-principle-num {
    font-size: 36px;
  }

  .jj-co-badges {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jj-co-badge:nth-child(2n) {
    border-right: 0;
  }

  .jj-footer-cta > .jj-container {
    grid-template-columns: minmax(0, 1fr);
  }

  .jj-footer-cta-copy,
  .jj-footer-cta-btns {
    grid-column: 1;
    grid-row: auto;
  }

  .jj-footer-cta-btns,
  .jj-footer-cta-btns .jj-btn {
    width: 100%;
  }

  .jj-footer-sitemap-grid,
  .jj-footer-info-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .jj-footer-brand {
    grid-column: auto;
  }
}

/* ============================================================
   Generic WordPress content resilience

   Some legacy Gutenberg pages contain mismatched closing tags. Browsers then
   recover the HTML by moving later blocks outside .jj-page-content and its
   narrow container. Keep those recovered blocks inside the same editorial
   measure so a malformed database fragment cannot create a full-viewport
   paragraph, table or CTA.
   ============================================================ */

.jj-page-article {
  padding-bottom: clamp(64px, 8vw, 112px);
}

.jj-page-header {
  padding-block: clamp(24px, 4vw, 48px) clamp(24px, 3vw, 36px);
}

.jj-page-title {
  margin: 0;
}

.jj-page-content {
  min-width: 0;
  padding-bottom: clamp(40px, 6vw, 72px);
}

.jj-page-content > .wp-block-group:has(> h2:only-child) {
  display: none;
}

.jj-page-article > :where(.wp-block-group, .wp-block-table, figure, section):not(.jj-container) {
  width: min(var(--jj-reading-max), calc(100% - (2 * var(--jj-gutter))));
  max-width: var(--jj-reading-max);
  margin-inline: auto;
}

.jj-page-article > .wp-block-group {
  color: var(--jj-text-primary);
  font-size: 16px;
  line-height: 1.9;
}

.jj-page-article > .wp-block-group > * + * {
  margin-top: 24px;
}

.jj-page-article > .wp-block-group p {
  max-width: 68ch;
  margin-bottom: 0;
}

.jj-page-article > .wp-block-group h2 {
  margin: clamp(48px, 6vw, 72px) 0 16px;
  font-size: var(--jj-h2-size);
}

.jj-page-article > .wp-block-group h3 {
  margin: clamp(32px, 4vw, 48px) 0 12px;
  font-size: var(--jj-h3-size);
}

.jj-page-article :where(.wp-block-image, .wp-block-image figure) {
  max-width: 100%;
}

.jj-page-article :where(.wp-block-image img, .wp-block-group img) {
  display: block;
  max-width: 100%;
  height: auto;
}

.jj-page-article .wp-block-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.6fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}

.jj-page-article .wp-block-column {
  min-width: 0;
}

.jj-page-article > .wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.jj-page-article > .wp-block-table table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
}

.jj-page-article > .wp-block-table :where(th, td) {
  padding: 14px 16px;
  border: 1px solid var(--jj-line);
  text-align: left;
  vertical-align: top;
}

.jj-page-article > .wp-block-table th {
  width: 30%;
  color: var(--jj-deep);
  background: var(--jj-pale);
  font-weight: 700;
}

/* Every page already ends with the shared site CTA. Suppress only escaped
   legacy CTA blocks to avoid duplicate conversion prompts and overlapping
   button styles. Correctly nested CTA components remain untouched. */
.jj-page-article > .jj-cta-block {
  display: none;
}

@media (max-width: 767.98px) {
  .jj-page-article {
    padding-bottom: 64px;
  }

  .jj-page-header {
    padding-block: 24px;
  }

  .jj-page-content {
    padding-bottom: 40px;
  }

  .jj-page-article .wp-block-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .jj-page-article > .wp-block-table table {
    min-width: 520px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
