/**
 * beautiful isnt beautiful — ARCHIVE ページ専用スタイル
 *
 * 対象: /beautiful-isnt-beautiful/archive/
 *       (template-beautiful-isnt-beautiful-archive.php)
 *
 * スコープ: すべて body.bib-arc-page / .bib-arc-* に閉じ込める。専用テンプレ
 *   が get_header()/get_footer() を呼ばず自前で HTML を組み立て、functions.php
 *   側でサイト共通 CSS をこのページだけ dequeue している。冒頭リセットは
 *   dequeue 取りこぼし時の多層防御。
 *
 * デザイン: 背景 #ccc / 文字 #fff / 中央揃え。テキストのみ (画像なし)。
 *   全体は縦中央寄せ。アーカイブが増えてビューポートを超えたら自然に
 *   ページがスクロールする (min-height + justify-content:center の併用で、
 *   短いときは中央寄せ・長いときは上から並んでスクロール)。フォントは
 *   Today's ページと同じ Questrial。
 */

/* ===== リセット (html margin は admin bar 用に触らない) ===== */
body.bib-arc-page {
	margin: 0;
	padding: 0;
	background: #ccc;
	color: #fff;
	overflow-x: hidden;
	font-family: "Questrial", "Century Gothic", "Futura", "Avenir Next", "Avenir", sans-serif;
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body.bib-arc-page * {
	box-sizing: border-box;
}

/* ===== ルート: 縦中央寄せ / 件数が増えたらスクロール ===== */
.bib-arc {
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: clamp(28px, 6vh, 64px);
	padding: clamp(40px, 8vh, 96px) clamp(20px, 5vw, 56px);
	text-align: center;
}

/* ===== 上部: ロゴ + タイトルリンク ===== */
.bib-arc__head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(12px, 2.4vh, 22px);
}

.bib-arc__logo {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	/* 白ロゴ (暗い字のロゴを白く反転)。#ccc 上での視認性確保のため軽い影。 */
	filter: brightness(0) invert(1) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.18));
}

.bib-arc__logo-img {
	display: block;
	width: auto;
	height: clamp(22px, 3vh, 32px);
}

.bib-arc__logo-text {
	font-size: clamp(0.85rem, 1.6vw, 1.05rem);
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: #fff;
}

.bib-arc__title {
	color: #fff;
	text-decoration: none;
	font-size: clamp(1.1rem, 3.2vw, 2rem);
	letter-spacing: 0.12em;
	text-transform: lowercase;
	line-height: 1.1;
}

.bib-arc__title:hover,
.bib-arc__title:focus-visible {
	opacity: 0.78;
}

/* ===== 中央: アーカイブ一覧 (テキストのみ) ===== */
.bib-arc__list {
	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
	max-width: 920px;
	display: flex;
	flex-direction: column;
	gap: clamp(10px, 1.8vh, 18px);
}

.bib-arc__row {
	font-size: clamp(0.82rem, 1.8vw, 1.12rem);
	letter-spacing: 0.06em;
	line-height: 1.5;
	color: #fff;
	overflow-wrap: anywhere;
}

.bib-arc__date {
	/* 日付はやや控えめに */
	opacity: 0.85;
	font-variant-numeric: tabular-nums;
}

/* 名称。説明があれば <button> (モーダル起動) になる。見た目は地のテキストと
   ほぼ同じに保ち、リンク色や派手な下線は出さない。hover/focus のみ控えめに。 */
.bib-arc__name {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}

button.bib-arc__name {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

button.bib-arc__name:hover,
button.bib-arc__name:focus-visible {
	opacity: 0.7;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	outline: none;
}

/* ===== 下部: コピーライト (TODAY'S は ARCHIVE では非表示) ===== */
.bib-arc__foot {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(8px, 1.6vh, 16px);
}

.bib-arc__copy {
	margin: 0;
	font-size: clamp(0.6rem, 1vw, 0.74rem);
	letter-spacing: 0.18em;
	text-transform: lowercase;
	color: #fff;
}

/* ===== 「上に戻る」ボタン (白丸 + グレー矢印) ===== */
.bib-arc__top {
	position: fixed;
	right: clamp(16px, 3vw, 32px);
	bottom: clamp(16px, 3vh, 32px);
	z-index: 20;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: clamp(44px, 6vw, 54px);
	height: clamp(44px, 6vw, 54px);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #ccc; /* 矢印色 (currentColor) */
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
	/* 既定は非表示。JS が .is-visible を付けたときだけ表示。 */
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.bib-arc__top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.bib-arc__top-icon {
	display: block;
}

.bib-arc__top:hover {
	color: #b3b3b3;
}

.bib-arc__top:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.bib-arc__top {
		transition: opacity 0.01ms, visibility 0.01ms;
		transform: none;
	}
}

/* ===== 説明モーダル (<dialog>) ===== */
/* dialog は閉じている間は UA 既定で display:none。開いた時だけ flex で中央寄せ。 */
.bib-arc-modal {
	position: fixed;
	inset: 0;
	width: auto;
	height: auto;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: clamp(20px, 5vw, 48px);
	border: 0;
	background: rgba(204, 204, 204, 0.85); /* #ccc 系の控えめなオーバーレイ */
	overflow: auto;
}

.bib-arc-modal[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* 既定の ::backdrop は使わず、dialog 自身の背景をオーバーレイにする */
.bib-arc-modal::backdrop {
	background: transparent;
}

.bib-arc-modal__inner {
	position: relative;
	width: 100%;
	max-width: min(92vw, 460px);
	max-height: 86vh;
	overflow: auto;
	box-sizing: border-box;
	padding: clamp(22px, 4vw, 36px) clamp(20px, 4vw, 34px) clamp(20px, 4vw, 30px);
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
	text-align: left;
}

.bib-arc-modal__title {
	margin: 0 2rem 0.6em 0; /* 右上の閉じるボタンと重ならない余白 */
	font-size: clamp(1rem, 2.4vw, 1.3rem);
	font-weight: 400;
	letter-spacing: 0.03em;
	line-height: 1.3;
	color: #888;
}

.bib-arc-modal__body {
	margin: 0;
	font-size: clamp(0.86rem, 1.8vw, 1rem);
	line-height: 1.7;
	letter-spacing: 0.02em;
	color: #999;
	overflow-wrap: anywhere;
}

.bib-arc-modal__close {
	position: absolute;
	top: clamp(6px, 1.4vw, 12px);
	right: clamp(8px, 1.6vw, 14px);
	width: 2em;
	height: 2em;
	padding: 0;
	border: 0;
	background: none;
	color: #bbb;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	transition: color 0.2s ease;
}

.bib-arc-modal__close:hover,
.bib-arc-modal__close:focus-visible {
	color: #888;
	outline: none;
}
