/* ハダタイ テーマカラー（決定版） */
/* PANTONE 470U, 2015U, 712U, 691U ベース - 鮮やか版 */

/* Kosugi Maru フォント */
@font-face {
  font-family: 'Kosugi Maru';
  src: url('KosugiMaru-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Primary Colors - 彩度アップ版 */
  --color-primary: #B85A30;       /* 元 #A37052 → 彩度+20% */
  --color-primary-dark: #9A4520;
  --color-primary-light: #D4744A;

  --color-secondary: #FFD299;     /* 元 #FFDAB6 → 彩度+15% */
  --color-accent: #FFB870;        /* 元 #FFCA9D → 彩度+20% */
  --color-subtle: #FFBFC4;        /* 元 #F1D3D5 → 彩度+25% */

  /* Text Colors */
  --color-text: #3d3d3d;
  --color-text-light: #666666;
  --color-text-inverse: #ffffff;

  /* Background Colors */
  --color-bg: #ffffff;
  --color-bg-alt: #fffaf5;
  --color-bg-warm: var(--color-secondary);

  /* Bootstrap overrides */
  --bs-primary: var(--color-primary);
  --bs-primary-rgb: 184, 90, 48;
  --bs-link-color: var(--color-primary);
  --bs-link-hover-color: var(--color-primary-dark);
}

/* Body */
body {
  font-family: 'Kosugi Maru', "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* ========================================
   禁則処理・テキストバランス
   ======================================== */

/* 長い段落の禁則処理 */
p, li, td, th, dd {
  word-break: auto-phrase; /* Chrome 119+ */
  overflow-wrap: break-word;
  line-break: strict; /* 厳格な禁則処理 */
}

/* 短いテキストのバランス調整（見出し用） */
h1, h2, h3, h4, h5, h6,
.text-balance {
  text-wrap: balance; /* Chrome 114+, Firefox 121+ */
}

/* ========================================
   将来使用予定（現在無効）
   ======================================== */

/*
--- Navbar (Bootstrap互換) ---
.navbar-hadatai {
  background-color: var(--color-primary);
}

.navbar-hadatai .navbar-brand,
.navbar-hadatai .nav-link {
  color: var(--color-text-inverse);
}

.navbar-hadatai .nav-link:hover {
  color: var(--color-accent);
}

--- Hero Section ---
.hero {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  padding: 4rem 0;
}

.hero-title {
  color: var(--color-primary);
  font-weight: bold;
}

--- Buttons ---
.btn-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.btn-outline-primary {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline-primary:hover {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn-accent {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text);
}

.btn-accent:hover {
  background-color: #f0a050;
  border-color: #f0a050;
}

--- Cards ---
.card-hadatai {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-hadatai:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.card-hadatai .card-header {
  background-color: var(--color-subtle);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
}

.card-hadatai .card-img-top {
  border-radius: 12px 12px 0 0;
  object-fit: cover;
  height: 200px;
}

.card-hadatai .card-title {
  color: var(--color-primary);
  font-weight: bold;
}

--- Section backgrounds ---
.section-warm {
  background-color: var(--color-bg-warm);
}

.section-subtle {
  background-color: var(--color-subtle);
}

.section-alt {
  background-color: var(--color-bg-alt);
}

--- Typography colors ---
.text-primary {
  color: var(--color-primary) !important;
}

.text-accent {
  color: var(--color-accent);
}

--- Thumbnail size variations ---
.thumb-xs {
  height: 32px;
}

.thumb-sm {
  height: 80px;
}

.thumb-md {
  height: 125px;
}

.thumb-lg {
  height: 160px;
}

.thumb-xl {
  height: 200px;
}

.thumb-square {
  width: 96px;
  height: 96px;
  object-fit: cover;
}

.thumb-square-lg {
  width: 160px;
  height: 160px;
  object-fit: cover;
}

--- Thumbnail float ---
.thumb-left {
  float: left;
  margin-right: 10px;
  margin-bottom: 5px;
}

.thumb-right {
  float: right;
  margin-left: 10px;
  margin-bottom: 5px;
}

.thumb-inline {
  height: 1.2em;
  width: auto;
  vertical-align: middle;
  border: none;
  margin: 0 2px;
}

.thumb-noborder,
.thumb-noborder.thumb {
  border: none;
}

--- Aside (テキスト横の補足画像) ---
.aside {
  float: right;
  max-width: 35%;
  height: auto;
  margin: 0 0 10px 15px;
  border: 1px solid #ccc;
  border-radius: 2px;
}

@media (max-width: 575.98px) {
  .aside {
    float: none;
    max-width: 100%;
    margin: 10px 0;
    display: block;
  }

  .thumb-left,
  .thumb-right {
    float: none;
    display: block;
    margin: 10px auto;
  }
}

--- 将来使用予定ここまで ---
*/

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

.footer-hadatai {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.footer-hadatai a {
  color: var(--color-accent);
}

.footer-hadatai a:hover {
  color: var(--color-secondary);
}

/* Footer layout */
.footer-logo {
  float: left;
  margin-right: 1.5rem;
  margin-top: 0.5rem;
}

.footer-text {
  overflow: hidden;
}

.footer-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin: 0;
  color: var(--color-text-inverse);
}

.footer-subtitle {
  font-size: 1.25rem;
  font-weight: normal;
  margin: 0 0 1rem 0;
  opacity: 0.9;
  color: var(--color-text-inverse);
}

.footer-notice {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  opacity: 0.85;
}

.footer-notice li {
  margin-bottom: 0.25rem;
}

.footer-copyright {
  font-size: 0.875rem;
  margin: 0;
  opacity: 0.8;
}

@media (max-width: 575.98px) {
  .footer-logo {
    float: none;
    margin-bottom: 1rem;
    text-align: center;
  }

  .footer-title {
    font-size: 2rem;
  }

  .footer-subtitle {
    font-size: 1rem;
  }
}

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

.header-hadatai {
  background-color: var(--color-primary);
}

.header-logo img {
  height: 40px;
}

.btn-header {
  background-color: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--color-text-inverse);
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-header:hover {
  background-color: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
  color: var(--color-text-inverse);
}

.header-hadatai .navbar-toggler {
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.5rem 0.75rem;
  color: var(--color-text-inverse);
  font-size: 1.25rem;
}

/* ========================================
   Language Bar
   ======================================== */

.lang-bar {
  background-color: var(--color-bg-alt);
  padding: 0.25rem 0;
  border-bottom: 1px solid #eee;
}

.lang-bar .lang-label {
  color: var(--color-text-light);
  font-size: 0.75rem;
  margin-right: 0.25rem;
}

.lang-bar select {
  background-color: #fff;
  border: 1px solid #ccc;
  color: var(--color-text);
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.lang-bar select:hover {
  border-color: var(--color-primary);
}

/* ========================================
   Global Navigation
   ======================================== */

.global-nav {
  background-color: var(--color-primary-dark);
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.nav-menu li {
  flex: 1;
  text-align: center;
}

.nav-menu li a {
  display: block;
  color: var(--color-text-inverse);
  text-decoration: none;
  padding: 0.75rem 0.5rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-menu li a:hover {
  background-color: rgba(255,255,255,0.1);
  color: var(--color-accent);
}

.nav-menu-mobile {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu-mobile li a {
  display: block;
  color: var(--color-text-inverse);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-menu-mobile li a:hover {
  background-color: rgba(255,255,255,0.1);
}

.mobile-quick-links {
  padding: 0.5rem 1rem;
  background-color: rgba(255,255,255,0.05);
}

.mobile-quick-links .btn-header {
  text-align: center;
}

/* ========================================
   Thumbnail / Image Styles
   ======================================== */

/* 基本サムネイル */
.thumb {
  height: 125px;
  width: auto;
  border: 1px solid #ccc;
  margin: 2px;
  border-radius: 2px;
  object-fit: cover;
}

/* CSS縮小（サムネイルがない場合にフルサイズ画像を縮小表示） */
.thumb-css {
  height: 125px;
  width: auto;
  max-width: 100%;
  border: 1px solid #ccc;
  border-radius: 2px;
  object-fit: contain;
}

/* ギャラリー（横並び複数画像） */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1rem 0;
}

.gallery .thumb,
.gallery a.popup img {
  height: 125px;
  width: auto;
  border: 1px solid #ccc;
  border-radius: 2px;
  object-fit: cover;
}

.gallery .thumb-css {
  height: 125px;
}

/* メイン画像（単独表示） */
.main-image {
  margin: 1.5rem 0;
  text-align: left;
}

@media (max-width: 575.98px) {
  .gallery .thumb,
  .gallery a.popup img {
    height: 100px;
  }
}

/* ========================================
   Text Styles (warn/note)
   ======================================== */

.warn {
  color: #FF0000;
  font-weight: bold;
}

.note {
  color: #B22222;
}

/* ========================================
   Content Article Styles
   ======================================== */

.content-article {
  line-height: 1.8;
}

.content-article h1,
.content-article h2,
.content-article h3,
.content-article h4 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.content-article p {
  margin-bottom: 1rem;
}

.content-article ul,
.content-article ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.content-article li {
  margin-bottom: 0.5rem;
}

/* クリアフィックス（float解除） - 記事全体の最後のみ */
.content-article::after {
  content: "";
  display: table;
  clear: both;
}

/* ========================================
   Links
   ======================================== */

a {
  color: var(--color-primary);
}

a:hover {
  color: var(--color-primary-dark);
}

/* ========================================
   Typography - 統一設定
   h1: calc(1.375rem + 1.5vw) - 下線なし
   h3: 135% (1.35em) - 下線あり
   h4: 120% (1.2em) - 細い下線 + 薄い色
   h2: 保留、h5/h6: 廃止
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  color: var(--color-text);
}

/* h1: ページタイトル */
h1 {
  font-size: calc(1.375rem + 1.5vw);
  color: #636363;
}

/* h3: セクション見出し */
h3 {
  font-size: 1.35em;
  color: #636363;
  margin-top: 20px;
  margin-bottom: 10px;
  border-bottom: 2px solid #e07145;
  padding-bottom: 8px;
}

/* h4: 小見出し */
h4 {
  font-size: 1.2em;
  color: #888;
  margin-top: 20px;
  margin-bottom: 10px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 6px;
}

/* 最初の見出しは上マージン不要 */
h3:first-child,
h4:first-child {
  margin-top: 0;
}

/* h1〜h4は上記で統一定義（各CSSでの上書き禁止） */

/* セクション区切り線（h3と同じスタイル） */
hr.section-divider {
  border: none;
  border-top: 2px solid #e07145;
  margin: 20px 0;
}

/* イントロコンテナ */
.product-intro {
  /* floatは包含しない - テキストが回り込む */
}

/* フォームセクション（floatの影響を受けない独立ブロック） */
.easyorder-form {
  display: flow-root;
}

/* イントロ・ヒーロー画像（商品ページ右上） */
.intro-hero {
  width: 35%;
  float: right;
  margin: 0 0 10px 10px;
  display: block;
}

/* <a>タグが.intro-heroのimgを囲む場合、<a>にfloatを適用 */
a:has(> img.intro-hero) {
  width: 35%;
  float: right;
  margin: 0 0 10px 10px;
  display: block;
}

a:has(> img.intro-hero) > img.intro-hero {
  width: 100%;
  height: auto;
  float: none;
  margin: 0;
}

/* イントロ・メイン画像（サムネイル） */
.intro-main-image {
  width: 35%;
  max-width: 200px;
  height: auto;
}

@media (max-width: 575.98px) {
  .intro-hero,
  a:has(> img.intro-hero) {
    float: none;
    width: 35%;
    margin: 0 0 15px 0;
    display: block;
  }

  .intro-main-image {
    width: 50%;
    max-width: none;
  }
}

/* ========================================
   Top Page - Main Visual & Cards
   ======================================== */

/* メインビジュアル・カード画像: 最大600px */
.mainvisual .thumbnail img,
.pickup .thumbnail img {
  max-width: 600px;
  width: 100%;
  height: auto;
}

/* カードタイトル: 本文と同じ16px */
.thumbnail-title {
  font-size: 1rem;
  font-weight: bold;
}

/* メインビジュアル・商品カタログ: 背景色で差別化 */
.mainvisual,
.pickup {
  background-color: var(--color-bg-alt);
  padding: 1.5rem 0;
}

/* 外枠（containerの内側に） */
.mainvisual > .container,
.pickup > .container {
  border: 1px solid #e0d8d0;
  padding: 1rem;
  border-radius: 4px;
}

.pickup {
  margin-top: 0;
}

/* ========================================
   News Section (新着情報)
   ======================================== */

/* セクション全体 */
.news-section {
  padding: 2rem 0;
  margin-top: 2rem;
  border-top: 3px solid var(--color-accent);
}

/* ヘッダー */
.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.news-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--color-primary);
}

.news-archive-link {
  font-size: 0.875rem;
}

/* 個別アイテム */
.news-item {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 1rem;
}

.news-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.news-item a {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* 新着情報画像 */
.news-section .news-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* 新着情報タイトル */
.news-title {
  font-size: 0.875rem;
  font-weight: bold;
  margin: 0.75rem;
  line-height: 1.4;
  color: var(--color-text);
}

/* 新着情報日付 */
.news-date {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin: 0 0.75rem 0.75rem;
}

/* モバイル: 2カラム */
@media (max-width: 767.98px) {
  .news-section .col-md-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .news-title {
    font-size: 0.8rem;
  }
}

/* ========================================
   Collapse Section (折りたたみ)
   ======================================== */

.collapse-section {
  margin: 1.5rem 0;
  border: 1px solid #e0d8d0;
  border-radius: 8px;
  background-color: #fff;
}

.collapse-section[open] {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.collapse-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--color-text);
  background-color: var(--color-bg-alt);
  border-radius: 8px;
  transition: background-color 0.2s;
}

.collapse-section[open] .collapse-header {
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid #e0d8d0;
}

.collapse-header:hover {
  background-color: var(--color-secondary);
}

.collapse-header img {
  height: 32px;
  width: auto;
  border-radius: 4px;
}

.collapse-icon {
  margin: 0 0.25rem;
  transition: transform 0.2s;
}

.collapse-section[open] .collapse-icon {
  transform: rotate(90deg);
}

.collapse-desc {
  color: var(--color-text-light);
  font-weight: normal;
  font-size: 0.9rem;
}

.collapse-content {
  padding: 1rem;
  line-height: 1.8;
}

.collapse-content img {
  max-width: 100%;
  height: auto;
}

.collapse-content p {
  margin-bottom: 0.75rem;
}

.collapse-content a:last-child {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--color-primary);
  font-weight: bold;
}

/* クリアフィックス */
.collapse-content::after {
  content: "";
  display: table;
  clear: both;
}

@media (max-width: 575.98px) {
  .collapse-header {
    font-size: 1rem;
    padding: 0.75rem;
  }

  .collapse-header img {
    height: 24px;
  }

  .collapse-desc {
    font-size: 0.8rem;
  }

  .collapse-content {
    padding: 0.75rem;
  }
}

/* ========================================
   Code Block (整形済みテキスト)
   ======================================== */

.code-block {
  background: #f5f5f5;
  padding: 1em;
  border-radius: 4px;
  font-family: monospace;
  white-space: pre;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid #e0e0e0;
}

/* ========================================
   Blog Article Styles
   ======================================== */

.blog-date {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.blog-date time {
  display: inline-block;
}

.blog-eyecatch {
  margin: 0 0 2rem 0;
  text-align: center;
}

.blog-eyecatch img {
  max-width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 575.98px) {
  .blog-eyecatch img {
    max-height: 250px;
    border-radius: 4px;
  }
}

/* フッターリンク */
.footer-links {
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--color-accent);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-secondary);
  text-decoration: underline;
}

@media (min-width: 768px) {
  .footer-links {
    text-align: right;
  }
}

/* ========================================
   マニュアル戻るボタン（スクロール追従）
   ======================================== */
.man-back-container {
  position: sticky;
  top: 0;
  z-index: 1050;
  height: 0;
  overflow: visible;
}

.man-back-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #000000;
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: background 0.2s, transform 0.2s;
}

.man-back-btn:hover {
  background: #f0f0f0;
  color: #000000;
  transform: scale(1.1);
}

.man-back-btn:active {
  transform: scale(0.95);
}

/* テーブル幅auto + センタリング */
.table-auto {
  width: auto !important;
  margin-left: auto;
  margin-right: auto;
}
