:root {
	--ink: #2F5233;
	--ink-soft: #6D8670;
	--bg: #F6F3E8;
	--bg-soft: #FDFEFD;
	--bg-map: #ECECDA;
	--line: #DEE3DE;
	--accent: #8FBFA0;
	--badge-bg: #E6EAE7;
}

body {
	font-family: "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
	background: var(--bg);
	color: var(--ink);
	margin: 0;
	padding: 20px;
}
.container { max-width: 1000px; margin: 0 auto; }

/* ヘッダーは画面横いっぱいの帯にする（中身はheader-innerのmax-widthで中央寄せのまま）。
   100vw+負のmarginで広げる方法は、スクロールバー幅を含んでしまい右端が数十px欠ける環境があったため、
   bodyの左右paddingを打ち消す負のmarginだけを指定し、幅はwidth:auto(既定値)に委ねる方式にしている
   （bodyの実際のコンテンツ幅を基準にするのでスクロールバーの有無に関わらず正確に画面幅いっぱいになる）。
   スマホ幅も含め常時フルブリードとし、bodyのpaddingが変わる600px以下のブレークポイントでのみ
   打ち消す量を合わせて調整する（下部の@media(max-width:600px)参照） */
.header-area {
	background: var(--bg-soft);
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	margin-left: -20px;
	margin-right: -20px;
	margin-bottom: 16px;
}
.header-inner {
	position: relative;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	padding: 14px 18px;
	overflow: hidden;
	max-width: 1000px;
	margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; position: relative; }
.brand .club-mark { width: 72px; height: auto; flex: none; }
.brand .title-block h1 { font-size: 17px; font-weight: 700; margin: 0; line-height: 1.3; color: var(--ink); }
.brand .title-block .en { font-size: 9px; letter-spacing: 0.1em; color: var(--ink-soft); margin: 2px 0 0; font-weight: 700; }
.header-links { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }

/* 部活ノートらしい控えめな幾何学コンフェッティ（学マス公式ガイドブックの表紙モチーフをオマージュ） */
.header-confetti { position: absolute; inset: 0; pointer-events: none; opacity: 0.3; }
.header-confetti span { position: absolute; display: block; }
.header-confetti .tri { width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 17px solid var(--accent); right: 18%; top: 12%; transform: rotate(18deg); }
.header-confetti .circ { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); right: 6%; top: 30%; }
.header-confetti .dia { width: 11px; height: 11px; background: var(--accent); transform: rotate(45deg); right: 30%; top: 55%; }

.filter-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; }
.btn {
	background: var(--bg-soft);
	border: 1.5px solid var(--line);
	color: var(--ink-soft);
	padding: 9px 16px;
	border-radius: 999px;
	font-weight: bold;
	font-size: 13px;
	cursor: pointer;
	font-family: inherit;
}
.btn.active { background: var(--accent); color: var(--ink); border-color: var(--accent); }

#map {
	display: block;
	width: 100%;
	height: 550px;
	background-color: var(--bg-map);
	border-radius: 16px;
	box-shadow: 0 12px 28px -18px rgba(47,82,51,0.35);
	border: 1px solid var(--line);
	margin-bottom: 20px;
}

.custom-pin {
	display: flex;
	align-items: center;
	justify-content: center;
}
.pin-circle {
	/* .custom-pin(Leafletのdiv-icon)の幅とぴったり一致させ、borderの分だけ内側にはみ出て
	   flexboxに横方向だけ縮められ楕円になってしまうのを防ぐため、border込みでサイズ指定する */
	box-sizing: border-box;
	position: relative;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 3px solid var(--bg-soft);
	box-shadow: 0 4px 10px -3px rgba(47,82,51,0.45);
	transition: transform 0.15s ease;
}
/* 「ぬい活フォト」フィルター時だけ、ぬい活ピンを大きく表示する（JS側のPIN_SIZE_NUI_FILTERとサイズを一致させること） */
.pin-circle.pin-circle-large {
	width: 52px;
	height: 52px;
}

/* 座標がほぼ同じスポットをまとめた「クラスタピン」。クリックで個別ピンに展開できる（map.jsのcreateClusterMarker参照） */
.pin-cluster {
	box-sizing: border-box;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--ink-soft);
	border: 3px solid var(--bg-soft);
	box-shadow: 0 4px 10px -3px rgba(47,82,51,0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--bg-soft);
	font-size: 13px;
	font-weight: 800;
	transition: transform 0.15s ease;
}

/* 常設ストア（event_idなしのEVENTスポット）は「期間限定ではなくずっとそこにある」ことが
   シルエットだけで分かるよう、他のEVENTピンと違うひし形にする。角丸スクエアを45度回転させたもの。
   中身（アイコンバッジ）は回転の影響を受けないよう逆回転させて正立させる */
.pin-circle.pin-store {
	border-radius: 8px;
	transform: rotate(45deg);
}
.pin-circle.pin-store .pin-icon-badge {
	transform: translate(-50%, -50%) rotate(-45deg);
}
/* 選択時の拡大(.pin-selected)はtransformの上書き合戦になるため、ひし形の回転を保ったまま拡大するよう明示的に合成する */
.pin-circle.pin-store.pin-selected {
	transform: rotate(45deg) scale(1.35);
}

/* イベントピンに重ねる種別アイコン。ピザ型・虹色グラデーションの上でも視認できるよう、白丸バッジ越しに乗せる */
.pin-icon-badge {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 19px;
	height: 19px;
	border-radius: 50%;
	background: var(--bg-soft);
	color: var(--ink);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 1px 2px rgba(47,82,51,0.35);
}

/* ぬい活ピンの写真サムネイル。ぬい活フォトギャラリー（.photo-grid-item img）と同じ焦点位置・ズームの技法を丸クリップで使う */
.pin-thumb {
	overflow: hidden;
	background: var(--accent);
}
.pin-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--focal-x, 50%) var(--focal-y, 50%);
	transform-origin: var(--focal-x, 50%) var(--focal-y, 50%);
	transform: scale(var(--zoom, 1));
	filter: brightness(var(--fx-brightness, 1)) contrast(var(--fx-contrast, 1)) saturate(var(--fx-saturate, 1)) grayscale(var(--fx-grayscale, 0)) sepia(var(--fx-sepia, 0));
}

/* ピンをクリックした際の拡大表示。ポップアップを閉じると元のサイズに戻る */
.pin-selected {
	transform: scale(1.35);
}

/* ダッシュボードの一覧・カレンダーから遷移してきた際に、対象のピンを一時的に目立たせる演出 */
.pin-highlighted {
	animation: pin-pulse 1s ease-in-out 4;
}
@keyframes pin-pulse {
	0% { box-shadow: 0 4px 10px -3px rgba(47,82,51,0.45), 0 0 0 0 rgba(143,191,160,0.8); }
	70% { box-shadow: 0 4px 10px -3px rgba(47,82,51,0.45), 0 0 0 12px rgba(143,191,160,0); }
	100% { box-shadow: 0 4px 10px -3px rgba(47,82,51,0.45), 0 0 0 0 rgba(143,191,160,0); }
}

/* Leafletのポップアップの既定デザインを、部活ノート風のカード（マスキングテープ付き）に上書きする */
.leaflet-popup-content-wrapper {
	background: var(--bg-soft);
	border-radius: 14px;
	border: 1px solid var(--line);
	box-shadow: 0 16px 30px -14px rgba(47,82,51,0.4);
}
.leaflet-popup-content { margin: 0; }
.leaflet-popup-close-button { color: var(--ink-soft) !important; }

/* 吹き出しの三角tipを消し、ピンに紙を貼り付けたような「付箋」の見た目にする
   （tip分の間隔はdivIconのpopupAnchorで調整済み） */
.leaflet-popup-tip-container { display: none; }

.spot-popup { position: relative; font-family: inherit; padding: 14px 12px 12px; }
.spot-popup .tape {
	position: absolute;
	top: -10px;
	left: 18px;
	width: 44px;
	height: 17px;
	background: rgba(143,191,160,0.55);
	border: 1px solid rgba(143,191,160,0.75);
	transform: rotate(-4deg);
	border-radius: 2px;
}
.spot-popup .spot-image {
	width: 100%; height: auto; display: block; border-radius: 10px; margin-bottom: 8px;
	filter: brightness(var(--fx-brightness, 1)) contrast(var(--fx-contrast, 1)) saturate(var(--fx-saturate, 1)) grayscale(var(--fx-grayscale, 0)) sepia(var(--fx-sepia, 0));
}
.spot-popup .eyebrow-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.spot-popup .eyebrow { font-size: 9px; letter-spacing: 0.12em; color: var(--ink-soft); font-weight: 700; }
.spot-popup .spot-name {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: var(--ink);
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.spot-popup .place-name { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.spot-popup .organizer-link { color: var(--ink-soft); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.spot-popup .organizer-link:hover { color: var(--ink); }
.spot-popup .closure-notice {
	display: inline-block; font-size: 10.5px; font-weight: 700; color: #9C6B1F;
	background: #FBF0DA; border: 1px solid #EAD3A0; border-radius: 999px; padding: 2px 8px; margin-top: 4px;
}
.spot-popup .opening-notice {
	display: inline-block; font-size: 10.5px; font-weight: 700; color: #2F6B45;
	background: #E9F3EC; border: 1px solid #B9D9C4; border-radius: 999px; padding: 2px 8px; margin-top: 4px;
}
.spot-popup .tag-row { margin-top: 6px; }
.spot-popup .idol-tag,
.spot-popup .location-tag {
	display: inline-block;
	background: var(--badge-bg);
	color: var(--ink);
	padding: 3px 8px;
	border-radius: 999px;
	font-size: 10.5px;
	font-weight: 700;
	margin: 3px 4px 0 0;
}
.spot-popup .description { font-size: 12px; margin: 6px 0 0; color: #4A5A4C; white-space: pre-wrap; }
.spot-popup details { margin-top: 6px; }
.spot-popup summary { font-size: 12px; color: var(--ink); cursor: pointer; font-weight: bold; }

.btn-nav-create {
	background: var(--ink);
	color: var(--bg-soft);
	text-decoration: none;
	padding: 10px 18px;
	border-radius: 999px;
	font-weight: bold;
	font-size: 14px;
	white-space: nowrap;
	transition: opacity 0.2s;
}
.btn-nav-create:hover { opacity: 0.85; }
.btn-nav-dashboard {
	background: var(--bg-soft);
	color: var(--ink);
	border: 1.5px solid var(--line);
	text-decoration: none;
	padding: 9px 18px;
	border-radius: 999px;
	font-weight: bold;
	font-size: 14px;
	white-space: nowrap;
}
.btn-nav-dashboard:hover { border-color: var(--accent); }

@media (max-width: 600px) {
	body { padding: 12px; }
	.brand .club-mark { width: 56px; }
	.brand .title-block h1 { font-size: 15px; }
	.header-area { padding: 12px 14px; margin-bottom: 12px; margin-left: -12px; margin-right: -12px; }
	#map { height: 420px; }
	.btn { padding: 7px 12px; font-size: 12.5px; }
	.btn-nav-create, .btn-nav-dashboard { padding: 8px 14px; font-size: 13px; }
	/* モバイル幅では「ぬい活を投稿」導線をタブバー中央の＋FABに譲り、ヘッダーからは消す
	   （英字サブタイトルとの折り返し合戦を避けるため） */
	.header-links { display: none; }
}
