/* ==========================================================================
   RIMM Festival — site chrome: header, navigation, footer, page banner
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 6rem; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--c-paper); }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link {
	position: absolute; left: 1rem; top: -100px; z-index: 1000;
	padding: .75rem 1rem; background: var(--c-sun); color: var(--c-ink); border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

/* ---------- Header ------------------------------------------------------ */

.site-header {
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 100;
	color: #fff;
	transition: background-color .3s ease, box-shadow .3s ease;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.site-header::before {
	/* soft shade so links stay readable on bright hero photos */
	content: ""; position: absolute; inset: 0 0 -40px; z-index: -1; pointer-events: none;
	background: linear-gradient(180deg, rgba(var(--c-overlay), .55), transparent);
	transition: opacity .3s ease;
}
.site-header.is-scrolled,
.no-hero .site-header,
.nav-open .site-header {
	background: rgba(var(--c-overlay), .96);
	box-shadow: 0 10px 30px -18px rgba(0,0,0,.7);
}
.site-header.is-scrolled::before, .no-hero .site-header::before { opacity: 0; }
.site-header__inner {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	max-width: 1440px;
	margin: 0 auto;
	padding: .85rem var(--gutter);
}
.site-brand { flex: none; line-height: 0; }
.site-brand .custom-logo { height: 60px; width: auto; transition: height .3s ease; }
.is-scrolled .site-brand .custom-logo { height: 48px; }
.site-brand__text {
	font-family: var(--f-display); font-weight: 800; font-size: 1.8rem;
	color: var(--c-orange); text-decoration: none; line-height: 1;
}

/* Desktop navigation: direct links, dropdown only for RIMM 2026 and Éditions */
.site-nav { margin-inline: auto; }
.site-nav .menu { display: flex; align-items: center; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.site-nav .menu > li { position: relative; display: flex; align-items: center; }
.site-nav a { color: inherit; text-decoration: none; }
.site-nav .menu > li > a {
	position: relative;
	padding: .7rem .7rem;
	font-weight: 600;
	font-size: .98rem;
	white-space: nowrap;
}
.site-nav .menu > li > a::after {
	content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .3rem; height: 2px;
	background: var(--c-orange); border-radius: 2px;
	transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.site-nav .menu > li > a:hover::after,
.site-nav .menu > li.current-menu-item > a::after,
.site-nav .menu > li.current-menu-ancestor > a::after,
.site-nav .menu > li.current-menu-parent > a::after { transform: scaleX(1); }
.site-nav .menu-item-has-children > a { padding-right: .25rem; }
.submenu-toggle {
	display: grid; place-items: center;
	width: 26px; height: 26px; margin-right: .3rem;
	padding: 0; border: 0; border-radius: 50%;
	background: transparent; color: inherit; cursor: pointer;
}
.submenu-toggle .icon { width: 18px; height: 18px; transition: transform .2s ease; }
.submenu-toggle[aria-expanded="true"] .icon,
.site-nav li:hover > .submenu-toggle .icon { transform: rotate(180deg); }

.site-nav .sub-menu {
	position: absolute;
	top: calc(100% + .35rem);
	left: 0;
	min-width: 250px;
	margin: 0; padding: .5rem;
	list-style: none;
	background: var(--c-night-deep);
	border: 1px solid rgba(255,255,255,.1);
	border-radius: var(--radius-md);
	box-shadow: 0 24px 50px -20px rgba(0,0,0,.7);
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.site-nav .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -.6rem; height: .6rem; }
.site-nav .sub-menu a { display: block; padding: .7rem .9rem; border-radius: 12px; font-weight: 500; color: rgba(255,255,255,.85); }
.site-nav .sub-menu a:hover, .site-nav .sub-menu .current-menu-item > a { background: rgba(255,255,255,.08); color: #fff; }
.site-nav .sub-menu .current-menu-item > a { box-shadow: inset 3px 0 0 var(--c-orange); }
.site-nav li:hover > .sub-menu,
.site-nav li:focus-within > .sub-menu,
.site-nav li.is-open > .sub-menu { opacity: 1; visibility: visible; transform: none; }

.site-nav__mobile-extra { display: none; }

.site-header__actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; flex: none; }
.days-left {
	font-family: var(--f-display); font-weight: 700; font-size: .85rem;
	padding: .45rem .7rem; border-radius: 999px; background: var(--c-sun); color: var(--c-ink);
}
.header-cta {
	display: inline-flex; align-items: center; gap: .5rem;
	padding: .75rem 1.25rem;
	border-radius: 999px;
	background: var(--c-orange);
	color: #fff;
	text-decoration: none;
	font-family: var(--f-display); font-weight: 600; font-size: .88rem;
	white-space: nowrap;
	transition: background-color .2s ease;
}
.header-cta:hover { background: var(--c-orange-deep); color: #fff; }
.header-cta .icon { width: 16px; height: 16px; }

.nav-toggle {
	display: none;
	width: 46px; height: 46px; padding: 0;
	place-items: center;
	border: 1.5px solid rgba(255,255,255,.4); border-radius: 50%;
	background: transparent; color: #fff; cursor: pointer;
}
.nav-toggle__close { display: none; }
.nav-open .nav-toggle__open { display: none; }
.nav-open .nav-toggle__close { display: block; }
.nav-toggle .icon { display: block; }

@media (max-width: 1240px) {
	.nav-toggle { display: grid; }
	.site-nav {
		position: fixed;
		inset: 0;
		z-index: -1;
		margin: 0;
		padding: 6.5rem var(--gutter) 3rem;
		background: var(--c-night-deep);
		overflow-y: auto;
		opacity: 0; visibility: hidden;
		transition: opacity .25s ease, visibility .25s;
	}
	.nav-open .site-nav { opacity: 1; visibility: visible; }
	.nav-open { overflow: hidden; }
	.site-nav .menu { flex-direction: column; align-items: stretch; gap: 0; max-width: 640px; margin: 0 auto; }
	.site-nav .menu > li { flex-wrap: wrap; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.1); }
	.site-nav .menu > li > a {
		flex: 1;
		padding: 1.05rem 0;
		font-family: var(--f-display); font-weight: 700; font-size: 1.45rem; letter-spacing: -0.01em;
	}
	.site-nav .menu > li > a::after { display: none; }
	.site-nav .menu > li.current-menu-item > a,
	.site-nav .menu > li.current-menu-ancestor > a { color: var(--c-orange); }
	.submenu-toggle { width: 44px; height: 44px; margin: 0; border: 1px solid rgba(255,255,255,.25); }
	.site-nav li:hover > .submenu-toggle .icon { transform: none; }
	.submenu-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
	.site-nav .sub-menu {
		position: static; flex-basis: 100%;
		display: none;
		min-width: 0; padding: 0 0 1rem; border: 0;
		background: none; box-shadow: none;
		opacity: 1; visibility: visible; transform: none;
	}
	.site-nav li.is-open > .sub-menu { display: block; }
	.site-nav .sub-menu a { padding: .6rem .9rem; font-size: 1.05rem; }
	.site-nav__mobile-extra { display: block; max-width: 640px; margin: 2rem auto 0; }
	.site-nav__mobile-extra .rimm-social a { background: rgba(255,255,255,.1); }
}
@media (max-width: 480px) {
	.site-header__inner { gap: .6rem; padding-block: .7rem; }
	.site-brand .custom-logo { height: 50px; }
	.header-cta { padding: .7rem 1rem; font-size: .8rem; }
	.header-cta .icon { display: none; }
	.nav-toggle { width: 44px; height: 44px; }
}

/* ---------- Page banner (pages without a hero) -------------------------- */

.page-banner {
	position: relative;
	padding: clamp(8.5rem, 16vw, 11rem) var(--gutter) clamp(3.5rem, 7vw, 5rem);
	background: var(--c-night-deep);
	color: #fff;
}
.theme-kerkennah .page-banner::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 40px;
	background: var(--c-paper);
	-webkit-mask: var(--wave) repeat-x bottom / 600px 40px; mask: var(--wave) repeat-x bottom / 600px 40px;
}
.page-banner__inner { max-width: 1240px; margin: 0 auto; }
.page-banner__title { margin: 0; color: #fff; }

.no-hero .entry-content { padding: clamp(3rem, 6vw, 5rem) var(--gutter); }
.no-hero .entry-content > .alignfull { margin-inline: calc(-1 * var(--gutter)); }
.entry-content { padding-bottom: 0; }

/* ---------- Posts list / 404 -------------------------------------------- */

.post-list {
	max-width: 1240px; margin: 0 auto; padding: 4rem var(--gutter);
	display: grid; gap: 2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.post-card__img img { border-radius: var(--radius-lg); aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.post-card__title { font-size: 1.3rem; margin-top: 1rem; }
.post-card__title a { color: inherit; text-decoration: none; }
.nav-links { display: flex; gap: .5rem; }
.not-found { min-height: 70vh; padding: 10rem var(--gutter) 5rem; max-width: 780px; margin: 0 auto; }
.not-found__code { font-family: var(--f-display); font-weight: 800; font-size: clamp(5rem, 18vw, 11rem); line-height: .9; color: var(--c-orange); margin: 0; letter-spacing: -0.05em; }
.not-found__btn { display: inline-block; padding: 1rem 1.6rem; border-radius: 999px; background: var(--c-orange); color: #fff; text-decoration: none; font-family: var(--f-display); font-weight: 600; }

/* ---------- Footer ------------------------------------------------------ */

.site-footer {
	position: relative;
	margin-top: 0;
	background: var(--c-night-deep);
	color: rgba(242,246,245,.82);
}
.site-footer__wave { display: none; }
.theme-kerkennah .site-footer__wave {
	display: block;
	position: absolute; left: 0; right: 0; top: -39px; height: 40px;
	background: var(--c-night-deep);
	-webkit-mask: var(--wave) repeat-x bottom / 600px 40px; mask: var(--wave) repeat-x bottom / 600px 40px;
}
.site-footer__inner { max-width: 1400px; margin: 0 auto; padding: clamp(4rem, 8vw, 6rem) var(--gutter) 2rem; }
.footer-slogan { padding-bottom: clamp(3rem, 6vw, 4.5rem); border-bottom: 1px solid rgba(242,246,245,.15); }
.footer-slogan__ar {
	margin: 0; font-size: clamp(1.6rem, 3vw, 2.4rem); color: var(--c-sun); font-weight: 600;
	font-family: 'Noto Kufi Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif; text-align: left;
}
.footer-slogan__main {
	margin: .25rem 0 0;
	font-family: var(--f-display); font-weight: 800;
	font-size: clamp(2.6rem, 8.5vw, 7.5rem);
	line-height: .92; letter-spacing: -0.045em;
	color: var(--c-orange);
}
.site-footer .footer-slogan__cta {
	display: inline-block; margin-top: 2rem;
	padding: 1rem 1.6rem; border-radius: 999px;
	background: var(--c-paper); color: var(--c-ink);
	font-family: var(--f-display); font-weight: 600; text-decoration: none;
}
.site-footer .footer-slogan__cta:hover { background: var(--c-sun); color: var(--c-ink); }

.footer-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr;
	gap: clamp(2rem, 5vw, 4rem);
	padding-block: clamp(2.5rem, 5vw, 3.5rem);
}
.footer-col--about .custom-logo { height: 64px; width: auto; margin-bottom: 1.25rem; }
.footer-col--about p { max-width: 46ch; margin: 0; }
.footer-title { font-size: 1rem; color: #fff; margin-bottom: 1.1rem; letter-spacing: 0; }
.footer-menu, .footer-contact { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.site-footer a { color: rgba(242,246,245,.9); text-decoration: none; }
.site-footer a:hover { color: var(--c-sun); }
.site-footer .rimm-social a { background: rgba(255,255,255,.1); }
.site-footer .rimm-social a:hover { background: var(--c-orange); color: #fff; }
.footer-bottom {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
	padding-top: 1.5rem; border-top: 1px solid rgba(242,246,245,.15);
	font-size: .9rem; color: rgba(242,246,245,.6);
}
.footer-bottom p { margin: 0; }

@media (max-width: 860px) {
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.footer-col--about { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
	.footer-grid { grid-template-columns: 1fr; }
}



/* ==========================================================================
   v1.3 — Mobile menu: full screen, same items as desktop, phone + socials + FR/EN
   ========================================================================== */
@media (max-width: 1240px) {
	.site-nav {
		height: 100vh; height: 100dvh;
		padding: 6.25rem var(--gutter) 2rem;
		display: flex; flex-direction: column;
	}
	.admin-bar .site-nav { padding-top: calc(6.25rem + var(--wp-admin--admin-bar--height, 0px)); }
	.site-nav .menu { width: 100%; }
	.site-nav .menu > li > a { font-size: 1.35rem; padding: .85rem 0; }
	.site-nav .menu-item-has-children > a { padding-bottom: .35rem; }
	.site-nav .sub-menu a { padding: .45rem 0 .45rem 1rem; font-size: 1.02rem; border-left: 2px solid rgba(255,255,255,.15); border-radius: 0; }
	.site-nav .sub-menu .current-menu-item > a { border-left-color: var(--c-orange); box-shadow: none; color: #fff; }

	.site-nav__mobile-extra {
		display: grid; gap: .7rem;
		width: 100%; max-width: 640px;
		margin: auto auto 0; padding-top: 2rem;
	}
	.panel-btn {
		display: flex; align-items: center; justify-content: center; gap: .6rem;
		min-height: 54px; padding: .9rem 1.25rem;
		border-radius: 999px;
		font-family: var(--f-display); font-weight: 600; font-size: 1rem;
		text-decoration: none;
	}
	.panel-btn--cta { background: var(--c-orange); color: #fff; }
	.panel-btn--phone { background: #fff; color: var(--c-ink); }
	.panel-btn--phone .icon { width: 20px; height: 20px; color: var(--c-orange); }
	.panel-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: .4rem; }
	.panel-row .rimm-social { margin: 0; }
	.site-header__actions .lang-switch { display: none; }
}

/* ---------- FR / EN switch ---------- */
.lang-switch {
	display: inline-flex;
	padding: 3px;
	border-radius: 999px;
	border: 1.5px solid rgba(255,255,255,.35);
}
.lang-switch__btn {
	min-width: 40px; height: 34px; padding: 0 .7rem;
	border: 0; border-radius: 999px;
	background: transparent; color: #fff;
	font: 600 .82rem/1 var(--f-display);
	cursor: pointer;
}
.lang-switch__btn:hover { background: rgba(255,255,255,.12); }
.lang-switch__btn.is-active { background: #fff; color: var(--c-ink); }
.lang-switch.is-panel .lang-switch__btn { min-width: 52px; height: 44px; font-size: .95rem; }

/* ---------- Old plugins that would cover the theme on phones ---------- */
/* Mobile Menu plugin: its burger and panel replace the theme's — hidden (deactivate the plugin anyway) */
body .mob-menu-header-holder, body .mobmenu, body .mobmenu-left-alignment, body .mobmenu-right-alignment,
body .mobmenul-container, body .mobmenur-container, body .mob-menu-left-panel, body .mob-menu-right-panel,
body .mobmenu-overlay, body .mobmenu-push-wrap > .mob-menu-header-holder { display: none !important; }
body.mob-menu-slideout, body.mob-menu-slideout-over, body.mob-menu-overlay { padding-top: 0 !important; }
/* GTranslate's own globe/floating selector: the theme's FR / EN button replaces it */
body > .gtranslate_wrapper, .gt_float_switcher, .gt_white_content { display: none !important; }
/* Google translation toolbar and highlights */
.goog-te-banner-frame, iframe.skiptranslate, #goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
body { top: 0 !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
@media (max-width: 1240px) {
	.site-nav a.panel-btn--phone { color: var(--c-ink); }
	.site-nav a.panel-btn--cta { color: #fff; }
	/* Logo, button and close stay on a solid bar; the menu scrolls underneath it */
	.site-header__inner { position: relative; z-index: 1; }
	.nav-open .site-header__inner { background: var(--c-night-deep); max-width: none; }
}
@media (max-width: 1240px) {
	.nav-open .site-header__inner { background: transparent; }
	/* The panel starts under the header bar (height measured by JS), so nothing scrolls under the logo */
	.site-nav,
	.admin-bar .site-nav {
		top: var(--rimm-header-bottom, 84px);
		height: auto;
		bottom: 0;
		padding-top: 1.25rem;
		border-top: 1px solid rgba(255,255,255,.08);
	}
	.nav-open .site-header { background: var(--c-night-deep); }
}

/* ==========================================================================
   v1.3.2 — Keep the theme menu visible even if another plugin (e.g. "Mobile Menu",
   which hides nav / .menu / toggles under 1024px) tries to hide it.
   ========================================================================== */
html body header#site-header.site-header { display: block !important; }
html body header#site-header .site-header__inner { display: flex !important; }
html body header#site-header .site-brand { display: block !important; }
html body header#site-header .site-header__actions { display: flex !important; visibility: visible !important; opacity: 1 !important; }
html body header#site-header .header-cta { display: inline-flex !important; visibility: visible !important; }
html body header#site-header nav#site-nav.site-nav { display: block !important; }
html body header#site-header nav#site-nav ul.menu { display: flex !important; }
html body header#site-header nav#site-nav ul.menu > li { display: flex !important; }
html body header#site-header nav#site-nav ul.sub-menu > li { display: block !important; }
@media (max-width: 1240px) {
	html body header#site-header button.nav-toggle { display: grid !important; visibility: visible !important; opacity: 1 !important; }
	html body header#site-header nav#site-nav.site-nav { display: flex !important; }
	html body header#site-header .site-nav__mobile-extra { display: grid !important; }
}
@media (min-width: 1241px) {
	html body header#site-header button.nav-toggle { display: none !important; }
	html body header#site-header .site-nav__mobile-extra { display: none !important; }
}

/* v1.3.3 — A closed menu must never catch taps.
   The sub-menus were set to "visible" on phones, which let them stay clickable inside the
   invisible (closed) panel and send taps to menu pages. */
@media (max-width: 1240px) {
	html body header#site-header nav#site-nav .sub-menu { visibility: inherit !important; opacity: 1; }
	html body:not(.nav-open) header#site-header nav#site-nav.site-nav { pointer-events: none !important; visibility: hidden !important; }
	html body.nav-open header#site-header nav#site-nav.site-nav { pointer-events: auto !important; visibility: visible !important; }
}

/* v1.4 — Phone menu: sub-pages closed, an arrow opens them */
@media (max-width: 1240px) {
	html body header#site-header nav#site-nav ul.sub-menu { display: none !important; padding: 0 0 .9rem .1rem; }
	html body header#site-header nav#site-nav li.is-open > ul.sub-menu { display: block !important; }
	html body header#site-header nav#site-nav .submenu-toggle {
		display: grid !important;
		width: 46px; height: 46px; margin: 0;
		border: 1px solid rgba(255,255,255,.25);
		background: rgba(255,255,255,.06);
	}
	html body header#site-header nav#site-nav li.is-open > .submenu-toggle { background: var(--c-orange); border-color: var(--c-orange); }
	.site-nav .menu-item-has-children > a { padding-bottom: .85rem; }
}
@media (max-width: 1240px) {
	html body header#site-header nav#site-nav li > .submenu-toggle .icon { transform: none; transition: transform .2s ease; }
	html body header#site-header nav#site-nav li.is-open > .submenu-toggle .icon { transform: rotate(180deg); }
}

/* v1.4.1 — Phone menu: RIMM 2027 + phone side by side, smaller, so socials show without scrolling */
@media (max-width: 1240px) {
	html body header#site-header .site-nav__mobile-extra {
		grid-template-columns: 1fr 1fr;
		gap: .6rem;
		padding-top: 1.25rem;
	}
	.site-nav__mobile-extra .panel-btn {
		min-height: 46px;
		padding: .6rem .75rem;
		font-size: .85rem;
		gap: .4rem;
		white-space: nowrap;
	}
	.site-nav__mobile-extra .panel-btn .icon { width: 17px; height: 17px; flex: none; }
	.site-nav__mobile-extra .panel-btn:only-of-type { grid-column: 1 / -1; }
	.site-nav__mobile-extra .panel-row { grid-column: 1 / -1; margin-top: .2rem; }
	.site-nav__mobile-extra .rimm-social a { width: 42px; height: 42px; }
	.lang-switch.is-panel .lang-switch__btn { min-width: 46px; height: 40px; }
}
@media (max-width: 360px) {
	.site-nav__mobile-extra .panel-btn { font-size: .78rem; padding-inline: .55rem; }
	.site-nav__mobile-extra .rimm-social { gap: .4rem; }
	.site-nav__mobile-extra .rimm-social a { width: 38px; height: 38px; }
}

/* v1.4.2 — Chat bubbles (Chatway…) hidden while the phone menu is open */
.rimm-floating-hidden { visibility: hidden !important; pointer-events: none !important; }
