/*
Theme Name: Savan Wijewardene
Description: Lightweight one-page personal brand theme built on Bootstrap 5 and the block editor.
Version: 1.0.0
Requires at least: 6.6
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: savan
*/

:root {
	--sw-forest: #203e32;
	--sw-cream: #f5f2e9;
	--sw-sage: #d4ddcf;
	--sw-moss: #6b8073;
	--sw-serif: "Libre Caslon Display", Georgia, serif;
	--sw-gutter: 1.5rem;
	--sw-space: 4rem;
	--sw-eyebrow: var(--sw-forest);
	--bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--bs-body-color: #203e32;
	--bs-body-color-rgb: 32, 62, 50;
	--bs-body-bg: #f5f2e9;
	--bs-body-bg-rgb: 245, 242, 233;
	--bs-secondary-color: #5e685f;
	--bs-border-color: #c9cec1;
	--bs-border-radius: 0;
	--bs-link-color-rgb: 32, 62, 50;
	--bs-link-hover-color-rgb: 32, 62, 50;
}

/* Layout: 24px side padding on mobile, 80px on desktop, 1440px max. */
.container {
	--bs-gutter-x: calc(var(--sw-gutter) * 2);
	max-width: 1440px;
}

.section-y {
	padding-block: var(--sw-space);
}

.font-serif {
	font-family: var(--sw-serif);
	font-weight: 400;
}

.heading-section {
	font-size: clamp(2.75rem, 2.286rem + 1.905vw, 4rem);
	line-height: 1.05;
	letter-spacing: -.023em;
}

.bg-forest,
.sw-contact,
.sw-panel {
	--bs-body-color: var(--sw-cream);
	--bs-body-bg: transparent;
	--bs-border-color: var(--sw-moss);
	--bs-secondary-color: var(--sw-sage);
	--sw-eyebrow: var(--sw-sage);
	background-color: var(--sw-forest);
	color: var(--sw-cream);
}

/* Header */
.site-header {
	min-height: 5.5rem;
}

.site-logo {
	font-size: 2rem;
	line-height: 1;
	letter-spacing: -.03em;
	color: inherit;
	text-decoration: none;
}

.site-nav {
	gap: 1rem;
	font-size: .8125rem;
}

.site-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 3rem;
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
	text-underline-offset: .3em;
}

.site-nav a:hover,
.site-nav a:focus-visible {
	text-decoration: underline;
}

@media (max-width: 359.98px) {
	.site-nav {
		gap: .625rem;
		font-size: .75rem;
	}
}

/* Footer */
.footer-bar {
	min-height: 5.5rem;
}

.footer-copy {
	font-size: .75rem;
}

.footer-logo {
	font-size: 1.875rem;
	line-height: 1;
}

/* Buttons: block editor buttons and the contact form submit. */
.wp-block-button .wp-block-button__link,
.wpcf7 .wpcf7-submit {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 2rem;
	width: 100%;
	height: 3.25rem;
	padding: 0 1.5rem;
	border: 0;
	border-radius: 0;
	background-color: var(--sw-forest);
	color: var(--sw-cream);
	font-size: .875rem;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
}

.wp-block-button .wp-block-button__link::after,
.wpcf7 .wpcf7-submit::after {
	content: "↗";
	content: "↗" / "";
	font-size: 1.375rem;
	font-weight: 400;
}

.wp-block-button .wp-block-button__link:hover {
	background-color: #2b5243;
}

.wp-block-button .wp-block-button__link:focus-visible,
.wpcf7 .wpcf7-submit:focus-visible {
	outline: 2px solid var(--bs-body-color);
	outline-offset: 3px;
}

.wpcf7 .wpcf7-submit {
	justify-content: space-between;
	background-color: var(--sw-cream);
	color: var(--sw-forest);
}

.wpcf7 .wpcf7-submit:hover {
	background-color: #fff;
}

.wp-block-buttons,
.wp-block-button {
	width: 100%;
}

/* Front-page sections, built from blocks in the editor. */
.sw-section {
	padding-inline: max(var(--sw-gutter), calc((100% - 1440px) / 2 + var(--sw-gutter)));
}

.sw-section h1,
.sw-section h2,
.sw-section h3,
.sw-section p,
.sw-section figure,
.sw-section .wp-block-columns {
	margin: 0;
}

.sw-section h1,
.sw-section h2,
.sw-section h3 {
	font-family: var(--sw-serif);
	font-weight: 400;
	color: inherit;
}

.sw-section p {
	font-size: 1.0625rem;
	line-height: 1.7;
	color: var(--bs-secondary-color);
}

.sw-section .is-style-eyebrow {
	font-size: .6875rem;
	font-weight: 500;
	line-height: normal;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--sw-eyebrow);
}

.sw-section .is-style-lead {
	font-family: var(--sw-serif);
	font-size: clamp(1.75rem, 1.611rem + .571vw, 2.125rem);
	line-height: 1.25;
	letter-spacing: -.007em;
	color: var(--bs-body-color);
}

/* Hero */
.sw-hero > .wp-block-columns {
	gap: 2rem 0;
	padding-top: 2.5rem;
	border-bottom: 1px solid var(--bs-border-color);
}

.sw-hero .wp-block-column:first-child {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1.5rem;
}

/* Scales down proportionally below 390px so the surname never overflows. */
.sw-hero h1 {
	font-size: clamp(3rem, min(16.4vw, 2.979rem + 4.19vw), 6.75rem);
	line-height: .98;
	letter-spacing: -.03em;
}

.sw-hero p:not([class*="is-style-"]) {
	font-size: clamp(1.125rem, 1.079rem + .19vw, 1.25rem);
	line-height: 1.6;
}

.sw-hero .wp-block-image {
	max-width: 520px;
	aspect-ratio: 520 / 592;
	margin-inline: auto;
}

.sw-hero .wp-block-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 1px 0 #fff) drop-shadow(0 3px 0 #fff);
}

/* About */
.sw-about {
	padding-block: var(--sw-space);
}

.sw-about > .wp-block-columns {
	gap: 2rem 4.5rem;
}

.sw-about .wp-block-column {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.sw-about > .wp-block-columns > .wp-block-column + .wp-block-column {
	gap: 1.5rem;
}

.sw-about .wp-block-column .wp-block-columns {
	gap: 1.5rem 2.5rem;
}

.sw-about h2 {
	font-size: clamp(2.625rem, 2.486rem + .571vw, 3rem);
	line-height: 1.08;
	letter-spacing: -.02em;
}

/* Photo and dark panel */
.sw-intersection {
	padding-bottom: var(--sw-space);
}

.sw-intersection > .wp-block-columns {
	gap: 0;
}

.sw-intersection .wp-block-image {
	height: 100%;
}

.sw-intersection .wp-block-image img {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 640 / 470;
	object-fit: cover;
}

.sw-panel {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 1.5rem;
	padding: 2.25rem 1.5rem;
}

.sw-panel h2 {
	font-size: clamp(2.375rem, 2.05rem + 1.333vw, 3.25rem);
	line-height: 1.06;
	letter-spacing: -.018em;
}

.sw-intersection > p {
	margin-top: 1rem;
	font-size: .75rem;
	line-height: 1.5;
}

/* Perspectives */
.sw-perspectives {
	padding-bottom: var(--sw-space);
}

.sw-perspectives > h2 {
	font-size: clamp(2.75rem, 2.286rem + 1.905vw, 4rem);
	line-height: 1.05;
	letter-spacing: -.023em;
}

.sw-perspectives > .is-style-eyebrow {
	margin-top: 1rem;
}

.sw-perspectives > .wp-block-columns {
	gap: 1.25rem 4.5rem;
	margin-top: 2.5rem;
}

.sw-perspectives > .is-style-eyebrow + .wp-block-columns {
	margin-top: 2.75rem;
}

.sw-perspectives h3 {
	font-size: clamp(2.125rem, 1.8rem + 1.333vw, 3rem);
	line-height: 1.08;
	letter-spacing: -.01em;
}

.sw-perspectives .wp-block-column p {
	font-size: clamp(1.0625rem, .97rem + .381vw, 1.3125rem);
	line-height: 1.7;
}

/* Contact */
.sw-contact {
	padding-block: 3.5rem 3rem;
}

.sw-contact > .wp-block-columns {
	gap: 3rem 4.5rem;
}

.sw-contact .wp-block-column:first-child {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.sw-contact h2 {
	font-size: clamp(3.5rem, 2.85rem + 2.667vw, 5.25rem);
	line-height: 1.02;
	letter-spacing: -.024em;
}

.sw-contact .wp-block-column:first-child p:not([class*="is-style-"]) {
	max-width: 23.125rem;
	font-size: 1.125rem;
	line-height: 1.65;
}

.sw-contact .form-label {
	margin-bottom: .75rem;
	font-size: .8125rem;
}

.sw-contact .form-control {
	min-height: 3.25rem;
}

.sw-contact textarea.form-control {
	height: 9rem;
	resize: vertical;
}

.form-control:focus {
	border-color: var(--sw-sage);
	box-shadow: 0 0 0 .2rem rgba(212, 221, 207, .25);
}

.wpcf7-form-control-wrap {
	display: block;
}

.sw-contact .wpcf7-not-valid-tip {
	margin-top: .5rem;
	font-size: .8125rem;
	color: #f4b8ae;
}

/* Columns stack until the desktop layout fits. */
@media (max-width: 991.98px) {
	.sw-section .wp-block-columns {
		flex-wrap: wrap !important;
	}

	.sw-section .wp-block-column {
		flex-basis: 100% !important;
	}
}

@media (min-width: 768px) {
	:root {
		--sw-gutter: 3rem;
	}

	.site-header {
		min-height: 6.5rem;
	}

	.site-nav {
		gap: 2.25rem;
	}

	.wp-block-buttons,
	.wp-block-button,
	.wp-block-button .wp-block-button__link,
	.wpcf7 .wpcf7-submit {
		width: auto;
	}

	.wp-block-button .wp-block-button__link,
	.wpcf7 .wpcf7-submit {
		display: inline-flex;
	}
}

@media (min-width: 992px) {
	:root {
		--sw-space: 6.5rem;
	}

	.sw-hero > .wp-block-columns {
		padding-top: 4rem;
	}

	.sw-hero .wp-block-column:first-child {
		gap: 2rem;
	}

	.sw-hero .wp-block-buttons {
		margin-top: .25rem;
	}

	.sw-hero h1 {
		line-height: .94;
	}

	.sw-hero .wp-block-image {
		margin-right: 0;
	}

	.sw-about .wp-block-column {
		gap: 1.5rem;
	}

	.sw-about > .wp-block-columns > .wp-block-column + .wp-block-column {
		gap: 2.25rem;
	}

	.sw-panel {
		gap: 1.75rem;
		padding: 3rem;
	}

	.sw-perspectives > .wp-block-columns {
		margin-top: 4.5rem;
	}

	.sw-perspectives > .is-style-eyebrow + .wp-block-columns {
		margin-top: 6rem;
	}

	.sw-perspectives h3 {
		line-height: 1;
	}

	.sw-perspectives .wp-block-column p {
		line-height: 1.6;
	}

	.sw-contact {
		padding-block: 5.5rem 4.5rem;
	}

	.sw-contact .wp-block-column:first-child {
		gap: 2rem;
	}

	.sw-contact .form-control {
		min-height: 3rem;
	}

	.sw-contact textarea.form-control {
		height: 7rem;
	}

	.footer-bar {
		min-height: 5.75rem;
	}
}

@media (min-width: 1200px) {
	:root {
		--sw-gutter: 5rem;
	}

	.sw-contact > .wp-block-columns {
		column-gap: 7.5rem;
	}
}
