/*
Theme Name: BRAM
Theme URI: https://bramlab.com
Author: BRAM
Description: Thème block (édition complète du site) pour l'univers littéraire de BRAM : écriture, pensée, philosophie, absurde, imaginaire. Palette nuit et ambre, typographie Cormorant Garamond, modèles de sections prêts à l'emploi.
Version: 1.2.1
Requires at least: 6.6
Tested up to: 6.8
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: bram
*/

:root {
	--bram-gutter: clamp(1.25rem, 5vw, 3rem);
	--bram-line: rgba(234, 223, 200, 0.22);
}

html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	color-scheme: dark;
}

::selection {
	background: var(--wp--preset--color--ambre);
	color: var(--wp--preset--color--nuit);
}

:focus-visible {
	outline: 2px solid var(--wp--preset--color--ambre);
	outline-offset: 3px;
}

.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* ---------- Gabarits de base ---------- */

.bram-gutter {
	padding-inline: var(--bram-gutter);
}

.bram-main {
	padding: clamp(3rem, 8vw, 6rem) var(--bram-gutter);
}

.bram-section {
	padding: clamp(4rem, 9vw, 8rem) var(--bram-gutter);
}

.bram-center {
	text-align: center;
}

.bram-eyebrow {
	font-size: 0.8rem;
	letter-spacing: 0.32em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ambre);
	margin-bottom: 0.75rem;
}

.bram-small {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--brume);
}

/* ---------- En-tête ---------- */

.bram-header {
	padding: 1.1rem var(--bram-gutter) 0;
}

.bram-header-inner {
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--bram-line);
}

.bram-logo {
	margin: 0;
	font-size: 1.9rem;
	line-height: 1;
	letter-spacing: 0.5em;
	text-transform: uppercase;
}

.bram-logo a {
	color: var(--wp--preset--color--creme);
	text-decoration: none;
}

.bram-header .wp-block-navigation {
	font-size: 1.1rem;
	letter-spacing: 0.02em;
}

.bram-header .wp-block-navigation a {
	color: var(--wp--preset--color--creme);
	text-decoration: none;
	padding-bottom: 0.3rem;
	border-bottom: 1px solid transparent;
	transition: color 0.25s ease, border-color 0.25s ease;
}

.bram-header .wp-block-navigation a:hover {
	color: var(--wp--preset--color--ambre);
}

.bram-header .wp-block-navigation a[aria-current="page"],
.bram-header .wp-block-navigation .current-menu-item > a {
	color: var(--wp--preset--color--rouge);
	border-bottom-color: var(--wp--preset--color--rouge-sang);
}

.bram-header .wp-block-search__button {
	background: transparent;
	color: var(--wp--preset--color--creme);
	border: 0;
	padding: 0.25rem;
}

.bram-header .wp-block-search__inside-wrapper {
	border-color: var(--bram-line);
}

.bram-header .wp-block-search__input {
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--creme);
	border: 1px solid var(--bram-line);
}

/* Sur l'accueil et la page livre, l'en-tête flotte sur l'image */
.home .bram-header,
.page-template-page-livre .bram-header {
	position: absolute;
	inset: 0 0 auto 0;
	z-index: 20;
}

.admin-bar.home .bram-header,
.admin-bar.page-template-page-livre .bram-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar.home .bram-header,
	.admin-bar.page-template-page-livre .bram-header {
		top: 46px;
	}
	.bram-logo {
		font-size: 1.5rem;
		letter-spacing: 0.4em;
	}
}

/* ---------- Bandeau d'accueil ---------- */

.bram-hero .wp-block-cover__inner-container {
	text-align: center;
	padding: clamp(6rem, 14vh, 9rem) var(--bram-gutter) clamp(5rem, 15vh, 9rem);
}

.bram-hero::after {
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	height: 18%;
	background: linear-gradient(to top, var(--wp--preset--color--nuit), transparent);
	pointer-events: none;
}

.bram-hero-title {
	margin: 0;
	padding-left: 0.42em; /* compense l'espacement après la dernière lettre */
	font-size: clamp(3.5rem, 11vw, 7.25rem);
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.42em;
	text-transform: uppercase;
	color: var(--wp--preset--color--creme);
}

.bram-hero-tagline {
	margin-top: 1rem;
	font-size: clamp(1.25rem, 2.6vw, 2rem);
	font-style: italic;
	line-height: 1.3;
}

.bram-accent {
	color: var(--wp--preset--color--rouge);
}

.wp-block-separator.bram-rule {
	width: min(12rem, 50%);
	max-width: none;
	margin: 2rem auto;
	border: 0;
	border-top: 1px solid var(--wp--preset--color--rouge-sang);
	background: none;
	opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
	.bram-hero .wp-block-cover__inner-container > * {
		animation: bram-rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
	}
	.bram-hero .wp-block-cover__inner-container > *:nth-child(2) { animation-delay: 0.15s; }
	.bram-hero .wp-block-cover__inner-container > *:nth-child(3) { animation-delay: 0.3s; }
	.bram-hero .wp-block-cover__inner-container > *:nth-child(4) { animation-delay: 0.45s; }
	.bram-hero .wp-block-cover__image-background {
		animation: bram-drift 28s ease-in-out infinite alternate;
	}
}

@keyframes bram-rise {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: none; }
}

@keyframes bram-drift {
	from { transform: scale(1); }
	to { transform: scale(1.045); }
}

/* ---------- Boutons ---------- */

.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--ambre);
	border: 1px solid var(--wp--preset--color--ambre);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--ambre);
	color: var(--wp--preset--color--nuit);
}

.bram-stack {
	flex-direction: column;
	align-items: stretch;
}

.bram-stack .wp-block-button,
.bram-stack .wp-block-button__link {
	width: 100%;
	text-align: center;
}

/* ---------- Sections ---------- */

.bram-section h2 {
	margin-top: 0;
}

.bram-card {
	padding-top: 1.1rem;
	border-top: 1px solid rgba(217, 146, 63, 0.45);
}

.bram-card h3 {
	margin: 0.25rem 0 0.5rem;
}

.bram-card p {
	margin: 0;
	color: var(--wp--preset--color--brume);
}

.bram-num {
	font-size: 0.85rem;
	letter-spacing: 0.2em;
	color: var(--wp--preset--color--ambre);
}

.bram-livre .wp-block-image img {
	box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
}

.wp-block-details {
	padding: 1.1rem 0;
	border-bottom: 1px solid var(--bram-line);
}

.wp-block-details summary {
	cursor: pointer;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.25;
}

.wp-block-details[open] summary {
	color: var(--wp--preset--color--ambre);
	margin-bottom: 0.6rem;
}

.wp-block-pullquote {
	padding: 0;
}

.wp-block-pullquote cite {
	font-size: 0.85rem;
	font-style: normal;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ambre);
}

/* ---------- Articles ---------- */

.bram-main .wp-block-post-template {
	padding: 0;
}

.bram-main .wp-block-post-template > li {
	padding: 2rem 0;
	border-top: 1px solid var(--bram-line);
}

.bram-main .wp-block-post-title {
	margin: 0.25rem 0 0.5rem;
	font-size: var(--wp--preset--font-size--large);
}

.bram-main .wp-block-post-title a {
	color: var(--wp--preset--color--creme);
	text-decoration: none;
}

.bram-main .wp-block-post-title a:hover {
	color: var(--wp--preset--color--ambre);
}

.bram-main .wp-block-post-date,
.bram-main .wp-block-post-terms {
	font-size: 0.85rem;
	letter-spacing: 0.25em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ambre);
}

.bram-main .wp-block-post-terms a {
	color: inherit;
	text-decoration: none;
}

/* ---------- Pied de page ---------- */

.bram-footer {
	padding: 3rem var(--bram-gutter) 2rem;
	border-top: 1px solid var(--bram-line);
}

.bram-footer .wp-block-navigation a {
	color: var(--wp--preset--color--brume);
	text-decoration: none;
	font-size: var(--wp--preset--font-size--small);
}

.bram-footer .wp-block-navigation a:hover {
	color: var(--wp--preset--color--ambre);
}

.bram-footer .bram-logo {
	font-size: 1.4rem;
}

/* ---------- Formulaires ---------- */

input,
textarea,
select {
	font-family: inherit;
}

.wp-block-search__input {
	background: var(--wp--preset--color--encre);
	color: var(--wp--preset--color--creme);
	border: 1px solid var(--bram-line);
	padding: 0.6rem 0.9rem;
}

/* ---------- Page Ouvrages ---------- */

.bram-books {
	gap: clamp(2rem, 5vw, 4rem);
	margin-top: 2.5rem;
}

.bram-book-cover {
	margin: 0;
}

.bram-book-cover img {
	box-shadow: 0 28px 55px rgba(0, 0, 0, 0.5);
	transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.bram-book-cover a {
	display: block;
}

.bram-book-cover a:hover img,
.bram-book-cover a:focus-visible img {
	transform: translateY(-6px);
	box-shadow: 0 36px 70px rgba(0, 0, 0, 0.6);
}

.bram-book-title {
	margin: 1.25rem 0 0.25rem;
	font-size: var(--wp--preset--font-size--large);
}

.bram-book-title a {
	color: var(--wp--preset--color--creme);
	text-decoration: none;
	transition: color 0.25s ease;
}

.bram-book-title a:hover {
	color: var(--wp--preset--color--ambre);
}
