/* ==========================================================================
   サイト共通ヘッダー・フッター
   ヘッダー＝ノートの表紙（紺）＋ 見出しシール（タブ）＋ 今日のテーマの帯（マスキングテープ）
   フッター＝応援パートナーのロゴ ＋ ノートの裏表紙（紺）
   ========================================================================== */

:root {
	--ss-navy: #0b1f3a;
	--ss-desk: #f6f4ec;
	--ss-hand: "Klee One", "Noto Sans JP", sans-serif;
	--ss-sans: "Noto Sans JP", system-ui, -apple-system, "Hiragino Sans", sans-serif;
}

/* 旧ヘッダー（固定表示）用の余白は不要になったので打ち消す */
html body {
	padding-top: 0 !important;
}

/* サイト全体の背景：ノート風の方眼紙（議事録と同じ） */
html body {
	background-color: #f6f4ec !important;
	background-image:
		linear-gradient(rgba(120, 150, 190, .14) 1px, transparent 1px),
		linear-gradient(90deg, rgba(120, 150, 190, .14) 1px, transparent 1px) !important;
	background-size: 22px 22px !important;
}

/* bbPress のページではヘッダー・フッターが外側の枠に入るので、枠を無いものとして扱う
   （枠があるとヘッダーがスクロールに追従しない） */
.wp-block-template-part:has(> .ss-header),
.wp-block-template-part:has(> .ss-footer) {
	display: contents;
}

/* ページ内リンクで飛んだとき、見出しがヘッダーに隠れないように */
html {
	scroll-padding-top: 110px;
}

.ss-header,
.ss-header *,
.ss-footer,
.ss-footer * {
	box-sizing: border-box;
	font-style: normal !important;
}

/* ---------- ヘッダー ---------- */

.ss-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 1000;
	font-family: var(--ss-sans);
}

.ss-header__cover {
	background: var(--ss-navy);
	/* 表紙の布っぽい細かな質感 */
	background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 5px);
}

.ss-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	max-width: 1120px;
	height: 52px;
	margin: 0 auto;
	padding: 0 16px;
}

/* トップページでは h1 になるので、テーマの見出しサイズに負けないよう強めに指定 */
.ss-header .ss-header__title {
	min-width: 0;
	margin: 0;
	font-family: var(--ss-hand);
	font-size: 19px !important;
	font-weight: 600;
	line-height: 1 !important;
	letter-spacing: .04em;
	white-space: nowrap;
	overflow: hidden;
}

.ss-header__title a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: inherit !important; /* サイト全体のリンク文字サイズ指定を打ち消す */
	font-family: inherit;
	color: #fff !important;
	text-decoration: none !important;
}

/* タイトル横のアイコン（意見投稿のアバターと同じ手描きキャラクター）を丸く */
.ss-logo-icon {
	display: block;
	flex: none;
	width: 32px;
	height: 32px;
	margin: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #fff;
	object-fit: cover;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

.ss-footer__title .ss-logo-icon {
	width: 40px;
	height: 40px;
}

.ss-logo-icon--emoji {
	display: grid;
	place-items: center;
	font-size: 18px;
	border: 0;
	background: none;
	box-shadow: none;
}

.ss-header__right {
	display: flex;
	flex: none;
	align-items: center;
	gap: 10px;
}

/* サイト名のすぐ右のキャラクター */
.ss-header__mascot {
	display: inline-flex;
	flex: none;
}

/* Twitch 配信中の表示（点滅する赤い丸＋LIVE） */
.ss-live {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 30px;
	padding: 0 12px 0 10px;
	border-radius: 999px;
	background: #e11d48;
	color: #fff !important;
	font-family: var(--ss-sans);
	font-size: 12px !important;
	font-weight: 800;
	letter-spacing: .06em;
	text-decoration: none !important;
	box-shadow: 0 0 0 0 rgba(225, 29, 72, .6);
	animation: ss-live-ring 1.8s ease-out infinite;
}

.ss-live[hidden] {
	display: none;
}

.ss-live i {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #fff;
	animation: ss-live-dot 1s ease-in-out infinite alternate;
}

.ss-live__sub {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0;
	opacity: .9;
}

@keyframes ss-live-ring {
	0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, .55); }
	100% { box-shadow: 0 0 0 10px rgba(225, 29, 72, 0); }
}

@keyframes ss-live-dot {
	from { opacity: 1; }
	to { opacity: .25; }
}

/* スマホでは「配信中」の文字を省いて LIVE だけに */
@media (max-width: 420px) {
	.ss-live__sub {
		display: none;
	}

	.ss-header__right {
		gap: 8px;
	}

	.ss-header .ss-header__title {
		font-size: 17px !important;
		letter-spacing: .02em;
	}

	/* スマホでは4つの見出しシールを1画面に収める（アイコンを省いて文字を少し小さく） */
	.ss-tabs__list {
		gap: 4px;
		padding: 0 8px;
	}

	.ss-tab {
		padding: 0 8px 2px;
		font-size: 12px !important;
	}

	.ss-tab__icon {
		display: none;
	}

	/* 配信中はスペースが足りないので、サイト名の右のキャラクターは LIVE に場所をゆずる */
	.ss-header:has(.ss-live:not([hidden])) .ss-header__mascot {
		display: none;
	}
}

.ss-header__x {
	display: grid;
	flex: none;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 1.5px solid rgba(255, 255, 255, .35);
	border-radius: 50%;
	color: #fff !important;
	text-decoration: none !important;
	transition: background-color .15s ease;
}

.ss-header__x:hover {
	background: rgba(255, 255, 255, .12);
}

/* 見出しシール（タブ）：表紙のふちから下に垂れている */
.ss-tabs {
	background: var(--ss-desk);
	box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
}

/* 見出しシールは4つ。スマホで収まらないときは横にスクロール */
.ss-tabs {
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.ss-tabs::-webkit-scrollbar {
	display: none;
}

.ss-tabs__list {
	display: flex;
	gap: 6px;
	width: max-content;
	min-width: 100%;
	max-width: 1120px;
	margin: 0 auto;
	padding: 0 12px;
	list-style: none;
}

.ss-tabs__list li {
	flex: 1 0 auto;
	margin: 0;
	list-style: none;
}

.ss-tab {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	height: 36px;
	padding: 0 11px 2px;
	border-radius: 0 0 9px 9px;
	/* 選んでいないタブはグレーで統一 */
	background: #e4e2dc;
	color: #6b6f76 !important;
	font-family: var(--ss-hand);
	font-size: 13px !important;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none !important;
	box-shadow: inset 0 6px 6px -6px rgba(0, 0, 0, .25);
	transition: background-color .15s ease, height .15s ease, color .15s ease;
}

.ss-tab:hover {
	background: #d9d6ce;
	color: #4b4e54 !important;
}

/* いま開いているページのタブだけ色をつけ、少し長く飛び出させる */
.ss-tab.is-current {
	height: 42px;
	background: color-mix(in srgb, var(--c) 62%, #fff);
	color: color-mix(in srgb, var(--c) 28%, #111) !important;
	box-shadow: inset 0 6px 6px -6px rgba(0, 0, 0, .2), 0 3px 6px rgba(0, 0, 0, .08);
}

.ss-tab__icon {
	font-size: 14px;
}

/* 今日のテーマの帯（マスキングテープ） */
.ss-ticker {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 1096px;
	max-height: 40px;
	margin: 6px auto 0;
	padding: 0 12px;
	height: 34px;
	background: rgba(255, 223, 79, .62);
	color: var(--ss-navy) !important;
	text-decoration: none !important;
	clip-path: polygon(0 10%, 1% 0, 99% 0, 100% 12%, 100% 88%, 99% 100%, 1% 100%, 0 90%);
	overflow: hidden;
	transition: max-height .2s ease, margin .2s ease, opacity .2s ease;
}

.ss-ticker__label {
	flex: none;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--ss-navy);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
}

.ss-ticker__window {
	display: flex;
	align-items: center;
	flex: 1;
	min-width: 0;
	height: 100%;
	overflow: hidden;
	white-space: nowrap;
}

.ss-ticker__text {
	display: inline-block;
	margin: 0;
	font-family: var(--ss-hand);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
}

/* 文字が収まらないときだけ、ゆっくり流す */
.ss-ticker__window.is-scroll .ss-ticker__text {
	animation: ss-ticker 11s ease-in-out infinite;
}

@keyframes ss-ticker {
	0%, 18% { transform: translateX(0); }
	82%, 100% { transform: translateX(calc(-1 * var(--ss-ticker-dist, 0px))); }
}

.ss-ticker__go {
	flex: none;
	font-size: 12px;
	font-weight: 700;
	color: #15803d;
}

/* スクロールしたら帯をたたむ（ヘッダーを細く） */
.ss-header.is-compact .ss-ticker {
	max-height: 0;
	margin-top: 0;
	opacity: 0;
	pointer-events: none;
}

.ss-header.is-compact .ss-tabs {
	box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

/* ---------- フッター ---------- */

.ss-footer {
	margin-top: 56px;
	font-family: var(--ss-sans);
	font-weight: 400;
}

/* 応援パートナー（全ページで露出） */
.ss-footer__partners {
	padding: 30px 16px 26px;
	background: #fffefa;
	border-top: 2px dashed #e6d9a8;
	text-align: center;
}

.ss-footer__partners-title {
	margin: 0 0 18px;
	font-family: var(--ss-hand);
	font-size: 15px;
	font-weight: 600;
	color: var(--ss-navy);
}

.ss-footer__pr {
	display: inline-block;
	margin-right: 8px;
	padding: 1px 6px;
	border: 1px solid #c9c4b6;
	border-radius: 3px;
	font-family: var(--ss-sans);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .08em;
	color: #8a8578;
	vertical-align: 1px;
}

.ss-footer__logos {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 22px 18px;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.ss-footer__logos li {
	margin: 0;
	list-style: none;
}

.ss-footer__logos a {
	position: relative;
	display: grid;
	place-items: center;
	min-width: 120px;
	height: 68px;
	padding: 10px 14px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 10px rgba(60, 50, 30, .08);
	text-decoration: none !important;
	transform: rotate(-1.5deg);
	transition: transform .15s ease;
}

.ss-footer__logos li:nth-child(even) a {
	transform: rotate(1.3deg);
}

.ss-footer__logos a:hover {
	transform: rotate(0) translateY(-2px);
}

/* ロゴも透明なセロハンテープで貼る（記事・パートナーの写真と同じテープ） */
.ss-footer__logos a::before {
	content: "";
	position: absolute;
	top: -8px;
	left: 50%;
	width: 50px;
	height: 16px;
	margin-left: -25px;
	background:
		linear-gradient(100deg, transparent 0 22%, rgba(255, 255, 255, .75) 30%, rgba(255, 255, 255, 0) 40%, transparent 100%),
		linear-gradient(180deg, rgba(255, 255, 255, .55) 0, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .35) 100%),
		rgba(205, 220, 232, .38);
	box-shadow: 0 1px 2px rgba(40, 50, 60, .12);
	-webkit-backdrop-filter: blur(.4px) brightness(1.06);
	backdrop-filter: blur(.4px) brightness(1.06);
	transform: rotate(-4deg);
	clip-path: polygon(
		0 0, 3% 12%, 0 25%, 3% 37%, 0 50%, 3% 62%, 0 75%, 3% 87%, 0 100%,
		100% 100%, 97% 87%, 100% 75%, 97% 62%, 100% 50%, 97% 37%, 100% 25%, 97% 12%, 100% 0
	);
	z-index: 1;
}

.ss-footer__logos img {
	display: block;
	width: auto;
	max-width: 150px;
	max-height: 46px;
	object-fit: contain;
}

.ss-footer__logo-text {
	font-family: var(--ss-hand);
	font-size: 15px;
	font-weight: 600;
	color: var(--ss-navy);
}

.ss-footer__recruit {
	font-size: 12px !important;
	font-weight: 700;
	color: #8a5a00 !important;
	text-decoration: none !important;
}

/* 裏表紙 */
.ss-footer__cover {
	background: var(--ss-navy);
	background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 5px);
	color: #c9d3e3;
}

.ss-footer__inner {
	display: grid;
	gap: 28px;
	max-width: 1120px;
	margin: 0 auto;
	padding: 36px 20px 28px;
}

.ss-footer__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 10px;
	font-family: var(--ss-hand);
	font-size: 22px;
	font-weight: 600;
	color: #fff;
}

.ss-footer__lead {
	margin: 0 0 18px;
	font-size: 13px;
	line-height: 1.9;
	color: #aab7cc;
}

.ss-footer__follow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 42px;
	padding: 0 18px;
	border-radius: 999px;
	background: #fff;
	color: var(--ss-navy) !important;
	font-size: 13px !important;
	font-weight: 700;
	text-decoration: none !important;
	transition: transform .15s ease;
}

.ss-footer__follow:hover {
	transform: translateY(-1px);
}

.ss-footer__nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ss-footer__nav li {
	margin: 0;
	border-bottom: 1px dashed rgba(255, 255, 255, .14);
	list-style: none;
}

.ss-footer__nav a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 13px 2px;
	color: #fff !important;
	font-family: var(--ss-hand);
	font-size: 16px !important;
	font-weight: 600;
	text-decoration: none !important;
}

.ss-footer__nav a::after {
	content: "›";
	margin-left: auto;
	color: #6f81a0;
}

.ss-footer__bottom {
	max-width: 1120px;
	margin: 0 auto;
	padding: 18px 20px 26px;
	border-top: 1px solid rgba(255, 255, 255, .1);
}

.ss-footer__legal {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 0 0 12px;
	padding: 0;
	list-style: none;
}

.ss-footer__legal li {
	margin: 0;
	list-style: none;
}

.ss-footer__legal a {
	color: #9fb0c8 !important;
	font-size: 12px !important;
	text-decoration: none !important;
}

.ss-footer__legal a:hover {
	color: #fff !important;
}

.ss-footer__copy {
	margin: 0;
	font-size: 11px;
	color: #6f81a0;
}

/* ---------- タブレット・PC ---------- */

@media (min-width: 640px) {
	.ss-header .ss-header__title {
		font-size: 22px !important;
	}

	.ss-tabs__list {
		padding: 0 16px;
		gap: 8px;
	}

	.ss-tabs__list li {
		flex: 0 0 auto;
	}

	/* PC では横スクロール不要。タイトルと左端をそろえる */
	.ss-tabs {
		overflow: visible;
	}

	.ss-tabs__list {
		width: auto;
		min-width: 0;
	}

	.ss-tab {
		padding: 0 18px 2px;
		font-size: 15px !important;
	}

	.ss-ticker {
		margin-left: 16px;
		margin-right: 16px;
	}

	.ss-footer__inner {
		grid-template-columns: 1.4fr 1fr;
		gap: 48px;
		padding: 44px 24px 32px;
	}
}

@media (min-width: 1128px) {
	.ss-ticker {
		margin-left: auto;
		margin-right: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ss-ticker__window.is-scroll .ss-ticker__text,
	.ss-live,
	.ss-live i {
		animation: none;
	}
}
