/*
Theme Name: The English Club
Description: One-page theme for The English Club (englishclub.fr). The theme slug stays holly-english.
Version: 1.1.1
Requires at least: 7.0
Requires PHP: 8.4
Text Domain: holly-english
*/

/* ==========================================================================
   Fonts — Raleway, self-hosted (no request to Google, for GDPR).
   ========================================================================== */

@font-face {
	font-family: "Raleway";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("fonts/raleway-latin-wght-normal.woff2") format("woff2");
}

@font-face {
	font-family: "Raleway";
	font-style: italic;
	font-weight: 100 900;
	font-display: swap;
	src: url("fonts/raleway-latin-wght-italic.woff2") format("woff2");
}

/* ==========================================================================
   Design tokens — change colours, fonts and spacing here.
   ========================================================================== */

:root {
	/* Colours (placeholders, TBC) */
	--colour-primary: #2f5d62;
	--colour-accent: #d9a441;
	--colour-text: #222222;
	--colour-heading: #1b2a4a;
	--colour-cta: #a66161;
	--colour-cta-dark: #864a4a;
	/* WCAG AA: 4.84:1 on --colour-bg-alt, 5.47:1 on white (was #4f7f94: 3.88 / 4.38). */
	--colour-subheading: #436f83;
	--colour-muted: #5c6b6e;
	--colour-bg: #ffffff;
	--colour-bg-alt: #f3f1ec;
	--colour-border: #d8d4cc;
	--colour-header-bg: #ffffff;
	/* Not the subheading blue: black footer text needs this lighter shade (4.80:1). */
	--colour-footer-bg: #4f7f94;
	--colour-footer-text: #000000;
	--colour-whatsapp: #128c7e;
	--colour-whatsapp-text: #ffffff;
	--colour-logo-bg: #e4e2dd; /* matches the logo artwork's background */

	/* Typography */
	--font-body: "Raleway", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-heading: var(--font-body);

	/* Layout */
	--container-width: 72rem;
	--container-narrow: 44rem;
	--space-s: 1rem;
	--space-m: 2rem;
	--space-l: 4rem;
	--header-height: 4rem;
	--radius: 0.5rem;
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	margin: 0;
	font-family: var(--font-body);
	line-height: 1.6;
	color: var(--colour-text);
	background: var(--colour-bg);
}

/* Form controls don't inherit the page font by default. */
input,
button,
select,
textarea {
	font-family: inherit;
}

h1,
h2,
h3,
h4 {
	font-family: var(--font-heading);
	line-height: 1.2;
	color: var(--colour-heading);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Subheadings: lowercase in the accent blue (h1 keeps the capitals). */
h2,
h3,
h4 {
	color: var(--colour-subheading);
	text-transform: lowercase;
}

a {
	color: var(--colour-primary);
}

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

.container {
	width: 100%;
	max-width: var(--container-width);
	margin-inline: auto;
	padding-inline: var(--space-s);
}

.container--narrow {
	max-width: var(--container-narrow);
}

.skip-link {
	position: absolute;
	left: var(--space-s);
	top: -3rem;
	z-index: 100;
	padding: 0.5rem 1rem;
	background: var(--colour-primary);
	color: var(--colour-bg);
}

.skip-link:focus {
	top: var(--space-s);
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ==========================================================================
   Header and navigation
   ========================================================================== */

.site-header {
	position: sticky;
	top: 0;
	z-index: 10;
	min-height: var(--header-height);
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding-inline: var(--space-m);
	background: var(--colour-header-bg);
}

.site-nav__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: var(--space-s) var(--space-m);
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav__list a {
	color: #000000;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.9rem;
	font-weight: 700;
}

/* Brand and menu button exist for small screens only (see below). */
.site-header__brand,
.site-nav__toggle {
	display: none;
}

@media (max-width: 40rem) {
	.site-header {
		padding-inline: var(--space-s);
	}

	/* Without JavaScript: the full list, wrapped. */
	.site-nav__list {
		gap: var(--space-s);
	}

	.site-nav__list a {
		font-size: 0.8rem;
		letter-spacing: 0.04em;
	}

	/* With JavaScript (js/nav-toggle.js): brand left, "Menu" button right,
	   and the list as a full-width drop-down panel. */
	.site-header.has-nav-toggle {
		justify-content: space-between;
		gap: var(--space-s);
	}

	.has-nav-toggle .site-header__brand {
		display: block;
		color: var(--colour-heading);
		font-weight: 700;
		font-size: 0.95rem;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		text-decoration: none;
	}

	.has-nav-toggle .site-nav__toggle {
		display: inline-flex;
		align-items: center;
		gap: 0.6rem;
		min-height: 2.75rem;
		padding: 0 0 0 0.5rem;
		border: 0;
		background: none;
		color: #000000;
		font-size: 0.9rem;
		font-weight: 700;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		cursor: pointer;
	}

	/* Three bars, drawn with one element and two shadows. */
	.site-nav__toggle-icon {
		width: 1.25rem;
		height: 2px;
		background: currentColor;
		box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
	}

	.has-nav-toggle .site-nav__list {
		display: none;
	}

	.has-nav-toggle.is-nav-open .site-nav__list {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		display: flex;
		flex-direction: column;
		gap: 0;
		padding: 0 var(--space-s) var(--space-s);
		background: var(--colour-header-bg);
		border-bottom: 1px solid var(--colour-border);
		box-shadow: 0 0.5rem 1rem rgb(0 0 0 / 0.08);
	}

	/* Full-width rows, 48px tall: comfortable touch targets. */
	.has-nav-toggle .site-nav__list a {
		display: flex;
		align-items: center;
		min-height: 3rem;
		border-top: 1px solid var(--colour-border);
		font-size: 1rem;
		letter-spacing: 0.06em;
	}
}

.site-nav__list a:hover,
.site-nav__list a:focus-visible {
	color: var(--colour-subheading);
}

/* Link for the section in view, set by js/nav-highlight.js. */
.site-nav__list a.is-active {
	color: var(--colour-subheading);
	text-decoration: underline;
	text-underline-offset: 0.35em;
	text-decoration-thickness: 2px;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
	padding-block: var(--space-l);
	border-top: 1px solid var(--colour-border);
	/* Keep headings clear of the sticky header after an anchor jump. */
	scroll-margin-top: var(--header-height);
}

/* Hero */

.hero {
	padding-block: var(--space-l);
	text-align: center;
}

.hero__title {
	margin-top: 0;
	color: var(--colour-subheading);
	/* Sized to keep "Cours d'anglais dans la Narbonnaise" on one line: the
	   title measures ~27.8em wide, the narrow container is 42rem inside its
	   padding. A longer title will wrap. */
	font-size: min(1.5rem, calc((100vw - 2rem) / 28.5));
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

/* Square artwork inside a circle: padding keeps its corners from being
   clipped, and the background colour fills the gap seamlessly. */
.hero__logo {
	--logo-padding: 30px;
	width: min(100%, calc(24rem + 2 * var(--logo-padding)));
	height: auto;
	aspect-ratio: 1;
	margin: 0 auto var(--space-m);
	padding: var(--logo-padding);
	border-radius: 50%;
	background: var(--colour-logo-bg);
	object-fit: contain;
}

.hero__intro {
	font-size: 1.15rem;
	color: var(--colour-muted);
}

/* "Essai gratuit" call to action: jumps to the contact form. */
.hero__cta-wrap {
	margin: 0 0 var(--space-m);
}

/* Nothing follows it: the section padding below provides the gap. */
.hero__cta-wrap:last-child {
	margin-bottom: 0;
}

/* Small screens: hero bottom + section top padding stacked to ~150px of blank
   screen between the button and "à propos". */
@media (max-width: 40rem) {
	.hero {
		padding-block: var(--space-m);
	}

	.section {
		padding-block: 3rem;
	}
}

.hero__cta {
	display: inline-block;
	padding: 0.7em 1.6em;
	border-radius: 999px;
	background: var(--colour-cta);
	color: #ffffff;
	font-weight: 700;
	font-style: italic;
	letter-spacing: 0.05em;
	text-transform: lowercase;
	text-decoration: none;
	transition: background-color 0.2s;
}

.hero__cta:hover,
.hero__cta:focus-visible {
	background: var(--colour-cta-dark);
}

/* About: text left, image right, stacked on mobile */

.about {
	border-top: 0;
}

.about__grid {
	display: grid;
	gap: var(--space-m);
}

@media (min-width: 48rem) {
	.about__grid {
		grid-template-columns: 1fr 1fr;
		align-items: start;
	}
}

.about__image {
	width: 100%;
	border-radius: var(--radius);
}

.about__body h2 {
	margin-top: 0;
}

/* Full-width text sections: alternate backgrounds for rhythm */

.text-section--cours,
.text-section--faq {
	background: var(--colour-bg-alt);
	color: var(--colour-subheading);
}

.text-section--tarifs {
	text-align: center;
}

/* Contact */

.contact__email {
	font-weight: 600;
}

.contact__form {
	margin-top: var(--space-m);
	padding: var(--space-m);
	border: 1px solid var(--colour-border);
	border-radius: var(--radius);
}

/* Ninja Forms' submit button, styled as the hero call to action. */
.contact__form input[type="submit"] {
	min-height: 2.75rem;
	padding: 0.7em 1.6em;
	border: 0;
	border-radius: 999px;
	background: var(--colour-cta);
	color: #ffffff;
	font-size: 1rem;
	font-weight: 700;
	font-style: italic;
	letter-spacing: 0.05em;
	text-transform: lowercase;
	cursor: pointer;
	transition: background-color 0.2s;
}

.contact__form input[type="submit"]:hover,
.contact__form input[type="submit"]:focus-visible {
	background: var(--colour-cta-dark);
}

/* Privacy notice above the button (a Ninja Forms HTML field). */
.contact__privacy {
	margin: 0;
	font-size: 0.875rem;
	color: var(--colour-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
	padding-block: var(--space-m);
	background: var(--colour-footer-bg);
	color: var(--colour-footer-text);
	text-align: right;
}

.site-footer a {
	color: inherit;
}

/* Facebook badge left, footer text right; stacked and centred on mobile. */
.site-footer__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-s);
}

.site-footer__text {
	margin-left: auto;
}

.site-footer__text p {
	margin: 0;
}

.site-footer__text .site-footer__legal {
	margin-top: 0.25em;
	font-size: 0.875em;
}

.facebook-badge {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
}

.facebook-badge:hover,
.facebook-badge:focus-visible {
	opacity: 0.8;
}

.facebook-badge__icon {
	width: 2rem;
	height: 2rem;
}

@media (max-width: 30rem) {
	.site-footer__inner {
		flex-direction: column;
		text-align: center;
	}

	.site-footer__text {
		margin-left: 0;
	}
}

/* Keep the footer text clear of the floating WhatsApp button. */
body:has(.whatsapp-button) .site-footer {
	padding-bottom: calc(var(--space-m) + 4.5rem);
}

/* ==========================================================================
   WhatsApp button
   ========================================================================== */

.whatsapp-button {
	position: fixed;
	right: var(--space-s);
	bottom: var(--space-s);
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 50%;
	background: var(--colour-whatsapp);
	color: var(--colour-whatsapp-text);
	box-shadow: 0 0.25rem 0.75rem rgb(0 0 0 / 0.25);
}

.whatsapp-button:hover,
.whatsapp-button:focus-visible {
	filter: brightness(1.1);
}

.whatsapp-button__icon {
	width: 1.75rem;
	height: 1.75rem;
}
