/*
Theme Name: Gabe Ostley
Author: Josh Jones
Description: Portfolio theme for cartoonist Gabe Ostley. A splash cover and three tugboat buttons lead to About, Public Domain Workshop and Collaborations.
Version: 0.2.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: gabeostley
*/

/* ---------- Base ---------- */
body {
	-webkit-font-smoothing: antialiased;
}

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	white-space: nowrap;
}

a:focus-visible {
	outline: 3px solid var(--wp--preset--color--red);
	outline-offset: 4px;
}

/* ---------- Tugboat buttons ---------- */
.boat-nav {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(0.5rem, 3vw, 2.5rem);
	align-items: end;
}

.boat-nav > * {
	margin: 0;
}

.boat-nav .boat {
	display: block;
	transform-origin: 50% 85%;
	transition: transform 0.15s ease-out;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

/* Press feedback, mainly for touch screens. */
.boat-nav .boat:active {
	transform: scale(0.94);
}

.boat-nav .boat img {
	display: block;
	width: 100%;
	height: auto;
}

@keyframes boat-rock {
	0%   { transform: rotate(0deg) translateY(0); }
	25%  { transform: rotate(-4deg) translateY(-3px); }
	75%  { transform: rotate(4deg) translateY(-3px); }
	100% { transform: rotate(0deg) translateY(0); }
}

/* Only rock for real pointers: on touch screens :hover sticks after a tap. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.boat-nav .boat:hover,
	.boat-nav .boat:focus-visible {
		animation: boat-rock 1.4s ease-in-out infinite;
	}
}

/* ---------- Home ---------- */
.home-splash {
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: clamp(1rem, 3vh, 2.5rem);
	padding: clamp(0.75rem, 3vw, 2.5rem);
	padding-left: max(clamp(0.75rem, 3vw, 2.5rem), env(safe-area-inset-left));
	padding-right: max(clamp(0.75rem, 3vw, 2.5rem), env(safe-area-inset-right));
	box-sizing: border-box;
}

.home-splash > * {
	margin: 0;
}

.home-splash .splash-cover {
	margin: 0;
}

.home-splash .splash-cover img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: min(58vh, 900px);
	max-height: min(58svh, 900px);
}

.home-splash .boat-nav {
	/* Each boat is roughly a third of this wide and as tall, so cap by height too. */
	width: min(100%, 860px, 78vh);
}

/* Phones: the cover and all three boats fit on the first screen, no scrolling. */
@media (max-width: 600px) {
	.home-splash .boat-nav {
		gap: 0.5rem;
	}
}

/* Phones held sideways: cover on the left, boats on the right. */
@media (orientation: landscape) and (max-height: 500px) {
	.home-splash {
		flex-direction: row;
		gap: clamp(1rem, 4vw, 3rem);
	}

	.home-splash .splash-cover img {
		max-height: 88vh;
		max-height: 88svh;
	}

	.home-splash .boat-nav {
		flex: 1 1 0;
		width: auto;
		max-width: 520px;
	}
}

/* ---------- Inner page header ---------- */
.site-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
	padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
	border-bottom: 4px solid var(--wp--preset--color--ink);
}

.site-header > * {
	margin: 0;
}

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

.site-header .boat-nav {
	width: min(100%, 450px);
	gap: 1rem;
}

@media (max-width: 600px) {
	.site-header {
		justify-content: center;
		text-align: center;
		padding-top: 0.9rem;
		padding-bottom: 0.9rem;
		gap: 0.6rem;
	}

	.site-header .boat-nav {
		gap: 0.5rem;
	}

	.site-header .boat {
		padding-bottom: 5px;
		border-bottom-width: 4px;
	}
}

/* Mark the boat for the page you are on. */
.site-header .boat {
	padding-bottom: 8px;
	border-bottom: 6px solid transparent;
}

.page-slug-about .site-header .boat-about,
.page-slug-public-domain-workshop .site-header .boat-public-domain-workshop,
.page-slug-collaborations .site-header .boat-collaborations {
	border-bottom-color: var(--wp--preset--color--red);
}

/* ---------- Page body ---------- */
h1,
h2,
h3 {
	overflow-wrap: break-word;
	text-wrap: balance;
}

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

.site-main {
	padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 4vw, 2.5rem);
	min-height: 50vh;
}

.site-footer {
	padding: 1.5rem clamp(1rem, 4vw, 2.5rem);
	border-top: 4px solid var(--wp--preset--color--ink);
	text-align: center;
}

/* ---------- "Link list" block style: chunky comic-panel links ---------- */
ul.is-style-link-list {
	list-style: none;
	padding: 0;
	display: grid;
	gap: 1.1rem;
}

ul.is-style-link-list li {
	margin: 0;
}

ul.is-style-link-list li a {
	display: block;
	padding: 0.9rem 1.2rem;
	min-height: 48px;
	box-sizing: border-box;
	overflow-wrap: anywhere;
	touch-action: manipulation;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	border: 3px solid var(--wp--preset--color--ink);
	box-shadow: 6px 6px 0 var(--wp--preset--color--ink);
	font-weight: 800;
	text-decoration: none;
	transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background-color 0.12s ease-out;
}

ul.is-style-link-list li a:active,
ul.is-style-link-list li a:focus-visible {
	background: var(--wp--preset--color--gold);
	transform: translate(3px, 3px);
	box-shadow: 3px 3px 0 var(--wp--preset--color--ink);
}

@media (hover: hover) {
	ul.is-style-link-list li a:hover {
		background: var(--wp--preset--color--gold);
		transform: translate(3px, 3px);
		box-shadow: 3px 3px 0 var(--wp--preset--color--ink);
	}
}
