/*
Theme Name: Darkroom
Theme URI: https://mainstaythemes.com/themes/darkroom/
Author: Mainstay Themes
Author URI: https://mainstaythemes.com/
Description: A dark, full-bleed block theme for UK photographers and videographers, with edge-to-edge portfolio grids, packages and a client gallery link.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.1
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: darkroom
Tags: one-column, custom-colors, custom-menu, editor-style, featured-images, full-site-editing, block-patterns, translation-ready, wide-blocks, block-styles, style-variations
*/

/* Focus ring: two tones, so it shows on both light and dark sections. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.wp-block-button__link:focus-visible {
	outline: var(--wp--custom--focus--width) solid var(--wp--preset--color--contrast);
	outline-offset: var(--wp--custom--focus--width);
	box-shadow: 0 0 0 var(--wp--custom--focus--width) var(--wp--preset--color--base);
}

/* Form fields: a visible edge in every style. */
input:not([type="submit"], [type="button"], [type="checkbox"], [type="radio"]),
select,
textarea {
	border: var(--wp--custom--line--thin) solid var(--wp--preset--color--muted);
	border-radius: var(--wp--custom--radius--button);
}

/* Header, main content, footer and full-width sections sit flush against each other. */
.wp-site-blocks > *,
.wp-block-post-content > .alignfull,
main > .alignfull {
	margin-block: 0;
}

/* Card block style. */
.is-style-mainstay-card {
	height: 100%;
	padding: var(--wp--preset--spacing--40);
	background-color: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--card);
}

.has-surface-background-color .is-style-mainstay-card {
	background-color: var(--wp--preset--color--base);
}

/* FAQ rows. */
.wp-block-details {
	padding-block: var(--wp--preset--spacing--30);
	border-block-end: var(--wp--custom--line--thin) solid var(--wp--preset--color--border);
}

.wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
}

/* Left and right aligned content stays inside the text column on full-width pages. */
.wp-block-post-content.alignfull > .alignleft {
	margin-inline-start: max(0%, calc((100% - var(--wp--style--global--content-size)) / 2));
}

.wp-block-post-content.alignfull > .alignright {
	margin-inline-end: max(0%, calc((100% - var(--wp--style--global--content-size)) / 2));
}

/* Long words, big images and code never push the page sideways. */
body {
	overflow-wrap: break-word;
}

img {
	max-width: 100%;
	height: auto;
}

.wp-caption {
	max-width: 100%;
}

pre {
	white-space: pre-wrap;
}

table {
	max-width: 100%;
}

/* Buttons and menu icons are big enough to tap comfortably. */
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
}

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	min-height: 2.75rem;
}

.wp-block-navigation__responsive-container-open svg {
	width: 2rem;
	height: 2rem;
}

/* When the menu has to wrap below the site name, it stays on the right. */
.mainstay-header-row:not(.is-vertical) > .mainstay-header-actions {
	margin-inline-start: auto;
}

/* Links that stand on their own, such as a phone number, are comfortable to tap. */
.wp-block-site-title a,
footer p > a:only-child,
.is-style-mainstay-card p > a:only-child {
	display: inline-block;
	padding-block: 0.125rem;
}

/* The open phone menu has large, well spaced links. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	padding-block: var(--wp--preset--spacing--20);
	font-size: var(--wp--preset--font-size--x-large);
}

/* Phones: the site name and menu icon share the first row, so the page starts sooner. */
@media (max-width: 37.4375rem) {
	.mainstay-header-row {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
		justify-items: start;
		gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
		width: 100%;
	}

	.mainstay-header-row .wp-block-site-title {
		text-align: start;
	}

	.mainstay-header-actions {
		display: contents !important;
	}

	/* The page's own button is just below, so the header's waits for bigger screens. */
	.mainstay-header-row .wp-block-buttons {
		display: none;
	}

	/* Where the button is the point, such as a phone number, it gets its own full-width row. */
	.mainstay-keep-cta .wp-block-buttons {
		display: flex;
		grid-column: 1 / -1;
		width: 100%;
	}

	.mainstay-keep-cta .wp-block-button,
	.mainstay-keep-cta .wp-block-button__link {
		width: 100%;
	}

	/* Main buttons fill the width, so they are easy to hit with a thumb. */
	main .wp-block-buttons > .wp-block-button {
		flex-grow: 1;
	}

	main .wp-block-buttons > .wp-block-button > .wp-block-button__link {
		width: 100%;
	}
}

/* The words sit quietly in the corner, so the photo does the talking. */
.darkroom-hero.wp-block-cover {
	padding: var(--wp--preset--spacing--50);
}

.darkroom-hero .wp-block-cover__inner-container {
	max-width: 48rem;
}

/* On phones the words need to show on the first screen. */
@media (max-width: 37.4375rem) {
	.darkroom-hero.wp-block-cover {
		min-height: 70vh !important;
	}
}

/* Portfolio grids run to the screen edges, with hairline gaps. */
.darkroom-bleed.wp-block-gallery {
	--wp--style--gallery-gap-default: var(--wp--custom--line--button);
	gap: var(--wp--custom--line--button);
}
