/*
 * BCOOL Base Theme - main.css
 * =========================================
 * カラー・フォント変数はtheme.jsonで管理。
 * このファイルは構造・レイアウト・コンポーネントのスタイルです。
 * 業種ごとのデザイン変更はtheme.jsonのpalette/typographyを更新してください。
 */

/* =========================================
   リセット・ベース
   ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  transition: color 0.2s ease, opacity 0.2s ease;
}

/* =========================================
   サイトヘッダー
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--wp--preset--color--base);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* 透過ヘッダー（front-page / page-fullscreen 用） */
.site-header.is-transparent {
  position: fixed;
  background-color: transparent;
  border-bottom-color: transparent;
}

.site-header.is-transparent.is-scrolled {
  background-color: var(--wp--preset--color--base);
  border-bottom-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 透過ヘッダー時：テキスト・ロゴを白に */
.site-header.is-transparent:not(.is-scrolled) .wp-block-site-logo img,
.site-header.is-transparent:not(.is-scrolled) .wp-block-site-title a,
.site-header.is-transparent:not(.is-scrolled) .wp-block-navigation a,
.site-header.is-transparent:not(.is-scrolled) .contact-info a,
.site-header.is-transparent:not(.is-scrolled) .contact-info p,
.site-header.is-transparent:not(.is-scrolled) .contact-info svg {
  color: #fff;
  fill: #fff;
}

.site-header.is-transparent:not(.is-scrolled) .nav-toggle__bar {
  background-color: #fff;
}

/* =========================================
   Header A - ロゴ左・ナビ右
   ========================================= */
.header-a {
  padding: 0 clamp(1rem, 4vw, 2rem);
  min-height: 72px;
}

.header-a .header-right {
  gap: 0.5rem;
  align-items: flex-end;
}

.header-a .header-contact-bar {
  gap: 1rem;
  justify-content: flex-end;
  padding-bottom: 0.25rem;
}

/* =========================================
   Header B - ロゴ中央・ナビ下
   ========================================= */
.header-b {
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.header-b .header-top-bar {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: var(--wp--preset--font-size--xs);
}

.header-b .header-center-bar {
  padding: 0.75rem 0;
  position: relative;
}

.header-b .header-center-bar .nav-toggle-wrap {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.header-b .header-nav-bar {
  padding: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.header-b .wp-block-navigation a {
  padding: 0.875rem 1rem;
  font-size: var(--wp--preset--font-size--sm);
}

/* =========================================
   Header C - ハンバーガーのみ
   ========================================= */
.header-c {
  padding: 0 clamp(1rem, 4vw, 2rem);
  min-height: 72px;
}

/* =========================================
   ハンバーガーボタン
   ========================================= */
.nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.nav-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--wp--preset--color--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
  transform-origin: center;
}

/* アクティブ状態（×マーク） */
.nav-toggle.is-active .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-active .nav-toggle__bar:nth-child(2) {
  opacity: 0;
  width: 0;
}
.nav-toggle.is-active .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================================
   フルスクリーンナビゲーション
   ========================================= */
.fullscreen-nav {
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: var(--wp--preset--color--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  overflow-y: auto;
}

.fullscreen-nav.is-open {
  opacity: 1;
  visibility: visible;
}

.fullscreen-nav__close {
  position: fixed;
  top: 1.25rem;
  right: clamp(1rem, 4vw, 2rem);
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.fullscreen-nav__close span {
  display: block;
  position: absolute;
  width: 24px;
  height: 2px;
  background-color: var(--wp--preset--color--contrast);
  border-radius: 2px;
}

.fullscreen-nav__close span:first-child {
  transform: rotate(45deg);
}
.fullscreen-nav__close span:last-child {
  transform: rotate(-45deg);
}

.fullscreen-nav__inner {
  width: 100%;
  max-width: 600px;
  padding: clamp(3rem, 10vw, 6rem) clamp(1.5rem, 6vw, 3rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

.fullscreen-nav__menu {
  width: 100%;
  text-align: center;
}

/* フルスクリーンナビのリンクスタイル */
.fullscreen-nav__links .wp-block-navigation__container,
.fullscreen-nav .wp-block-navigation__container {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.fullscreen-nav__links .wp-block-navigation-item__content,
.fullscreen-nav .wp-block-navigation-item__content {
  color: var(--wp--preset--color--contrast) !important;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.6rem 1rem;
  text-decoration: none;
  transition: opacity 0.2s;
  display: block;
}

.fullscreen-nav__links .wp-block-navigation-item__content:hover,
.fullscreen-nav .wp-block-navigation-item__content:hover {
  opacity: 0.6;
}

/* フルスクリーンナビ内のcontact-info */
.fullscreen-nav__info {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 2rem;
  width: 100%;
  display: flex;
  justify-content: center;
}

.fullscreen-nav__info .contact-info {
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.fullscreen-nav__info .contact-info a,
.fullscreen-nav__info .contact-info p {
  color: var(--wp--preset--color--contrast) !important;
}

.fullscreen-nav__info .contact-info svg {
  fill: var(--wp--preset--color--contrast) !important;
}

/* ナビオープン時：bodyのスクロール禁止 */
body.nav-is-open {
  overflow: hidden;
}

/* =========================================
   contact-info パーツ
   ========================================= */
.contact-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.contact-info__tel {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.contact-info__tel-number a {
  text-decoration: none;
  font-size: var(--wp--preset--font-size--lg);
  font-weight: 700;
  color: var(--wp--preset--color--primary);
  white-space: nowrap;
}

.contact-info__tel-number a:hover {
  color: var(--wp--preset--color--accent);
}

.contact-info__icon {
  fill: currentColor;
  flex-shrink: 0;
}

.contact-info__sns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-info__sns-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--wp--preset--color--text);
  transition: color 0.2s, background-color 0.2s;
}

.contact-info__sns-link:hover {
  color: var(--wp--preset--color--accent);
  background-color: rgba(0, 0, 0, 0.05);
}

.contact-info__sns-link svg {
  fill: currentColor;
  display: block;
}

/* =========================================
   フルスクリーンFV
   ========================================= */
.fv-fullscreen {
  margin-top: 0;
}

/* 透過ヘッダーの分、FVをずらさない（fixedのため） */
.site-header.is-transparent + .site-main .fv-fullscreen {
  margin-top: 0;
}

.fv-cover {
  width: 100%;
}

/* =========================================
   ページMV（標準固定ページ）
   ========================================= */
.page-mv {
  position: relative;
  overflow: hidden;
}

.page-mv .wp-block-post-featured-image img {
  object-fit: cover;
  width: 100%;
}

.page-mv .wp-block-post-title {
  position: relative;
  z-index: 1;
}

/* =========================================
   2カラムレイアウト（ローカルナビ）
   ========================================= */
.sidebar-layout {
  align-items: flex-start;
  gap: clamp(1.5rem, 4vw, 3rem);
}

@media (max-width: 768px) {
  .sidebar-layout {
    flex-direction: column;
  }

  .sidebar-layout .sidebar-col {
    width: 100% !important;
    flex-basis: 100% !important;
  }
}

/* =========================================
   ローカルナビ
   ========================================= */
.local-nav {
  background-color: var(--wp--preset--color--base-2);
  border-radius: 8px;
  padding: 1.25rem;
  position: sticky;
  top: calc(72px + 1rem); /* ヘッダー高さ分 */
}

.local-nav__title {
  color: var(--wp--preset--color--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--wp--preset--color--base-3);
  padding-bottom: 0.5rem !important;
  margin-bottom: 0.75rem !important;
}

.local-nav__list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.local-nav__list li {
  border-bottom: 1px solid var(--wp--preset--color--base-3);
}

.local-nav__list li:last-child {
  border-bottom: none;
}

.local-nav__list a {
  display: block;
  padding: 0.6rem 0.5rem;
  font-size: var(--wp--preset--font-size--sm);
  color: var(--wp--preset--color--text);
  text-decoration: none;
  transition: color 0.2s, padding-left 0.2s;
}

.local-nav__list a:hover {
  color: var(--wp--preset--color--accent);
  padding-left: 0.875rem;
}

.local-nav__list .is-active a {
  color: var(--wp--preset--color--accent);
  font-weight: 700;
  padding-left: 0.875rem;
}

/* =========================================
   アーカイブ一覧
   ========================================= */
.archive-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.archive-item {
  display: flex !important;
  align-items: baseline;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--wp--preset--color--base-3);
}

.archive-item:first-child {
  border-top: 1px solid var(--wp--preset--color--base-3);
}

.archive-item .wp-block-post-date {
  flex-shrink: 0;
  min-width: 6rem;
  color: var(--wp--preset--color--text-light);
  font-size: var(--wp--preset--font-size--sm);
  font-family: monospace;
}

.archive-item .wp-block-post-title {
  font-size: var(--wp--preset--font-size--md) !important;
  margin: 0;
  line-height: 1.5;
}

.archive-item .wp-block-post-title a {
  color: var(--wp--preset--color--text);
  text-decoration: none;
  transition: color 0.2s;
}

.archive-item .wp-block-post-title a:hover {
  color: var(--wp--preset--color--accent);
}

/* =========================================
   フッター
   ========================================= */
.site-footer {
  background-color: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--contrast);
}

.site-footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: #fff;
}

.site-footer .wp-block-site-logo img {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.footer-copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
  .footer-columns {
    flex-direction: column;
  }

  .footer-columns .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
  }

  .footer-copyright {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* =========================================
   CTA
   ========================================= */
.site-cta {
  text-align: center;
}

.cta-actions {
  gap: 1.5rem 2rem;
  margin-top: 1.5rem;
}

.cta-tel .contact-info__tel-number a {
  color: #fff !important;
  font-size: var(--wp--preset--font-size--2xl);
}

.cta-tel .contact-info__icon {
  fill: #fff !important;
}

/* =========================================
   デスクトップナビゲーション
   ========================================= */
.desktop-nav .wp-block-navigation__container {
  gap: 0;
}

.desktop-nav .wp-block-navigation-item__content {
  padding: 1.5rem 0.875rem;
  font-size: var(--wp--preset--font-size--sm);
  font-weight: 500;
  position: relative;
  transition: color 0.2s;
}

.desktop-nav .wp-block-navigation-item__content::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.875rem;
  right: 0.875rem;
  height: 2px;
  background-color: var(--wp--preset--color--accent);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.desktop-nav .wp-block-navigation-item:hover .wp-block-navigation-item__content::after,
.desktop-nav .wp-block-navigation-item.current-menu-item .wp-block-navigation-item__content::after {
  transform: scaleX(1);
}

/* =========================================
   404ページ
   ========================================= */
.error-404 .wp-block-heading {
  font-size: clamp(4rem, 15vw, 8rem);
  color: var(--wp--preset--color--base-3);
  line-height: 1;
  margin-bottom: 0;
}

/* =========================================
   レイアウト補完（wp:group の layout 属性を使わず CSS で flex 管理）
   ========================================= */

/* Header A */
.header-inner.header-a {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
}
.header-a .header-right {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
}
.header-a .header-contact-bar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.header-a .header-nav-wrap {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
}

/* Header B */
.header-inner.header-b {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
}
.header-b .header-top-bar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
}
.header-b .header-contact-bar {
  display: flex;
  flex-wrap: nowrap;
}
.header-b .header-center-bar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
}
.header-b .header-nav-bar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
}

/* Header C */
.header-inner.header-c {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
}

/* CTA */
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.cta-tel {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
}

/* フッター */
.footer-copyright {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
}

/* =========================================
   Contact Info - SVG Background Images
   ========================================= */
.contact-info__icon {
  width: 16px;
  height: 16px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: inline-block;
}

.contact-info__sns-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  text-decoration: none;
}

/* =========================================
   レスポンシブ共通
   ========================================= */
@media (max-width: 600px) {
  .wp-block-post-navigation-link {
    font-size: var(--wp--preset--font-size--sm);
  }
}
