/*
Theme Name: Lycée Amchit
Theme URI: https://lyceeamchit.edu.lb
Description: Lycée Amchit school theme. Child of Twenty Twenty-Five, carrying the
             school's brand identity: blue #224b9f and green #5eba47 from the
             cedar logo, navy #1c1b3b header, Poppins and ABeeZee typography.
             Replaces the previous Kingster / GoodLayers stack.
Author: Lycée Amchit
Template: twentytwentyfive
Version: 1.1.0
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lyceeamchit
*/

/* ==========================================================================
   Layout: footer pinned to the bottom, no dead white space on short pages
   ========================================================================== */

html, body {
	min-height: 100%;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	margin: 0;
}

body > main,
body > .wp-site-blocks > main {
	flex: 1 0 auto;
}

.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

/* ==========================================================================
   Header: always solid navy and sticky.

   The logo file is the WHITE variant - its "LYCEE AMCHIT" wordmark is white,
   so it is invisible on a light background. The navigation is white too.
   The header must therefore stay dark at all times.
   ========================================================================== */

.lycee-header {
	position: sticky;
	top: 0;
	z-index: 999;
	background-color: var(--wp--preset--color--header-navy);
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.16);
	transition: padding 0.25s ease;
	padding-block: 0.95rem;
}

.lycee-header.is-solid {
	padding-block: 0.6rem;
}

/* ---- Logo: large, left aligned, same row as the navigation ---- */

.lycee-header .wp-block-site-logo {
	margin-right: auto;
	line-height: 0;
}

.lycee-header .wp-block-site-logo img {
	width: clamp(210px, 22vw, 300px);
	height: auto;
	max-height: none;
	transition: width 0.25s ease;
}

.lycee-header.is-solid .wp-block-site-logo img {
	width: clamp(180px, 18vw, 240px);
}

/* ---- Navigation: Poppins semibold, white, never underlined ---- */

.lycee-header .wp-block-navigation {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 1.0625rem;
	letter-spacing: 0.01em;
}

.lycee-header .wp-block-navigation,
.lycee-header .wp-block-navigation a,
.lycee-header .wp-block-navigation a:hover,
.lycee-header .wp-block-navigation a:focus,
.lycee-header .wp-block-navigation a:active,
.lycee-header .wp-block-navigation .wp-block-navigation-item__content,
.lycee-header .wp-block-navigation .wp-block-navigation-item__content:hover,
.lycee-header .wp-block-navigation .wp-block-navigation-item__content:focus,
.lycee-header .wp-block-navigation button.wp-block-navigation-item__content {
	color: #ffffff !important;
	text-decoration: none !important;
	box-shadow: none;
}

.lycee-header .wp-block-navigation .wp-block-navigation-item__content:hover {
	opacity: 0.75;
}

/* Submenus: white panel, brand blue on hover, no underline. */
.lycee-header .wp-block-navigation__submenu-container {
	background-color: #ffffff !important;
	border: none !important;
	border-radius: 4px;
	box-shadow: 0 8px 26px rgba(0, 0, 0, 0.16);
	padding-block: 0.4rem;
	min-width: 240px !important;
}

.lycee-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content,
.lycee-header .wp-block-navigation__submenu-container a {
	color: #3a3a3a !important;
	font-weight: 500;
	font-size: 0.97rem;
}

.lycee-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--brand-blue) !important;
	background-color: #f5f7fb;
	opacity: 1;
}

/* Never underline navigation anywhere. */
.wp-block-navigation a:where(:not(.wp-element-button)):hover {
	text-decoration: none;
}

/* The front page opens on the hero - no title band there. */
.home .lycee-page-title {
	display: none;
}

/* ==========================================================================
   Search: icon in the header, full-screen overlay on click
   ========================================================================== */

.lycee-search-toggle {
	appearance: none;
	background: none;
	border: 0;
	color: #fff;
	cursor: pointer;
	padding: 0.4rem;
	margin-left: 1.5rem;
	display: inline-flex;
	align-items: center;
	line-height: 0;
}

.lycee-search-toggle svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
}

.lycee-search-toggle:hover {
	opacity: 0.75;
}

.lycee-search-overlay {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(10, 10, 20, 0.94);
	padding: 1.5rem;
}

.lycee-search-overlay.is-open {
	display: flex;
}

.lycee-search-overlay__inner {
	width: min(900px, 92vw);
}

.lycee-search-overlay form {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	border-bottom: 2px solid rgba(255, 255, 255, 0.55);
	padding-bottom: 0.6rem;
}

.lycee-search-overlay input[type="search"] {
	flex: 1;
	background: transparent;
	border: 0;
	outline: none;
	color: #fff;
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.6rem, 5vw, 3rem);
	font-weight: 400;
	padding: 0.2rem 0;
}

.lycee-search-overlay input[type="search"]::placeholder {
	color: rgba(255, 255, 255, 0.65);
}

.lycee-search-overlay button {
	appearance: none;
	background: none;
	border: 0;
	color: #fff;
	cursor: pointer;
	line-height: 0;
	padding: 0.35rem;
}

.lycee-search-overlay button svg {
	width: 30px;
	height: 30px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
}

.lycee-search-overlay button:hover {
	opacity: 0.7;
}

/* ==========================================================================
   Footer: full-bleed navy, copyright bar, social icons
   ========================================================================== */

.lycee-footer {
	flex-shrink: 0;
	margin-top: 0;
}

.lycee-footer a {
	color: #cfd6e6;
	text-decoration: none;
}

.lycee-footer a:hover {
	color: #fff;
	text-decoration: underline;
}

.lycee-social {
	display: flex;
	gap: 0.65rem;
	flex-wrap: wrap;
	margin-top: 1rem;
}

.lycee-social a {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.lycee-social a:hover {
	background: var(--wp--preset--color--brand-blue);
	transform: translateY(-2px);
}

.lycee-social svg {
	width: 18px;
	height: 18px;
	fill: #fff;
}

.lycee-copyright {
	border-top: 1px solid rgba(255, 255, 255, 0.14);
	margin-top: 2rem;
	padding-top: 1.2rem;
	font-size: 0.88rem;
	color: #aab3c7;
}

/* ==========================================================================
   Typography and i18n
   ========================================================================== */

/* Hero headings use the serif accent, as the previous design did. */
.wp-block-cover h1,
.wp-block-cover .lycee-hero-kicker {
	font-family: var(--wp--preset--font-family--accent);
}

.lycee-hero-kicker {
	font-style: italic;
}

/* Arabic / RTL - the school publishes in AR as well as EN and FR. */
body:lang(ar),
.rtl body {
	font-family: var(--wp--preset--font-family--body);
	line-height: 1.9;
}

.rtl .lycee-header .wp-block-site-logo {
	margin-right: 0;
	margin-left: auto;
}

.rtl .lycee-search-toggle {
	margin-left: 0;
	margin-right: 1.5rem;
}

/* Long French and Arabic headings must not overflow narrow screens. */
h1, h2, h3, h4 {
	overflow-wrap: break-word;
}

@media (max-width: 781px) {
	.lycee-header .wp-block-site-logo img {
		width: clamp(150px, 42vw, 210px);
	}
	.lycee-search-toggle {
		margin-left: 0.75rem;
	}
}

/* ==========================================================================
   Full-bleed sections

   The front page is built from alternating full-width bands, as the previous
   design was. post-content sits inside a constrained <main>, so alignfull is
   forced out to the viewport explicitly rather than relying on nested
   constrained layouts resolving correctly.
   ========================================================================== */

.wp-site-blocks main .alignfull,
.wp-site-blocks main > .wp-block-post-content > .alignfull,
.entry-content > .alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

/* Keep the page background white - sections supply their own colour. */
body,
.wp-site-blocks {
	background-color: #ffffff;
}

/* Hero: text block sits lower-left, as in the previous design. */
.wp-block-cover.alignfull:first-child .wp-block-cover__inner-container {
	align-self: flex-end;
	padding-bottom: 4rem;
}

/* Cards inside a section get breathing room. */
.wp-block-columns .wp-block-column > .wp-block-image:first-child {
	margin-top: 0;
}

/* Hero height: tall enough to feel like a landing, short enough that the
   first content section is visible without scrolling far. */
.wp-site-blocks main .wp-block-cover.alignfull:first-child {
	min-height: 64vh !important;
}

/* Remove the dark gap between the sticky header and the hero. */
.wp-site-blocks > main {
	margin-top: 0;
	padding-top: 0;
}

/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 781px) {
	/* A 64vh hero swallows the whole phone screen. Shorter, so the first
	   content section is visible without scrolling - as the previous design
	   did. */
	.wp-site-blocks main .wp-block-cover.alignfull:first-child {
		min-height: 48vh !important;
	}

	/* Tighter section rhythm on small screens. */
	.wp-site-blocks main .wp-block-group.alignfull,
	.wp-site-blocks main .wp-block-cover.alignfull:not(:first-child) {
		padding-top: 2.5rem !important;
		padding-bottom: 2.5rem !important;
	}

	.lycee-header {
		padding-block: 0.6rem;
	}
}

/* ==========================================================================
   Home page: hero + overlapping green quick-links band
   ========================================================================== */

/* Hero text sits centre-left, as the previous design had it. */
.lycee-hero .wp-block-cover__inner-container {
	align-self: center;
	width: 100%;
	text-align: left;
}

.lycee-hero-kicker,
.lycee-hero-title {
	font-family: var(--wp--preset--font-family--accent);
	text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.lycee-hero-kicker {
	font-style: italic;
}

/* Green band rides up over the bottom of the hero. */
.lycee-quicklinks {
	position: relative;
	z-index: 2;
	margin-top: -3.5rem;
}

.lycee-quicklinks .wp-block-heading,
.lycee-quicklinks p,
.lycee-quicklinks a {
	color: #ffffff !important;
}

.lycee-quicklinks a {
	text-decoration: none;
	opacity: 0.95;
}

.lycee-quicklinks a:hover {
	text-decoration: underline;
}

@media (max-width: 781px) {
	.lycee-quicklinks {
		margin-top: -2rem;
	}
	.lycee-hero .wp-block-cover__inner-container {
		align-self: flex-end;
		padding-bottom: 3.5rem;
	}
}

/* ==========================================================================
   Motion: staged hero reveal + gentle section reveal on scroll

   The previous site used Revolution Slider, whose content animated in one
   element at a time. These rules reproduce that feel without the plugin.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {

	/* Hero: kicker, then title, then button. */
	.lycee-hero .wp-block-cover__inner-container > * {
		opacity: 0;
		transform: translateY(26px);
		animation: lycee-rise 0.85s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
	}

	.lycee-hero .wp-block-cover__inner-container > *:nth-child(1) { animation-delay: 0.15s; }
	.lycee-hero .wp-block-cover__inner-container > *:nth-child(2) { animation-delay: 0.45s; }
	.lycee-hero .wp-block-cover__inner-container > *:nth-child(3) { animation-delay: 0.78s; }

	/* The hero image itself drifts in very slightly. */
	.lycee-hero .wp-block-cover__image-background {
		animation: lycee-zoom 9s ease-out forwards;
	}

	/* Sections fade up as they enter the viewport. */
	.lycee-reveal {
		opacity: 0;
		transform: translateY(32px);
		transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
		will-change: opacity, transform;
	}

	.lycee-reveal.is-visible {
		opacity: 1;
		transform: none;
	}

	/* Stagger the cards within a revealed row. */
	.lycee-reveal.is-visible .wp-block-column:nth-child(1) { transition-delay: 0.05s; }
	.lycee-reveal.is-visible .wp-block-column:nth-child(2) { transition-delay: 0.16s; }
	.lycee-reveal.is-visible .wp-block-column:nth-child(3) { transition-delay: 0.27s; }
}

@keyframes lycee-rise {
	to { opacity: 1; transform: none; }
}

@keyframes lycee-zoom {
	from { transform: scale(1.06); }
	to   { transform: scale(1); }
}

/* Motion disabled: everything simply visible. */
@media (prefers-reduced-motion: reduce) {
	.lycee-hero .wp-block-cover__inner-container > *,
	.lycee-reveal {
		opacity: 1 !important;
		transform: none !important;
	}
}

/* ==========================================================================
   Mobile navigation drawer

   Matches the previous design: a dark panel sliding in from the right rather
   than a full-screen takeover, with uppercase items, hairline dividers and
   submenus collapsed behind a chevron.
   ========================================================================== */

.lycee-header .wp-block-navigation__responsive-container.is-menu-open {
	inset: 0 0 0 auto;              /* right-hand drawer, not full screen */
	width: var(--lycee-drawer);
	background-color: #2b2b2b !important;
	box-shadow: -14px 0 40px rgba(0, 0, 0, 0.45);
	padding: 4.2rem 1.6rem 2rem !important;
	overflow-y: auto;
}

.lycee-header .is-menu-open .wp-block-navigation__responsive-container-close {
	top: 1.1rem;
	right: auto;
	left: 1.4rem;
	color: #ffffff;
}

.lycee-header .is-menu-open .wp-block-navigation__responsive-container-content,
.lycee-header .is-menu-open .wp-block-navigation__container {
	width: 100%;
	gap: 0 !important;
}

/* ---- top-level items: uppercase, spaced, divided ---- */

.lycee-header .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item {
	width: 100%;
	border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.lycee-header .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content,
.lycee-header .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-submenu__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 1.05rem 0 !important;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: #d8d8e2 !important;
}

.lycee-header .is-menu-open .wp-block-navigation-item__content:hover,
.lycee-header .is-menu-open .wp-block-navigation-submenu__toggle:hover {
	color: #ffffff !important;
	opacity: 1;
}

/* Chevron on the right, rotating when open. */
.lycee-header .is-menu-open .wp-block-navigation__submenu-icon {
	margin-left: auto;
	transition: transform 0.2s ease;
}

.lycee-header .is-menu-open [aria-expanded="true"] .wp-block-navigation__submenu-icon,
.lycee-header .is-menu-open [aria-expanded="true"] + .wp-block-navigation__submenu-icon {
	transform: rotate(180deg);
}

/* ---- submenus: collapsed until tapped ---- */

.lycee-header .is-menu-open .wp-block-navigation__submenu-container {
	display: none !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 0 0 0.6rem 0.9rem !important;
	min-width: 0 !important;
}

/* Expanded only when our own JS says so. WordPress sets aria-expanded="true"
   on these toggles inside the overlay, so that attribute cannot be the signal. */
.lycee-header .is-menu-open .wp-block-navigation-item.lycee-sub-open > .wp-block-navigation__submenu-container {
	display: block !important;
}

.lycee-header .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item {
	width: 100%;
	border: none;
}

.lycee-header .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.62rem 0 !important;
	font-size: 0.86rem;
	font-weight: 400;
	letter-spacing: 0.02em;
	text-transform: none;
	color: #a9a9bd !important;
	background: transparent !important;
}

.lycee-header .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	color: #ffffff !important;
	background: transparent !important;
}

/* The focus ring WordPress draws in the overlay reads as a stray white box. */
.lycee-header .is-menu-open .wp-block-navigation-item__content:focus:not(:focus-visible) {
	outline: none;
	box-shadow: none;
}

/* Core hides the submenu chevron inside the overlay; the drawer needs it to
   signal which items expand. */
.lycee-header .is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-icon {
	display: inline-flex !important;
	align-items: center;
	margin-left: auto;
	opacity: 0.75;
	transition: transform 0.22s ease;
}

.lycee-header .is-menu-open .wp-block-navigation__submenu-icon svg {
	width: 0.85em;
	height: 0.85em;
}

.lycee-header .is-menu-open .wp-block-navigation-item.lycee-sub-open > .wp-block-navigation-submenu__toggle .wp-block-navigation__submenu-icon,
.lycee-header .is-menu-open .wp-block-navigation-item.lycee-sub-open > .wp-block-navigation-submenu__toggle + .wp-block-navigation__submenu-icon {
	transform: rotate(180deg);
	opacity: 1;
}

/* The chevron is a sibling of the toggle button, so rather than fight the
   flex row, the item is a plain block and the chevron is positioned over it. */
.lycee-header .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item.has-child {
	display: block;
	position: relative;
}

.lycee-header .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item.has-child > .wp-block-navigation-submenu__toggle {
	width: 100% !important;
	justify-content: flex-start !important;
	text-align: left;
	padding-right: 2.2rem !important;
}

.lycee-header .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-icon {
	position: absolute;
	top: 0;
	right: 0;
	height: 3.1rem;
	display: flex !important;
	align-items: center;
	margin: 0;
	padding: 0 0.2rem;
	cursor: pointer;
	opacity: 0.7;
	transition: transform 0.22s ease, opacity 0.22s ease;
}

.lycee-header .is-menu-open .wp-block-navigation-item.has-child.lycee-sub-open > .wp-block-navigation__submenu-icon {
	transform: rotate(180deg);
	opacity: 1;
}


/* ==========================================================================
   Drawer pushes the page aside

   The previous design slid the whole page left and revealed the menu in the
   gap, rather than laying a panel over the top. Because the drawer is a
   descendant of the translated wrapper, it is translated back by the same
   amount so it stays pinned to the viewport edge.
   ========================================================================== */

:root {
	/* Matches the previous design: the page stays partly visible alongside. */
	--lycee-drawer: min(64vw, 340px);
}

/* A `transform` here would make .wp-site-blocks the containing block for the
   position:fixed drawer inside it, dragging the drawer off-screen with the
   page. A relative offset shifts the content without that side effect. */
.wp-site-blocks {
	position: relative;
	right: 0;
	transition: right 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}

body.lycee-drawer-open {
	overflow: hidden;
}

body.lycee-drawer-open .wp-site-blocks {
	right: var(--lycee-drawer);
}

@media (prefers-reduced-motion: reduce) {
	.wp-site-blocks {
		transition: none;
	}
}
