/* =========================================
  TECRITA Components (minimum)
  - Header (sticky)
  - Global Nav (desktop + drawer)
  - Nav Toggle (hamburger <-> X)
  - Footer + Footer Nav
========================================= */

/* ---------- Header ---------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--wp--preset--color--base);
  border-bottom: 1px solid rgba(0,0,0,.08);
}

/* ---------- Header (scroll transparent) ---------- */
.site-header{
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, backdrop-filter .2s ease;
}

/* スクロールしたら透過（半透明）にする */
.site-header.is-scrolled{
  background: rgba(255,255,255,.30);
  border-bottom-color: rgba(0,0,0,.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-header__inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}

.site-brand {
  max-width: 160px;
}

.site-brand a,
.site-brand__link{
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.site-brand a img {
  width: 100%;
  height: auto;
}

.site-header__right{
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- Global Nav (shared) ---------- */
.global-nav__list{
  display: flex;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.global-nav__list a{
  text-decoration: none;
  color: inherit;
}

/* Desktop nav hidden on mobile */
.global-nav--desktop{
  display: none;
}

.global-nav--desktop .global-nav__list{
  display: flex;
  gap: 2em;
  align-items: center;
}

.global-nav__list li:not(:last-child)::after {
  content: "|";
  display: inline;
  margin-left: 2em;
}

/* ---------- Toggle button (hamburger <-> X) ---------- */
.nav-toggle{
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  line-height: 1;
}

.nav-toggle:focus-visible{
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 2px;
}

.nav-toggle__icon{
  position: relative;
  display: inline-block;
  width: 20px;
  height: 14px;
}

.nav-toggle__bar{
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: transform .2s ease, top .2s ease, opacity .2s ease;
}

.nav-toggle__bar:nth-child(1){ top: 0; }
.nav-toggle__bar:nth-child(2){ top: 6px; }
.nav-toggle__bar:nth-child(3){ top: 12px; }

/* open -> X : aria-expanded で判定（JS差し替え漏れでも動く） */
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1){
  top: 6px;
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2){
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3){
  top: 6px;
  transform: rotate(-45deg);
}

/* SR text toggle : aria-expanded で判定 */
.nav-toggle__sr-close{ display:none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__sr-open{ display:none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__sr-close{ display:inline; }

/* ---------- Drawer (mobile) ---------- */
.nav-drawer{
  display: none;
}

.nav-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 40;
}

/* open state */
html.is-nav-open .nav-drawer{
  display: block;
  position: fixed;
  left: 0;
  right: 0;
  top: var(--tecrita-header-h);
  z-index: 60;
  background: var(--wp--preset--color--base);
  border-bottom: 1px solid rgba(0,0,0,.08);

  /* 追加：画面内に収めてスクロール */
  max-height: calc(100vh - var(--tecrita-header-h));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-drawer__inner{
  padding: 16px 0;
}

.global-nav--drawer .global-nav__list{
  display: grid;
  gap: 10px;
}

.global-nav--drawer a{
  display: block;
  padding: 10px 6px;
  text-decoration: none;
  color: inherit;
}

/* Skip link (accessibility) */
.skip-link{
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 10px;
  transform: translateY(-200%);
  z-index: 9999;
}
.skip-link:focus{
  transform: translateY(0);
}

/* ---------- Breakpoint ---------- */
@media (min-width: 960px){
  .nav-toggle{ display:none; }
  .global-nav--desktop{ display:block; }
  .nav-drawer,
  .nav-backdrop{ display:none !important; }
}

/* =========================================================
   Footer
========================================================= */

.site-footer{
  background: #4a4a4a; /* スクショの濃いグレー寄せ */
  color: #fff;
}

/* 上段（会社情報 + ナビ） */
.site-footer__inner{
  padding-top: 56px;   /* ← 高さの要 */
  padding-bottom: 56px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* ← PCで上揃え */
  gap: 40px;
}

/* 左：会社情報 */
.site-footer__info{
  max-width: 520px;
}

.site-footer__title{
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .08em; /* “STRACTION inc.” の雰囲気 */
}

.site-footer__line{
  margin: 0;
  font-size: 13px;
  line-height: 1.9;
  opacity: .95;
}

.site-footer__map{
  color: inherit;
  text-decoration: underline; /* スクショの下線 */
  font-size: 13px;
}

.site-footer__tel{
  color: inherit;
  text-decoration: none;
}
.site-footer__tel:hover{ opacity: .75; }

/* 右：ナビ（PCは右寄せで上段に配置） */
.site-footer__nav{
  margin-left: auto;
}

.footer-nav__list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;  /* ← 右寄せ */
  gap: 24px;                 /* PCは区切り線なし */
  font-size: 12px;
  letter-spacing: .02em;
  opacity: .95;
}

.footer-nav__list a{
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.footer-nav__list a:hover{
  opacity: .75;
}

/* 下段：コピーライト（中央） */
.site-footer__bottom{
  padding: 0 0 30px;
  text-align: center;
}

.site-footer__copy{
  font-size: 12px;
  opacity: .65;
}

/* -------------------------
   SP：縦積み & ナビを中央＋｜区切り
------------------------- */
@media (max-width: 768px){
  .site-footer__inner{
    flex-direction: column;
    align-items: flex-start; /* スクショは左寄せ */
    gap: 18px;
    padding-top: 30px;
    padding-bottom: 18px;
  }

  .site-footer__title{
    font-size: 22px; /* SPは見出しが大きめに見える */
    margin-bottom: 14px;
  }

  /* SPはナビを会社情報の下に置いて中央寄せ */
  .site-footer__nav{
    width: 100%;
    margin-left: 0;
  }

  .footer-nav__list{
    justify-content: center; /* ← 中央寄せ */
    gap: 0;                  /* 区切りを使うのでgapは消す */
    flex-wrap: wrap;
    font-size: 12px;
  }

  .footer-nav__list li{
    display: inline-flex;
    align-items: center;
  }

  /* “｜” 区切りを再現 */
  .footer-nav__list li + li::before{
    content: "｜";
    opacity: .6;
    margin: 0 10px;
  }

  .site-footer__bottom{
    padding-bottom: 16px;
  }
}


/* =================================================
   b-hero (MV) – single source of truth
   ※ 構造: .b-hero > .b-hero__slides / .b-hero__inner
================================================= */
.b-hero{
  position: relative;
  overflow: hidden;
  min-height: var(--hero-min-height);
  display: flex;
  align-items: center;
}

/* 背景レイヤー（画像ブロックが入る領域） */
.b-hero__slides{
  position: absolute;
  inset: 0;
  z-index: 0;

  /* 画像ブロックが無い場合も成立させる */
  background: var(--hero-bg);
  background-image: var(--hero-bg-image);
  background-size: cover;
  background-position: center;
}

/* 暗幕（可読性） */
.b-hero__slides::after{
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
}

/* slides 内の figure（wp-block-image）を「必ず全面レイヤー化」 */
.b-hero__slides .wp-block-image{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}

/* img は figure の高さ100%に追従 */
.b-hero__slides .wp-block-image img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.b-hero__slides > :where(.wp-block-image, .wp-block-cover){
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
}

/* 画像ブロック以外（Cover等）も cover */
.b-hero__slides :where(img, video){
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Coverブロックの背景画像も */
.b-hero__slides .wp-block-cover,
.b-hero__slides .wp-block-cover__image-background{
  width: 100%;
  height: 100%;
}

.b-hero__slides img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 文字エリア（前面） */
.b-hero__inner{
  position: relative;
  z-index: 2;
  width: 100%;
  padding-block: clamp(48px, 8vw, 96px);
}

/* タイトル・サブ */
.b-hero__title{
  color: var(--hero-title-color);
  text-shadow: var(--hero-text-shadow);
  margin: 0 0 12px;
}

.b-hero__sub{
  color: var(--hero-sub-color);
  text-shadow: var(--hero-text-shadow);
  margin: 0 0 24px;
}

/* CTA */
.b-hero__cta{
  gap: var(--hero-cta-gap);
}

.b-hero__cta .wp-element-button{
  text-decoration: none;
}

/* dots（hero-slider.js が生成） */
.b-hero__dots{
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 18px;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
}

.b-hero__dot{
  width: var(--hero-dot-size);
  height: var(--hero-dot-size);
  border-radius: 999px;
  border: 0;
  padding: 0;
  cursor: pointer;
  opacity: var(--hero-dot-opacity);
}

.b-hero__dot[aria-selected="true"]{
  opacity: 1;
}

/* =========================
   Breadcrumbs (minimum)
   - 余白/サイズ/区切りだけ
   - デザインはしない
========================= */

/* TECRITA推奨スコープ（自前パンくず用） */
.tecrita-breadcrumbs{
  margin: 16px 0;
  font-size: .875rem;
  line-height: 1.4;
}

/* 併用しやすい別名（将来の命名揺れ対策） */
.breadcrumbs,
.breadcrumb{
  font-size: .875rem;
  line-height: 1.4;
}

/* よくある構造：nav > ol/ul */
.tecrita-breadcrumbs ol,
.tecrita-breadcrumbs ul,
.breadcrumbs ol,
.breadcrumbs ul,
.breadcrumb ol,
.breadcrumb ul{
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* li を横並びに */
.tecrita-breadcrumbs li,
.breadcrumbs li,
.breadcrumb li{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 区切り（liの前に自動挿入） */
.tecrita-breadcrumbs li + li::before,
.breadcrumbs li + li::before,
.breadcrumb li + li::before{
  content: "/";
  opacity: .55;
}

/* リンクは“普通に” */
.tecrita-breadcrumbs a,
.breadcrumbs a,
.breadcrumb a{
  color: inherit;
  text-decoration: none;
}
.tecrita-breadcrumbs a:hover,
.breadcrumbs a:hover,
.breadcrumb a:hover{
  text-decoration: underline;
}

/* =========================
   Page Header
========================= */
.tecrita-page-header{
  position: relative;
  padding: var(--tecrita-page-header-pad-y, 56px) 0;
  background-color: var(--wp--preset--color--muted);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* 背景なし */
.tecrita-page-header.bg-none{
  background: transparent;
}

/* 画像がある時は文字を白に寄せる（必要なら調整） */
.tecrita-page-header.has-bg-image{
  color: #fff;
}

/* overlay（濃度はCSS変数） */
.tecrita-page-header__overlay{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0, var(--tecrita-page-header-overlay, .4));
  pointer-events: none;
}

.tecrita-page-header__inner{
  position: relative;
  z-index: 1;
}

.tecrita-page-header__title{
  margin: 0;
  line-height: 1.2;
}

@media (max-width: 640px){
  .tecrita-page-header{
    padding: var(--tecrita-page-header-pad-y-sp, 40px) 0;
  }
}

/* =========================
  NEWS right column (actual HTML based)
========================= */

/* 右カラム全体（Query） */
.news_right{
  padding: 15px 20px;
  max-height: 260px;      /* 必要に応じて調整 */
  overflow-y: auto;
  padding-right: 10px;    /* スクロールバー分 */
}

/* UL初期化（Query Loop差分対策） */
.news_right :where(ul,ol){
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 1記事（li.wp-block-post） */
.news_text > li.wp-block-post{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  margin: 0 0 20px;
  border-bottom: 1px solid var(--color-border, rgba(0,0,0,.15));
}

/* 日付 */
.news_text .wp-block-post-date{
  font-size: 14px;
  opacity: .85;
  margin: 0;
}

/* カテゴリ */
.news_text .news_cat{
  margin-left: auto;
}
.news_text .news_cat a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 0px 15px;
  border-radius: 5px;
  font-size: 13px;
  text-decoration: none;
  color: #fff;
  background: var(--wp--preset--color--primary);
}

/* タイトル */
.news_text .wp-block-post-title{
  width: 100%;
  font-size: 16px;
  font-weight: normal;
  line-height: 1.4;
  margin: 4px 0 10px;
}
.news_text .wp-block-post-title a{
  text-decoration: none;
}
.news_text .wp-block-post-title a:hover{
  text-decoration: underline;
}

/* ▼ SP調整 */
@media (max-width: 640px){
  .news_text > li.wp-block-post{
    gap: 6px 10px;
  }
  .news_text .news_cat{
    display: flex;
    justify-content: flex-end;
  }
}

/* ▼ カテゴリ別色（実クラスに対応） */
li.category-news .news_cat a{
  background: var(--tecrita-color-accent, #ff3b3b);
}
li.category-blog .news_cat a{
  background: var(--tecrita-color-primary, #283f92);
}
li.category-uncategorized .news_cat a{
  background: #777;
}

/* Firefox scrollbar */
@supports not selector(::-webkit-scrollbar){
  .news_right{
    scrollbar-width: thin;
    scrollbar-color: var(--wp--preset--color--cyan-bluish-gray) transparent;
  }
}

.news_right::-webkit-scrollbar {
  width: 4px;
}

.news_right::-webkit-scrollbar-track {
  background: var(--tecrita-color-muted);
  border-radius: 999px;
}

.news_right::-webkit-scrollbar-thumb {
  background: var(--wp--preset--color--cyan-bluish-gray);
  border-radius: 999px;
}

.news_right::-webkit-scrollbar-thumb:hover {
  background: #06344d;
}