/*
Theme Name: 杏の里教会（anzunosato）
Theme URI: https://anzunosato.net/
Author: 基督兄弟団 杏の里教会
Description: 基督兄弟団 杏の里教会のためのブロックテーマ。礼拝時間・はじめての方への案内・礼拝メッセージを読みやすく伝えることを目的とする。
Version: 1.1.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: anzunosato
*/

/* ---------- 全体 ---------- */

html {
	scroll-padding-top: 5rem;
}

body {
	word-break: normal;
	overflow-wrap: anywhere;
	line-break: strict;
	-webkit-text-size-adjust: 100%;
}

/* 押せる部分は高さ44px以上 */
.wp-block-button__link,
.wp-block-navigation-item__content,
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close,
.anz-pill a {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

.wp-block-button__link {
	justify-content: center;
}

:where(a, button, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent-strong);
	outline-offset: 3px;
}

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

.anz-header {
	position: sticky;
	top: 0;
	z-index: 20;
	border-bottom: 3px solid var(--wp--preset--color--accent);
}

.admin-bar .anz-header {
	top: var(--wp-admin--admin-bar--height, 0);
}

/* スマホでは本文を広く読めるよう、ヘッダーを固定しない */
@media (max-width: 781px) {
	.anz-header {
		position: static;
	}
}

.anz-header .wp-block-site-title a:hover {
	text-decoration: underline;
}

.anz-header__tel .wp-block-button__link {
	white-space: nowrap;
}

/* 教会名を1行に保つ */
.anz-header .wp-block-site-title {
	white-space: nowrap;
}

.anz-header .wp-block-site-title,
.anz-header__tel {
	flex-shrink: 0;
}

/* 画面が狭いときは電話番号の文字を隠し、受話器だけにする */
@media (max-width: 1180px) {
	.anz-header__tel-label {
		display: none;
	}
}

/* スマホだけに出す「礼拝・集会」「アクセス」 */
.anz-quicklinks {
	display: none !important;
}

@media (max-width: 781px) {
	.anz-quicklinks {
		display: flex !important;
	}
}

.anz-quicklinks a {
	flex: 1 1 0;
	justify-content: center;
	text-align: center;
	text-decoration: none;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	border-radius: 999px;
	padding: 0.5rem 0.75rem;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

/* ---------- トップのメイン画像と礼拝時間 ---------- */

.anz-hero {
	position: relative;
}

.anz-hero .wp-block-cover__image-background {
	object-position: 50% 60%;
}

/* スマホ：最初の画面に礼拝時間が収まるよう、写真部分を詰める */
@media (max-width: 781px) {
	.anz-hero.wp-block-cover {
		min-height: 0 !important;
		padding-top: 1.25rem !important;
		padding-bottom: 1.25rem !important;
	}
	.anz-hero h1 {
		font-size: 1.625rem !important;
		margin: 0;
	}
	.anz-hero h1 br,
	.anz-hero__lead {
		display: none;
	}
	.anz-hero .wp-block-columns {
		gap: 1rem;
	}
}

.anz-worship-card {
	box-shadow: 0 8px 24px rgba(47, 42, 38, 0.12);
}

.anz-worship-card dl {
	margin: 0;
}

.anz-worship-card dt {
	font-weight: 700;
	margin-top: 0.75rem;
}

.anz-worship-card dt:first-child {
	margin-top: 0;
}

.anz-worship-card dd {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.04em;
}

.anz-worship-card dd small {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	color: var(--wp--preset--color--muted);
}

/* ---------- 見出しの飾り（杏色の線） ---------- */

.anz-section-title {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.anz-section-title::before {
	content: "";
	flex: 0 0 auto;
	width: 0.5rem;
	height: 1.4em;
	border-radius: 999px;
	background: var(--wp--preset--color--accent);
}

/* ---------- 記事一覧 ---------- */

.anz-post-list .wp-block-post {
	padding-block: 1rem;
	border-bottom: 1px solid var(--wp--preset--color--surface);
}

.anz-post-list .wp-block-post:first-child {
	border-top: 1px solid var(--wp--preset--color--surface);
}

.anz-post-list .wp-block-post-title {
	margin-block: 0.25rem;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
}

.anz-post-list .wp-block-post-title a:hover,
.anz-post-list .wp-block-post-title a:focus {
	text-decoration: underline;
	color: var(--wp--preset--color--accent-strong);
}

.anz-meta {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	margin: 0;
}

/* 聖書書名の絞り込み */
.anz-book-filter .wp-block-tag-cloud,
.anz-book-filter .wp-block-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 0;
	margin: 0;
	list-style: none;
}

.anz-book-filter .wp-block-tag-cloud a {
	font-size: var(--wp--preset--font-size--small) !important;
	text-decoration: none;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	border-radius: 999px;
	padding: 0.4rem 0.9rem;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	margin: 0 !important;
}

.anz-book-filter .wp-block-tag-cloud a:hover,
.anz-book-filter .wp-block-tag-cloud a:focus {
	background: var(--wp--preset--color--accent-strong);
	color: var(--wp--preset--color--white);
}

/* ---------- 記事本文 ---------- */

/* Word から貼り付けた本文のフォント指定・文字サイズを無効にして読みやすさを揃える */
.wp-block-post-content [style*="font-family"] {
	font-family: inherit !important;
}

.wp-block-post-content [style*="font-size"] {
	font-size: inherit !important;
}

.wp-block-post-content img {
	height: auto;
	max-width: 100%;
}

.wp-block-post-content p:empty {
	display: none;
}

.anz-message-header {
	border-left: 4px solid var(--wp--preset--color--accent);
}

/* ---------- 地図 ---------- */

.anz-map iframe {
	width: 100%;
	height: 360px;
	border: 0;
	border-radius: 12px;
	display: block;
}

/* ---------- はじめての方へ Q&A ---------- */

/* 質問の行は高さ44px以上。開閉がわかるよう「＋／－」を付ける */
.wp-block-details summary {
	cursor: pointer;
	font-weight: 700;
	list-style: none;
	position: relative;
	padding: 0.6rem 2.5rem 0.6rem 0;
	min-height: 44px;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::after {
	content: "＋";
	position: absolute;
	right: 0.5rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--wp--preset--color--accent-strong);
	font-weight: 700;
}

.wp-block-details[open] summary::after {
	content: "－";
}

.wp-block-details[open] summary {
	color: var(--wp--preset--color--accent-strong);
}

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

.anz-footer a {
	color: var(--wp--preset--color--white);
}

.anz-footer address {
	font-style: normal;
}

/* ---------- 動きを減らす設定への配慮 ---------- */

@media (prefers-reduced-motion: reduce) {
	* {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}

/* トップの写真の上の文字：明るい部分（雪山・空）でも読めるよう影を付ける */
.anz-hero .wp-block-cover__inner-container {
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.anz-hero .has-background,
.anz-hero .has-background * {
	text-shadow: none;
}

/* 画像の説明文（ギャラリー）：写真に重ねず、写真の下に濃い文字で出す */
.wp-block-gallery.has-nested-images figure.wp-block-image {
	flex-direction: column;
}
.wp-block-gallery.has-nested-images figure.wp-block-image .wp-element-caption {
	position: static;
	background: none;
	color: var(--wp--preset--color--contrast);
	text-shadow: none;
	font-size: var(--wp--preset--font-size--small, 1rem);
	padding: 0.5em 0 0;
	max-height: none;
	overflow: visible;
}
.wp-block-gallery.has-nested-images figure.wp-block-image:has(.wp-element-caption)::before {
	content: none;
}
.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img {
	flex: 0 0 auto;
	height: auto;
	aspect-ratio: 4 / 3;
}

/* スマートフォンのメニューボタン：押しやすい大きさに */
.wp-block-navigation__responsive-container-open {
	min-width: 44px;
	justify-content: center;
}
