/*
Theme Name: Sydney Portfolio
Description: Sydney Barnett's portfolio. Built on Twenty Twenty-Five so WordPress keeps it up to date. Projects are pages placed under the Work page.
Template: twentytwentyfive
Version: 1.3.3
Requires at least: 6.6
Text Domain: sydney-portfolio
*/

/* Keyboard focus is always visible. */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--ink);
	outline-offset: 3px;
}

/* Header */
.sb-header {
	border-bottom: 1px solid var(--wp--preset--color--rule);
}
.sb-header .wp-block-navigation__submenu-container {
	border: 1px solid var(--wp--preset--color--rule) !important;
	padding: 0.5rem 0;
	min-width: 15rem;
}
.sb-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.5rem 1.25rem;
	font-weight: 500;
}

/* Home page tiles: three across on desktop. Each tile is a title, a line, a picture and a "View project" button, all edited in place on the home page. */
.sb-tiles {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: var(--wp--preset--spacing--40);
	row-gap: var(--wp--preset--spacing--60);
}
/* Each tile shares its row's lines for title, line and picture, so pictures in a row always line up. */
.sb-tiles > .sb-tile {
	position: relative;
	display: grid;
	grid-template-rows: subgrid;
	grid-row: span 3;
	row-gap: 0;
	align-content: start;
	margin: 0;
}
.sb-tiles .sb-tile > * {
	margin: 0;
}
.sb-tiles .sb-tile-title {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.2;
}
.sb-tiles .sb-tile .sb-tile-line {
	margin-top: 0.25rem;
	color: var(--wp--preset--color--graphite);
}

/* The picture and the button share one cell, so the button sits in the middle of the picture. */
.sb-tiles .sb-tile .sb-tile-media {
	display: grid;
	margin-top: 1rem;
}
.sb-tiles .sb-tile-media > * {
	grid-area: 1 / 1;
	margin: 0;
}
/* Stacked above the picture, which brightens on hover and would otherwise paint over the button. */
.sb-tiles .sb-tile-media > .wp-block-buttons {
	z-index: 1;
	align-self: center;
	justify-self: center;
}
/* Tiles never crop the artwork: anything that isn't 4:5 sits on a mat. */
.sb-tiles .sb-tile-media .wp-block-image img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: contain;
	background: var(--wp--preset--color--mat);
	transition: filter 150ms ease;
}

/* "View project" is white at rest so it reads on any artwork, and Gator orange when the tile is hovered or focused. */
.sb-tiles .sb-tile-media .wp-block-button__link {
	padding: calc(0.8rem - 2px) calc(1.4rem - 2px);
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: 2px;
	background: var(--wp--preset--color--wall);
	color: var(--wp--preset--color--ink);
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	transition: background-color 150ms ease, border-color 150ms ease;
}
/* The button's link stretches over the whole tile, so the title and picture open the project too. */
.sb-tiles .sb-tile-media .wp-block-button__link::after {
	content: "";
	position: absolute;
	inset: 0;
}
/* In the editor, clicks go to the title, line and picture so they can be changed. */
.editor-styles-wrapper .sb-tiles .sb-tile-media .wp-block-button__link::after {
	content: none;
}
.sb-tiles > .sb-tile:hover .wp-block-button__link,
.sb-tiles > .sb-tile:focus-within .wp-block-button__link {
	background: var(--wp--preset--color--spark);
	border-color: var(--wp--preset--color--spark);
	color: var(--wp--preset--color--ink);
}
.sb-tiles > .sb-tile:hover .wp-block-image img {
	filter: brightness(1.06);
}
@media (prefers-reduced-motion: reduce) {
	.sb-tiles .sb-tile-media .wp-block-button__link,
	.sb-tiles .sb-tile-media .wp-block-image img {
		transition: none;
	}
}

/* The first tile is the feature: full width, title at display size. */
.sb-tiles > .sb-tile:first-child {
	grid-column: 1 / -1;
}
.sb-tiles > .sb-tile:first-child .wp-block-image img {
	aspect-ratio: auto;
	height: min(62vh, 42vw);
	object-fit: cover;
}
.sb-tiles > .sb-tile:first-child .sb-tile-title {
	font-size: var(--wp--preset--font-size--display);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1;
}
.sb-tiles > .sb-tile:first-child .sb-tile-line {
	margin-top: 0.5rem;
	font-size: var(--wp--preset--font-size--lead);
}
.sb-tiles > .sb-tile:first-child .sb-tile-media {
	margin-top: 1.5rem;
}

@media (max-width: 1024px) {
	.sb-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 600px) {
	.sb-tiles {
		grid-template-columns: minmax(0, 1fr);
	}
	.sb-tiles > .sb-tile:first-child .wp-block-image img {
		height: auto;
	}
}

/* Project pages: text stays readable, galleries use the full width. */
.sb-project .wp-block-post-content > .wp-block-gallery {
	max-width: none;
}
.sb-project .wp-block-post-content > h2 {
	margin-top: var(--wp--preset--spacing--70);
}

/* Galleries stack images in columns so posters of any shape fit without cropping. */
.wp-block-gallery.has-nested-images {
	display: block;
	columns: 3;
	column-gap: var(--wp--preset--spacing--30);
}
.wp-block-gallery.has-nested-images figure.wp-block-image {
	width: 100% !important;
	margin: 0 0 var(--wp--preset--spacing--30) !important;
	break-inside: avoid;
}
.wp-block-gallery.has-nested-images figure.wp-block-image img {
	width: 100%;
	height: auto;
}
@media (max-width: 1024px) {
	.wp-block-gallery.has-nested-images {
		columns: 2;
	}
}
@media (max-width: 600px) {
	.wp-block-gallery.has-nested-images {
		columns: 1;
	}
}

/* A picture set to Wide or Full width, or placed in a wide or full-width box, fills that width even when its file is smaller. */
.wp-block-image:is(.alignwide, .alignfull) img,
:is(.wp-block-group, .wp-block-columns):is(.alignwide, .alignfull):not(main) .wp-block-image img {
	width: 100%;
}
/* Pictures in a wide row share the row's width instead of keeping their file size. */
.wp-block-group:is(.alignwide, .alignfull).is-layout-flex > .wp-block-image {
	flex: 1 1 0;
	min-width: 0;
}

/* Ordinary pages (About, Privacy policy) */
.sb-page .wp-block-post-content > h2 {
	margin-top: var(--wp--preset--spacing--60);
}
.sb-page .wp-block-post-content > h2:first-child {
	margin-top: var(--wp--preset--spacing--40);
}

/* About page */
.sb-page .wp-block-post-content > h3 {
	margin-top: 1.75rem;
	margin-bottom: 0.25rem;
}
.sb-page .wp-block-post-content > h3 + p {
	margin-top: 0;
}

/* Contact form */
.wpcf7 label {
	display: block;
	font-weight: 600;
}
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 textarea {
	box-sizing: border-box;
	width: 100%;
	margin-top: 0.4rem;
	padding: 0.8rem 0.9rem;
	border: 1px solid var(--wp--preset--color--graphite);
	border-radius: 2px;
	background: var(--wp--preset--color--wall);
	color: var(--wp--preset--color--ink);
	font: inherit;
}
.wpcf7 input[type="submit"] {
	height: auto;
	line-height: 1.2;
	padding: 0.9rem 1.5rem;
	border: 0;
	border-radius: 2px;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--wall);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.wpcf7 input[type="submit"]:hover {
	background: var(--wp--preset--color--graphite);
}

/* Footer */
.sb-footer {
	border-top: 1px solid var(--wp--preset--color--rule);
}
.sb-footer a {
	color: inherit;
}
