/* Rizzardi Ceramiche S.r.l. - one-page site. No external resources: fonts and images are served from this site. */

@font-face {
	font-family: "Open Sans";
	src: url("../fonts/open-sans.woff2") format("woff2");
	font-weight: 300 800;
	font-style: normal;
	font-display: swap;
}

/* Headings: a geometric face close to the lettering of the logo. */
@font-face {
	font-family: "Montserrat";
	src: url("../fonts/montserrat.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

:root {
	--font-head: "Montserrat", "Segoe UI", Roboto, Arial, sans-serif;
	--yellow: #f2ec32;
	--grey-dark: #444;
	--grey-darker: #353535;
	--grey-light: #f5f5f5;
	--grey-line: #e3e3e3;
	--text: #444;
	--text-soft: #666;
	--white: #fff;
	--page-max: 1360px;
	--gutter: clamp(16px, 4vw, 40px);
}

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

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

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

body {
	margin: 0;
	font-family: "Open Sans", "Segoe UI", Roboto, Arial, sans-serif;
	font-weight: 300;
	font-size: 16px;
	line-height: 1.7;
	color: var(--text);
	/* The yellow-to-grey backdrop of the original site, drawn in CSS. */
	background: #555 linear-gradient(180deg, var(--yellow) 0, #c9c43a 90px, #555 260px) no-repeat fixed;
}

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

a {
	color: var(--grey-darker);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: var(--yellow);
	text-decoration-thickness: 3px;
	text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
	background: var(--yellow);
	text-decoration-color: var(--grey-darker);
}

:focus-visible {
	outline: 3px solid var(--grey-darker);
	outline-offset: 2px;
}

strong {
	font-weight: 700;
}

h2,
h3,
.main-nav a,
.band p,
.button,
.privacy summary,
.site-footer,
.lightbox button {
	font-family: var(--font-head);
}

.sprite {
	display: none;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 10;
	padding: 8px 16px;
	background: var(--yellow);
	color: var(--grey-darker);
}

.skip-link:focus {
	left: 16px;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* The boxed page of the original layout. */
.page {
	max-width: var(--page-max);
	margin: 0 auto;
	background: var(--white);
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

.inner {
	padding: 0 var(--gutter);
}

/* Header */

.site-header .inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 24px;
	min-height: 100px;
	padding-top: 10px;
	padding-bottom: 10px;
}

.logo {
	display: block;
	background: none;
}

.logo:hover,
.logo:focus-visible {
	background: none;
}

.logo img {
	width: 230px;
}

.main-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-nav a {
	display: block;
	padding: 8px 12px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--grey-darker);
	border-bottom: 3px solid transparent;
}

.main-nav a:hover,
.main-nav a:focus-visible {
	background: none;
	border-bottom-color: var(--yellow);
}

.top-bar {
	background: var(--grey-light);
	border-top: 1px solid var(--grey-line);
	font-size: 14px;
}

.top-bar .inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 20px;
	padding-top: 8px;
	padding-bottom: 8px;
}

.top-bar ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.top-bar a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 400;
}

.icon {
	width: 18px;
	height: 18px;
	flex: none;
	fill: currentColor;
}

/* Slideshow */

.slideshow {
	position: relative;
	aspect-ratio: 16 / 9;
	/* On wide screens 16:9 would fill the whole window: the photos are cropped instead. */
	max-height: 640px;
	width: 100%;
	overflow: hidden;
	background: var(--grey-dark);
}

.slideshow img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 1.5s ease;
}

.slideshow img.is-active {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.slideshow img {
		transition: none;
	}
}

/* Sections */

.section {
	padding-bottom: 48px;
	scroll-margin-top: 16px;
}

/* The dark band with yellow title of the original page headers. */
.band {
	margin-bottom: 32px;
	padding: 22px var(--gutter);
	background: var(--grey-dark);
	color: var(--yellow);
}

.band h2 {
	margin: 0;
	font-size: clamp(22px, 3vw, 28px);
	font-weight: 700;
	line-height: 1.25;
}

.band p {
	margin: 4px 0 0;
	font-size: 15px;
	font-weight: 600;
}

.intro p {
	margin: 0 0 1em;
	font-size: 17px;
}

/* On a wide page two columns keep the lines short enough to read comfortably. */
@media (min-width: 1000px) {
	.intro {
		column-count: 2;
		column-gap: 48px;
	}

	.intro p {
		break-inside: avoid-column;
	}
}

/* Showroom */

/* Seven photos: the first takes two places, so they fill two rows of four (four rows of two on phones). */
.gallery {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gallery li:first-child {
	grid-column: span 2;
}

.gallery a {
	display: block;
	height: 100%;
	overflow: hidden;
	background: var(--grey-light);
}

.gallery img {
	width: 100%;
	height: 100%;
	aspect-ratio: 5 / 4;
	object-fit: cover;
	transition: transform 0.3s ease;
}

/* As wide as two photos and as tall as one, so both rows keep the same height. */
.gallery li:first-child img {
	aspect-ratio: 5 / 2;
}

.gallery a:hover img,
.gallery a:focus-visible img {
	transform: scale(1.04);
}

@media (max-width: 700px) {
	.gallery {
		grid-template-columns: repeat(2, 1fr);
	}
}

.lightbox {
	width: min(96vw, 1280px);
	max-height: 96vh;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}

.lightbox::backdrop {
	background: rgba(0, 0, 0, 0.85);
}

.lightbox img {
	max-width: 100%;
	max-height: 86vh;
	margin: 0 auto;
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

.lightbox-bar {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-top: 10px;
}

.lightbox button {
	min-width: 44px;
	min-height: 44px;
	padding: 0 16px;
	border: 0;
	background: var(--yellow);
	color: var(--grey-darker);
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
}

.lightbox button:hover,
.lightbox button:focus-visible {
	background: var(--white);
}

/* Brands */

.brands {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.brands li {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	background: var(--white);
	border: 1px solid var(--grey-line);
}

.brands img {
	max-height: 90px;
	width: auto;
}

/* Sixteen brands: two full rows of eight. */
@media (min-width: 1200px) {
	.brands {
		grid-template-columns: repeat(8, 1fr);
		gap: 12px;
	}
}

@media (max-width: 800px) {
	.brands {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 520px) {
	.brands {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}
}

/* Contacts */

.contacts {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px 48px;
}

@media (max-width: 760px) {
	.contacts {
		grid-template-columns: 1fr;
	}
}

.contacts h3 {
	margin: 0 0 12px;
	font-size: 20px;
	font-weight: 700;
	color: var(--grey-darker);
}

.contacts address {
	font-style: normal;
	font-size: 18px;
	line-height: 1.6;
}

.contact-list {
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

.contact-list li {
	margin-bottom: 10px;
}

.contact-list .label {
	display: block;
	font-size: 14px;
	color: var(--text-soft);
}

.hours {
	width: 100%;
	max-width: 360px;
	border-collapse: collapse;
}

.hours th,
.hours td {
	padding: 8px 0;
	border-bottom: 1px solid var(--grey-line);
	text-align: left;
	vertical-align: top;
}

.hours th {
	padding-right: 16px;
	font-weight: 600;
}

.hours td span {
	display: block;
}

.button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 24px;
	padding: 12px 22px;
	background: var(--yellow);
	color: var(--grey-darker);
	font-weight: 700;
	text-decoration: none;
	border: 2px solid var(--yellow);
}

.button:hover,
.button:focus-visible {
	background: var(--grey-dark);
	color: var(--yellow);
}

.note {
	font-size: 14px;
	color: var(--text-soft);
}

/* Privacy */

.privacy {
	padding-bottom: 32px;
}

.privacy details {
	border: 1px solid var(--grey-line);
	background: var(--grey-light);
}

.privacy summary {
	padding: 14px 18px;
	font-weight: 700;
	cursor: pointer;
}

.privacy-text {
	padding: 0 18px 8px;
	font-size: 15px;
}

.privacy-text h3 {
	margin: 1.2em 0 0.3em;
	font-size: 16px;
	font-weight: 700;
}

.privacy-text p {
	margin: 0 0 0.8em;
}

/* Footer */

.site-footer {
	padding: 22px var(--gutter);
	background: var(--grey-dark);
	color: var(--yellow);
	font-size: 14px;
	font-weight: 600;
	line-height: 2;
	text-align: center;
}

.site-footer p {
	margin: 0;
}

.site-footer a {
	color: var(--white);
	text-decoration-color: var(--yellow);
}

.site-footer a:hover,
.site-footer a:focus-visible {
	color: var(--grey-darker);
}

@media (max-width: 560px) {
	body {
		font-size: 15px;
	}

	.site-header .inner {
		justify-content: center;
	}

	.main-nav ul {
		justify-content: center;
	}

	.main-nav a {
		padding: 6px 8px;
		font-size: 12px;
	}

	.top-bar .inner {
		justify-content: center;
	}

	.intro p {
		font-size: 16px;
	}
}

@media print {
	body {
		background: none;
	}

	.page {
		box-shadow: none;
	}

	.slideshow,
	.main-nav,
	.button {
		display: none;
	}
}
