/* =========================================================
 * v1.5.2 Smartphone Perfect Fit / Independent Mobile Menu
 * ======================================================= */
:root{
  --nk-con-mobile-header-height:64px;
  --nk-con-mobile-cta-height:76px;
  --nk-con-safe-left:env(safe-area-inset-left,0px);
  --nk-con-safe-right:env(safe-area-inset-right,0px);
  --nk-con-safe-bottom:env(safe-area-inset-bottom,0px);
}

.nk-con-mobile-header,
.nk-con-mobile-drawer{display:none;}

@media (max-width:980px){
  html,
  body{
    width:100%;
    max-width:100%;
    overflow-x:hidden !important;
    -webkit-text-size-adjust:100%;
    text-size-adjust:100%;
  }

  *,*::before,*::after{box-sizing:border-box;}

  img,video,iframe,svg,canvas,table{
    max-width:100%;
  }

  iframe{display:block;}

  body.nk-construction-theme{
    padding-top:var(--nk-con-mobile-header-height);
    overflow-x:hidden !important;
  }

  body.nk-construction-theme.nk-con-mobile-menu-open,
  html.nk-con-mobile-menu-open{
    overflow:hidden !important;
    touch-action:none;
  }

  /* 親テーマ側のスマホナビが暴れる場合の保険。PC表示には影響させない。 */
  body.nk-construction-theme .nk-header,
  body.nk-construction-theme .site-header,
  body.nk-construction-theme header.wp-block-template-part,
  body.nk-construction-theme .wp-site-blocks > header,
  body.nk-construction-theme .main-navigation,
  body.nk-construction-theme .primary-navigation,
  body.nk-construction-theme .wp-block-navigation,
  body.nk-construction-theme .menu-toggle,
  body.nk-construction-theme .nk-mobile-menu{
    display:none !important;
  }

  .nk-con-mobile-header{
    display:block;
    position:fixed;
    top:0;
    left:0;
    right:0;
    z-index:100000;
    height:var(--nk-con-mobile-header-height);
    padding-left:var(--nk-con-safe-left);
    padding-right:var(--nk-con-safe-right);
    background:rgba(255,255,255,.96);
    color:#111827;
    border-bottom:1px solid rgba(15,23,42,.1);
    box-shadow:0 8px 24px rgba(15,23,42,.08);
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
  }

  .admin-bar .nk-con-mobile-header{top:46px;}
  body.admin-bar.nk-construction-theme{padding-top:calc(var(--nk-con-mobile-header-height) + 46px);}

  .nk-con-mobile-header__bar{
    height:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:0 14px;
  }

  .nk-con-mobile-header__brand{
    display:flex;
    align-items:center;
    min-width:0;
    max-width:calc(100vw - 154px);
    color:inherit;
    text-decoration:none;
    font-weight:900;
    letter-spacing:.02em;
  }

  .nk-con-mobile-header__logo-img{
    display:block;
    width:auto;
    max-width:min(190px,50vw);
    max-height:42px;
    object-fit:contain;
  }

  .nk-con-mobile-header__brand-text{
    display:block;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    font-size:1rem;
    line-height:1.25;
  }

  .nk-con-mobile-header__quick{
    display:flex;
    align-items:center;
    gap:8px;
    flex:0 0 auto;
  }

  .nk-con-mobile-header__tel{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:42px;
    padding:0 12px;
    border-radius:999px;
    background:var(--nk-con-accent,#f5a623);
    color:#111827;
    font-size:.84rem;
    font-weight:900;
    text-decoration:none;
    line-height:1;
  }

  .nk-con-mobile-header__toggle{
    display:inline-flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:5px;
    width:46px;
    height:46px;
    padding:0;
    border:0;
    border-radius:16px;
    background:var(--nk-con-primary,#0b4c86);
    color:#fff;
    cursor:pointer;
    box-shadow:0 10px 22px rgba(11,76,134,.25);
    -webkit-tap-highlight-color:transparent;
  }

  .nk-con-mobile-header__toggle span{
    display:block;
    width:21px;
    height:2px;
    border-radius:999px;
    background:currentColor;
    transition:transform .22s ease, opacity .22s ease;
  }

  .nk-con-mobile-header__toggle[aria-expanded="true"] span:nth-child(1){transform:translateY(7px) rotate(45deg);}
  .nk-con-mobile-header__toggle[aria-expanded="true"] span:nth-child(2){opacity:0;}
  .nk-con-mobile-header__toggle[aria-expanded="true"] span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}

  .nk-con-mobile-drawer{
    display:block;
    position:fixed;
    inset:0;
    z-index:100001;
    pointer-events:none;
    visibility:hidden;
  }

  .nk-con-mobile-drawer__overlay{
    position:absolute;
    inset:0;
    background:rgba(15,23,42,.56);
    opacity:0;
    transition:opacity .24s ease;
  }

  .nk-con-mobile-drawer__panel{
    position:absolute;
    top:0;
    right:0;
    width:min(88vw,380px);
    max-width:calc(100vw - 28px);
    height:100%;
    padding:calc(18px + env(safe-area-inset-top,0px)) 18px calc(20px + var(--nk-con-safe-bottom));
    background:#fff;
    color:#111827;
    transform:translateX(105%);
    transition:transform .28s cubic-bezier(.2,.9,.2,1);
    box-shadow:-24px 0 48px rgba(15,23,42,.22);
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }

  .nk-con-mobile-menu-open .nk-con-mobile-drawer{
    pointer-events:auto;
    visibility:visible;
  }

  .nk-con-mobile-menu-open .nk-con-mobile-drawer__overlay{opacity:1;}
  .nk-con-mobile-menu-open .nk-con-mobile-drawer__panel{transform:translateX(0);}

  .nk-con-mobile-drawer__head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding-bottom:14px;
    border-bottom:1px solid rgba(15,23,42,.1);
  }

  .nk-con-mobile-drawer__head strong{
    min-width:0;
    font-size:1rem;
    line-height:1.35;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .nk-con-mobile-drawer__close{
    display:grid;
    place-items:center;
    width:42px;
    height:42px;
    flex:0 0 auto;
    border:0;
    border-radius:14px;
    background:#f3f4f6;
    color:#111827;
    font-size:1.7rem;
    line-height:1;
    cursor:pointer;
  }

  .nk-con-mobile-drawer__nav{padding:14px 0;}

  .nk-con-mobile-drawer__menu,
  .nk-con-mobile-drawer__menu ul{
    list-style:none;
    margin:0;
    padding:0;
  }

  .nk-con-mobile-drawer__menu li{margin:0;}

  .nk-con-mobile-drawer__menu a{
    display:flex;
    align-items:center;
    justify-content:space-between;
    min-height:48px;
    padding:12px 2px;
    border-bottom:1px solid rgba(15,23,42,.08);
    color:#111827;
    text-decoration:none;
    font-weight:850;
    line-height:1.4;
    overflow-wrap:anywhere;
  }

  .nk-con-mobile-drawer__menu a::after{
    content:"›";
    flex:0 0 auto;
    margin-left:10px;
    color:var(--nk-con-primary,#0b4c86);
    font-size:1.25rem;
    line-height:1;
  }

  .nk-con-mobile-drawer__menu .sub-menu,
  .nk-con-mobile-drawer__menu .children{
    padding-left:14px;
    border-left:3px solid rgba(11,76,134,.14);
  }

  .nk-con-mobile-drawer__menu .sub-menu a,
  .nk-con-mobile-drawer__menu .children a{
    min-height:42px;
    font-size:.92rem;
    font-weight:700;
    color:#334155;
  }

  .nk-con-mobile-drawer__actions{
    display:grid;
    gap:10px;
    padding-top:14px;
    border-top:1px solid rgba(15,23,42,.1);
  }

  .nk-con-mobile-drawer__action{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:50px;
    border-radius:999px;
    background:#eef2f7;
    color:#111827;
    text-align:center;
    text-decoration:none;
    font-weight:900;
    line-height:1.3;
    padding:10px 14px;
  }

  .nk-con-mobile-drawer__action--primary{
    background:var(--nk-con-primary,#0b4c86);
    color:#fff;
  }

  .nk-con-container,
  .container,
  .wp-block-group__inner-container{
    width:100%;
    max-width:100%;
    padding-left:max(16px,var(--nk-con-safe-left)) !important;
    padding-right:max(16px,var(--nk-con-safe-right)) !important;
  }

  .nk-con-section,
  .nk-con-single,
  .nk-con-hero,
  .nk-con-subhero{
    max-width:100vw;
    overflow:hidden;
  }

  .nk-con-hero{
    margin-top:calc(var(--nk-con-mobile-header-height) * -1);
    padding-top:var(--nk-con-mobile-header-height);
  }

  .nk-con-hero__content{
    padding-top:clamp(58px,15vw,88px) !important;
    padding-bottom:clamp(38px,11vw,62px) !important;
  }

  .nk-con-hero__panel{
    position:relative !important;
    right:auto !important;
    bottom:auto !important;
    width:100% !important;
    max-width:100% !important;
    margin:0 auto 22px !important;
    transform:none !important;
  }

  .nk-con-head,
  .nk-con-beforeafter,
  .nk-con-beforeafter--premium,
  .nk-con-cta__inner,
  .nk-con-single__layout{
    display:block !important;
  }

  .nk-con-grid,
  .nk-con-grid--2,
  .nk-con-grid--3,
  .nk-con-grid--4,
  .nk-con-stats__inner,
  .nk-con-timeline,
  .nk-con-process-row,
  .nk-con-process-row--top,
  .nk-con-process-row--bottom,
  .nk-con-license-cards,
  .nk-con-company-profile-grid{
    display:grid !important;
    grid-template-columns:1fr !important;
  }

  .nk-con-card,
  .nk-con-reason,
  .nk-con-step,
  .nk-con-stat,
  .nk-con-license-card,
  .nk-con-company-profile-card{
    width:100% !important;
    max-width:100% !important;
  }

  .nk-con-card-auto-grid{
    display:grid !important;
    grid-template-columns:1fr !important;
  }

  .nk-con-card-auto-grid > *{
    width:100% !important;
    max-width:100% !important;
    flex:none !important;
  }

  .nk-con-hero__actions,
  .nk-con-cta__buttons,
  .nk-con-head__actions{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:12px !important;
    width:100% !important;
  }

  .nk-con-btn,
  .nk-con-hero__actions .nk-con-btn,
  .nk-con-cta__buttons .nk-con-btn{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    white-space:normal !important;
    text-align:center !important;
  }

  .nk-con-title,
  .nk-con-hero__title,
  .nk-con-card__title,
  .nk-con-lead,
  .nk-con-card__text,
  .nk-con-hero__lead{
    overflow-wrap:anywhere;
    word-break:normal;
  }

  .nk-con-title{font-size:clamp(1.72rem,8vw,2.24rem) !important;}
  .nk-con-hero__title{font-size:clamp(2rem,10.5vw,3rem) !important;line-height:1.14 !important;}
  .nk-con-hero__lead,.nk-con-lead{font-size:clamp(.94rem,4vw,1.04rem) !important;line-height:1.82 !important;}

  .nk-con-card__image,
  .nk-con-work-card__image,
  .nk-con-editable-card-image img{
    height:auto;
    max-height:260px;
  }

  .nk-con-gallery-strip{
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch;
    mask-image:none !important;
    -webkit-mask-image:none !important;
  }

  .nk-con-gallery-track{animation:none !important;}

  #nk-con-beforeafter .nk-con-ba-flow,
  #nk-con-beforeafter .nk-con-ba-flow--compact,
  #nk-con-beforeafter .nk-con-ba-flow--count-1,
  #nk-con-beforeafter .nk-con-ba-flow--count-2,
  #nk-con-beforeafter .nk-con-ba-flow--count-3{
    display:grid !important;
    grid-template-columns:1fr !important;
    overflow:visible !important;
    padding:0 !important;
  }

  #nk-con-beforeafter .nk-con-ba-card{
    width:100% !important;
    max-width:100% !important;
  }

  #nk-con-beforeafter .nk-con-ba-card::after{display:none !important;}

  .nk-con-mobile-cta[style]{
    z-index:99999 !important;
  }
}

@media (max-width:430px){
  :root{--nk-con-mobile-header-height:60px;}

  body.nk-construction-theme{padding-top:var(--nk-con-mobile-header-height);}
  .nk-con-mobile-header__bar{padding-inline:12px;}
  .nk-con-mobile-header__brand{max-width:calc(100vw - 142px);}
  .nk-con-mobile-header__tel{padding-inline:10px;font-size:.78rem;}
  .nk-con-mobile-header__toggle{width:44px;height:44px;border-radius:14px;}
  .nk-con-mobile-drawer__panel{width:min(92vw,360px);max-width:calc(100vw - 18px);padding-inline:16px;}
  .nk-con-container,.container,.wp-block-group__inner-container{padding-left:14px !important;padding-right:14px !important;}
}

@media (prefers-reduced-motion:reduce){
  .nk-con-mobile-drawer__overlay,
  .nk-con-mobile-drawer__panel,
  .nk-con-mobile-header__toggle span{transition:none !important;}
}


/* v1.5.4: スマホのセクション見出し／もっと見るボタン重なり防止 */
@media (max-width:767px){
  body.nk-construction-theme .nk-con-head{
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    justify-content:flex-start !important;
    gap:clamp(16px,5vw,24px) !important;
    margin-bottom:clamp(26px,7vw,38px) !important;
    min-height:0 !important;
  }
  body.nk-construction-theme .nk-con-head__text,
  body.nk-construction-theme .nk-con-head__actions{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
  }
  body.nk-construction-theme .nk-con-head__actions{
    display:block !important;
    position:relative !important;
    z-index:2 !important;
    flex:0 0 auto !important;
    margin:0 !important;
    padding:0 !important;
    clear:both !important;
  }
  body.nk-construction-theme .nk-con-head__actions .nk-con-btn{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    min-height:52px !important;
    padding:14px 18px !important;
    line-height:1.35 !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
    word-break:keep-all !important;
    text-align:center !important;
    box-sizing:border-box !important;
  }
  body.nk-construction-theme #nk-con-services .nk-con-head + .nk-con-grid,
  body.nk-construction-theme #nk-con-works .nk-con-head + .nk-con-grid,
  body.nk-construction-theme #nk-con-news .nk-con-head + .nk-con-news-list{
    margin-top:clamp(20px,6vw,30px) !important;
  }
  body.nk-construction-theme .nk-con-news-item{
    align-items:start !important;
    padding:16px !important;
    line-height:1.55 !important;
  }
}

/* =========================================================
 * v1.5.5: Smartphone final hardening / vertical rhythm
 * 目的：スマホでの重なり、横はみ出し、CTA/カード/見出しの詰まりを広範囲に抑制。
 * ======================================================= */
@media (max-width:980px){
  body.nk-construction-theme{
    min-width:0 !important;
  }

  body.nk-construction-theme .nk-con-section{
    padding-top:clamp(42px,11vw,68px) !important;
    padding-bottom:clamp(42px,11vw,68px) !important;
  }

  body.nk-construction-theme .nk-con-container,
  body.nk-construction-theme .container,
  body.nk-construction-theme .wp-block-group__inner-container{
    max-width:100% !important;
    min-width:0 !important;
  }

  body.nk-construction-theme .nk-con-head,
  body.nk-construction-theme .nk-con-card__body,
  body.nk-construction-theme .nk-con-cta__text,
  body.nk-construction-theme .nk-con-hero__copy{
    min-width:0 !important;
  }

  body.nk-construction-theme .nk-con-eyebrow{
    display:inline-flex !important;
    max-width:100% !important;
    line-height:1.35 !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
  }

  body.nk-construction-theme .nk-con-title,
  body.nk-construction-theme .nk-con-card__title,
  body.nk-construction-theme .nk-con-card__title a,
  body.nk-construction-theme .nk-con-news-item strong,
  body.nk-construction-theme .nk-con-recruit-item strong{
    line-height:1.35 !important;
    letter-spacing:.01em !important;
    max-width:100% !important;
    overflow-wrap:anywhere !important;
    word-break:auto-phrase;
  }

  body.nk-construction-theme .nk-con-lead,
  body.nk-construction-theme .nk-con-card__text,
  body.nk-construction-theme .nk-con-card__body p,
  body.nk-construction-theme .nk-con-news-item,
  body.nk-construction-theme .nk-con-recruit-item span{
    line-height:1.78 !important;
    max-width:100% !important;
    overflow-wrap:anywhere !important;
  }

  body.nk-construction-theme .nk-con-grid,
  body.nk-construction-theme .nk-con-card-auto-grid,
  body.nk-construction-theme .nk-con-company-profile-grid,
  body.nk-construction-theme .nk-con-process-row,
  body.nk-construction-theme .nk-con-license-cards,
  body.nk-construction-theme .nk-con-news-list,
  body.nk-construction-theme .nk-con-recruit-list{
    gap:clamp(16px,5vw,24px) !important;
  }

  body.nk-construction-theme .nk-con-card,
  body.nk-construction-theme .nk-con-step,
  body.nk-construction-theme .nk-con-reason,
  body.nk-construction-theme .nk-con-stat,
  body.nk-construction-theme .nk-con-license-card,
  body.nk-construction-theme .nk-con-company-profile-card,
  body.nk-construction-theme .nk-con-news-item,
  body.nk-construction-theme .nk-con-recruit-item{
    min-width:0 !important;
    overflow:hidden !important;
    transform:none !important;
  }

  body.nk-construction-theme .nk-con-card__body{
    display:flex !important;
    flex-direction:column !important;
    gap:10px !important;
    padding:clamp(18px,5vw,24px) !important;
  }

  body.nk-construction-theme .nk-con-card__title,
  body.nk-construction-theme .nk-con-card__text,
  body.nk-construction-theme .nk-con-card__meta,
  body.nk-construction-theme .nk-con-card__price{
    margin-top:0 !important;
    margin-bottom:0 !important;
  }

  body.nk-construction-theme .nk-con-card__link{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    min-height:44px !important;
    margin-top:4px !important;
    line-height:1.35 !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
  }

  body.nk-construction-theme .nk-con-card__image,
  body.nk-construction-theme .nk-con-company-profile-card .nk-con-card__image{
    display:block !important;
    width:100% !important;
    min-height:190px !important;
    height:clamp(190px,52vw,260px) !important;
    max-height:280px !important;
    background-size:cover !important;
    background-position:center !important;
  }

  body.nk-construction-theme .nk-con-process-turn{
    display:none !important;
  }

  body.nk-construction-theme .nk-con-process-flow{
    overflow:visible !important;
  }

  body.nk-construction-theme .nk-con-step{
    padding:clamp(18px,5vw,24px) !important;
  }

  body.nk-construction-theme .nk-con-step__no{
    margin-bottom:10px !important;
  }

  body.nk-construction-theme .nk-con-step h3,
  body.nk-construction-theme .nk-con-step p{
    margin-top:0 !important;
  }

  body.nk-construction-theme .nk-con-badgelist,
  body.nk-construction-theme .nk-con-card__meta{
    display:flex !important;
    flex-wrap:wrap !important;
    gap:8px !important;
    padding-left:0 !important;
  }

  body.nk-construction-theme .nk-con-badgelist li,
  body.nk-construction-theme .nk-con-chip{
    max-width:100% !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
  }

  body.nk-construction-theme .nk-con-news-list{
    display:grid !important;
    grid-template-columns:1fr !important;
  }

  body.nk-construction-theme .nk-con-news-item{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:6px !important;
    min-height:auto !important;
  }

  body.nk-construction-theme .nk-con-news-item time{
    display:block !important;
    margin:0 !important;
  }

  body.nk-construction-theme .nk-con-recruit .nk-con-container,
  body.nk-construction-theme .nk-con-cta__inner{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:clamp(20px,6vw,30px) !important;
  }

  body.nk-construction-theme .nk-con-hero{
    min-height:auto !important;
  }

  body.nk-construction-theme .nk-con-hero__inner,
  body.nk-construction-theme .nk-con-hero__content{
    min-height:0 !important;
  }

  body.nk-construction-theme .nk-con-hero__actions,
  body.nk-construction-theme .nk-con-cta__buttons{
    margin-top:clamp(18px,5vw,26px) !important;
  }

  body.nk-construction-theme .nk-con-hero__panel{
    margin-top:clamp(18px,5vw,28px) !important;
  }
}

@media (max-width:767px){
  body.nk-construction-theme .nk-con-head{
    row-gap:clamp(18px,6vw,28px) !important;
  }

  body.nk-construction-theme .nk-con-head__text > * + *{
    margin-top:12px !important;
  }

  body.nk-construction-theme .nk-con-head__actions{
    padding-top:2px !important;
  }

  body.nk-construction-theme #nk-con-company-profile .nk-con-head + .nk-con-company-profile-grid,
  body.nk-construction-theme #nk-con-services .nk-con-head + .nk-con-grid,
  body.nk-construction-theme #nk-con-works .nk-con-head + .nk-con-grid,
  body.nk-construction-theme #nk-con-staff .nk-con-head + .nk-con-grid,
  body.nk-construction-theme #nk-con-voices .nk-con-head + .nk-con-grid,
  body.nk-construction-theme #nk-con-news .nk-con-head + .nk-con-news-list{
    margin-top:clamp(22px,7vw,34px) !important;
  }

  body.nk-construction-theme .nk-con-btn,
  body.nk-construction-theme button,
  body.nk-construction-theme input,
  body.nk-construction-theme select,
  body.nk-construction-theme textarea{
    max-width:100% !important;
  }
}
