/* ============================================================
   yoridori — Dynamic Responsive & Component Styles
   ============================================================ */

:root {
  --primary: #2D6A4F;
  --primary-hover: #1B4332;
  --primary-light: #E8F5E9;
  --accent: #E76F51;
  --accent-hover: #D45032;
  --bg-main: #F4F7F5;
  --bg-card: #FFFFFF;
  --text-main: #1C2D27;
  --text-soft: #52635A;
  --text-faint: #8A9A90;
  --border: #D8E2DC;
  --border-light: #EAF0EC;
  --gold: #D4A373;
  --stamp: #BC4749;
  --shadow-sm: 0 2px 8px rgba(45, 106, 79, 0.06);
  --shadow-md: 0 8px 24px rgba(45, 106, 79, 0.12);
  --radius: 8px;
  --radius-lg: 16px;
  --font-display: 'M PLUS Rounded 1c', 'Zen Maru Gothic', sans-serif;
  --font-body: 'M PLUS Rounded 1c', 'Zen Maru Gothic', sans-serif;
  --font-mono: 'M PLUS Rounded 1c', 'Zen Maru Gothic', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.7;
}

img, video { max-width: 100%; height: auto; }

/* ---------- Ticker ---------- */
.top-ticker {
  background: var(--primary-hover); color: #fff;
  font-family: var(--font-mono); font-size: 0.76rem;
  overflow: hidden; white-space: nowrap; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.top-ticker .ticker-track {
  display: inline-flex; gap: 38px; padding: 7px 0; animation: ticker 35s linear infinite;
}
.top-ticker b { color: #FFE082; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Navbar & Hamburger ---------- */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
  box-shadow: var(--shadow-sm);
}
.nav-container {
  max-width: 1180px; margin: 0 auto; 
  padding: 12px 20px;
  display: flex; align-items: center; gap: 16px;
}
.logo {
  font-size: 1.4rem; font-weight: 800; color: var(--primary);
  cursor: pointer; display: flex; align-items: baseline; gap: 8px;
}
.logo small { font-size: 0.75rem; color: var(--text-soft); font-weight: 500; }
.auth-status { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 0.85rem; }

.hamburger-btn {
  background: transparent; border: none; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; padding: 4px;
}
.hamburger-btn span { width: 22px; height: 2px; background: var(--text-main); border-radius: 2px; }

/* ---------- Hero / Landing Page ---------- */
.landing-section {
  padding: 40px 20px 0; /* 下パディングを0にしてフッターのスクロール限界を制御 */
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.hero-copy { font-size: 2.2rem; font-weight: 900; line-height: 1.3; margin-bottom: 24px; }
.hero-copy .highlight { color: var(--accent); }
.hero-subcopy { font-size: 1.05rem; color: var(--text-soft); margin-bottom: 40px; }
.hero-subcopy p { margin-bottom: 6px; }

.venn-wrapper {
  display: flex; justify-content: center; align-items: center; margin: 40px 0;
}
.venn-circle {
  width: 220px; height: 220px; border-radius: 50%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 20px; text-align: center; color: #fff; box-shadow: var(--shadow-md);
}
.venn-left { background: rgba(45, 106, 79, 0.85); margin-right: -40px; }
.venn-right { background: rgba(231, 111, 81, 0.85); }
.venn-circle h3 { font-size: 1.2rem; margin-bottom: 8px; }
.venn-circle p { font-size: 0.8rem; line-height: 1.4; }

.hero-cta-area { margin-top: 40px; margin-bottom: 0; }
.login-link-sub { margin-top: 24px; } /* スタートページの新規会員登録ボタンとログイン誘導を離す */
.sub-login-link { color: var(--text-soft); font-size: 0.9rem; text-decoration: underline; }

/* ---------- Buttons & UI Components ---------- */
.btn {
  padding: 10px 20px; border-radius: 30px; font-weight: 700; border: none; cursor: pointer;
  transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-size: 0.9rem; text-decoration: none;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn.small { padding: 6px 14px; font-size: 0.8rem; }
.btn.full-width { width: 100%; }
.cta-large { font-size: 1.1rem; padding: 14px 40px; border-radius: 40px; background: var(--accent); color: #fff; }

/* ---------- Drawer Menu ---------- */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 299;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer-menu {
  position: fixed; top: 0; left: -280px; width: 280px; height: 100%;
  background: var(--bg-card); z-index: 300; transition: transform 0.3s ease;
  box-shadow: var(--shadow-md); display: flex; flex-direction: column;
}
.drawer-menu.open { transform: translateX(280px); }
.drawer-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.drawer-user-info { display: flex; align-items: center; gap: 12px; }
.avatar-img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.avatar-img.small { width: 28px; height: 28px; }
.avatar-img.large { width: 80px; height: 80px; }
.drawer-close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.drawer-nav { padding: 12px 0; overflow-y: auto; }
.drawer-btn {
  width: 100%; text-align: left; padding: 12px 24px; background: none; border: none;
  font-family: var(--font-body); font-size: 0.95rem; cursor: pointer; color: var(--text-main);
}
.drawer-btn.active, .drawer-btn:hover { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.drawer-dropdown-toggle { padding: 12px 24px; display: flex; justify-content: space-between; cursor: pointer; font-size: 0.95rem; }
.drawer-submenu { background: #F8FAF9; }
.drawer-btn.sub-btn { padding-left: 40px; font-size: 0.9rem; }

/* ---------- App Views ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 20px; }
.view-section { display: none; }
.view-section.active { display: block; }
.page-head { margin-bottom: 24px; }
.page-head h2 { font-size: 1.5rem; color: var(--primary); }
.page-head .subtitle { font-size: 0.85rem; color: var(--text-soft); }

/* ---------- Cards Grid & Cards ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-img { width: 100%; height: 180px; object-fit: cover; cursor: pointer; }
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-size: 1rem; font-weight: 700; cursor: pointer; line-height: 1.4; }
.card-desc { font-size: 0.8rem; color: var(--text-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-author-bar { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; cursor: pointer; }

/* 正方形画像のトリミング・カード端までの拡大設定 */
.post-horizontal-card { width: 280px; flex-shrink: 0; }
.post-horizontal-card .card-img { height: 180px; width: 100%; object-fit: cover; display: block; }

/* マイページ カードデザイン */
.big-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

/* ---------- 属性選択カード（横並び） ---------- */
.horiz-cards-container {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px;
}
.attribute-card {
  flex: 1; min-width: 180px; border: 2px solid var(--border); border-radius: var(--radius);
  padding: 14px; cursor: pointer; transition: all 0.2s; background: var(--bg-card);
}
.attribute-card.on { border-color: var(--primary); background: var(--primary-light); }
.role-badge { display: inline-block; background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 700; margin-bottom: 6px; }
.attribute-card p { font-size: 0.75rem; color: var(--text-soft); line-height: 1.4; }

/* ---------- 支援形態カード（寄付・物資・お手伝い） ---------- */
.type-tab-row {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.type-tab-card {
  flex: 1; min-width: 140px; border: 2px solid var(--border); border-radius: var(--radius);
  padding: 16px 14px; text-align: center; background: var(--bg-card); transition: all 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.type-tab-card.on { border-color: var(--primary); background: var(--primary-light); }
.type-tab-icon { font-size: 1.6rem; }
.type-tab-label { font-weight: 700; font-size: 0.95rem; }
.type-tab-btn { margin-top: 4px; }

/* ---------- 無限スクロール (CSS Animation) ---------- */
.horizontal-section { margin-bottom: 32px; overflow: hidden; }
.section-title { font-size: 1.15rem; margin-bottom: 12px; }
.infinite-scroll-outer { width: 100%; overflow: hidden; }
.infinite-scroll-track {
  display: flex; gap: 0; width: max-content; animation: scrollLeft 35s linear infinite;
}
.infinite-scroll-track:hover { animation-play-state: paused; }
@keyframes scrollLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---------- Badges & Forms ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 700; }
.badge-pref { background: #E9ECEF; color: var(--text-main); }
.badge-type-money { background: #E3F2FD; color: #1976D2; }
.badge-type-goods { background: #E8F5E9; color: #388E3C; }
.badge-type-human { background: #FFF3E0; color: #F57C00; }
.badge-status-approved { background: var(--primary-light); color: var(--primary); }
.badge-status-pending { background: #FFF9C4; color: #F57F17; }

.form-card { background: var(--bg-card); padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--border-light); max-width: 600px; margin: 0 auto; }
.form-group { margin-bottom: 16px; text-align: left; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font-body); font-size: 0.9rem;
}
.search-box input { padding: 8px 16px; border: 1px solid var(--border); border-radius: 20px; width: 100%; font-size: 0.85rem; }

/* Progress Bar */
.progress-bar-bg { width: 100%; height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.card-stats { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-soft); }

/* Chat Container */
.chat-container { display: flex; height: 500px; background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
.chat-sidebar { width: 280px; border-right: 1px solid var(--border); overflow-y: auto; }
.chat-main { flex: 1; display: flex; flex-direction: column; }
.chat-thread-item { padding: 12px; border-bottom: 1px solid var(--border-light); cursor: pointer; display: flex; gap: 10px; align-items: center; }
.chat-thread-item.active { background: var(--primary-light); }
.chat-header { padding: 12px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.chat-messages-list { flex: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.chat-msg-row { display: flex; gap: 8px; }
.chat-msg-row.me { flex-direction: row-reverse; }
.chat-msg-bubble { padding: 8px 14px; border-radius: 16px; font-size: 0.85rem; max-width: 70%; }
.chat-msg-row.me .chat-msg-bubble { background: var(--primary); color: #fff; }
.chat-msg-row.other .chat-msg-bubble { background: #E9ECEF; color: var(--text-main); }
.chat-input-area { padding: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 400; display: flex; justify-content: center; align-items: center; padding: 20px; }
.modal-content { background: var(--bg-card); padding: 28px; border-radius: var(--radius-lg); max-width: 480px; width: 100%; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-content.wide { max-width: 640px; }
.close-btn { position: absolute; top: 16px; right: 20px; font-size: 1.5rem; cursor: pointer; }

/* Ranking Map */
.japan-map-container { height: 450px; background: #e9e9e9; border-radius: var(--radius-lg); overflow: hidden; position: relative; margin-top: 16px; }
.ranking-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.rank-filter-btn { padding: 4px 12px; border-radius: 16px; border: 1px solid var(--border); background: #fff; font-size: 0.8rem; cursor: pointer; }
.rank-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.report-preview-thumb { width: 100px; height: 70px; object-fit: cover; border-radius: 4px; cursor: pointer; }
.kanban-board { display: flex; gap: 20px; }
.kanban-column { flex: 1; }
.kanban-title { font-size: 1rem; margin-bottom: 12px; padding: 6px 12px; border-radius: 4px; }
.kanban-title.status-pending { background: #FFF9C4; color: #F57F17; }
.kanban-title.status-approved { background: var(--primary-light); color: var(--primary); }
/* ============================================================
   yoridori — Dynamic Responsive & Component Styles
   ============================================================ */

:root {
  --primary: #2D6A4F;
  --primary-hover: #1B4332;
  --primary-light: #E8F5E9;
  --accent: #E76F51;
  --accent-hover: #D45032;
  --bg-main: #F4F7F5;
  --bg-card: #FFFFFF;
  --text-main: #1C2D27;
  --text-soft: #52635A;
  --text-faint: #8A9A90;
  --border: #D8E2DC;
  --border-light: #EAF0EC;
  --gold: #D4A373;
  --stamp: #BC4749;
  --shadow-sm: 0 2px 8px rgba(45, 106, 79, 0.06);
  --shadow-md: 0 8px 24px rgba(45, 106, 79, 0.12);
  --radius: 8px;
  --radius-lg: 16px;
  --font-display: 'M PLUS Rounded 1c', 'Zen Maru Gothic', sans-serif;
  --font-body: 'M PLUS Rounded 1c', 'Zen Maru Gothic', sans-serif;
  --font-mono: 'M PLUS Rounded 1c', 'Zen Maru Gothic', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.7;
}

img, video { max-width: 100%; height: auto; }

/* ---------- Ticker ---------- */
.top-ticker {
  background: var(--primary-hover);
  color: #fff;
}

/* ---------- 変更点：認証モーダルの切り替えリンクスタイル ---------- */
.auth-toggle-container {
  text-align: center;
  margin-top: 16px;
}

.auth-toggle-style {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.auth-toggle-style:hover {
  text-decoration: underline;
}

/* ---------- 変更点：プロジェクト一覧 検索バーとフィルター横並び ---------- */
.filter-header-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.filter-header-bar .search-box {
  flex: 1;
  min-width: 200px;
}

.filter-header-bar .filter-controls {
  display: flex;
  gap: 12px;
}

/* ---------- 変更点：無限スクロール＆カードグリッドの間隔（※1: 20pxで統一） ---------- */
.infinite-scroll-track {
  display: flex;
  gap: 20px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 280px);
  justify-content: start;
  gap: 20px;
}

/* ---------- 変更点：⏳もうすぐ終了のスピード調整 ---------- */
@keyframes scrollLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

#posts-hot-list,
#posts-soon-list {
  animation: scrollLeft 30s linear infinite;
}

/* ---------- 変更点：「*必須」テキストスタイル ---------- */
.required-tag {
  color: #f97316;
  font-size: 0.8rem;
  margin-left: 4px;
}

/* ---------- 変更点：ポストカード横幅調整（間隔20pxを保ったまま、3列がコンテナ幅ちょうどに収まる幅へ） ---------- */
:root {
  --post-card-w: calc((1180px - 40px - 40px) / 3);
}

#posts-grid.cards-grid {
  grid-template-columns: repeat(auto-fill, var(--post-card-w));
}

.post-horizontal-card {
  width: var(--post-card-w);
}