/* —————————————————————————————————————————————————— ASSETS */

@font-face {
	font-family: "Newsreader";
	src: url("fonts/Newsreader.woff2") format("woff");
}
	
@font-face {
	font-family: "Satoshi";
	src: url("fonts/Satoshi-Variable.woff2") format("woff");
}

/* —————————————————————————————————————————————————— RESET */

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

html { 
	text-rendering: optimizeLegibility;
}

body {
	-webkit-font-smoothing: antialiased;
}

ol, ul {
	list-style-position: outside;
	margin-left: 1em;
}

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

p, h1, h2, h3, h4, h5, h6 {
	overflow-wrap: break-word;
}

p {
	text-wrap: pretty;
}

h1, h2, h3, h4, h5, h6 {
	text-wrap: balance;
}

/* —————————————————————————————————————————————————— GLOBALS */

:root {
	--color-brand-area: hsl(144, 100%, 38%);
	--color-brand-line: hsl(144, 90%, 30%);
	--color-brand-secondary-area: hsl(50, 100%, 99%);
	--color-brand-secondary-line: hsl(50, 37%, 77%);
	--color-brand-secondary-accent: hsl(50, 100%, 40%);
	--color-text: hsl(0, 0%, 26%);
	--color-text-secondary: hsl(0, 0%, 38%);
	--distance-left: 40px;
}

html {
	/*
	Fluid font sizes, adapted from:
	https://jameshfisher.com/2024/03/12/a-formula-for-responsive-font-size/.
	Frozen (125%) above a width threshold.
	Fluid (calc(1rem + 0.25vw)) below, see media queries.
	*/
	font-size: 125%;
	scroll-behavior: smooth;
}

body {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: center;
	width: 100vw;
	min-height: 100vh;
	font-size: 0.95rem;
	line-height: 1.6rem;
	background-image: url("loretolio_images/loretolio-table-bottle-2025.jpg");
	background-size: contain;
	background-repeat: no-repeat;
	background-position-y: 0;
	hyphens: auto;
	/* Prevent excessive hyphenation by setting high thresholds: */
	-webkit-hyphenate-limit-before: 4; 
	-webkit-hyphenate-limit-after: 4;
	hyphenate-limit-chars: 8 4 4;
}

h1 {
	font-weight: normal;
	font-variation-settings: "wght" 900 !important;
	font-size: 0.72rem;
	color: var(--color-brand-secondary-accent);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	text-shadow: 0 0 1px hsl(0, 0%, 100%);
}

h2 {
	font-weight: normal;
	font-variation-settings: "wght" 420, "opsz" 6;
	font-size: 1.3rem;
	line-height: 120%;
	margin-top: 1.2em;
	margin-bottom: 0.4em;
}

p, figure, ul {
	margin-bottom: 0.7em;
}

details > summary {
	outline: none;
}

details > summary::-webkit-details-marker {
	display: none;
}

/* p.sans-margin, figure.sans-margin, ul.sans-margin {
	margin-bottom: 0;
} */

#intro {
	margin-top: 1.7em;
}

.gallery.thumbnails div {
	columns: 3 170px;
	column-gap: 0.7rem;
	margin-top: 0.6rem;
	line-height: 0;
	font-size: 0;
	-webkit-user-select: none;
	user-select: none;
}

.gallery.thumbnails figure {
	display: inline-block;
	width: 100%;
	padding: 0.7rem 0 0 0;
}

main.gallery.thumbnails img {
	padding: 3px;
	outline: 0 solid var(--color-brand-area);
	/* outline-offset: 0; */
}

main.gallery.thumbnails img:hover {
	outline: 3px solid var(--color-brand-area);
	outline-offset: -3px;
	transition: outline 0.16s linear;
}

.gallery figure:first-of-type {
	margin-top: 1.1em;
}

.gallery.thumbnails figure:first-of-type {
	margin-top: 0;
}

#intro p {
	font-weight: normal;
	font-variation-settings: "wght" 420, "opsz" 6;
	font-size: 1.3rem;
	line-height: 144%;
	margin-bottom: 0.6em;
}

a {
	color: inherit;
	border:none;
	text-decoration: none;
}

a:active, a:focus {
	outline: 0;
}

a:hover {
	text-decoration: underline;
}

/* #intro a:link, #intro a:visited, p a:link, p a:visited {
	color: var(--color-link);
} */

#wrapper { /* Contains nav and main */
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	flex: 1;
	align-items: flex-start;
	padding-bottom: 6em;
	z-index: 1;
}

.center {
	width: 1256px;
	max-width: 100vw;
	padding: 0 132px;
}

.action a {
	color: inherit;
	font-size: 0.85rem;
	display: inline-block;
	padding: 0.3em 1em;
	border: 1px solid var(--color-text-secondary);
	border-radius: 8px;
}

.action a:hover {
	text-decoration: none;
	color: #fff;
	background-color: var(--color-brand-area);
	border-color: var(--color-brand-area);
}

.sans {
	font-family: "Satoshi", sans-serif;
	font-variation-settings: "wght" 500;
	font-feature-settings: "ss01" 1;
}

.serif {
	font-family: "Newsreader", serif;
	font-variation-settings: "wght" 420, "opsz" 6;
}

/* —————————————————————————————————————————————————— ELEMENTS */

/* —————————————————————————————————————————————————— Header */

header {
	width: 100vw;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	z-index: 0;
}

header img#masthead {
	object-fit: contain;
	width: 100%;
	max-width: 1256px;
	padding: 7vw 40px 6vw 40px;
	filter: drop-shadow(0 1px 3px hsla(0, 0%, 0%, 0.5));
}

/* —————————————————————————————————————————————————— Nav */

nav {
	color: var(--color-text-secondary);
	background-color: var(--color-brand-secondary-area);
	font-size: 0.7rem;
	line-height: 1.26em;
	padding: 0.1em 0 0.8em 0;
	cursor: default;
	-webkit-user-select: none;
	user-select: none;
}

nav#side {
	display: block;
	order: 2;
	flex-shrink: 0;
	width: fit-content;
	margin: 4.66em 0 0 36px;
	border: 0.5px solid var(--color-brand-secondary-line);
	border-radius: 4px;
}

nav#top {
	display: none;
	position: -webkit-sticky; /* Safari 6.1 - 12.1 */
	position: sticky;
	top: 0;
	width: 100%;
	padding: 0em 0 1.3em 0;
	box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.6), 0 1px 0 0 rgba(0, 0, 0, 0.05);
	z-index: 3;
}

nav ul, nav .quick, nav .logo {
	margin: 0 12px; /* So top borders aren't as wide as the parent (nav) */
}

nav .logo {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: baseline;
	padding: 0.9em 0 0 var(--distance-left);
	color: var(--color-brand-area);
	font-variation-settings: "wght" 520, "opsz" 7;
	font-size: 1.36rem;
}

nav#top .logo {
	padding: 0.8em 0 0.1em var(--distance-left);
}

nav .logo div { /* Wordmark (both) — Menu/Close icons (#top only) */
	position: relative;
}

nav .logo div:first-child::before { /* Before wordmark */
	position: relative;
	top: 2px;
	height: 22px;
	margin: 0 4px 0 -34px;
	content: url(loretolio_images/loretolio-leaf-green-small.svg);
	opacity: 0.92; /* Adjust for visual weight */
}

nav .logo * {
	filter: drop-shadow(0 0 2px hsl(0, 0%, 100%));
}

nav ul {
	padding: 16px 12px 10px calc(var(--distance-left) - 4px);
	opacity: 0.96; /* Counteract the bolder font weight */
	font-variation-settings: "wght" 700;
	list-style: none;
}

nav ul li a {
	display: block;
	padding: 1px 32px 1px 4px;
	/* border-radius: 3px; */
	color: var(--color-text-secondary);
	/* background-color: transparent; */
	/* transition: background-color 0.12s linear; */
}

nav ul li a:hover {
	/* background-color: var(--color-brand-secondary-highlight); */
	color: hsl(0, 0%, 0%);
	text-decoration: none;
}

nav ul li.current {
	position: relative;
	margin: 1px 32px 1px 4px;
}

nav ul li.current::before {
	position: absolute;
	left: -0.8em;
	content: "•";
}

.quick {
	margin: 0 12px;
	border-top: 0.5px solid var(--color-brand-secondary-line);
	padding: 0.8em 16px 10px var(--distance-left);
	font-size: 0.64rem;
}

.instagram {
	display: flex;
	flex-direction: row;
	align-items: center;
	white-space: nowrap;
}

.instagram img {
	width: 18px;
	height: auto;
	padding: 0;
	margin: 0;
}

.instagram a {
	padding-left: 0.4em;
}

nav#top details > summary { /* aka nav#top .logo */
	display: block;
}

nav#top details > summary div {
	display: block;
	position: relative;
}

nav#top details > summary div::after {
	height: 18px; /* Prevent layout shift when first loading, and when first opening the menu */
	padding-right: calc(var(--distance-left) - 1.3em);
	content: url(loretolio_images/loretolio-menu.svg);
	position: absolute;
	right: 0;
	bottom: 0;
}


nav#top details[open] > summary div::after {
	content: url(loretolio_images/loretolio-close.svg);
}

nav#top details .menu {
	position: absolute;
	background-color: var(--color-brand-secondary-area);
	width: 100vw;
	padding-bottom: 0.6em;
	font-size: 1rem;
	line-height: 1.6em;
	transform-origin: top;
	box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.6), 0 1px 0 0 rgba(0, 0, 0, 0.05);
	/* Mask the top shadow — use polygon (not rect) for backwards compatibility: */
	/* -webkit-clip-path: rect(10px 100% 110% 0px); */
	-webkit-clip-path: polygon(0 10px, 100% 10px, 110% 100%, 0 110%);
	/* clip-path: rect(10px 100% 110% 0px); */
	clip-path: polygon(0 10px, 100% 10px, 110% 100%, 0 110%);
}

nav#top details[open] .menu {
	animation: slidedown 0.3s ease-in;
}

nav#top ul {
	opacity: 0.92; /* Counteract the bolder font weight + larger text size */
}

nav#top .quick {
	font-size: 0.9rem;
	line-height: 1.4em;
}

@keyframes slidedown {
	0%    {opacity: 0; transform: scaleY(0.0);}
	77%   {opacity: 1; transform: scaleY(1.04);}
	90%   {transform: scaleY(0.98);}
	100%  {transform: scaleY(1.0);}
}

/* —————————————————————————————————————————————————— Main */

main {
	position: relative;
	color: var(--color-text);
}

main a {
	color: var(--color-brand-line);
}

main figure {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
}

figcaption {
	width: 100%;
	margin-top: 0.5em;
	font-size: 86%;
	color: var(--color-text-secondary);
	line-height: 1.3em;
}

main img {
	position: relative;
	display: block;
	width: 100%;
	height: auto;
	padding: 14px 2vw;
}

main .knockout img {
	padding: 14px 0;
}

main img.overlay {
	position: absolute;
	top: 0;
	left: -2.6%;
}

main .portrait img {
	padding: 14px 7.4vw;
}

main.gallery img {
	padding: 14px 0;
}

main.gallery .portrait img {
	padding: 14px 8vw;
}

main .instagram img {
	position: relative;
	width: 26px;
	top: -2px;
}

main .action {
	margin-top: 2.4em;
}

.order-spacer { /* Make space for the absolutely positioned #order-container */
	padding-top: 4.4em;
}

#order-container {
	position: absolute;
	/* display: block; */
	width: 100%;
	/* height: 8em; */
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: center;
	padding: 0.5em 0 1em 0; /* Only top is effective */
	-webkit-user-select: none;
	user-select: none;
}

#order-widget { /* The details element */
	position: relative;
	text-align: center;
	z-index: 20;
	background-color: transparent;
	padding: 2px;
	border-radius: 10px;
	box-shadow: none;
}

#order-widget ul {
	margin: 0;
	list-style-type: none;
	transform-origin: top;
	animation: slidedown 0.3s ease-in;
}

#order-widget summary div::after {
	vertical-align: text-top;
	position: relative;
	display: inline-block;
	content:url(loretolio_images/loretolio-chiclet.svg);
	width: 18px;
	height: 18px;
	margin-left: 0.6em;
	transform: rotate(0deg);
}

#order-widget summary, #order-widget ul li a {
	display: block;
	width: 11em;
	white-space: nowrap;
	cursor: pointer;
	color: #fff;
	background-color: var(--color-brand-area);
	border: 1px solid transparent;
	border-radius: 8px;
	font-size: 0.85rem;
	padding: 0.3em 1em;
	transition: background-color 0.05s linear;
}


#order-widget ul li a:hover {
	background-color: hsl(144, 100%, 36%);
}

/* #order-widget summary {
	display: flex;
	flex-flow: row;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: center;
} */

#order-widget ul li a {
	margin-top: 1px;
	border-radius: 0px;
}

#order-widget ul li:last-child a {
	margin-top: 1px;
	border-radius: 0 0 8px 8px;
}

#order-widget[open] {
	background-color: hsl(0, 0%, 100%);
	box-shadow: 0 6px 8px 3px hsla(0, 0%, 0%, 0.2), 0 0 0 1px hsla(0, 0%, 0%, 0.07);
	transition: all 0.2s linear 0.1s;
}

#order-widget[open] summary {
	border-radius: 8px 8px 0 0;
}

#order-widget[open] summary div::after {
	transform-origin: center;
	/* transform-origin: center center; */
	transform: rotate(90deg);
	transition: transform 0.1s linear;
}

#order-widget ul a:hover {
	text-decoration: none;
}

/* —————————————————————————————————————————————————— Footer */

.footer {
	margin-bottom: 4em;
	font-size: 1.33rem;
	font-size: 0.64rem;
	color: var(--color-text-secondary);
	line-height: 1.2em;
}

/* —————————————————————————————————————————————————— MEDIA QUERIES */

@media (max-width: 1256px) {
	html {
		font-size: calc(1rem + 0.25vw);
	}
	body {
		line-height: calc(1.3rem + 0.6vw);
		background-size: 116vw;
		background-position-x: -8vw;
	}
	.center {
		padding: 0 8vw;
	}
	header img#masthead {
		padding: 9vw 7.3vw 8vw 7.3vw;
	}
	main img {
		padding: 1.1vw 2.9vw 1.1vw 3.2vw;
	}
	main .portrait img {
		padding: 14px 10vw;
	}
}

@media (max-width: 860px) {
	:root {
		--distance-left: calc(8vw + 17px);
	}
	body {
		background-size: 148vw;
		background-position-x: -19vw;
		background-position-y: 3.5rem;
	}
	header img#masthead {
		padding: 11.2vw 7.3vw 14.8vw 7.3vw;
		filter: drop-shadow(0 1px 3px hsla(0, 0%, 0%, 0.6));
	}
	nav#side {
		display: none;
	}
	nav#top {
		display: block;
	}
	/* .center {
		padding: 0 36px;
	} */
}

@media (max-width: 660px) {
	header img#masthead {
		filter: drop-shadow(0 1px 3px hsla(0, 0%, 0%, 0.8));
	}
}

@media (min-width: 1900px) {
	body {
		background-position-y: -2vw;
	}
}

@media screen and (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
