/*
Theme Name: 4ème Ligne
Theme URI: https://www.4emeligne.fr
Description: Thème enfant Blocksy du site de l'agence 4ème Ligne. Ambiance sombre, effets de défilement fournis par l'extension 4L Effets.
Author: Agence 4ème Ligne
Author URI: https://www.4emeligne.fr
Template: blocksy
Version: 1.8.1
Text Domain: 4emeligne
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: blocksy, agence, communication
*/

/*
 * Repères partagés avec l'extension 4L Effets, calculés à partir des réglages natifs de Blocksy :
 * - gouttière : la marge latérale du thème (Personnaliser › Général › Mise en page,
 *   « Espacement des bords du contenu »), sur laquelle s'alignent le logo et le bouton de menu ;
 * - en-tête : la hauteur de l'en-tête collant une fois rétréci, sous laquelle se calent les piles.
 * Blocksy pose --header-sticky-height et --sticky-shrink sur body[data-header].
 */
body {
	--qel-gouttiere: calc((100vw - var(--theme-container-edge-spacing, 90vw)) / 2);
	--qel-entete: calc(var(--header-sticky-height, 0px) * var(--sticky-shrink, 100) / 100);
}

/*
 * Fiche réalisation (façon Uncode « Classic layout ») : l'en-tête plein écran, le titre et la
 * navigation sont réglés dans Blocksy (Personnaliser › Types de contenu › Réalisations) ; ici, la
 * mise en forme du texte saisi dans l'éditeur et les tuiles de navigation.
 *  - « Le projet » (1er titre) devient un sur-titre, le paragraphe qui suit une introduction centrée ;
 *  - la liste des livrables passe en grille de 3 colonnes, avec un tiret vert ;
 *  - précédente / suivante : deux tuiles photo pleine largeur.
 */
.single-portfolio .entry-content > h2 {
	margin: clamp(64px, 9vw, 140px) 0 28px;
	font-size: .82rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; text-align: center;
	color: var(--theme-palette-color-1);
}
.single-portfolio .entry-content > h2:first-child { margin-top: clamp(48px, 7vw, 110px); }
.single-portfolio .entry-content > h2:first-child + p {
	max-width: 980px; margin-inline: auto; text-align: center; text-wrap: balance;
	font-size: clamp(1.45rem, 2.5vw, 2.35rem); line-height: 1.35; letter-spacing: -.01em; color: var(--theme-palette-color-4);
}
.single-portfolio .entry-content > ul {
	list-style: none; margin: 0 auto; padding: 0; max-width: 1320px;
	display: grid; grid-template-columns: 1fr; gap: 0 40px;
}
@media (min-width: 690px) { .single-portfolio .entry-content > ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .single-portfolio .entry-content > ul { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.single-portfolio .entry-content > ul > li {
	margin: 0; padding: 18px 0; border-top: 1px solid rgb(255 255 255 / .12);
	font-size: 1.12rem; font-weight: 500; color: var(--theme-palette-color-4);
}
.single-portfolio .entry-content > ul > li::before { content: "— "; color: var(--theme-palette-color-1); }
/* Livrable avec description : « <strong>Titre</strong> description » → titre sur sa ligne. */
.single-portfolio .entry-content > ul > li strong { display: inline; font-weight: 600; color: #fff; }
.single-portfolio .entry-content > ul > li:has(strong) { font-size: 1rem; font-weight: 400; color: var(--theme-palette-color-3); line-height: 1.55; }
.single-portfolio .entry-content > ul > li:has(strong) strong { font-size: 1.12rem; }
.single-portfolio .entry-content > ul > li:has(strong) strong::after { content: ""; display: block; height: 6px; }

/* Ligne « Client · Services · Année » sous le titre (champs ACF lus par la méta du hero Blocksy). */
/* Titre de la fiche : jamais coupé en plein mot (« RugbyAmateur.fr »). L'en-tête s'élargit au-delà du
   conteneur étroit de Blocksy, et la taille du titre se réduit avec l'écran pour qu'un nom long tienne. */
.single-portfolio .hero-section .entry-header { max-width: min(1100px, 100%); }
.single-portfolio .hero-section .page-title { font-size: min(var(--theme-font-size), 10.5vw); overflow-wrap: normal; word-break: normal; hyphens: manual; text-wrap: balance; }
.single-portfolio .hero-section .entry-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 32px; margin-top: 22px; }
.single-portfolio .hero-section .entry-meta li { font-size: clamp(.95rem, 1.2vw, 1.1rem); font-weight: 400; letter-spacing: 0; text-transform: none; color: #e6ece9; }
.single-portfolio .hero-section .entry-meta li span { margin-right: .5em; font-weight: 600; color: #fff; }

/* Rangées photo / texte en pleine largeur (groupe « qel-zigzag » : colonnes image + texte). */
.single-portfolio .entry-content > .qel-zigzag { margin-block: 0; background: #141618; }
.single-portfolio .entry-content > .qel-zigzag + .qel-zigzag { background: #1a1d1f; }
.qel-zigzag > .wp-block-columns { gap: 0; margin: 0; align-items: stretch !important; }
.qel-zigzag .wp-block-column { margin: 0; }
.qel-zigzag .qel-zigzag__media { min-height: clamp(320px, 42vw, 760px); position: relative; overflow: hidden; }
.qel-zigzag .qel-zigzag__media figure { position: absolute; inset: 0; margin: 0; }
.qel-zigzag .qel-zigzag__media img { width: 100%; height: 100%; object-fit: cover; }
/* Style d'image « Entière » (mockups) : rien n'est rogné, marge autour. */
.qel-zigzag .qel-zigzag__media .is-style-qel-entiere { inset: clamp(12px, 2vw, 32px); }
.qel-zigzag .qel-zigzag__media .is-style-qel-entiere img { object-fit: contain; }
.qel-zigzag .qel-zigzag__texte { align-self: center; padding: clamp(40px, 7vw, 120px) clamp(24px, 7vw, 140px); }
.qel-zigzag .qel-zigzag__texte h2 { margin: 0 0 22px; font-size: .82rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--theme-palette-color-1); }
.qel-zigzag .qel-zigzag__texte p { margin: 0; font-size: clamp(1.15rem, 1.6vw, 1.5rem); line-height: 1.5; color: var(--theme-palette-color-4); }
/* Sur téléphone, la photo passe toujours au-dessus du texte. */
@media (max-width: 781px) {
	.qel-zigzag > .wp-block-columns { flex-direction: column; }
	.qel-zigzag .qel-zigzag__media { order: -1; flex-basis: auto !important; min-height: 62vw; }
}

/* Texte en deux colonnes sous un titre aligné à gauche. */
.single-portfolio .entry-content > .qel-texte-colonnes { max-width: 1320px; margin: clamp(72px, 10vw, 150px) auto 0; }
.qel-texte-colonnes > h2 { margin: 0 0 28px; font-size: clamp(1.7rem, 3vw, 2.6rem); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; color: #fff; text-align: left; text-transform: none; }
.qel-texte-colonnes .wp-block-columns { gap: clamp(24px, 5vw, 72px); }
.qel-texte-colonnes p { font-size: 1.05rem; line-height: 1.7; color: var(--theme-palette-color-3); }

/* Bande sombre de trois visuels légendés (écrans mobiles, supports…). */
.single-portfolio .entry-content > .qel-bande { margin-top: clamp(72px, 10vw, 150px); padding: clamp(56px, 8vw, 120px) var(--qel-gouttiere, 7vw); background: #1a1d1f; }
.qel-bande > h2 { margin: 0 0 clamp(32px, 4vw, 56px); text-align: center; font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 600; letter-spacing: -.01em; text-transform: none; color: #fff; }
.qel-bande .wp-block-columns { max-width: 1320px; margin: 0 auto; gap: clamp(16px, 3vw, 40px); }
.qel-bande figure { margin: 0; }
.qel-bande img { display: block; width: 100%; height: auto; border-radius: 14px; box-shadow: 0 24px 60px rgb(0 0 0 / .45); }
/* Variantes (classe du groupe) : écrans mobiles, affiches jamais rognées, visuels carrés. */
.qel-bande--ecrans img { aspect-ratio: 1 / 2; object-fit: cover; object-position: top; border-radius: 22px; }
.qel-bande--affiches img { aspect-ratio: 3 / 4; object-fit: contain; border-radius: 0; box-shadow: none; filter: drop-shadow(0 24px 40px rgb(0 0 0 / .45)); }
.qel-bande--carres img { aspect-ratio: 1; object-fit: cover; }
.qel-bande figcaption { margin-top: 18px; text-align: center; font-size: .95rem; color: var(--theme-palette-color-3); }
@media (max-width: 781px) { .qel-bande .wp-block-columns { flex-direction: column; } .qel-bande--ecrans img { aspect-ratio: 4 / 5; } }

/* Vidéo de présentation. */
.single-portfolio .entry-content > .qel-video { max-width: 1320px; margin: clamp(72px, 10vw, 150px) auto 0; }
.qel-video > h2 { margin: 0 0 28px; text-align: center; font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 600; text-transform: none; letter-spacing: -.01em; color: #fff; }
.qel-video video { display: block; width: 100%; border-radius: 18px; background: #000; }

/* Lien « Voir le site ». */
.single-portfolio .entry-content > .qel-voir-site { margin-top: clamp(48px, 6vw, 80px); }
.qel-voir-site a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 4px; font-size: 1.2rem; font-weight: 600; color: var(--theme-palette-color-1); text-decoration: none; border-bottom: 2px solid currentColor; }
.qel-voir-site a::after { content: " →"; white-space: pre; }
.qel-voir-site a:hover { color: #fff; }

.single-portfolio .post-navigation {
	display: grid; grid-template-columns: 1fr 1fr; gap: 0; column-gap: 0;
	width: 100vw; max-width: none; margin: clamp(80px, 10vw, 160px) 0 0 calc(50% - 50vw); padding: 0;
}
.single-portfolio .post-navigation::before, .single-portfolio .post-navigation::after { display: none; }
.single-portfolio .post-navigation > a {
	position: relative; display: grid; place-items: center; min-height: clamp(220px, 40vh, 440px);
	overflow: hidden; padding: 24px; color: #fff; text-decoration: none;
}
.single-portfolio .post-navigation > a:only-child { grid-column: 1 / -1; }
/* Blocksy réduit la photo à une pastille de 45 px et n'affiche son voile qu'au survol : on la déplie sur toute la tuile. */
.single-portfolio .post-navigation > a > figure.ct-media-container { position: absolute; inset: 0; flex: none; width: 100%; max-width: none; height: 100%; margin: 0; border-radius: 0; }
.single-portfolio .post-navigation > a > figure.ct-media-container img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto !important; border-radius: 0; transition: transform .6s ease; }
.single-portfolio .post-navigation > a > figure.ct-media-container::after { opacity: 1; background: rgb(16 18 19 / .55); transition: background .3s; }
.single-portfolio .post-navigation > a > figure.ct-media-container svg { display: none; }
.single-portfolio .post-navigation > a:hover > figure.ct-media-container img { transform: scale(1.04); }
.single-portfolio .post-navigation > a:hover > figure.ct-media-container::after { opacity: 1; background: rgb(16 18 19 / .35); }
.single-portfolio .post-navigation .item-content { position: relative; z-index: 1; display: grid; gap: 8px; text-align: center; }
.single-portfolio .post-navigation > .nav-item-next { justify-content: center; text-align: center; }
.single-portfolio .post-navigation .item-label { color: #e6ece9; }
.single-portfolio .post-navigation .item-title { display: block !important; font-size: clamp(1.3rem, 2.4vw, 2.2rem); font-weight: 600; line-height: 1.1; color: #fff; }
.single-portfolio .post-navigation .nav-item-prev .item-title::before { content: "← "; }
.single-portfolio .post-navigation .nav-item-next .item-title::after { content: " →"; }
@media (prefers-reduced-motion: reduce) { .single-portfolio .post-navigation img { transition: none; } }

/*
 * Liste des réalisations façon Uncode « Portfolio Metro » : mosaïque sans marge qui commence sous
 * l'en-tête transparent. 4 colonnes de cellules carrées (2 sur téléphone) ; une carte sur trois est
 * grande (2 × 2) : 1re, 4e, 7e, 10e… L'ordre se règle dans chaque réalisation (attribut « Ordre »).
 * Le titre « Nos réalisations » reste dans la page (référencement, lecteurs d'écran), masqué à l'œil.
 */
/*
 * Titre de la liste, puis la mosaïque (esprit Uncode « Services Innovators ») : grand titre calé à
 * gauche sur la gouttière, un filet d'un bord à l'autre, l'introduction dans la moitié droite.
 * Le titre et l'introduction viennent de l'en-tête Blocksy (type 1, éléments Titre + Description).
 */
:is(body.post-type-archive-portfolio, body.page:not(.elementor-page)) .hero-section[data-type="type-1"] {
	width: 100%; max-width: none; margin: 0;
	padding: calc(var(--header-height, 80px) + clamp(40px, 8vw, 140px)) 0 clamp(40px, 5vw, 80px);
}
:is(body.post-type-archive-portfolio, body.page:not(.elementor-page)) .hero-section .entry-header { width: 100%; max-width: none; margin: 0; text-align: left; }
:is(body.post-type-archive-portfolio, body.page:not(.elementor-page)) .hero-section .page-title { margin: 0; padding-inline: var(--qel-gouttiere); }
/* Pages sans Elementor (mentions légales…) : titre à la taille de celui de la liste des réalisations. */
body.page:not(.elementor-page) .hero-section .page-title { font-size: clamp(46px, 8.4vw, 120px); line-height: 1; letter-spacing: -.035em; font-weight: 600; text-wrap: balance; }
body.post-type-archive-portfolio .hero-section .page-description {
	display: block; width: 100%; box-sizing: border-box;
	margin: clamp(36px, 5vw, 80px) 0 0; padding: clamp(28px, 3.5vw, 52px) var(--qel-gouttiere) 0;
	border-top: 1px solid rgb(255 255 255 / .14);
	font-size: clamp(1.1rem, 1.5vw, 1.45rem); line-height: 1.5; color: var(--theme-palette-color-3);
}
body.post-type-archive-portfolio .hero-section .page-description p { margin: 0; max-width: 34em; }
@media (min-width: 1000px) {
	body.post-type-archive-portfolio .hero-section .page-description p { margin-left: 50%; max-width: 30em; }
}
/*
 * Même en-tête sur les pages Elementor : conteneur « qel-entete-page » (titre animé, puis conteneur
 * « qel-entete-page__intro » avec le texte d'introduction). Marges et alignements sont réglés dans
 * Elementor ; ici, le filet et la colonne de droite, communs avec la liste des réalisations.
 */
.e-con.qel-entete-page__intro { border-top: 1px solid rgb(255 255 255 / .14); }
.e-con.qel-entete-page__intro > .elementor-widget-text-editor { max-width: 34em; color: var(--theme-palette-color-3); }
.e-con.qel-entete-page__intro > .elementor-widget-text-editor p:last-child { margin-bottom: 0; }
@media (min-width: 1000px) {
	.e-con.qel-entete-page__intro > .elementor-widget-text-editor { margin-left: 50%; max-width: 30em; }
}
body.post-type-archive-portfolio .site-main > .ct-container { width: 100%; max-width: none; margin: 0; padding: 0; }
body.post-type-archive-portfolio .entries[data-cards] {
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 50vw; grid-auto-flow: dense;
	gap: 0 !important; margin: 0;
	--card-min-height: 0px; /* Blocksy impose 400 px aux cartes « cover » : les cellules débordaient. */
}
body.post-type-archive-portfolio .entries[data-cards] > article {
	position: relative; display: block; min-height: 0; margin: 0; padding: 0; border-radius: 0; overflow: hidden; background: #141618;
}
body.post-type-archive-portfolio .entries[data-cards] > article:nth-child(6n+1),
body.post-type-archive-portfolio .entries[data-cards] > article:nth-child(6n+4) { grid-column: span 2; grid-row: span 2; }
body.post-type-archive-portfolio .entries[data-cards] > article > .ct-media-container { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border-radius: 0; }
body.post-type-archive-portfolio .entries[data-cards] > article > .ct-media-container::after { display: none; } /* voile Blocksy des cartes « cover » */
body.post-type-archive-portfolio .entries[data-cards] > article > .ct-media-container img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto !important; border-radius: 0; transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
body.post-type-archive-portfolio .entries[data-cards] > article::after {
	content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
	background: linear-gradient(to top, rgb(16 18 19 / .78), rgb(16 18 19 / 0) 55%); transition: background .4s ease;
}
body.post-type-archive-portfolio .entries[data-cards] > article > .entry-title {
	position: absolute; left: clamp(18px, 2.4vw, 36px); right: clamp(18px, 2.4vw, 36px); bottom: clamp(16px, 2.2vw, 32px); z-index: 2; margin: 0;
	font-size: clamp(1.15rem, 1.7vw, 1.7rem); font-weight: 600; line-height: 1.1; letter-spacing: -.01em; transition: opacity .35s ease, transform .35s ease;
}
body.post-type-archive-portfolio .entries[data-cards] > article > .entry-title a { color: #fff; text-decoration: none; }
body.post-type-archive-portfolio .entries[data-cards] > article:is(:nth-child(6n+1), :nth-child(6n+4)) > .entry-title { font-size: clamp(1.5rem, 3vw, 3rem); }
body.post-type-archive-portfolio .entries[data-cards] > article > .entry-excerpt { display: none; }
/* Survol (souris uniquement) : le voile s'assombrit, le titre apparaît, la photo avance un peu. */
@media (hover: hover) {
	body.post-type-archive-portfolio .entries[data-cards] > article::after { background: rgb(16 18 19 / 0); }
	body.post-type-archive-portfolio .entries[data-cards] > article > .entry-title { opacity: 0; transform: translateY(12px); }
	body.post-type-archive-portfolio .entries[data-cards] > article:is(:hover, :focus-within)::after { background: rgb(16 18 19 / .55); }
	body.post-type-archive-portfolio .entries[data-cards] > article:is(:hover, :focus-within) > .entry-title { opacity: 1; transform: none; }
	body.post-type-archive-portfolio .entries[data-cards] > article:hover > .ct-media-container img { transform: scale(1.04); }
}
@media (min-width: 768px) {
	body.post-type-archive-portfolio .entries[data-cards] { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 25vw; }
	/* Dernière ligne complétée, quel que soit le nombre de réalisations. */
	body.post-type-archive-portfolio .entries[data-cards] > article:nth-child(6n+1):last-child { grid-column: 1 / -1; }
	body.post-type-archive-portfolio .entries[data-cards] > article:nth-child(6n+2):last-child { grid-column: span 2; grid-row: span 2; }
	body.post-type-archive-portfolio .entries[data-cards] > article:nth-child(6n+2):nth-last-child(2),
	body.post-type-archive-portfolio .entries[data-cards] > article:nth-child(6n+3):last-child { grid-row: span 2; }
	body.post-type-archive-portfolio .entries[data-cards] > article:nth-child(6n+4):last-child { grid-row: span 1; }
	body.post-type-archive-portfolio .entries[data-cards] > article:nth-child(6n+5):last-child { grid-column: span 2; }
}
@media (prefers-reduced-motion: reduce) { body.post-type-archive-portfolio .entries[data-cards] img { transition: none; } }

/*
 * Pied de page (Blocksy, fond vert menthe, effet « reveal ») : grand « Discutons. », bouton et
 * menu en colonne. Le contenu se modifie dans Apparence › Widgets (zones de pied de page 1 à 5).
 */
/* Moins de vide sous le bouton « Nous écrire » : le pied (révélé, collé en bas) raccourcit et
   « Discutons. » descend sous l'en-tête. Blocksy n'a qu'un réglage commun haut/bas par rangée. */
footer.ct-footer [data-row="top"] > .ct-container { padding-bottom: clamp(24px, 3vw, 40px); }

/* Logo et menu en monochrome sombre au-dessus d'un fond vert menthe (classe posée par assets/entete.js). */
#header .site-logo-container img { transition: filter .25s ease; }
#header .ct-header-trigger { transition: color .25s ease; }
.qel-entete-sur-clair #header .site-logo-container img { filter: brightness(0); }
.qel-entete-sur-clair #header .ct-header-trigger { --theme-icon-color: #101213; color: #101213; }

.ct-footer .qel-pied-titre { margin: 0; font-size: clamp(3.6rem, 12vw, 11rem); font-weight: 600; line-height: .9; letter-spacing: -.045em; color: #101213; }
.ct-footer .qel-pied-intro { margin: 20px 0 0; font-size: clamp(1.15rem, 1.6vw, 1.5rem); }
.ct-footer .qel-pied-bouton { display: inline-flex; align-items: center; min-height: 48px; margin-top: 8px; padding: 14px 28px; border-radius: 999px; background: #101213; color: #6eedc2 !important; font-weight: 600; text-decoration: none; transition: background .2s; }
.ct-footer .qel-pied-bouton:hover { background: #2a2f33; }
.ct-footer .widget_nav_menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ct-footer .widget_nav_menu a { text-decoration: none; }
.ct-footer .widget_text p { margin: 0; }

/* Page Clients : mur de logos blancs, même opacité que le bandeau de l'accueil. */
.qel-mur-logos .gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; margin: 0; }
.qel-mur-logos .gallery-item { width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
@media (min-width: 768px) { .qel-mur-logos .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; } }
@media (min-width: 1025px) { .qel-mur-logos .gallery { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.qel-mur-logos .gallery-item img { width: 100%; height: auto; opacity: .85; transition: opacity .2s; }
.qel-mur-logos .gallery-item img:hover { opacity: 1; }
