/*
Theme Name: Ichikawa Original
Theme URI: https://sample1.r-out.jp/
Author: Ichikawa Shoten
Description: イチカワ商店専用の独自WordPressテーマです。各ページの既存デザインを維持しながら、テーマ側で構造を管理します。
Version: 1.1.14
Text Domain: ichikawa-original
*/

:root {
  --ich-theme-navy: #08233d;
  --ich-theme-orange: #d95519;
  --ich-theme-cream: #fff9f4;
  --ich-theme-line: #e8e0d9;
  --ich-theme-text: #142c43;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 0;
  color: var(--ich-theme-text);
  background: #fff;
  font-family: "Noto Sans JP", "Yu Gothic", YuGothic, sans-serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: inherit; }

/* Existing page navigation labels must stay on one line. */
.ich-site-nav a,
.ich-article-nav a,
.ich-theme-nav a { white-space: nowrap; }

/* ========================================
   TOP固定ページ：旧ビジュアルエディターが挿入した要素の無害化
   アンカーやグリッドの間に入った br / 空p が、特にスマホで
   余計な行・巨大な余白・カードの段落ちを作らないようにする。
======================================== */
.ich-site-nav > br,
.ich-hero__actions > br,
.ich-trust > br,
.ich-cta__actions > br,
.ich-contact-bottom__guide > br,
.ich-footer__brand > br,
.ich-footer__nav > br,
.ich-mobile-cta > br,
.ich-case-grid > p,
.ich-case-link > p:empty,
.ich-site-header__inner > p:empty,
.ich-hero__grid > p:empty,
.ich-hero__visual > p:empty,
.ich-cta__inner > p:empty,
.ich-shop-grid > p:empty,
.ich-company__grid > p:empty,
.ich-contact-bottom__inner > p:empty,
.ich-footer__inner > p:empty {
  display: none !important;
}

/* WordPress管理バー表示時の固定ヘッダー調整 */
body.admin-bar .ich-article-header,
body.admin-bar .ich-theme-header { top: 32px; }

/* ========================================
   汎用固定ページ：現行ページ構造を維持
======================================== */
.ich-theme-header {
  position: relative;
  z-index: 100;
  width: 100%;
  min-height: 122px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.ich-theme-header__inner {
  width: min(100% - 48px, 1000px);
  min-height: 122px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.ich-theme-header__brand { display: block; color: var(--ich-theme-navy); text-decoration: none; line-height: 1.25; }
.ich-theme-header__brand strong { display: block; font-size: 25px; font-weight: 800; }
.ich-theme-header__brand span { display: block; margin-top: 4px; color: var(--ich-theme-orange); font-size: 10px; font-weight: 700; letter-spacing: .18em; }

.ich-theme-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #6d6d6d;
  font-size: 25px;
  cursor: pointer;
}

.ich-theme-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-weight: 700;
  font-size: 14px;
}

.ich-theme-nav a { text-decoration: none; }

.ich-theme-nav__contact {
  padding: 12px 20px;
  border-radius: 8px;
  color: #fff;
  background: var(--ich-theme-orange);
}

.l-main { width: 100%; }

.p-page-header {
  min-height: 150px;
  display: flex;
  align-items: center;
  background: #f5f5f5;
}

.l-inner { width: min(100% - 48px, 1010px); margin-inline: auto; }

.p-page-header__title {
  margin: 0;
  color: #333;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
}

.p-entry-page { margin-top: 0; margin-bottom: 0; padding: 0 0 150px; }

.p-entry-page__inner { padding: 80px 70px; background: #fff; }

body:not(.home):not(.page-id-1015) .l-main { background: #f4f4f4; }

.p-entry__body > :first-child { margin-top: 0; }
.p-entry__body > :last-child { margin-bottom: 0; }

/* ========================================
   汎用フッター
======================================== */
.ich-theme-footer {
  padding: 64px 0 24px;
  color: #fff;
  background: var(--ich-theme-navy);
}

.ich-theme-footer__inner {
  width: min(100% - 48px, 1100px);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 48px;
}

.ich-theme-footer__brand strong { display: block; font-size: 24px; }
.ich-theme-footer__brand span { color: #d9a685; font-size: 11px; letter-spacing: .16em; }
.ich-theme-footer__nav { display: flex; flex-wrap: wrap; gap: 12px 24px; align-content: flex-start; }
.ich-theme-footer__nav a { color: #fff; text-decoration: none; }
.ich-theme-footer__copy { margin: 44px 0 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.18); text-align: center; font-size: 12px; }

/* ========================================
   コラム共通ヘッダーの最低限フォールバック
   詳細デザインは既存のコラムCSSを引き継ぎます
======================================== */
.ich-article-header {
  position: relative;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.ich-article-shell { width: min(100% - 48px, 1200px); margin-inline: auto; }
.ich-article-header__inner { min-height: 116px; display: flex; align-items: center; gap: 32px; }
.ich-article-brand { margin-right: auto; text-decoration: none; }
.ich-article-brand strong { display: block; font-family: serif; font-size: 27px; font-weight: 500; }
.ich-article-brand span { display: block; color: #d65b27; font-size: 10px; font-weight: 700; letter-spacing: .2em; }
.ich-article-nav { display: flex; gap: 28px; font-size: 14px; font-weight: 700; }
.ich-article-nav a { text-decoration: none; }
.ich-article-header__contact { padding: 15px 24px; border-radius: 8px; color: #fff; background: var(--ich-theme-orange); text-decoration: none; font-weight: 700; }

.ich-article-footer { padding: 56px 0 20px; color: #fff; background: var(--ich-theme-navy); }
.ich-article-footer__inner { display: flex; justify-content: space-between; gap: 48px; }
.ich-article-footer__about p { margin: 6px 0; }
.ich-article-footer__nav { display: flex; flex-wrap: wrap; gap: 12px 22px; align-content: flex-start; }
.ich-article-footer__nav a { color: #fff; text-decoration: none; }
.ich-article-footer__copy { margin: 40px 0 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.18); text-align: center; font-size: 12px; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1199px) {
  body.admin-bar .ich-article-header,
  body.admin-bar .ich-theme-header { top: 46px; }
  .ich-theme-header,
  .ich-theme-header__inner { min-height: 61px; }
  .ich-theme-header__inner { position: relative; }
  .ich-theme-header__brand strong { font-size: 21px; }
  .ich-theme-menu-button { display: block; }
  .ich-theme-nav { display: none; }
  .ich-theme-nav.is-open {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0;
    background: #fff;
    box-shadow: 0 12px 24px rgba(0,0,0,.12);
  }
  .ich-theme-nav.is-open a { padding: 10px 20px; }
  .ich-article-nav { display: none; }
  .ich-article-header__inner { min-height: 90px; }
  .ich-article-header__contact { margin-left: auto; padding: 12px 16px; }
  .p-entry-page__inner { padding: 36px 28px; }
}

@media (max-width: 600px) {
  .ich-theme-header__inner,
  .ich-article-shell,
  .l-inner { width: min(100% - 28px, 1200px); }
  .ich-theme-header__logo img { width: 155px; }
  .p-page-header { min-height: 110px; }
  .p-entry-page { padding: 0 0 80px; }
  .p-entry-page__inner { padding: 24px 18px; }
  .ich-theme-footer__inner,
  .ich-article-footer__inner { flex-direction: column; gap: 28px; }
  .ich-article-brand strong { font-size: 22px; }
  .ich-article-header__contact { font-size: 13px; }
}

@media screen and (max-width: 782px) {
  body.admin-bar .ich-article-header,
  body.admin-bar .ich-theme-header { top: 46px; }
}
