/*
Theme Name: Noetic Sea
Theme URI: https://noeticsea.com
Template: twentytwentyfive
Description: Child theme of Twenty Twenty-Five for Noetic Sea. Sun-faded ocean palette, a photo collage gallery style, and landing page section patterns.
Author: Noetic Sea
Version: 0.1.0
Requires at least: 6.9
Requires PHP: 8.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: noetic-sea
*/

/*
 * Shared styles, loaded on the front end and in the editor.
 * Colors, fonts and spacing live in theme.json; this file only holds what theme.json can't express.
 */

:root {
	/* Sun-faded film look applied to photos; removed on hover. */
	--ns-film: saturate(0.8) sepia(0.12) contrast(0.96) brightness(1.03);
	--ns-shadow: 0 1px 2px rgb(31 71 68 / 0.12), 0 14px 28px -12px rgb(31 71 68 / 0.45);
	--ns-shadow-lifted: 0 2px 4px rgb(31 71 68 / 0.12), 0 26px 40px -16px rgb(31 71 68 / 0.5);
	--ns-wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath d='M0 46C180 6 360 6 540 38s360 42 540 6 270-34 360-12v48H0Z'/%3E%3C/svg%3E");
	--ns-wave-back: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80' preserveAspectRatio='none'%3E%3Cpath d='M0 22c160 30 340 40 520 14S860 0 1040 24s300 30 400 8v48H0Z'/%3E%3C/svg%3E");
	--ns-squiggle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 12'%3E%3Cpath d='M1 6c5-6 10-6 14 0s9 6 14 0 9-6 14 0' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Headings: Fraunces with its soft axis turned all the way up. */
h1, h2, h3, h4, h5, h6,
.wp-block-site-title,
.wp-block-post-title,
.wp-block-pullquote,
figcaption {
	font-variation-settings: "SOFT" 100, "WONK" 0;
}

/* Paper grain over the whole page, echoing the logo's distressed print. */
body::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	pointer-events: none;
	opacity: 0.06;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.28 0 0 0 0 0.27 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

html {
	scroll-behavior: smooth;
}

[id] {
	scroll-margin-top: 1.5rem;
}

/* Landing sections and the footer sit flush; waves overlap the seams. */
.wp-site-blocks > footer {
	margin-block-start: 0;
}

/* Kicker: small uppercase label with a wave squiggle, used above section headings. */
.is-style-kicker {
	font-family: var(--wp--preset--font-family--manrope);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.24em;
	text-transform: uppercase;
}

.is-style-kicker::before {
	content: "";
	display: inline-block;
	width: 2.4em;
	height: 0.7em;
	margin-inline-end: 0.7em;
	vertical-align: 0;
	background: currentColor;
	-webkit-mask: var(--ns-squiggle) center / contain no-repeat;
	mask: var(--ns-squiggle) center / contain no-repeat;
	opacity: 0.7;
}

/* Wave: a two-layer wave edge on top of a section, in the section's own background. */
.is-style-wave {
	position: relative;
}

.is-style-wave::before,
.is-style-wave::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: calc(100% - 1px);
	background: inherit;
	pointer-events: none;
	-webkit-mask: var(--ns-wave) bottom / 100% 100% no-repeat;
	mask: var(--ns-wave) bottom / 100% 100% no-repeat;
}

.is-style-wave::before {
	height: clamp(28px, 5vw, 72px);
	opacity: 0.45;
	-webkit-mask-image: var(--ns-wave-back);
	mask-image: var(--ns-wave-back);
}

.is-style-wave::after {
	height: clamp(22px, 3.6vw, 52px);
}

/* Drift: very slow zoom on a cover's background photo. */
.wp-block-cover.is-style-drift {
	overflow: clip;
}

.wp-block-cover.is-style-drift .wp-block-cover__image-background {
	transform-origin: 60% 45%;
	animation: ns-drift 40s ease-in-out infinite alternate;
}

/* Mostly sideways, like clouds moving. The zoom always exceeds the shift, so no edge shows. */
@keyframes ns-drift {
	from { transform: scale(1.06) translate3d(1.5%, 0, 0); }
	to { transform: scale(1.18) translate3d(-3%, -1%, 0); }
}

/* Hero */
.ns-hero-logo img {
	filter: drop-shadow(0 2px 22px rgb(245 239 227 / 0.7));
}

/* Outline buttons fill with a tint of their own color, so they work on light and dark sections. */
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover {
	background-color: color-mix(in srgb, currentColor 14%, transparent);
	color: inherit;
}

/* Footer logo: the teal logo knocked out to cream for dark backgrounds. */
.ns-logo-light img {
	filter: brightness(0) invert(1) sepia(0.3) saturate(0.6);
	opacity: 0.92;
}

/* News cards: featured images as prints. */
.ns-news .wp-block-post-featured-image img {
	background: var(--wp--preset--color--paper);
	padding: 8px;
	box-shadow: var(--ns-shadow);
	filter: var(--ns-film);
	transform: rotate(-1.2deg);
	transition: transform 0.5s ease, filter 0.5s ease;
}

.ns-news .wp-block-post:nth-child(even) .wp-block-post-featured-image img {
	transform: rotate(1.4deg);
}

.ns-news .wp-block-post:hover .wp-block-post-featured-image img {
	transform: rotate(0);
	filter: none;
}

/* Show listings: one row per gig, separated by hairlines. */
.ns-show {
	border-bottom: 1px solid color-mix(in srgb, currentColor 25%, transparent);
	padding-block: var(--wp--preset--spacing--30);
}

/* [noetic_sea_player]: one Apple Music player with the full song list under it. */
.ns-player {
	display: grid;
	gap: 0.75rem;
}

.ns-player__embed {
	display: block;
	width: 100%;
	height: 175px;
	border: 0;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: var(--ns-shadow);
}

.ns-player__tracks {
	display: grid;
	gap: 0.2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ns-player__tracks a {
	display: grid;
	grid-template-columns: 44px 1fr auto;
	align-items: center;
	gap: 0.9rem;
	padding: 0.4rem 0.6rem;
	border-radius: 10px;
	color: inherit;
	text-decoration: none;
	transition: background-color 0.3s ease;
}

.ns-player__tracks a:hover,
.ns-player__tracks a[aria-current] {
	background-color: rgb(255 253 248 / 0.75);
}

/* Keep the focus ring for keyboard users only; the highlight already shows the clicked song. */
.ns-player__tracks a:focus:not(:focus-visible) {
	outline: none;
}

.ns-player__tracks img {
	width: 44px;
	height: 44px;
	border-radius: 6px;
	box-shadow: 0 1px 3px rgb(31 71 68 / 0.25);
}

.ns-player__title {
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: var(--wp--preset--font-size--medium);
	font-variation-settings: "SOFT" 100, "WONK" 0;
}

.ns-player__date {
	color: var(--wp--preset--color--accent-4);
	font-size: var(--wp--preset--font-size--small);
}

/* [noetic_sea_downloads]: cards with an uncropped preview on a checkerboard and a Download button. */
.ns-downloads {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
	gap: var(--wp--preset--spacing--40);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ns-download {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.ns-download p {
	margin: 0;
}

.ns-download__preview {
	display: grid;
	place-items: center;
	aspect-ratio: 4 / 3;
	padding: 0.75rem;
	border-radius: 12px;
	box-shadow: var(--ns-shadow);
	background-color: #fffdf8;
	background-image:
		linear-gradient(45deg, rgb(31 71 68 / 0.07) 25%, transparent 25%, transparent 75%, rgb(31 71 68 / 0.07) 75%),
		linear-gradient(45deg, rgb(31 71 68 / 0.07) 25%, transparent 25%, transparent 75%, rgb(31 71 68 / 0.07) 75%);
	background-size: 20px 20px;
	background-position: 0 0, 10px 10px;
}

.ns-download__preview img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ns-download__title {
	margin-top: 0.4rem;
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: var(--wp--preset--font-size--medium);
	font-variation-settings: "SOFT" 100, "WONK" 0;
}

.ns-download__meta {
	color: var(--wp--preset--color--accent-4);
	font-size: var(--wp--preset--font-size--small);
}

.ns-download__button {
	align-self: flex-start;
	margin-top: 0.3rem;
	padding: 0.45rem 1.1rem;
	border: 2px solid currentColor;
	border-radius: 999px;
	color: inherit;
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
	transition: background-color 0.3s ease;
}

.ns-download__button:hover {
	background-color: color-mix(in srgb, currentColor 12%, transparent);
}

/*
 * Tabs: folder tabs sitting on a rule, the selected one open at the bottom so it joins the panel.
 * The editor puts a pill radius and a fill on every button inline, hence the !importants.
 */
.wp-block-tabs .wp-block-tab-list {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.25rem;
	border-bottom: 2px solid var(--wp--preset--color--contrast);
}

.wp-block-tabs .wp-block-tab-list button[role="tab"] {
	margin-top: 0.35rem;
	border: 2px solid var(--wp--preset--color--contrast);
	border-bottom: 0;
	border-radius: 10px 10px 0 0 !important;
	font-size: var(--wp--preset--font-size--small);
	opacity: 0.75;
	transition: opacity 0.2s ease, background-color 0.2s ease;
}

.wp-block-tabs .wp-block-tab-list button[role="tab"]:hover {
	opacity: 1;
}

.wp-block-tabs .wp-block-tab-list button[role="tab"][aria-selected="true"] {
	margin-top: 0;
	margin-bottom: -2px;
	padding-top: calc(var(--wp--preset--spacing--20) + 0.25rem);
	padding-bottom: calc(var(--wp--preset--spacing--20) + 2px);
	background-color: var(--wp--preset--color--base) !important;
	font-weight: 600;
	opacity: 1;
}

.wp-block-tabs .wp-block-tab-list button[role="tab"][aria-selected="true"]::before {
	display: none;
}

.wp-block-tabs .wp-block-tab-panels,
.wp-block-tabs .wp-block-tab-panel,
.wp-block-tab-panel .wp-block-table {
	margin-block-start: 0;
	padding-block-start: 0;
}

.wp-block-tab-panel .wp-block-table {
	margin-block-end: 0;
}

/* The panel is focusable; a click on a tab shouldn't draw a box around the whole panel. */
.wp-block-tabs .wp-block-tab-panel:focus:not(:focus-visible) {
	outline: none;
}

/* Input-list tables: dark header row, zebra rows, hairlines, narrow # column. */
.wp-block-tab-panel .wp-block-table table {
	table-layout: auto;
	font-size: var(--wp--preset--font-size--small);
}

.wp-block-tab-panel .wp-block-table td {
	padding: 0.55em 0.8em;
	border: 0;
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 18%, transparent);
	vertical-align: top;
}

.wp-block-tab-panel .wp-block-table tr:nth-child(even) td {
	background-color: color-mix(in srgb, var(--wp--preset--color--contrast) 5%, transparent);
}

/* The # column only holds a short number: shrink it to its content (1% + nowrap). */
.wp-block-tab-panel .wp-block-table td:first-child {
	width: 1%;
	padding-inline: 0.6em;
	text-align: center;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
	.wp-block-tab-panel .wp-block-table table {
		font-size: 0.8rem;
	}

	.wp-block-tab-panel .wp-block-table td {
		padding: 0.5em 0.5em;
	}

	.wp-block-tab-panel .wp-block-table td:first-child {
		padding-inline: 0.4em;
	}
}

.wp-block-tab-panel .wp-block-table tr:first-child td {
	background-color: var(--wp--preset--color--contrast);
	border-bottom: 0;
	color: var(--wp--preset--color--base);
	font-size: 0.8em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.wp-block-tab-panel .wp-block-table tr:first-child td:first-child {
	border-top-left-radius: 10px;
}

.wp-block-tab-panel .wp-block-table tr:first-child td:last-child {
	border-top-right-radius: 10px;
}

.wp-block-tab-panel .wp-block-table tr:last-child td {
	border-bottom: 2px solid var(--wp--preset--color--contrast);
}

/* Download link under each tab panel's table. */
.ns-pdf-link {
	margin-block-start: var(--wp--preset--spacing--30);
	font-size: var(--wp--preset--font-size--small);
}

/* Video embeds on dark sections */
.ns-watch .wp-block-embed iframe {
	border-radius: 14px;
	box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.6);
}

/* Contact Form 7 */
.wpcf7 form {
	display: grid;
	gap: 0.25rem;
}

.wpcf7 label {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.04em;
}

.wpcf7 input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.wpcf7 textarea {
	box-sizing: border-box;
	width: 100%;
	margin-top: 0.4rem;
	padding: 0.8rem 1rem;
	border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
	border-radius: 0.9rem;
	background: rgb(255 255 255 / 0.55);
	color: inherit;
	font: inherit;
	font-weight: 400;
	letter-spacing: normal;
}

.wpcf7 input:focus,
.wpcf7 textarea:focus {
	outline: 2px solid var(--wp--preset--color--accent-3);
	outline-offset: 1px;
}

.wpcf7 input[type="submit"] {
	cursor: pointer;
	border: 0;
	border-radius: 999px;
	padding: 0.9rem 1.9rem;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.wpcf7 input[type="submit"]:hover {
	background: var(--wp--preset--color--accent-3);
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.wp-block-cover.is-style-drift .wp-block-cover__image-background {
		animation: none;
	}
}
