/*
Theme Name: Studio Contour
Theme URI: https://example.com/themes/studio-contour/
Author: Studio Contour
Author URI: https://example.com/
Description: A quiet, editorial block theme for interior design studios. Serif display type, a black-and-grayscale palette, hairline rules and an 8dp spacing grid. Built entirely on core Gutenberg blocks — no page builder required.
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: studio-contour
Tags: one-column, block-patterns, editor-style, full-site-editing, custom-colors, custom-logo, custom-menu, wide-blocks, translation-ready, portfolio, blog

Studio Contour is distributed under the terms of the GNU GPL v2 or later.
*/

/* ---------------------------------------------------------------------------
 * Design tokens live in theme.json and are emitted as CSS custom properties
 * (--wp--preset--* and --wp--custom--*). This stylesheet only carries what
 * theme.json cannot express: sticky positioning, backdrop filters, :hover and
 * :focus states on non-element selectors, CSS grid, and media queries.
 * ------------------------------------------------------------------------- */

/* Base ------------------------------------------------------------------- */

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

::placeholder {
	color: var(--wp--preset--color--mist);
	opacity: 1;
}

:where(.sc-section) h1,
:where(.sc-section) h2,
:where(.sc-section) h3 {
	text-wrap: balance;
}

:where(.sc-section) p {
	text-wrap: pretty;
}

/* Shared section shell ---------------------------------------------------- */

.sc-section {
	padding-left: var(--wp--custom--gutter);
	padding-right: var(--wp--custom--gutter);
}

.sc-section--ruled {
	border-bottom: var(--wp--custom--hairline);
}

/* Vertical rhythm is fluid so the same section reads correctly on phone,
   tablet and desktop. Both clamp endpoints sit on the 8dp grid. */
.sc-section--pad {
	padding-top: var(--wp--custom--section-padding--top);
	padding-bottom: var(--wp--custom--section-padding--bottom);
}

.sc-measure-lead {
	max-width: var(--wp--custom--measure--lead);
}

.sc-measure-prose {
	max-width: var(--wp--custom--measure--prose);
}

.sc-measure-article {
	max-width: var(--wp--custom--measure--article);
}

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

/* Sticky has to sit on the template-part element itself: it is a direct child
   of the full-height `.wp-site-blocks` container, so it has somewhere to
   travel. Putting `position:sticky` on `.sc-header` instead would pin it
   inside a wrapper exactly as tall as the header — i.e. it would never move. */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 50;
}

.sc-header {
	background-color: var(--wp--custom--canvas-translucent);
	border-bottom: var(--wp--custom--hairline);
}

@supports ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))) {
	.sc-header {
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
	}
}

.sc-header__bar {
	max-width: var(--wp--custom--container-width);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--wp--custom--gutter);
	padding-right: var(--wp--custom--gutter);
}

.sc-header .wp-block-site-title a,
.sc-header .wp-block-site-title a:hover {
	text-decoration: none;
}

.sc-nav .wp-block-navigation-item__content {
	text-decoration: none;
}

/* Hero -------------------------------------------------------------------- */

.sc-hero {
	padding-top: var(--wp--custom--section-padding--hero);
	padding-bottom: var(--wp--custom--section-padding--hero-bottom);
}

/* Services grid ----------------------------------------------------------- */

/* The columns wrapper is painted in the hairline colour and the 1px block gap
   lets it show through as rules between cards — the same trick the source
   design used with `gap:1px` over a `background:#e6e5e2` grid. */
.sc-services {
	border: var(--wp--custom--hairline);
}

.sc-card {
	min-height: 300px;
	transition: background-color var(--wp--custom--transition), color var(--wp--custom--transition);
}

.sc-card__title,
.sc-card__body,
.sc-card__number {
	transition: color var(--wp--custom--transition);
}

.sc-card__body {
	opacity: 0.72;
}

@media (hover: hover) {
	.wp-block-column.sc-card:hover {
		background-color: var(--wp--preset--color--contrast) !important;
	}

	.sc-card:hover .sc-card__title,
	.sc-card:hover .sc-card__body {
		color: var(--wp--preset--color--white) !important;
	}
}

/* Cards keep their hairline separation when the columns stack. */
@media (max-width: 781px) {
	.sc-card {
		min-height: 0;
	}
}

/* Media panel ------------------------------------------------------------- */

/* Placeholder texture matching the source design's base layer. Replace the
   inner Image block (or set `background-image`) with the project photograph. */
.sc-media {
	aspect-ratio: 4 / 3;
	border: var(--wp--custom--hairline);
	background-color: var(--wp--preset--color--base);
	background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.045) 0 1px, transparent 1px 9px);
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
}

.sc-media .wp-block-image,
.sc-media .wp-block-image img {
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	display: block;
}

/* Contact ----------------------------------------------------------------- */

.sc-contact {
	padding-top: var(--wp--custom--section-padding--bottom);
	padding-bottom: var(--wp--custom--section-padding--bottom);
}

/* Placeholder form. The same rules are mirrored onto Contact Form 7 markup
   below so that swapping in a real form plugin needs no extra CSS. */
.sc-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 32px 24px;
}

.sc-form__field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.sc-form__field--wide {
	grid-column: span 2;
}

.sc-form__label {
	font-size: var(--wp--preset--font-size--eyebrow);
	letter-spacing: var(--wp--custom--letter-spacing--label);
	text-transform: uppercase;
	color: var(--wp--preset--color--stone);
}

.sc-form input[type="text"],
.sc-form input[type="email"],
.sc-form input[type="tel"],
.sc-form textarea,
.sc-contact .wpcf7-form input[type="text"],
.sc-contact .wpcf7-form input[type="email"],
.sc-contact .wpcf7-form input[type="tel"],
.sc-contact .wpcf7-form textarea {
	width: 100%;
	background: transparent;
	border: 0;
	border-bottom: var(--wp--custom--hairline-inverse);
	border-radius: 0;
	color: var(--wp--preset--color--white);
	font-family: inherit;
	font-size: 16px;
	font-weight: 300;
	padding: 8px 0;
	outline: none;
	transition: border-color var(--wp--custom--transition);
	box-sizing: border-box;
}

.sc-form input:focus,
.sc-form textarea:focus,
.sc-contact .wpcf7-form input:focus,
.sc-contact .wpcf7-form textarea:focus {
	border-bottom-color: var(--wp--preset--color--white);
}

.sc-form textarea,
.sc-contact .wpcf7-form textarea {
	resize: vertical;
}

.sc-form__actions {
	grid-column: span 2;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 8px;
}

.sc-form__submit,
.sc-contact .wpcf7-form input[type="submit"],
.sc-contact .wpcf7-form button[type="submit"] {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--contrast);
	border: 0;
	border-radius: 0;
	font-family: inherit;
	font-size: var(--wp--preset--font-size--label);
	letter-spacing: var(--wp--custom--letter-spacing--button);
	text-transform: uppercase;
	padding: 16px 32px;
	cursor: pointer;
	transition: background-color var(--wp--custom--transition);
}

.sc-form__submit:hover,
.sc-form__submit:focus,
.sc-contact .wpcf7-form input[type="submit"]:hover,
.sc-contact .wpcf7-form button[type="submit"]:hover {
	background: var(--wp--preset--color--pearl);
}

.sc-form__status {
	font-size: var(--wp--preset--font-size--meta);
	font-weight: 300;
	color: var(--wp--preset--color--stone);
	margin: 0;
}

.sc-contact .wpcf7-form label {
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: var(--wp--preset--font-size--eyebrow);
	letter-spacing: var(--wp--custom--letter-spacing--label);
	text-transform: uppercase;
	color: var(--wp--preset--color--stone);
}

.sc-contact .wpcf7-form .wpcf7-response-output {
	border-color: var(--wp--preset--color--graphite);
	color: var(--wp--preset--color--stone);
	font-size: var(--wp--preset--font-size--meta);
	margin-left: 0;
	margin-right: 0;
}

@media (max-width: 599px) {
	.sc-form {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	.sc-form__field--wide,
	.sc-form__actions {
		grid-column: span 1;
	}
}

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

.sc-footer__contact {
	text-align: right;
}

.sc-footer__social {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	justify-content: flex-end;
}

@media (max-width: 781px) {
	.sc-footer__contact,
	.sc-footer__social {
		text-align: left;
		justify-content: flex-start;
	}
}

/* Editorial templates ----------------------------------------------------- */

.sc-article :where(p, ul, ol, blockquote, figure, pre) {
	max-width: var(--wp--custom--measure--article);
}

.sc-post-card {
	border-bottom: var(--wp--custom--hairline);
}

/* Accessibility ----------------------------------------------------------- */

.skip-link:focus {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--white);
	clip: auto !important;
	clip-path: none;
	display: block;
	font-size: var(--wp--preset--font-size--meta);
	height: auto;
	left: 8px;
	line-height: normal;
	padding: 16px 24px;
	text-decoration: none;
	top: 8px;
	width: auto;
	z-index: 100000;
}

:where(a, button, input, textarea, select, [tabindex]):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

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