/*
Theme Name: SwaraBols
Theme URI: https://swarabols.com
Author: Prasannah Jeyandran
Description: Custom block theme for SwaraBols, an online music platform from Sri Lanka. Live classes on Zoom with qualified teachers, and recorded courses.
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 8.0
Version: 1.6.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: swarabols
*/

/* Small refinements that theme.json cannot express. Keep this file short. */

/* Cards: quiet, no hover gimmicks */
.is-style-sb-card {
	border-radius: 18px;
}

/* ---------- Tala line: 16 beats of Teentaal (4+4+4+4) ----------
   Sam (first beat) is the larger filled beat, tali beats are marked,
   the khali group starts with a hollow beat. Used as divider and above headlines. */
.sb-tala-wrap {
	display: flex;
	justify-content: center;
	margin-block: 0.75rem 1.5rem;
}
.sb-tala-wrap.is-hero-left {
	justify-content: flex-start;
	margin-block: 0 1.25rem;
}
.sb-tala {
	display: grid;
	grid-template-columns: repeat(16, auto);
	align-items: center;
	column-gap: 7px;
	color: var(--wp--preset--color--accent-deep);
}
.sb-tala span {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.55;
}
.sb-tala span:nth-child(4n + 1) {
	width: 9px;
	height: 9px;
	opacity: 1;
	margin-left: 12px;
}
.sb-tala span:first-child {
	margin-left: 0;
}
.sb-tala span.sam {
	width: 12px;
	height: 12px;
	box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent);
}
.sb-tala span.khali {
	background: transparent;
	border: 1.5px solid currentColor;
	box-sizing: border-box;
}
.is-gold .sb-tala,
.is-light .sb-tala {
	color: var(--wp--preset--color--accent);
}

/* Sticky header */
.sb-header {
	position: sticky;
	top: 0;
	z-index: 50;
}
body.admin-bar .sb-header {
	top: 32px;
}
@media (max-width: 782px) {
	body.admin-bar .sb-header {
		top: 46px;
	}
}

/* Keep the logo crisp and sized */
.sb-logo img {
	height: auto;
	max-height: 56px;
	width: auto;
}

/* Tamil text falls back to good system fonts */
:lang(ta) {
	font-family: "Noto Sans Tamil", "Nirmala UI", "Latha", var(--wp--preset--font-family--body);
}

/* Visible focus for keyboard users */
a:focus-visible,
button:focus-visible,
.wp-element-button:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

/* No cream gap between header, page content and footer */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* Cards in a row are always the same height */
.wp-block-column:has(> .is-style-sb-card) {
	display: flex;
	flex-direction: column;
}
.wp-block-column > .is-style-sb-card {
	flex: 1 1 auto;
}

/* ---------- Teacher cards (from Teachers in wp-admin) ---------- */
.sb-teacher-grid > li {
	display: flex;
}
.sb-teacher-grid > li > .is-style-sb-card {
	flex: 1 1 auto;
	text-align: center;
}
.sb-teacher-grid .sb-portrait {
	margin-inline: auto;
}
.sb-teacher-grid .sb-portrait img,
.sb-portrait img {
	border-radius: 50%;
	border: 3px solid var(--wp--preset--color--tint);
}
.sb-teacher-grid .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}
.sb-subjects {
	color: var(--wp--preset--color--accent-deep);
	font-weight: 500;
}
.sb-role {
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.75rem !important;
	color: var(--wp--preset--color--muted);
}
.sb-teacher-photo img {
	border-radius: 20px;
}
@media (max-width: 781px) {
	.sb-teacher-grid.is-layout-grid {
		grid-template-columns: 1fr;
	}
}

/* ---------- FAQ ---------- */
.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--tint);
	padding: 1rem 0;
}
.wp-block-details summary {
	cursor: pointer;
	font-weight: 500;
	color: var(--wp--preset--color--ink);
}
.wp-block-details[open] summary {
	margin-bottom: 0.5rem;
}
[id] {
	scroll-margin-top: 110px;
}

/* ---------- Enquiry and free-trial form ---------- */
.sb-form__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 1.25rem;
}
.sb-field {
	margin: 0 0 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}
.sb-field--wide {
	grid-column: 1 / -1;
}
.sb-field label {
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--wp--preset--color--ink);
}
.sb-field label span {
	color: var(--wp--preset--color--accent-deep);
}
.sb-field input:not([type="checkbox"]),
.sb-field select,
.sb-field textarea {
	font: inherit;
	font-size: 1rem;
	color: var(--wp--preset--color--ink);
	background: #fff;
	border: 1px solid #C9D3CC;
	border-radius: 10px;
	padding: 0.7rem 0.85rem;
	width: 100%;
	box-sizing: border-box;
}
.sb-field input:focus,
.sb-field select:focus,
.sb-field textarea:focus {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--primary);
}
.sb-field--check {
	flex-direction: row;
	align-items: flex-start;
	gap: 0.6rem;
}
.sb-field--check input {
	margin-top: 0.3rem;
	width: 1.1rem;
	height: 1.1rem;
	accent-color: var(--wp--preset--color--primary);
	flex: none;
}
.sb-field--check label {
	font-weight: 400;
	font-size: 0.9rem;
}
.sb-form__submit {
	margin: 0.5rem 0 0;
}
.sb-form__submit button {
	cursor: pointer;
	border: 0;
	width: 100%;
}
.sb-form__submit button[disabled] {
	opacity: 0.6;
	cursor: wait;
}
.sb-form-notice {
	border-radius: 12px;
	padding: 1rem 1.25rem;
	margin-bottom: 1.25rem;
}
.sb-form-notice p {
	margin: 0.25rem 0;
}
.sb-form-notice--ok {
	background: var(--wp--preset--color--tint);
	border-left: 4px solid var(--wp--preset--color--primary);
}
.sb-form-notice--error {
	background: #FBEFE6;
	border-left: 4px solid #B5541C;
}
/* Spam trap: hidden from people, visible to bots */
.sb-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
@media (max-width: 600px) {
	.sb-form__grid {
		grid-template-columns: 1fr;
	}
}

/* ---------- Phones ---------- */
.sb-header .wp-block-button__link {
	white-space: nowrap;
}
@media (max-width: 600px) {
	.sb-logo img {
		max-height: 44px;
	}
	.sb-header .wp-block-image.sb-logo {
		max-width: 170px;
	}
	/* Phones: hide the symbol (the logo is already in the header), but show the hero photo. */
	.sb-hero-art {
		display: none;
	}
	.sb-hero-art:has(.is-photo) {
		display: block;
		margin-top: 1.5rem;
	}
	.sb-arch.is-photo {
		max-width: 280px;
	}
}

/* ---------- Design pass: rhythm, arch, bands ---------- */
.sb-hero-title {
	font-size: clamp(2.6rem, 2rem + 3vw, 4.4rem) !important;
	line-height: 1.05;
	letter-spacing: -0.01em;
	margin-top: 0;
}

/* Arched frame, after temple doorways: holds the symbol now, a photo later */
.sb-arch {
	border-radius: 999px 999px 22px 22px;
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--wp--preset--color--accent) 60%, transparent),
		0 0 0 10px var(--wp--preset--color--primary),
		0 0 0 11px color-mix(in srgb, var(--wp--preset--color--accent) 45%, transparent);
	max-width: 340px;
	margin-inline: auto;
}
.sb-arch.is-photo {
	padding: 0;
	overflow: hidden;
	aspect-ratio: 4 / 5;
}
.sb-arch.is-photo .wp-block-image,
.sb-arch.is-photo .wp-block-image img {
	margin: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Photos placed in page content */
.wp-block-image.sb-photo img {
	border-radius: 14px;
}

/* Ways to learn: open columns with a gold rule, not boxes */
.sb-way {
	border-top: 3px solid var(--wp--preset--color--accent);
	padding-top: 1.5rem;
	height: 100%;
}
.sb-way h3 {
	margin-top: 0;
}

/* Text links: underlined, no arrows */
.sb-link a {
	font-weight: 500;
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
}
.sb-link a:hover {
	text-decoration-color: currentColor;
}
.sb-band-dark .sb-link a {
	color: var(--wp--preset--color--base);
}

/* Teachers on the dark band */
.sb-band-dark .is-style-sb-card {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink);
	box-shadow: none;
}
.sb-band-dark .is-style-sb-card .wp-block-post-title a,
.sb-band-dark .is-style-sb-card .sb-link a {
	color: var(--wp--preset--color--primary);
}
.sb-faculty-soon {
	margin-inline: auto;
	max-width: 720px;
}

/* Arched portraits; an arch with the symbol stands in until a photo is added */
.sb-teacher-grid .sb-portrait img,
.sb-portrait img {
	border-radius: 64px 64px 12px 12px;
	border: 0;
}
.sb-teacher-grid .is-style-sb-card:not(:has(.wp-block-post-featured-image))::before {
	content: "";
	display: block;
	width: 104px;
	height: 128px;
	margin: 0 auto 0.5rem;
	border-radius: 52px 52px 12px 12px;
	background: var(--wp--preset--color--tint) url("assets/images/symbol.png") center 60% / 58% no-repeat;
}

/* Subjects: one per line instead of dot-joined */
.sb-subjects .wp-block-post-terms__separator {
	display: block;
	height: 0;
	overflow: hidden;
}
.sb-role {
	text-transform: none !important;
	letter-spacing: 0 !important;
	font-style: italic;
}

/* Gold free-trial band */
.sb-band-gold .wp-block-button__link {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
}
.sb-band-gold .is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--ink);
	border: 1.5px solid var(--wp--preset--color--ink);
}

/* Small tags and step numbers */
.sb-badge {
	display: inline-block;
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--wp--preset--color--accent-deep);
	background: color-mix(in srgb, var(--wp--preset--color--accent) 18%, transparent);
	border-radius: 999px;
	padding: 0.2rem 0.75rem;
	margin: 0;
}
.sb-step {
	font-family: var(--wp--preset--font-family--heading, "Lora", serif);
	font-size: 2.6rem;
	line-height: 1;
	color: var(--wp--preset--color--accent-deep);
	margin: 0;
}

/* Smooth glide for same-page links only; normal scrolling stays native */
html {
	scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	* {
		transition: none !important;
	}
}

/* Teacher application: instrument tick-boxes */
.sb-checks {
	border: 0;
	padding: 0;
	margin: 0 0 1rem;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 0.5rem 1rem;
}
.sb-checks legend {
	font-size: 0.9rem;
	font-weight: 500;
	margin-bottom: 0.5rem;
	color: var(--wp--preset--color--ink);
}
.sb-checks legend span {
	color: var(--wp--preset--color--accent-deep);
}
.sb-checks label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.95rem;
}
.sb-checks input {
	width: 1.05rem;
	height: 1.05rem;
	accent-color: var(--wp--preset--color--primary);
}
