/*
 * TAKASE Scholarship Foundation - site styles (on top of Bootstrap 4.6)
 *
 * A calm palette of Japanese indigo (藍) and sumi ink on white, with a muted
 * ochre used only as a thin current-page marker. Headings, figures and the
 * founder's letter are set in Shippori Mincho B1, body text in Zen Kaku
 * Gothic New. Everything is left-aligned; rules instead of cards.
 */
:root {
	--indigo: #27405e;
	--indigo-dark: #1b2e45;
	--indigo-pale: #e8edf1;
	--ochre: #a8873f;
	--ink: #1f262d;
	--ink-soft: #5e6a74;
	--rule: #d3dadf;
	--serif: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", YuMincho, serif;
	--sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, system-ui, sans-serif;
}

body {
	font-family: var(--sans);
	font-size: 1rem;
	line-height: 1.9;
	color: var(--ink);
	background: #fff;
	letter-spacing: .02em;
}

a {
	color: var(--indigo);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .2em;
}

a:hover {
	color: var(--indigo-dark);
	text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible {
	outline: 3px solid var(--indigo);
	outline-offset: 2px;
}

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

h1, h2, h3,
.register,
.page-index {
	font-feature-settings: "palt";
}

h1, h2, h3 {
	font-family: var(--serif);
	font-weight: 700;
	line-height: 1.45;
	letter-spacing: .04em;
}

/* ---------- header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 1030;
	background: #fff;
	border-bottom: 1px solid var(--rule);
}

.site-header .navbar {
	padding-top: .9rem;
	padding-bottom: .9rem;
}

.site-brand {
	display: flex;
	flex-direction: column;
	padding: 0;
	color: var(--ink);
	text-decoration: none;
	white-space: normal;
	line-height: 1.3;
}

.site-brand:hover {
	color: var(--ink);
	text-decoration: none;
}

.site-brand-sub {
	font-size: .75rem;
	letter-spacing: .2em;
	color: var(--ink-soft);
}

.site-brand-name {
	font-family: var(--serif);
	font-size: 1.3rem;
	font-weight: 700;
	letter-spacing: .08em;
}

.site-header .nav-link {
	color: var(--ink);
	font-size: .92rem;
	text-decoration: none;
	padding: .4rem .7rem !important;
}

.site-header .nav-link:hover {
	color: var(--indigo);
	text-decoration: none;
}

.site-header .nav-item.active .nav-link {
	font-weight: 700;
	text-decoration: underline;
	text-decoration-color: var(--ochre);
	text-decoration-thickness: 2px;
	text-underline-offset: .5em;
}

.site-lang {
	margin-left: .8rem;
	padding-left: 1rem;
	font-size: .9rem;
	color: var(--ink);
	border-left: 1px solid var(--rule);
	text-decoration: none;
}

.site-toggler {
	padding: .35rem .9rem;
	font-size: .85rem;
	color: var(--ink);
	border: 1px solid var(--ink);
	border-radius: 2px;
}

@media (max-width: 991.98px) {
	.site-header .navbar-collapse {
		padding: .75rem 0 .5rem;
	}

	.site-header .nav-link {
		padding: .7rem 0 !important;
		font-size: 1rem;
		border-bottom: 1px solid var(--rule);
	}

	.site-lang {
		display: inline-block;
		margin: 1rem 0 0;
		padding: 0;
		border: 0;
		text-decoration: underline;
	}
}

/* ---------- top page ---------- */
.home-hero {
	padding: 4rem 0 3.5rem;
}

.home-hero-grid {
	display: grid;
	gap: 2.5rem;
	align-items: end;
}

@media (min-width: 992px) {
	.home-hero {
		padding: 5.5rem 0 4.5rem;
	}

	.home-hero-grid {
		grid-template-columns: 5fr 7fr;
		gap: 4rem;
	}
}

.home-hero-title {
	margin: 0 0 1.75rem;
	font-size: 2.5rem;
	font-weight: 800;
	line-height: 1.3;
	letter-spacing: .06em;
}

.home-hero-sub {
	display: block;
	margin-bottom: .4rem;
	font-size: 1rem;
	font-weight: 500;
	letter-spacing: .3em;
	color: var(--ink-soft);
}

.home-hero-lead {
	max-width: 30em;
	font-size: 1.05rem;
	line-height: 2.1;
}

.home-hero-links {
	margin: 1.75rem 0 0;
}

.home-hero-links a {
	display: inline-block;
	margin: 0 1.5rem .5rem 0;
	font-weight: 700;
}

.home-hero-photo {
	margin: 0;
}

.home-hero-photo img {
	display: block;
	width: 100%;
}

.home-hero-photo figcaption,
.founder-photo figcaption {
	margin-top: .5rem;
	font-size: .82rem;
	line-height: 1.7;
	color: var(--ink-soft);
}

@media (min-width: 992px) {
	.home-hero-title {
		font-size: 2.2rem;
	}

	/* keep 「タカセ国際奨学財団」 on one line; the English name may wrap */
	html[lang="ja"] .home-hero-title {
		white-space: nowrap;
	}
}

@media (min-width: 1200px) {
	.home-hero-title {
		font-size: 2.65rem;
	}
}

/* recipient register: the one strong element on the top page */
.register {
	padding: 4rem 0 4.5rem;
	color: #eef1f3;
	background: var(--indigo);
}

.register-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .25rem 1.5rem;
	margin-bottom: 2.5rem;
}

.register-title {
	margin: 0;
	font-size: 1.95rem;
	font-weight: 800;
}

.register-period {
	margin: 0;
	font-size: .9rem;
	color: rgba(238, 241, 243, .75);
}

.register ol {
	list-style: none;
	margin: 0;
	padding: 0;
}

.register-count {
	font-family: var(--serif);
	font-weight: 800;
	font-variant-numeric: tabular-nums lining-nums;
}

.register-lead {
	display: grid;
	grid-template-columns: 1.7fr repeat(4, 1fr);
	align-items: end;
	gap: 1rem 2rem;
	padding-bottom: 2rem !important;
	margin-bottom: 2rem !important;
	border-bottom: 1px solid rgba(238, 241, 243, .5);
}

.register-lead li {
	display: flex;
	flex-direction: column;
}

.register-lead .register-count {
	font-size: 4.2rem;
	line-height: 1;
}

.register-lead li:first-child .register-count {
	font-size: 6rem;
}

.register-lead .register-name {
	margin-top: .5rem;
	font-weight: 700;
}

.register-list {
	columns: 4;
	column-gap: 2.5rem;
}

.register-list li {
	display: flex;
	justify-content: space-between;
	break-inside: avoid;
	padding: .2rem 0;
	font-size: .92rem;
	border-bottom: 1px solid rgba(238, 241, 243, .18);
}

.register-list .register-count {
	margin-left: 1rem;
}

@media (max-width: 991.98px) {
	.register-lead {
		grid-template-columns: repeat(4, 1fr);
		row-gap: 1.75rem;
	}

	.register-lead li:first-child {
		grid-column: 1 / -1;
	}

	.register-list {
		columns: 2;
		column-gap: 1.5rem;
	}
}

@media (max-width: 575.98px) {
	.register-title {
		font-size: 1.3rem;
	}

	.register-lead {
		grid-template-columns: repeat(2, 1fr);
	}

	.register-lead li:first-child {
		grid-column: 1 / -1;
	}

	.register-lead .register-count {
		font-size: 3rem;
	}

	.register-lead li:first-child .register-count {
		font-size: 4.5rem;
	}
}

.home-index,
.home-activity {
	padding: 4.5rem 0;
}

.home-activity {
	padding-top: 0;
}

.home-section-title {
	margin: 0 0 1.75rem;
	font-size: 1.55rem;
}

.page-index {
	display: grid;
	gap: 0 3rem;
	list-style: none;
	padding: 0;
	margin: 0;
	border-top: 1px solid var(--ink);
}

@media (min-width: 768px) {
	.page-index {
		grid-template-columns: 1fr 1fr;
	}
}

.page-index li {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 1.25rem;
	padding: 1rem 0;
	border-bottom: 1px solid var(--rule);
}

.page-index a {
	font-family: var(--serif);
	font-size: 1.2rem;
	font-weight: 700;
}

.page-index span {
	font-size: .88rem;
	color: var(--ink-soft);
}

.home-activity-grid {
	display: grid;
	gap: 1rem 3rem;
}

@media (min-width: 992px) {
	.home-activity-grid {
		grid-template-columns: 1fr 2fr;
	}
}

.home-activity .activity-carousel {
	max-width: none;
	margin: 0;
}

/* ---------- inner pages ---------- */
.page-hero {
	padding: 2.5rem 0 2.25rem;
	background: var(--indigo-pale);
}

.page-hero .breadcrumb {
	padding: 0;
	margin-bottom: .6rem;
	background: transparent;
	font-size: .82rem;
}

.page-title {
	max-width: 24em;
	margin: 0;
	font-size: 2.2rem;
	font-weight: 800;
}

.page-lead {
	margin: .6rem 0 0;
	color: var(--ink-soft);
}

.page-body {
	padding: 3.5rem 15px 5.5rem;
}

.prose,
.letter,
.page-hero-inner {
	max-width: 44rem;
	margin-left: auto;
	margin-right: auto;
}

.prose p {
	margin-bottom: 1.3rem;
}

.prose h2 {
	margin: 3.25rem 0 1.1rem;
	font-size: 1.55rem;
}

.prose > h2:first-child {
	margin-top: 0;
}

.prose h3 {
	margin: 2rem 0 .75rem;
	font-size: 1.2rem;
}

.prose ul,
.prose ol {
	padding-left: 1.4rem;
	margin-bottom: 1.3rem;
}

.prose li {
	margin-bottom: .4rem;
}

.prose .signature {
	margin-top: 2.5rem;
	font-family: var(--serif);
	font-size: 1.1rem;
	text-align: right;
}

.founder-photo {
	float: right;
	width: 170px;
	margin: .4rem 0 1rem 2rem;
}

.founder-photo img {
	display: block;
	width: 100%;
}

@media (max-width: 575.98px) {
	.founder-photo {
		float: none;
		margin: 0 0 1.5rem;
	}
}

.info-box {
	padding: 1.25rem 1.5rem;
	margin-bottom: 1.5rem;
	background: var(--indigo-pale);
}

.info-box > :last-child {
	margin-bottom: 0;
}

.formula {
	margin: .25rem 0 .75rem !important;
	font-family: var(--serif);
	font-size: 1.15rem;
	font-weight: 700;
}

.note {
	font-size: .88rem;
	color: var(--ink-soft);
}

.bank-card {
	height: 100%;
	padding-top: 1rem;
	border-top: 1px solid var(--indigo);
}

.bank-card h3 {
	margin-top: 0;
}

.bank-card p:last-child {
	margin-bottom: 0;
}

.check-list {
	padding-left: 1.4rem !important;
}

/* PDF links */
.doc-list {
	list-style: none;
	padding: 0 !important;
	border-top: 1px solid var(--rule);
}

.doc-list li {
	margin: 0;
	border-bottom: 1px solid var(--rule);
}

.doc-link {
	display: flex;
	align-items: baseline;
	padding: .8rem 0;
	font-weight: 700;
}

.pdf-badge {
	flex: 0 0 auto;
	order: 2;
	margin-left: .6rem;
	padding: 0 .35rem;
	font-size: .7rem;
	font-weight: 700;
	line-height: 1.6;
	color: var(--ink-soft);
	border: 1px solid var(--rule);
	border-radius: 2px;
}

.btn-doc {
	display: inline-flex;
	align-items: baseline;
	padding: 0;
	font-size: .95rem;
	color: var(--indigo);
	text-decoration: underline;
	text-underline-offset: .2em;
}

.btn-doc:hover {
	color: var(--indigo-dark);
}

/* tables */
.table-site {
	border-top: 1px solid var(--indigo);
}

.table-site th,
.table-site td {
	padding: .8rem 1rem .8rem 0;
	vertical-align: middle;
	border-top: 0;
	border-bottom: 1px solid var(--rule);
}

.table-site thead th {
	font-size: .82rem;
	font-weight: 400;
	color: var(--ink-soft);
	border-bottom: 1px solid var(--ink);
}

.table-site tbody th {
	font-family: var(--serif);
}

.table-site .table-group th,
.table-site .table-group td {
	border-top: 1px solid var(--indigo);
}

@media (max-width: 575.98px) {
	.table-stack tr {
		display: block;
		padding: .75rem 0;
		border-bottom: 1px solid var(--rule);
	}

	.table-stack th,
	.table-stack td {
		display: block;
		padding: .1rem 0;
		border: 0 !important;
	}

	.table-stack .table-group {
		border-top: 1px solid var(--indigo);
	}

	.table-stack thead {
		display: none;
	}
}

/* activity photos: a carousel that moves only when the visitor asks it to */
.activity-carousel {
	max-width: 50rem;
	margin: 0 auto;
}

.activity-carousel-frame {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 3 / 2;
	background: var(--indigo-pale);
}

.activity-carousel-frame img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

/* figure's default margins off, but keep Bootstrap's margin-right: -100% on slides */
.activity-carousel figure {
	margin-top: 0;
	margin-bottom: 0;
	margin-left: 0;
}

.activity-carousel figcaption {
	min-height: 3.6em;
	padding-top: .75rem;
	font-size: .92rem;
	line-height: 1.8;
}

.activity-carousel-controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: .75rem 0;
	border-top: 1px solid var(--indigo);
	border-bottom: 1px solid var(--rule);
}

.activity-carousel-btn {
	padding: .35rem 0;
	font: inherit;
	font-size: .92rem;
	font-weight: 700;
	color: var(--indigo);
	background: none;
	border: 0;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .25em;
	cursor: pointer;
}

.activity-carousel-btn:hover {
	color: var(--indigo-dark);
	text-decoration-thickness: 2px;
}

.activity-carousel-count {
	font-family: var(--serif);
	font-variant-numeric: tabular-nums lining-nums;
	color: var(--ink-soft);
}

.activity-carousel-status {
	display: flex;
	align-items: center;
	gap: 1.25rem;
}

/* photos change every 3 seconds; a slightly slower slide reads as calm */
.activity-carousel .carousel-item {
	transition-duration: .8s;
}

/* ---------- page-specific ---------- */

/* 設立趣意: the founder's letter */
.letter {
	font-family: var(--serif);
	font-size: 1.08rem;
	line-height: 2.2;
	font-feature-settings: "palt";
}

.letter p {
	margin-bottom: 1.6rem;
}

.letter-sign {
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	gap: 1.5rem;
	margin-top: 3rem;
}

.letter-sign p {
	margin: 0;
	text-align: right;
	line-height: 2;
}

.letter-sign img {
	display: block;
	width: 120px;
}

/* 沿革: founder timeline */
.timeline {
	margin: 0;
	border-top: 1px solid var(--indigo);
}

.timeline-row {
	display: grid;
	grid-template-columns: 7rem 1fr;
	gap: 1.5rem;
	padding: 1.1rem 0;
	border-bottom: 1px solid var(--rule);
}

.timeline dt {
	font-family: var(--serif);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.6;
	color: var(--indigo);
	font-variant-numeric: lining-nums;
}

.timeline dd {
	margin: 0;
}

@media (max-width: 575.98px) {
	.timeline-row {
		grid-template-columns: 1fr;
		gap: .2rem;
	}
}

.founder-head {
	display: flex;
	align-items: flex-end;
	gap: 1.5rem;
	margin: 3.25rem 0 1.5rem;
}

.founder-head h2 {
	margin: 0 !important;
}

.founder-head img {
	flex: 0 0 auto;
	width: 96px;
}

/* 奨学金事業 */
.lead-statement {
	font-family: var(--serif);
	font-size: 1.25rem;
	line-height: 2;
	font-feature-settings: "palt";
}

.categories {
	display: grid;
	gap: 0 2rem;
	list-style: none;
	padding: 0 !important;
	margin: 0 0 1.5rem !important;
	border-top: 1px solid var(--indigo);
}

@media (min-width: 768px) {
	.categories {
		grid-template-columns: repeat(3, 1fr);
	}
}

.categories li {
	padding: 1rem 0;
	margin: 0 !important;
	border-bottom: 1px solid var(--rule);
}

.categories .categories-mark {
	display: block;
	font-family: var(--serif);
	font-size: 1.4rem;
	color: var(--indigo);
}

/* 役員名簿 */
.officer-group {
	margin-bottom: 2.75rem;
}

.officer-group h2 {
	margin: 0 0 .75rem !important;
	font-size: 1.3rem !important;
}

/* ---------- footer ---------- */
.site-footer {
	padding: 3.5rem 0 1.5rem;
	color: rgba(255, 255, 255, .88);
	background: var(--indigo-dark);
	font-size: .9rem;
}

.site-footer a {
	color: #fff;
}

.site-footer-label {
	margin-bottom: .25rem;
	color: rgba(255, 255, 255, .65);
}

.site-footer-name {
	margin-bottom: .75rem;
	font-family: var(--serif);
	font-size: 1.2rem;
	font-weight: 700;
	color: #fff;
}

.site-footer-nav {
	columns: 2;
	column-gap: 1.5rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.site-footer-nav li {
	margin-bottom: .35rem;
}

.site-footer-bottom {
	padding-top: 1.25rem;
	margin-top: 1rem;
	border-top: 1px solid rgba(255, 255, 255, .2);
	font-size: .78rem;
	color: rgba(255, 255, 255, .6);
}

/* ---------- small screens ---------- */
@media (max-width: 575.98px) {
	body {
		font-size: .97rem;
		line-height: 1.85;
	}

	.home-hero {
		padding-top: 2.5rem;
	}

	.home-hero-title {
		font-size: 2rem;
	}

	.page-title {
		font-size: 1.6rem;
	}

	.page-body {
		padding-top: 2rem;
	}

	.register {
		padding: 3rem 0;
	}

	.home-index,
	.home-activity {
		padding: 3rem 0;
	}

	.home-activity {
		padding-top: 0;
	}
}

/* align columns across the separate officer tables */
@media (min-width: 576px) {
	.officer-group .table-site {
		table-layout: fixed;
	}

	.officer-group .table-site th {
		width: 9rem;
	}

	.officer-group .table-site:not(.table-no-role) td:nth-child(2),
	.officer-group .table-no-role td:first-child {
		width: 9rem;
	}
}

/* ---------- motion ----------
 * One orchestrated moment per page: the top page's hero rises in on load and
 * the recipient register counts up once when it scrolls into view
 * (webroot/js/site.js). Inner pages only fade their heading in. Hover states
 * respond to the pointer. Everything is off for prefers-reduced-motion.
 */
@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(12px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes fade {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

.home-hero-title,
.home-hero-lead,
.home-hero-links,
.home-hero-photo {
	animation: rise .9s cubic-bezier(.2, .7, .2, 1) both;
}

.home-hero-lead {
	animation-delay: .15s;
}

.home-hero-links {
	animation-delay: .3s;
}

.home-hero-photo {
	animation-delay: .2s;
	animation-duration: 1.2s;
}

.page-title,
.page-lead {
	animation: fade .7s ease-out both;
}

.page-lead {
	animation-delay: .12s;
}

/* register: the rule under the five largest figures draws in with the count */
.register-lead {
	position: relative;
	border-bottom-color: transparent !important;
}

.register-lead::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 1px;
	background: rgba(238, 241, 243, .5);
	transform-origin: left;
}

.js-motion .register-lead::after {
	transform: scaleX(0);
	transition: transform 1.4s cubic-bezier(.2, .7, .2, 1);
}

.js-motion .register.is-counted .register-lead::after {
	transform: none;
}

/* links: underline thickens smoothly under the pointer */
a {
	transition: color .2s ease, text-decoration-color .2s ease, text-decoration-thickness .2s ease;
}

/* header menu: the marker slides in from the left on hover */
@media (min-width: 992px) {
	.site-header .nav-link {
		background: linear-gradient(var(--ochre), var(--ochre)) no-repeat left bottom / 0 2px;
		transition: background-size .3s ease, color .2s ease;
	}

	.site-header .nav-link:hover {
		background-size: 100% 2px;
	}

	.site-header .nav-item.active .nav-link {
		background-size: 100% 2px;
		text-decoration: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}

	.js-motion .register-lead::after {
		transform: none;
	}
}

/* top-page intro: the name and lead fill the screen, then shrink into place
 * while the rest of the page fades in (webroot/js/site.js) */
html.intro-pending {
	overflow: hidden;
}

html.intro-pending .site-header,
html.intro-pending main > :not(.home-hero),
html.intro-pending .site-footer,
html.intro-pending .home-hero-photo {
	opacity: 0;
}

html.intro-pending .home-hero-text {
	visibility: hidden;
}

html.intro-pending.intro-ready .home-hero-text {
	visibility: visible;
	animation: fade .9s ease-out both;
}

/* the intro replaces the usual rise-in; keep it off afterwards too */
html.intro-pending .home-hero-title,
html.intro-pending .home-hero-lead,
html.intro-pending .home-hero-links,
html.intro-pending .home-hero-photo,
html.intro-played .home-hero-title,
html.intro-played .home-hero-lead,
html.intro-played .home-hero-links,
html.intro-played .home-hero-photo {
	animation: none;
}

/* narrow screens: the name alone, large, on an overlay (.intro-name); the
 * real hero text waits and fades in as the overlay settles onto it */
html.intro-pending.intro-title-only .home-hero-title,
html.intro-pending.intro-title-only .home-hero-lead,
html.intro-pending.intro-title-only .home-hero-links {
	opacity: 0;
}

.intro-name {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 7vw;
	pointer-events: none;
	animation: fade .9s ease-out both;
}

.intro-name-text {
	margin: 0;
	font-family: var(--serif);
	font-size: min(13.5vw, 5rem);
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: .06em;
	word-break: keep-all;
	color: var(--ink);
	font-feature-settings: "palt";
}

.intro-name-text .home-hero-sub {
	display: block;
	margin-bottom: .5em;
	font-size: .3em;
	font-weight: 500;
	letter-spacing: .3em;
	color: var(--ink-soft);
}

html.intro-run .home-hero-title,
html.intro-run .home-hero-lead,
html.intro-run .home-hero-links,
html.intro-run .site-header,
html.intro-run main > *,
html.intro-run .site-footer,
html.intro-run .home-hero-photo {
	transition: opacity .9s ease;
}
