/* ==========================================================================
   Portail CD — règles de base
   Reprend la charte de charlotte-dunand.com
   ========================================================================== */

/* Polices
   -------------------------------------------------------------------------- */
@font-face {
	font-family: "alphazet";
	src: url("../fonts/alphazet-light.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "alphazet";
	src: url("../fonts/alphazet-semibold.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "calloveya";
	src: url("../fonts/calloveya.woff2") format("woff2");
	font-display: swap;
}

/* Repli calé sur les métriques d'Alphazet, pour limiter le saut au chargement */
@font-face {
	font-family: "alphazet Fallback";
	src: local("Arial");
	ascent-override: 83.98%;
	descent-override: 29.39%;
	line-gap-override: 13.44%;
	size-adjust: 119.08%;
}

/* Variables
   -------------------------------------------------------------------------- */
:root {
	--background: #fff;
	--foreground: #171717;
	--cerise: #a42731;
	--vin: #3a1f1e;
	--froid: #e5e5e5;
	--muted: #5a4a49;

	--font-alphazet: "alphazet", "alphazet Fallback", ui-sans-serif, system-ui, sans-serif;
	--font-calloveya: "calloveya", cursive;

	--radius-sm: .25rem;
	--radius-md: .375rem;
	--radius-lg: .5rem;
	--radius-2xl: 1rem;

	--gutter: 1.5rem;
	--transition: 300ms cubic-bezier(.4, 0, .2, 1);
}

/* Remise à zéro
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	border: 0 solid;
}

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

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

button,
input,
select,
textarea {
	font: inherit;
	letter-spacing: inherit;
	color: inherit;
	background-color: transparent;
	border-radius: 0;
}

ul,
ol {
	list-style: none;
}

/* Base
   -------------------------------------------------------------------------- */
body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	gap: .6rem;
	padding: var(--gutter) var(--gutter) 2rem;
	background: var(--background);
	color: var(--foreground);
	font-family: var(--font-alphazet);
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

::selection {
	background: var(--vin);
	color: #fff;
}

/* Typographie (mobile d'abord, puis desktop) */
h1, .h1 { font-size: 2rem;    font-weight: 600; line-height: 1; }
h2, .h2 { font-size: 1.75rem; font-weight: 400; line-height: 1; }
h3, .h3 { font-size: 1.25rem; font-weight: 600; line-height: 1; }
h4, .h4 { font-size: 1rem;    font-family: var(--font-calloveya); font-weight: 400; }
h5, .h5 { font-size: 1.25rem; font-weight: 400; line-height: 1; }
h6, .h6 { font-size: 1rem;    font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

@media (min-width: 48rem) {
	h1, .h1 { font-size: 4.5rem; }
	h2, .h2 { font-size: 4rem; }
	h3, .h3 { font-size: 2.5rem; }
	h4, .h4 { font-size: 2.5rem; }
	h5, .h5 { font-size: 2rem; }
}

p {
	line-height: 1.6;
}

p + p {
	margin-top: 1em;
}

strong,
b {
	font-weight: 600;
}

.script {
	font-family: var(--font-calloveya);
	font-weight: 400;
}

.text-muted { color: var(--muted); }
.text-cerise { color: var(--cerise); }

/* Liens : remplissage vin de bas en haut au survol */
a {
	color: inherit;
	text-decoration: none;
}

.link,
.entry__content a {
	position: relative;
	isolation: isolate;
	display: inline-block;
	padding: 0 .25rem;
	transition: color var(--transition);
}

.link::before,
.entry__content a::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--vin);
	transform: scaleY(0);
	transform-origin: bottom;
	transition: transform var(--transition);
}

.link:hover,
.entry__content a:hover {
	color: #fff;
}

.link:hover::before,
.entry__content a:hover::before {
	transform: scaleY(1);
}

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

/* Texte réservé aux lecteurs d'écran */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Lien d'évitement : visible seulement au clavier */
.skip-link:focus {
	z-index: 100;
	top: 1rem;
	left: 1rem;
	width: auto;
	height: auto;
	padding: .75rem 1.25rem;
	clip-path: none;
	border-radius: 9999px;
	background: var(--vin);
	color: #fff;
	font-weight: 600;
}

.site-main:focus {
	outline: none;
}

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

/* Boutons
   -------------------------------------------------------------------------- */
.button,
button[type="submit"],
input[type="submit"] {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	padding: .75rem 1.5rem;
	border-radius: 9999px;
	background: var(--vin);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
	transition: background-color var(--transition);
}

.button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
	background: var(--cerise);
}

.button--ghost {
	background: transparent;
	color: var(--vin);
	box-shadow: inset 0 0 0 1px var(--vin);
}

.button--ghost:hover {
	background: var(--vin);
	color: #fff;
}

/* Formulaires */
input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
select,
textarea {
	width: 100%;
	padding: .75rem 1rem;
	border: 1px solid var(--froid);
	border-radius: var(--radius-lg);
	background: #fff;
	transition: border-color var(--transition);
}

input:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--vin);
}

/* Mise en page
   -------------------------------------------------------------------------- */
.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.5rem;
	border-radius: var(--radius-2xl);
	background: var(--vin);
	color: #fff;
}

.site-header__brand {
	font-weight: 600;
	letter-spacing: .02em;
}

.site-header__brand img {
	width: 8.5rem;
}

.site-header__user {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-left: auto;
	font-size: .875rem;
}

.site-header__name {
	color: rgb(255 255 255 / .7);
}

.site-header__logout {
	padding: .4rem .9rem;
	border-radius: 9999px;
	box-shadow: inset 0 0 0 1px rgb(255 255 255 / .35);
	transition: background-color var(--transition), box-shadow var(--transition);
}

.site-header__logout:hover {
	background: rgb(255 255 255 / .1);
	box-shadow: inset 0 0 0 1px #fff;
}

@media (max-width: 40rem) {
	.site-header__name {
		display: none;
	}
}

.site-header__menu {
	display: flex;
	gap: .25rem;
	font-size: .875rem;
}

.site-header__menu a {
	display: block;
	padding: .5rem .75rem;
	border-radius: var(--radius-md);
	transition: background-color var(--transition);
}

.site-header__menu a:hover,
.site-header__menu .current-menu-item > a {
	background: rgb(255 255 255 / .1);
}

.site-main {
	flex: 1;
	padding: 3rem 0;
}

.entry {
	max-width: 72rem;
}

.entry__title {
	margin-bottom: 2rem;
}

.entry__content > * + * {
	margin-top: 1rem;
}

.entry__content ul,
.entry__content ol {
	padding-left: 1.25rem;
	list-style: revert;
}

.site-footer {
	padding: 1.5rem;
	border-radius: var(--radius-2xl);
	background: var(--froid);
	color: var(--muted);
	font-size: .875rem;
}

/* Cartes, utiles pour les futurs écrans du portail */
.card {
	padding: 1.5rem;
	border-radius: var(--radius-2xl);
	background: #fff;
	box-shadow: 0 0 0 1px rgb(58 31 30 / .08);
}

.card--vin {
	background: var(--vin);
	color: #fff;
	box-shadow: none;
}
