/*
Theme Name: Gesso
Description: Minimalist, bilingual (pt-BR / English) theme for an artist's website. A top bar with the artist's name, a hamburger menu, an Instagram link and a language toggle, followed by one full-screen image. Includes a Quick Editor at /login for the artist name, Instagram link, home images and colors, with no need to enter the WordPress dashboard.
Version: 1.1.2
Requires at least: 6.0
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: gesso
Update URI: false
*/

/* ==========================================================================
   Tokens
   The two colors below are the defaults. The real values come from the Quick
   Editor and are printed right after this stylesheet (see gesso_custom_css()).
   ========================================================================== */

:root {
	--gesso-bg: #f6f2e9;      /* egg white: top bar + page background */
	--gesso-text: #1c1b19;    /* near-black: text, icons, menu borders */
	--gesso-line: var(--gesso-text);

	/* Calibri when the visitor's device has it; otherwise Carlito, a free,
	   metric-identical clone bundled with the theme (assets/fonts). */
	--gesso-font: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

	--gesso-header-h: 64px;
	--gesso-gutter: clamp(16px, 3vw, 32px);
	--gesso-menu-w: 176px;
	--gesso-brick-h: 44px;
	--gesso-adminbar-h: 0px;
}

@media (max-width: 767px) {
	:root {
		--gesso-header-h: 56px;
	}
}

/* The WordPress admin bar (only shown to logged-in WordPress users). */
body.admin-bar {
	--gesso-adminbar-h: var(--wp-admin--admin-bar--height, 32px);
}
@media (max-width: 782px) {
	body.admin-bar {
		--gesso-adminbar-h: var(--wp-admin--admin-bar--height, 46px);
	}
}

/* ==========================================================================
   Base
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--gesso-bg);
	color: var(--gesso-text);
	font-family: var(--gesso-font);
	font-size: 1.125rem; /* Calibri runs small; 18px reads like ~16px Arial. */
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a {
	color: inherit;
}

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

:focus-visible {
	outline: 2px solid var(--gesso-text);
	outline-offset: 2px;
}

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

.skip-link {
	position: absolute;
	top: -100px;
	left: 8px;
	z-index: 200;
	padding: 10px 14px;
	background: var(--gesso-text);
	color: var(--gesso-bg);
	text-decoration: none;
}
.skip-link:focus {
	top: calc(var(--gesso-adminbar-h) + 8px);
}

/* ==========================================================================
   Language
   Every translatable string is printed in both languages; whichever one
   doesn't match <html data-lang> is hidden (see inc/i18n.php).
   ========================================================================== */

html[data-lang="pt"] [data-l="en"],
html[data-lang="en"] [data-l="pt"],
html:not([data-lang]) [data-l="en"] {
	display: none !important;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.site {
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - var(--gesso-adminbar-h));
	min-height: calc(100dvh - var(--gesso-adminbar-h));
}

.site-main {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}

/* ==========================================================================
   Top bar: always present, always on top
   ========================================================================== */

.site-header {
	position: sticky;
	top: var(--gesso-adminbar-h);
	z-index: 100;
	display: flex;
	flex: none;
	align-items: stretch;
	justify-content: space-between;
	gap: 16px;
	height: var(--gesso-header-h);
	padding: 0 var(--gesso-gutter);
	background: var(--gesso-bg);
}

.site-header__name {
	align-self: center;
	min-width: 0;
	overflow: hidden;
	font-size: 1.375rem;
	line-height: 1.25;
	letter-spacing: 0.01em;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.site-header__name:hover {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 5px;
}

@media (max-width: 767px) {
	.site-header__name {
		font-size: 1.25rem;
	}
}

.site-header__tools {
	display: flex;
	flex: none;
	align-items: stretch;
	/* Optical alignment: the icon glyphs sit inside larger tap areas, so pull
	   the cluster out until the last glyph lines up with the page gutter. */
	margin-right: -10px;
}

/* Hamburger, Instagram and language: each one fills the bar's full height,
   which keeps the hover area continuous down to the menu. */
.site-tool {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 44px;
	padding: 0 10px;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 0.9375rem;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.site-tool:focus-visible {
	outline-offset: -8px;
}
.site-tool .site-icon {
	display: block;
	flex: none;
	width: 24px;
	height: 24px;
}
.site-tool--link,
.site-tool--lang {
	transition: opacity 0.15s ease;
}
.site-tool--link:hover,
.site-tool--lang:hover {
	opacity: 0.6;
}
.site-tool__code {
	min-width: 1.4em;
	letter-spacing: 0.04em;
}

/* ==========================================================================
   Hamburger menu
   Opens on hover, closes when the pointer leaves the icon + menu. A click
   pins it open until the next click. (Behavior lives in assets/js/main.js;
   with JavaScript off it still opens on hover or keyboard focus.)
   ========================================================================== */

.site-menu {
	position: relative;
	display: flex;
	align-items: stretch;
}

/* Closed -> pinned: the three lines become an X. */
.site-icon--menu line {
	transform-box: fill-box;
	transform-origin: center;
	transition: transform 0.22s ease, opacity 0.15s ease;
}
.site-menu.is-pinned .site-icon--menu .l1 {
	transform: translateY(6px) rotate(45deg);
}
.site-menu.is-pinned .site-icon--menu .l2 {
	opacity: 0;
}
.site-menu.is-pinned .site-icon--menu .l3 {
	transform: translateY(-6px) rotate(-45deg);
}

/* The panel hangs from the bottom edge of the bar, centered under the icon. */
.site-menu__nav {
	position: absolute;
	top: 100%;
	left: 50%;
	width: var(--gesso-menu-w);
	visibility: hidden;
	opacity: 0;
	transform: translate(-50%, -4px);
	transition: opacity 0.14s ease, transform 0.14s ease, visibility 0s linear 0.14s;
}
.site-menu.is-open .site-menu__nav,
html:not(.js) .site-menu:hover .site-menu__nav,
html:not(.js) .site-menu:focus-within .site-menu__nav {
	visibility: visible;
	opacity: 1;
	transform: translate(-50%, 0);
	transition-delay: 0s;
}

.site-menu__list {
	margin: 0;
	padding: 0;
	list-style: none;
}
/* Bricks share their edges: one thin line between neighbors, not two. */
.site-menu__list li + li {
	margin-top: -1px;
}

.site-menu__item {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: var(--gesso-brick-h);
	padding: 0 12px;
	border: 1px solid var(--gesso-line);
	background: var(--gesso-bg);
	color: inherit;
	font-size: 1.0625rem;
	line-height: 1;
	text-decoration: none;
}
.site-menu__item::before {
	content: "";
	position: absolute;
	inset: 0;
	background: currentColor;
	opacity: 0;
	transition: opacity 0.12s ease;
}
.site-menu__item:hover::before,
.site-menu__item:focus-visible::before {
	opacity: 0.07;
}
.site-menu__item:focus-visible {
	outline-offset: -5px;
}
.site-menu__label {
	position: relative;
}
.site-menu__item[aria-current="page"] .site-menu__label {
	font-weight: 700;
}

/* ==========================================================================
   Home: one image fills everything under the bar
   ========================================================================== */

.site-hero {
	position: relative;
	flex: 1 1 auto;
	min-height: 240px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.05);
}
.site-hero__picture {
	position: absolute;
	inset: 0;
	display: block;
}
.site-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
}

/* ==========================================================================
   Inner pages
   ========================================================================== */

.site-page {
	width: 100%;
	max-width: 46rem;
	margin: 0 auto;
	padding: clamp(32px, 8vw, 96px) var(--gesso-gutter) 96px;
}
.site-page__title {
	margin: 0 0 1.25rem;
	font-size: clamp(1.75rem, 1.2rem + 2.5vw, 2.5rem);
	font-weight: 400;
	line-height: 1.15;
}
.site-page__title a {
	text-decoration: none;
}
.site-page__note {
	margin: 0;
}
.entry-content {
	overflow-wrap: break-word;
}
.entry-content > * + * {
	margin-top: 1.1em;
}
.entry-content > :first-child {
	margin-top: 0;
}
.entry-content h2,
.entry-content h3,
.entry-content h4 {
	margin: 1.9em 0 0.5em;
	font-weight: 700;
	line-height: 1.25;
}
.entry-content > :first-child:is(h2, h3, h4) {
	margin-top: 0;
}
.entry-content h2 {
	font-size: 1.5rem;
}
.entry-content h3 {
	font-size: 1.25rem;
}
.entry-content h4 {
	font-size: 1.0625rem;
}
.entry-content ul,
.entry-content ol {
	padding-left: 1.4em;
}
.entry-content li + li {
	margin-top: 0.35em;
}
.entry-content li > ul,
.entry-content li > ol {
	margin-top: 0.35em;
}
.entry-content a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}
.entry-content a:hover {
	text-decoration-thickness: 2px;
}
.entry-content blockquote {
	margin-left: 0;
	margin-right: 0;
	padding-left: 1.1em;
	border-left: 1px solid var(--gesso-line);
}
.entry-content hr {
	margin: 2em 0;
	border: 0;
	border-top: 1px solid var(--gesso-line);
}

/* Text-only pages (Currículo, Olá): a short note when a language has no text of its own yet. */
.site-text__note {
	margin: 0 0 1.5rem;
	font-size: 0.9375rem;
	font-style: italic;
	opacity: 0.75;
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

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