/*
Theme Name: Apprendre-Anglais.tv
Theme URI: https://apprendre-anglais.tv/
Author: Alban
Description: Thème de blocs (FSE) néo-brutaliste pour Apprendre-Anglais.tv : des vidéos YouTube sélectionnées et organisées en parcours de progression, avec transcriptions et quiz. Construit sur la base du thème Powder de Brian Gardner (GPL v3).
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: apprendre-anglais
Tags: block-patterns, block-styles, custom-colors, editor-style, full-site-editing, one-column, wide-blocks
*/

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

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

html {
	scroll-padding-top: 90px;
}

b,
strong {
	font-weight: 700;
}

/* L’outil de couleur de texte de l’éditeur génère un <mark>, auquel le navigateur
   applique un fond jaune. Un surlignage voulu passe par un style en ligne, prioritaire. */
mark {
	background-color: transparent;
}

a,
button,
.wp-element-button {
	transition: background-color 0.1s ease-out, color 0.1s ease-out, border-color 0.1s ease-out;
}

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

input,
select,
textarea {
	box-sizing: border-box;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: 1.4;
	width: 100%;
	background: transparent;
	border: 3px solid var(--wp--preset--color--contrast);
	border-radius: 0;
	color: inherit;
	padding: 10px 16px;
}

input:not([type="submit"]):focus,
textarea:focus {
	border-color: var(--wp--preset--color--primary);
	outline: 1px solid var(--wp--preset--color--primary);
}

input[type="checkbox"],
input[type="image"],
input[type="radio"] {
	width: auto;
}

::placeholder {
	color: inherit;
	opacity: 0.5;
}

/* En-tête : bandeau défilant
---------------------------------------- */

.aatv-marquee {
	overflow: hidden;
	white-space: nowrap;
	padding: 10px 0;
}

.aatv-marquee p {
	display: inline-block;
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 14px;
	font-weight: 900;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	animation: aatv-scroll 25s linear infinite;
}

@keyframes aatv-scroll {
	0% { transform: translateX(0); }
	100% { transform: translateX(-100%); }
}

/* En-tête : barre de navigation collante
---------------------------------------- */

.aatv-header-bar {
	position: sticky;
	top: 0;
	z-index: 100;
}

.admin-bar .aatv-header-bar {
	top: var(--wp-admin--admin-bar--height, 0px);
}

/* Logo */

.aatv-logo {
	display: inline-flex;
	align-items: center;
	color: inherit;
	text-decoration: none;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 21px;
	font-weight: 900;
	letter-spacing: -0.02em;
	line-height: 1.1;
	text-transform: uppercase;
}

.aatv-logo .aatv-slash {
	color: var(--wp--preset--color--youtube);
}

.aatv-play {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.4em;
	height: 1em;
	background: var(--wp--preset--color--youtube);
	margin-right: 0.3em;
	font-size: 0.7em;
}

.aatv-play::after {
	content: "";
	width: 0;
	height: 0;
	border-top: 0.3em solid transparent;
	border-bottom: 0.3em solid transparent;
	border-left: 0.45em solid var(--wp--preset--color--white);
}

/* Navigation */

.wp-block-navigation a {
	color: inherit;
	text-decoration: none;
	border-bottom: 2px solid transparent;
}

.wp-block-navigation a:hover,
.wp-block-navigation a:focus {
	border-bottom-color: currentColor;
}

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	border: 2px solid currentColor;
	padding: 2px;
}

.wp-block-navigation__responsive-container.is-menu-open {
	padding: 24px;
}

.wp-block-navigation__submenu-container {
	min-width: 180px !important;
	padding: 10px !important;
	border: 2px solid currentColor !important;
}

.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 2px 10px !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	padding: 5px 10px 0 !important;
	border: none !important;
}

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

.wp-block-button.is-style-red .wp-block-button__link {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

.wp-block-button.is-style-red .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--white);
}

.wp-block-button.is-style-green .wp-block-button__link {
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--white);
}

.wp-block-button.is-style-green .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--white);
}

.aatv-btn-big .wp-block-button__link {
	padding: 16px 32px;
	font-size: 14px;
}

.aatv-btn-cta .wp-block-button__link {
	padding: 19px 48px;
	font-size: 16px;
}

.aatv-btn-cta .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--contrast);
}

/* Titres soulignés (style de bloc)
---------------------------------------- */

.is-style-section-title {
	border-bottom: 3px solid currentColor;
	padding-bottom: 16px;
}

/* Accueil : hero
---------------------------------------- */

.aatv-kicker {
	display: flex;
	align-items: center;
	gap: 0.6em;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.1;
	text-transform: none;
	/* Le titre géant a une interligne de 0.85 : ses capitales débordent au-dessus
	   de leur bloc. Cette marge garde les descendantes de l’accroche à l’écart. */
	margin-bottom: 40px;
}

.aatv-kicker::before {
	content: "";
	flex: none;
	width: 1.28em;
	height: 0.9em;
	background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 37 26"><rect width="37" height="26" rx="6" fill="%23ff0000"/><path d="M14 6l12 7-12 7z" fill="%23ffffff"/></svg>') no-repeat center / contain;
}

.aatv-hero-title {
	font-size: var(--wp--preset--font-size--giant);
	line-height: 0.85;
	letter-spacing: -0.03em;
	margin: 0;
}

/* Accueil : statistique
---------------------------------------- */

.aatv-stat-num {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--colossal);
	font-weight: 900;
	line-height: 1;
	margin: 0;
}

.aatv-stat-label {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 19px;
	font-weight: 900;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	margin: 16px 0 0;
}

/* Listes de parcours et de leçons
---------------------------------------- */

.aatv-course-list {
	counter-reset: aatv-row;
}

.aatv-course-row {
	position: relative;
	display: grid;
	grid-template-columns: 80px 1fr 3fr 150px;
	gap: 32px;
	align-items: center;
	padding: 40px 0;
	border-bottom: 3px solid var(--wp--preset--color--contrast);
	counter-increment: aatv-row;
	transition: background-color 0.1s ease-out, color 0.1s ease-out;
}

.aatv-course-row::before {
	content: counter(aatv-row, decimal-leading-zero);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 24px;
	font-weight: 900;
	line-height: 1.1;
}

.aatv-course-row::after {
	content: "→";
	font-family: var(--wp--preset--font-family--heading);
	font-size: 32px;
	font-weight: 900;
	line-height: 1.1;
	text-align: right;
	transition: transform 0.2s ease-out;
}

.aatv-course-row:hover,
.aatv-course-row:focus-within {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.aatv-course-row:hover::after,
.aatv-course-row:focus-within::after {
	transform: translateX(10px);
}

.aatv-row-title {
	font-size: var(--wp--preset--font-size--x-large);
	letter-spacing: -0.02em;
	margin: 0;
}

.aatv-row-title a {
	color: inherit;
	text-decoration: none;
	outline: none;
}

.aatv-row-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.aatv-row-desc,
.aatv-row-desc p {
	font-size: 16px;
	font-weight: 400;
	line-height: 1.4;
	margin: 0;
}

.aatv-no-results {
	padding: 40px 0;
	font-size: var(--wp--preset--font-size--small);
}

/* Accueil : méthode (4 colonnes)
---------------------------------------- */

.aatv-features .wp-block-column {
	border-right: 3px solid var(--wp--preset--color--base);
}

.aatv-features .wp-block-column:last-child {
	border-right: none;
}

.aatv-feature-emoji {
	font-size: 40px;
	line-height: 1;
	margin: 0 0 16px;
}

.aatv-feature-title {
	font-size: 19px;
	letter-spacing: 0.05em;
	margin: 0 0 8px;
}

.aatv-feature-text {
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	opacity: 0.7;
	margin: 0;
}

/* Accueil : appel à l’action
---------------------------------------- */

.aatv-cta-title {
	font-size: var(--wp--preset--font-size--xxx-large);
	line-height: 0.9;
	margin: 0 0 32px;
}

/* Pagination
---------------------------------------- */

.aatv-pagination {
	margin-top: 48px;
}

.wp-block-query-pagination {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 13px;
	font-weight: 900;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.wp-block-query-pagination a {
	color: inherit;
	text-decoration: none;
	border-bottom: 2px solid transparent;
}

.wp-block-query-pagination a:hover,
.wp-block-query-pagination a:focus {
	border-bottom-color: currentColor;
}

.wp-block-query-pagination .wp-block-query-pagination-numbers .current {
	color: var(--wp--preset--color--primary);
}

/* Articles (leçons)
---------------------------------------- */

.aatv-post-meta {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 13px;
	font-weight: 900;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.aatv-post-meta a {
	color: inherit;
	text-decoration: none;
}

.aatv-post-meta a:hover,
.aatv-post-meta a:focus {
	color: var(--wp--preset--color--primary);
}

.wp-block-post-content > h2:not(:first-child),
.wp-block-post-content > h3:not(:first-child) {
	margin-top: 48px;
}

.wp-block-embed iframe {
	max-width: 100%;
}

/* Quiz (blocs dépliables)
---------------------------------------- */

.wp-block-details {
	border: 3px solid var(--wp--preset--color--contrast);
	padding: 16px 24px;
}

.wp-block-details summary {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 16px;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	cursor: pointer;
}

.wp-block-details[open] summary {
	margin-bottom: 12px;
}

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

.aatv-footer p,
.aatv-footer .wp-block-site-title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 13px;
	font-weight: 900;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin: 0;
}

.aatv-footer a {
	color: inherit;
	text-decoration: none;
}

.aatv-footer a:hover,
.aatv-footer a:focus {
	color: var(--wp--preset--color--primary);
}

/* Recherche et 404
---------------------------------------- */

.wp-block-search__input {
	border: 3px solid var(--wp--preset--color--contrast);
	background: transparent;
	padding: 10px 16px;
}

.wp-block-search__button {
	margin-left: 10px;
}

.aatv-404-num {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--colossal);
	font-weight: 900;
	line-height: 1;
	margin: 0;
}

/* Commentaires
---------------------------------------- */

.entry-comments .form-submit {
	margin-bottom: 0;
}

/* Écrans étroits
---------------------------------------- */

@media (max-width: 781px) {

	.aatv-kicker {
		margin-bottom: 24px;
	}

	.aatv-hero-right p.has-text-align-right {
		text-align: left;
	}

	.aatv-hero-right .wp-block-buttons {
		justify-content: flex-start;
	}

	.aatv-course-row {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.aatv-features .wp-block-column {
		border-right: none;
		border-bottom: 3px solid var(--wp--preset--color--base);
	}

	.aatv-features .wp-block-column:last-child {
		border-bottom: none;
	}

}

/* Mouvement réduit
---------------------------------------- */

@media (prefers-reduced-motion: reduce) {

	.aatv-marquee p {
		animation: none;
	}

	.aatv-course-row::after {
		transition: none;
	}

}
