/* ============================================
   Beauté Media — Mobile & Responsive Styles v3
   ============================================ */

/* ── ハンバーガーボタン ── */
.m-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  align-items: center;
}

.m-menu-btn span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--c-ink);
  transition: all 0.3s ease;
  transform-origin: center;
}

.m-menu-btn.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.m-menu-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.m-menu-btn.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── モバイル検索バー ── */
.m-search-bar {
  display: none;
  padding: 10px 16px;
  background: var(--c-white);
  border-bottom: 1px solid var(--c-line);
}

.m-search-bar-inner {
  display: flex;
  align-items: center;
  background: var(--c-paper);
  border-radius: 24px;
  padding: 10px 16px;
  gap: 10px;
}

.m-search-bar-inner input {
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--c-ink);
  outline: none;
  flex: 1;
  -webkit-appearance: none;
  min-height: 24px;
}

.m-search-bar-inner input::placeholder { color: #aaa; }

.m-search-bar-inner button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--c-ink-light);
  font-size: 15px;
  padding: 0;
  line-height: 1;
  min-width: 24px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── ドロワーナビ ── */
.m-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

.m-drawer.open { pointer-events: auto; }

.m-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.35s ease;
}

.m-drawer.open .m-drawer-overlay { background: rgba(0,0,0,0.55); }

.m-drawer-panel {
  position: absolute;
  top: 0; left: 0;
  width: 280px;
  height: 100%;
  background: var(--c-white);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.76, 0, 0.24, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.m-drawer.open .m-drawer-panel { transform: translateX(0); }

.m-drawer-head {
  background: var(--c-forest);
  padding: 52px 24px 24px;
}

.m-drawer-logo {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0.22em;
  color: var(--c-white);
  display: block;
  margin-bottom: 4px;
}

.m-drawer-tagline {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.4);
}

.m-drawer-search {
  padding: 14px 20px;
  border-bottom: 1px solid var(--c-line-light);
}

.m-drawer-search form {
  display: flex;
  align-items: center;
  background: var(--c-paper);
  border-radius: 20px;
  padding: 9px 14px;
  gap: 8px;
}

.m-drawer-search input {
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  flex: 1;
  color: var(--c-ink);
  min-height: 24px;
}

.m-drawer-nav { padding: 4px 0; }

.m-drawer-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 24px;
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--c-ink-mid);
  border-bottom: 1px solid var(--c-line-light);
  transition: all 0.2s;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}

.m-drawer-nav a:hover,
.m-drawer-nav a:active {
  background: var(--c-off-white);
  color: var(--c-forest-mid);
}

.m-drawer-nav a .arrow { font-size: 14px; color: var(--c-line); }

.m-drawer-tags {
  padding: 20px 24px;
  border-top: 1px solid var(--c-line-light);
}

.m-drawer-tags-label {
  font-size: 9px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--c-ink-light);
  margin-bottom: 12px;
}

.m-drawer-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.m-drawer-sns {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  border-top: 1px solid var(--c-line-light);
}

.m-drawer-sns a {
  font-size: 22px;
  color: var(--c-ink-light);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.m-drawer-sns a:hover { color: var(--c-forest-mid); }

/* ── 横スクロールカード行 ── */
.scroll-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  margin: 0 calc(-1 * var(--gutter));
  padding: 4px var(--gutter) 8px;
}

.scroll-row::-webkit-scrollbar { display: none; }

.scroll-card {
  flex-shrink: 0;
  width: 200px;
  scroll-snap-align: start;
}

/* ── リストカード（SP） ── */
.list-card-sp {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--c-line-light);
  align-items: start;
  -webkit-tap-highlight-color: transparent;
}

.list-card-sp:last-child { border-bottom: none; }
.list-card-sp:active { opacity: 0.65; }

.list-card-sp-img {
  width: 96px;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--c-paper);
  border-radius: 3px;
  display: block;
}

.list-card-sp-cat {
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-sage);
  margin-bottom: 5px;
}

.list-card-sp-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.45;
  color: var(--c-ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.list-card-sp-date { font-size: 10px; color: var(--c-ink-light); }

/* ── フローティング検索ボタン ── */
.fab-search {
  display: none;
  position: fixed;
  bottom: 72px;
  right: 16px;
  width: 52px; height: 52px;
  background: var(--c-forest-mid);
  border-radius: 50%;
  border: none;
  color: var(--c-white);
  font-size: 20px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(13,31,16,0.3);
  cursor: pointer;
  z-index: 400;
  transition: transform 0.15s, box-shadow 0.15s;
}

.fab-search:active { transform: scale(0.9); box-shadow: 0 2px 8px rgba(13,31,16,0.2); }

/* ── 検索オーバーレイ ── */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--c-white);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: slideUp 0.3s cubic-bezier(0.22,1,0.36,1);
}

.search-overlay.open { display: block; }

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.search-overlay-head {
  position: sticky;
  top: 0;
  background: var(--c-white);
  border-bottom: 1px solid var(--c-line);
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-overlay-form {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--c-paper);
  border-radius: 20px;
  padding: 10px 16px;
  gap: 10px;
}

.search-overlay-form input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  font-family: var(--font-sans);
  outline: none;
  color: var(--c-ink);
  min-height: 24px;
}

.search-cancel-btn {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--c-ink-light);
  cursor: pointer;
  padding: 8px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.search-suggest { padding: 20px 16px; }

.search-suggest-label {
  font-size: 9px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--c-ink-light);
  margin-bottom: 12px;
}

.search-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.search-history-list { display: flex; flex-direction: column; }

.search-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--c-line-light);
  font-size: 14px;
  color: var(--c-ink-mid);
  cursor: pointer;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}

.search-history-item i { font-size: 16px; color: var(--c-ink-light); }

/* ── ボトムナビ ── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  background: var(--c-white);
  border-top: 0.5px solid var(--c-line);
  z-index: 400;
}

.bottom-nav-inner {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  color: var(--c-ink-light);
  font-size: 9px;
  letter-spacing: 0.08em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
  min-width: 56px;
  min-height: 44px;
  justify-content: center;
}

.bottom-nav-item i { font-size: 21px; }
.bottom-nav-item.active { color: var(--c-forest-mid); }

/* ============================================
   モバイル (@max 768px)
   ============================================ */
@media (max-width: 768px) {

  :root { --gutter: 16px; }

  /* ヘッダー */
  .site-header .header-search-form { display: none !important; }
  .site-header .header-sns { display: none !important; }
  .m-menu-btn { display: flex !important; }
  .m-search-bar { display: block !important; }
  .site-nav { display: none !important; }
  .m-drawer { display: block !important; }
  .fab-search { display: flex !important; }
  .bottom-nav { display: block !important; }

  body { padding-bottom: 56px; }

  /* メインレイアウト */
  .site-wrap {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    padding: 0 0 48px !important;
  }

  .sidebar { display: none !important; }

  /* ヒーロー */
  .hero { min-height: 56vw; max-height: 300px; }
  .hero-title { font-size: 30px !important; }
  .hero-excerpt { display: none; }
  .hero-ornament, .hero-rule, .hero-scroll { display: none; }
  .hero-eyebrow { top: 36px !important; }
  .hero-wordmark { font-size: 20px !important; }

  /* featured grid */
  .featured-grid {
    display: block !important;
    border: none !important;
  }

  .featured-main {
    padding: var(--gutter) !important;
    border-right: none !important;
    border-bottom: 1px solid var(--c-line) !important;
  }

  .featured-main .card-thumb {
    margin: 0 calc(-1 * var(--gutter)) 16px !important;
    border-radius: 0 !important;
  }

  .featured-sub {
    padding: var(--gutter) !important;
    border-bottom: 1px solid var(--c-line-light) !important;
  }

  /* グリッド */
  .grid-4, .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
    padding: 0 var(--gutter) !important;
  }

  .card-title-lg { font-size: 18px !important; }
  .card-title-md { font-size: 15px !important; }
  .card-title-sm { font-size: 13px !important; }
  .card-body { padding-top: 12px !important; }

  /* section divider */
  .section-divider { padding: 24px var(--gutter) 14px !important; }

  /* CTA */
  .cta-banner {
    grid-template-columns: 1fr !important;
    padding: 28px var(--gutter) !important;
    margin: 24px 0 !important;
  }

  .cta-actions { align-items: flex-start !important; }

  /* 記事ページ */
  .post-hero { padding: 48px var(--gutter) 36px !important; }
  .post-hero::after { display: none; }
  .post-title { font-size: 26px !important; }
  .post-meta { gap: 12px !important; font-size: 9px !important; flex-wrap: wrap !important; }
  .post-thumb-wrap { margin-bottom: -28px !important; padding: 0 !important; }
  .post-thumb { border-radius: 0 !important; box-shadow: none !important; }
  .post-content-wrap { padding: 48px var(--gutter) 0 !important; }
  .post-content { font-size: 15px !important; line-height: 2 !important; }
  .post-content h2 { font-size: 20px !important; }
  .post-content h3 { font-size: 17px !important; }
  .post-nav { grid-template-columns: 1fr !important; }
  .post-nav-item:first-child { border-right: none !important; border-bottom: 1px solid var(--c-line) !important; }
  .author-box { grid-template-columns: 52px 1fr !important; gap: 14px !important; }
  .author-avatar { width: 52px !important; height: 52px !important; }
  .share-btns { flex-wrap: wrap !important; }
  .share-btn { flex: 1; min-width: 88px; justify-content: center; padding: 10px 12px !important; font-size: 11px !important; }

  /* アーカイブ */
  .archive-hero { padding: 36px var(--gutter) !important; }
  .archive-title { font-size: 30px !important; }
  .tag-bar { padding: 14px 0 18px !important; }

  /* フッター */
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 28px !important; }
  .footer-bottom { flex-direction: column !important; gap: 10px !important; text-align: center !important; }

  /* ランキング */
  .ranking-item { grid-template-columns: 26px 60px 1fr !important; gap: 10px !important; }

  /* タップ最適化 */
  a, button { -webkit-tap-highlight-color: transparent; }
  .card:active { opacity: 0.7; transform: scale(0.97) !important; transition: all 0.1s !important; }
  .cta-btn, .section-divider-more, .card-tag {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* ページネーション */
  .pagination a, .pagination span { width: 36px !important; height: 36px !important; font-size: 11px !important; }

  /* back to top */
  .back-to-top { bottom: 68px !important; right: 16px !important; width: 40px !important; height: 40px !important; }
}

/* ============================================
   タブレット (@769px ~ 1024px)
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --gutter: 28px; }

  .site-wrap { grid-template-columns: 1fr !important; }
  .sidebar { display: none !important; }
  .grid-4 { grid-template-columns: repeat(3, 1fr) !important; }
  .hero { min-height: 50vh !important; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; }
  .m-drawer, .m-menu-btn, .m-search-bar, .fab-search, .bottom-nav { display: none !important; }
  .site-nav { display: block !important; }
  .site-header .header-search-form { display: flex !important; }
}
