/*
Theme Name: Nandini Satpathy
Description: Memorial site for Smt. Nandini Satpathy. Child theme of Twenty Twenty-Five.
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: nandini-satpathy
License: GNU General Public License v2 or later
*/

/*
 * Colours, fonts and sizes are in theme.json. This file holds what theme.json
 * cannot say: the header and footer rules, the video players, the Appeal
 * letter and the photograph prints.
 */

:root {
	--ns-ease: cubic-bezier(0.23, 1, 0.32, 1);
	--ns-hairline: 1px solid var(--wp--preset--color--rule);
}

body {
	-webkit-font-smoothing: antialiased;
	/* Literata redraws itself for the size it is set at: sturdier letters for
	   body and small text, finer ones for large headings. */
	font-optical-sizing: auto;
	text-rendering: optimizeLegibility;
	font-variant-numeric: oldstyle-nums proportional-nums;
}

::selection {
	background: var(--wp--preset--color--paper-deep);
	color: var(--wp--preset--color--ink);
}

:where(a):focus-visible,
:where(button):focus-visible {
	outline: 2px solid var(--wp--preset--color--sindoor);
	outline-offset: 3px;
	border-radius: 2px;
}

a {
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

/* ---------- Header ---------- */

.ns-header {
	padding-block: clamp(1.25rem, 3vw, 2rem) 0;
}

.ns-header__inner {
	padding-bottom: clamp(1rem, 2.5vw, 1.5rem);
	border-bottom: var(--ns-hairline);
	row-gap: 0.75rem;
	/* Narrower on phones, so the menu stays beside the logo. */
	column-gap: clamp(1rem, 3vw, 1.25rem);
}

.ns-logo img {
	display: block;
	height: auto;
	max-width: min(180px, 52vw);
}

.ns-nav .wp-block-navigation__container {
	gap: clamp(1.25rem, 3vw, 2.25rem);
}

.ns-nav .wp-block-navigation-item__content {
	position: relative;
	color: var(--wp--preset--color--ink-soft);
	text-decoration: none;
	padding-block: 0.4rem;
	border-bottom: 1px solid transparent;
	transition: color 160ms ease, border-color 160ms ease;
}

/* A larger tap area for fingers; the underline stays close to the word. */
.ns-nav .wp-block-navigation-item__content::before {
	content: "";
	position: absolute;
	inset: -0.5rem -0.5rem;
}

.ns-nav .current-menu-item > .wp-block-navigation-item__content,
.ns-nav [aria-current="page"] {
	color: var(--wp--preset--color--ink);
	border-bottom-color: var(--wp--preset--color--sindoor);
}

@media (hover: hover) and (pointer: fine) {
	.ns-nav .wp-block-navigation-item__content:hover {
		color: var(--wp--preset--color--ink);
	}
}

/* ---------- Page body ---------- */

.ns-main {
	padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 8vw, 5.5rem);
}

/* Home has no visible title, so the banner sits close under the header. */
.ns-main--home {
	padding-block-start: clamp(1.25rem, 3vw, 2rem);
}

.wp-site-blocks > .ns-main,
.ns-main > .wp-block-post-content,
.ns-main > .wp-block-post-content > :first-child,
.ns-main > :first-child {
	margin-block-start: 0;
}

.ns-page-title {
	margin-block-end: clamp(1.5rem, 4vw, 2.5rem);
}

/* The banner: an archival print on the page, not a full-bleed hero. */
.ns-banner {
	margin-block-end: clamp(2.5rem, 7vw, 4.5rem);
}

.ns-banner img {
	display: block;
	width: 100%;
	height: auto;
	box-shadow: 0 1px 2px rgb(40 35 30 / 0.12), 0 8px 24px -12px rgb(40 35 30 / 0.25);
}

/* ---------- Videos ---------- */

/* The grid and its column gap are set on the block (deploy/pages/home.html);
   only the space between rows is set here, so two columns still fit. */
.ns-videos.is-layout-grid {
	row-gap: clamp(2rem, 5vw, 3rem);
}

.ns-videos > .wp-block-group {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
}

.ns-videos h2 {
	margin: 0;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.4;
	letter-spacing: 0;
	color: var(--wp--preset--color--ink);
	padding-top: 1rem;
	border-top: var(--ns-hairline);
}

/* The poster with its play button; replaced by the player on press. */
.ns-video {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--wp--preset--color--ink);
	border: 0;
	text-decoration: none;
}

.ns-video-item > .ns-video {
	margin-block: 0;
}

.ns-video__poster {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 30%;
	filter: saturate(0.85);
	transition: filter 200ms ease;
}

.ns-video__play {
	position: absolute;
	left: 1rem;
	bottom: 1rem;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.55rem 1rem 0.55rem 0.8rem;
	background: rgb(246 241 232 / 0.94);
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border-radius: 999px;
	box-shadow: 0 2px 10px -2px rgb(0 0 0 / 0.35);
	transition: transform 160ms var(--ns-ease), background-color 160ms ease;
}

.ns-video__play svg {
	color: var(--wp--preset--color--sindoor);
	flex: none;
}

.ns-video:active .ns-video__play {
	transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
	.ns-video:hover .ns-video__play {
		background: rgb(255 255 255 / 0.98);
	}
	.ns-video:hover .ns-video__poster {
		filter: saturate(1);
	}
}

iframe.ns-video--playing {
	height: auto;
}

/* ---------- An Appeal ---------- */

.ns-appeal {
	margin-block-start: clamp(3.5rem, 9vw, 6rem);
	padding: clamp(1.75rem, 5vw, 3rem) clamp(1.25rem, 5vw, 3.25rem);
	background: var(--wp--preset--color--paper-deep);
	border-top: 2px solid var(--wp--preset--color--sindoor);
}

.ns-appeal h2 {
	margin-block: 0 1.25rem;
	font-size: var(--wp--preset--font-size--large);
	font-style: italic;
}

.ns-appeal p {
	margin-block: 0 1rem;
	text-wrap: pretty;
}

.ns-appeal a {
	overflow-wrap: anywhere;
}

.ns-appeal__signature {
	margin-block-start: 1.75rem !important;
	font-style: italic;
}

/* ---------- Photos ---------- */

/*
 * Photographs set like prints in an album: one column, in order, each at its
 * own size (never enlarged beyond it, so none goes soft), on a white mat.
 */
.wp-block-gallery.ns-photos.has-nested-images {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(2rem, 6vw, 3.5rem);
}

.wp-block-gallery.ns-photos.has-nested-images figure.wp-block-image:not(#individual-image) {
	flex: none;
	width: fit-content;
	max-width: min(100%, 48rem);
	margin: 0;
	padding: clamp(0.5rem, 1.5vw, 0.85rem);
	background: #fffdf8;
	box-shadow: 0 1px 2px rgb(40 35 30 / 0.12), 0 10px 28px -16px rgb(40 35 30 / 0.35);
}

.wp-block-gallery.ns-photos.has-nested-images figure.wp-block-image img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
}

/* ---------- Footer ---------- */

.ns-footer {
	padding-block: 0 clamp(2rem, 5vw, 3rem);
}

.ns-footer__copy {
	margin: 0;
	padding-top: 1.25rem;
	border-top: var(--ns-hairline);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
