/* ==========================================================================
   In Memoriam — styles du thème
   Reprise fidèle du design Blocs d'origine, réécrit sans Bootstrap.
   ========================================================================== */

:root {
	--im-bg: #9a9ca9;          /* gris bleuté de fond */
	--im-ink: #000;
	--im-ink-soft: #212121;
	--im-muted: rgba(0, 0, 0, .5);
	--im-white: #feffff;
	--im-font: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--im-container: 1170px;
	--im-gutter: 20px;
	--im-shadow: 5px 0 30px rgba(192, 192, 192, .2);
	--im-shadow-hover: 0 10px 30px rgba(192, 192, 192, .3);
	/* --im-fond (image de l'en-tête) est injecté par functions.php */
}

/* Base ------------------------------------------------------------------- */

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

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

body {
	margin: 0;
	background: var(--im-bg);
	color: var(--im-muted);
	font-family: var(--im-font);
	font-weight: 300;
	font-size: 16px;
	line-height: 24px;
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.page-container { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; -webkit-touch-callout: none; }

a { color: var(--im-ink); font-weight: 700; text-decoration: none; transition: color .3s ease-in-out, background .3s ease-in-out; }
a:hover { color: var(--im-ink); }

h1, h2, h3, h4 { font-family: var(--im-font); color: var(--im-ink); margin: 0; }

p { margin: 0 0 1rem; }

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

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 1000; padding: 8px 16px; background: #000; color: #fff; }
.skip-link:focus { left: 8px; top: 8px; color: #fff; }

.container {
	width: 100%;
	max-width: var(--im-container);
	margin-inline: auto;
}
.container--narrow { max-width: 780px; }

.section { padding: 50px var(--im-gutter); }

/* En-tête « héros » ------------------------------------------------------- */

.hero {
	position: relative;
	padding: 20px var(--im-gutter) 100px;
	background: var(--im-fond) 50% 50% / cover no-repeat;
	color: var(--im-ink);
}

/* Navigation */
.site-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 0;
}

.site-nav__brand {
	display: inline-block;
	padding: 0 28px;
	background: #000;
	color: var(--im-white);
	font-weight: 700;
	font-size: 21px;
	line-height: 48px;
	text-transform: uppercase;
	letter-spacing: .02em;
}
.site-nav__brand:hover, .site-nav__brand:focus-visible { background: var(--im-white); color: #000; }

.site-nav__list { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }

.site-nav__list a {
	display: block;
	padding: 8px 7px;
	margin: 0 7px;
	color: rgba(0, 0, 0, .55);
	font-weight: 900;
	font-size: 14px;
	line-height: 24px;
	text-transform: uppercase;
	letter-spacing: .02em;
}
.site-nav__list a:hover,
.site-nav__list .current-menu-item > a { color: #000; }

.site-nav__toggle { display: none; }

/* Titres de l'en-tête */
.hero__titles { margin-top: 80px; text-align: center; }

.hero__title {
	font-weight: 900;
	font-size: 50px;
	line-height: 58px;
	margin: 10px 0 20px;
}

.hero__subtitle {
	margin: 10px 0 20px;
	color: var(--im-ink);
	font-weight: 300;
	font-size: 23px;
	line-height: 31px;
}
.hero--accueil .hero__subtitle { font-weight: 700; }

/* Introduction de la page d'accueil (contenu de la page « Accueil ») */
.hero__intro {
	max-width: 780px;
	margin: 55px auto 0;
	color: var(--im-ink);
}
.hero__intro h2 {
	text-align: center;
	font-weight: 700;
	font-size: 30px;
	line-height: 38px;
	margin: 10px 0 20px;
}
.hero__intro p { font-weight: 400; text-align: justify; hyphens: auto; }
.hero__intro .wp-block-quote {
	max-width: 80%;
	margin: 1.5rem auto 0;
	padding: 0;
	border: 0;
}
.hero__intro .wp-block-quote p { font-style: italic; }
.hero__intro .wp-block-quote cite { display: block; text-align: center; font-style: normal; font-weight: 400; }
.hero__intro a { font-weight: 400; border-bottom: 1px solid rgba(0, 0, 0, .35); }
.hero__intro a:hover { border-bottom-color: #000; }

/* Apparition douce (comme l'effet « scroll fade » d'origine) */
.reveal { animation: im-fade 1.2s ease-out both; }
@keyframes im-fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Grilles de cartes ------------------------------------------------------ */

.grid { display: grid; gap: 0 30px; grid-template-columns: 1fr; }
@media (min-width: 576px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.grid--cards { margin-top: 30px; }

/* Hommage (accueil) */
.hommage { display: flex; flex-direction: column; }
.hommage__phrase {
	margin: 10px 0 40px;
	min-height: 48px;
	text-align: center;
	color: rgba(0, 0, 0, .55);
	font-weight: 700;
	font-size: 16px;
	line-height: 24px;
}
.hommage .card { flex: 1 0 auto; }

/* Carte d'un défunt */
.card {
	position: relative;
	display: flex;
	flex-direction: column;
	margin-bottom: 80px;
	background: #fff;
	box-shadow: var(--im-shadow);
	transition: transform .3s ease, box-shadow .3s ease;
}
.card--link:hover, .card--link:focus-within { transform: translateY(-5px); box-shadow: var(--im-shadow-hover); }

.card__media { background: var(--im-white); }
.card__img { width: 100%; aspect-ratio: 500 / 290; object-fit: cover; }

.card__body { padding: 28px; flex: 1; }

.card__title {
	margin: 0;
	color: var(--im-ink-soft);
	font-weight: 400;
	font-size: 20px;
	line-height: 28px;
}
.card__title a { color: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; }
/* Toute la carte est cliquable */
.card__title a::after { content: ""; position: absolute; inset: 0; }

.card__text {
	margin: 10px 0 5px;
	color: #000;
	font-weight: 300;
	font-size: 15px;
	line-height: 24px;
}

.card__more { margin: 0; color: #000; font-weight: 700; font-size: 14px; line-height: 22px; }
.card--link:hover .card__more { text-decoration: underline; }

.empty, .famille__intro { color: #000; text-align: center; }

/* Fiche d'un défunt ------------------------------------------------------- */

.fiche { display: grid; gap: 30px; margin-top: 30px; color: #000; }
@media (min-width: 576px) {
	.fiche--photos-gauche, .fiche--photos-droite { grid-template-columns: 1fr 1fr; }
	.fiche--photos-droite .fiche__photos { order: 2; }
}
@media (min-width: 992px) {
	.fiche--photos-gauche { grid-template-columns: 1fr 2fr; }
	.fiche--photos-droite { grid-template-columns: 2fr 1fr; }
}
.fiche--sans-photo .fiche__texte { max-width: 780px; }

.fiche__figure { margin: 0 0 20px; }
.fiche__img { width: 100%; margin-bottom: 10px; }
.fiche__figure figcaption { font-weight: 400; font-size: 16px; line-height: 24px; }

.fiche__nom { margin: 10px 0 12px; font-weight: 700; font-size: 20px; line-height: 28px; }
.fiche__dates { margin: 0 0 20px; color: rgba(0, 0, 0, .65); font-size: 15px; }
.fiche__filiation { font-weight: 400; }

.entry-content p { font-weight: 400; font-size: 16px; line-height: 24px; margin: 10px 0 5px; }
.entry-content a { font-weight: 400; text-decoration: underline; text-underline-offset: 2px; }
.entry-content .wp-block-image figcaption { font-size: 14px; }

.fiche__familles { margin-top: 30px; padding-top: 15px; border-top: 1px solid rgba(0, 0, 0, .15); font-weight: 400; font-size: 14px; }
.fiche__familles a { font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }

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

.site-footer { padding: 50px var(--im-gutter); text-align: center; }
.site-footer p { margin: 0; color: #fff; font-weight: 300; font-size: 12px; line-height: 20px; }

/* Bouton retour en haut */
.scroll-top {
	position: fixed; right: 20px; bottom: 20px; z-index: 999;
	width: 36px; height: 36px; padding: 7px;
	border: 0; border-radius: 4px;
	background: rgba(0, 0, 0, .3);
	cursor: pointer;
	opacity: 0; pointer-events: none;
	transition: opacity .3s ease-in-out, background .3s;
}
.scroll-top:hover { background: rgba(0, 0, 0, .5); }
.scroll-top.is-visible { opacity: 1; pointer-events: auto; }
.scroll-top path { fill: none; stroke: #fff; stroke-width: 2px; stroke-linecap: round; }

/* Responsive -------------------------------------------------------------- */

@media (max-width: 991px) {
	.hero__title { font-size: 45px; line-height: 53px; }
	.hero__intro h2 { font-size: 28px; line-height: 36px; }
	.hero__subtitle { font-size: 22px; line-height: 30px; }
	.card__body { padding: 14px; }
	.site-nav__list a { margin: 0 4px; }
}

@media (max-width: 767px) {
	.hero { padding-bottom: 60px; }
	.hero__titles { margin-top: 30px; }
	.hero__title { font-size: 40px; line-height: 48px; }
	.hero__intro h2 { font-size: 25px; line-height: 33px; }
	.hero__subtitle { font-size: 21px; line-height: 29px; }
	.hero__intro .wp-block-quote { max-width: 100%; }

	/* Menu replié */
	.site-nav__toggle {
		display: block; width: 44px; height: 44px; padding: 10px;
		border: 0; background: transparent; cursor: pointer;
	}
	.site-nav__burger, .site-nav__burger::before, .site-nav__burger::after {
		display: block; width: 24px; height: 2px; background: #000; position: relative; transition: transform .2s, background .2s;
	}
	.site-nav__burger::before, .site-nav__burger::after { content: ""; position: absolute; left: 0; }
	.site-nav__burger::before { top: -7px; }
	.site-nav__burger::after { top: 7px; }
	.site-nav__toggle[aria-expanded="true"] .site-nav__burger { background: transparent; }
	.site-nav__toggle[aria-expanded="true"] .site-nav__burger::before { transform: translateY(7px) rotate(45deg); }
	.site-nav__toggle[aria-expanded="true"] .site-nav__burger::after { transform: translateY(-7px) rotate(-45deg); }

	.site-nav__menu { flex-basis: 100%; display: none; }
	.site-nav__menu.is-open { display: block; }
	.site-nav__list { flex-direction: column; align-items: center; padding: 10px 0; background: rgba(255, 255, 255, .75); }
	.site-nav__list a { padding: 10px; }

	.card { margin-bottom: 40px; }
	.hommage__phrase { margin-bottom: 20px; min-height: 0; }
}

@media (max-width: 575px) {
	.hero__title { font-size: 35px; line-height: 43px; }
	.hero__intro h2 { font-size: 23px; line-height: 31px; }
	.hero__subtitle { font-size: 20px; line-height: 28px; }
	.site-nav__brand { font-size: 18px; padding: 0 18px; line-height: 42px; }
	.hero__intro p, .entry-content p { font-size: 15px; line-height: 23px; }
	.hero__intro p { text-align: left; }
}

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