/*
Theme Name: Learnify
Theme URI: https://www.learnify.bh
Author: Learnify Academy
Description: Block theme for Learnify Academy, rebuilt from the Odoo website (September 2026). Keeps the original header, footer, brand colours and page addresses, and includes the site's redirects, Google tags, ads.txt and contact form.
Version: 1.2.3
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: learnify
*/

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; height: auto; }
.wp-site-blocks > * + * { margin-block-start: 0; }
.lf-page, .lf-page > .wp-block-post-content { margin: 0; }
.lf-page > .wp-block-post-content > * { margin-block-start: 0; margin-block-end: 0; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
	outline: 2px solid #2395cb;
	outline-offset: 2px;
}

/* ---------- Header (September 2026 redesign) ----------
 * Slim announcement bar that scrolls away + sticky main bar with logo, menu and "Free trial class" button.
 * Menu: WordPress Navigation block. Full menu from 1080px; below that a menu button opens a full-screen menu.
 */
.lf-header {
	--lf-topbar-h: 38px;
	--lf-ink: #0b1f2a;
	--lf-ink-soft: #3f5561;
	--lf-blue: #2395cb;
	--lf-blue-text: #0f6d9c;
	--lf-blue-button: #1573a6;
	--lf-night: #072f45;
	--lf-ice: #edf7fb;
	--lf-line: #d3e3ea;
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) - var(--lf-topbar-h));
	z-index: 100;
	background: #fff;
	box-shadow: 0 1px 0 var(--lf-line), 0 10px 24px -22px rgba(7, 47, 69, .5);
	font-family: var(--wp--preset--font-family--assistant);
}
.lf-header p { margin: 0; }
.lf-header .lf-topbar-in > *,
.lf-header .lf-mainbar-in > * { margin-block: 0; }

/* Announcement bar */
.lf-topbar { height: var(--lf-topbar-h); padding: 0 20px; overflow: hidden; background: var(--lf-night); color: #c9deea; }
.lf-topbar-in {
	max-width: 1240px;
	height: 100%;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}
.lf-header .lf-announce {
	min-width: 0;
	overflow: hidden;
	font-size: 14px;
	line-height: var(--lf-topbar-h);
	white-space: nowrap;
	text-overflow: ellipsis;
	color: #c9deea;
}
.lf-header .lf-announce strong { font-weight: 700; color: #fff; }
.lf-header .lf-announce a { margin-left: 10px; font-weight: 700; color: #7cc7ea; text-decoration: none; }
.lf-header .lf-announce a::after { content: " →"; }
.lf-header .lf-announce a:hover { color: #fff; }
.lf-header .lf-topbar-contact { display: flex; flex: none; gap: 22px; font-size: 14px; line-height: var(--lf-topbar-h); white-space: nowrap; }
.lf-header .lf-topbar-contact a { font-weight: 600; color: #c9deea; text-decoration: none; }
.lf-header .lf-topbar-contact a:hover { color: #fff; }

/* Main bar */
.lf-mainbar { padding: 0 20px; background: #fff; }
.lf-mainbar-in {
	max-width: 1240px;
	height: 72px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 24px;
}
.lf-header .lf-logo { flex: none; margin: 0; }
.lf-logo img,
.lf-logo .custom-logo { display: block; width: 150px; height: auto; }

.lf-header .lf-nav { flex: 1 1 auto; justify-content: flex-end; font-size: 16px; font-weight: 600; }
.lf-header .lf-nav .wp-block-navigation__container { gap: 2px; }
.lf-header .lf-nav .wp-block-navigation-item__content {
	padding: 10px 12px;
	border-radius: 8px;
	color: var(--lf-ink);
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}
.lf-header .lf-nav .wp-block-navigation-item__content:hover,
.lf-header .lf-nav .wp-block-navigation-item__content:focus-visible { background: var(--lf-ice); color: var(--lf-blue-text); }
.lf-header .lf-nav :is(.current-menu-item, .current-menu-ancestor) > .wp-block-navigation-item__content { color: var(--lf-blue-text); box-shadow: inset 0 -2px 0 var(--lf-blue); border-radius: 8px 8px 0 0; }
.lf-header .lf-nav .wp-block-navigation__submenu-icon { color: var(--lf-ink-soft); }

/* Dropdowns */
.lf-header .lf-nav .wp-block-navigation__submenu-icon { margin: 0 10px 0 -8px; }
.lf-header .lf-nav .has-child .wp-block-navigation__submenu-container {
	min-width: 320px !important;
	padding: 8px !important;
	border: 1px solid var(--lf-line) !important;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 26px 50px -24px rgba(7, 47, 69, .45);
}
.lf-header .lf-nav .has-child .wp-block-navigation__submenu-container::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -10px;
	height: 10px;
}
.lf-header .lf-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start !important;
	gap: 2px;
	width: 100%;
	padding: 10px 12px;
	border-radius: 10px;
	white-space: normal;
}
.lf-header .lf-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__label { font-weight: 700; color: var(--lf-ink); }
.lf-header .lf-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__description {
	display: block;
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.35;
	color: var(--lf-ink-soft);
}
.lf-header .lf-nav .wp-block-navigation__submenu-container .current-menu-item > .wp-block-navigation-item__content { box-shadow: inset 3px 0 0 var(--lf-blue); background: var(--lf-ice); border-radius: 10px; }

/* Call to action */
.lf-header .lf-cta-wrap { flex: none; margin: 0; }
.lf-header .lf-cta .wp-block-button__link {
	padding: 11px 20px;
	border-radius: 10px;
	background: var(--lf-blue-button);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	text-decoration: none;
	box-shadow: 0 8px 18px -10px rgba(21, 115, 166, .8);
}
.lf-header .lf-cta .wp-block-button__link:hover { background: #0f5f8a; color: #fff; }

/* Narrower desktops: tighten the menu */
@media (min-width: 1080px) and (max-width: 1279px) {
	.lf-mainbar-in { gap: 16px; }
	.lf-header .lf-nav { font-size: 15px; }
	.lf-header .lf-nav .wp-block-navigation-item__content { padding: 10px 8px; }
	.lf-logo img,
	.lf-logo .custom-logo { width: 136px; }
}

/* Below 1080px: menu button + full-screen menu (WordPress only switches below 600px by default) */
@media (min-width: 600px) and (max-width: 1079px) {
	.lf-header .lf-nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.lf-header .lf-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
	.lf-header .lf-nav .wp-block-navigation__responsive-container-close:not(.always-shown) { display: flex; }
}
@media (max-width: 1079px) {
	.lf-mainbar-in { height: 64px; gap: 10px; }
	.lf-logo img,
	.lf-logo .custom-logo { width: 124px; }
	.lf-header .lf-cta-wrap { order: 2; margin-left: auto; }
	.lf-header .lf-nav { flex: 0 0 auto; order: 3; }
	.lf-header .lf-cta .wp-block-button__link { padding: 10px 14px; font-size: 15px; }
	.lf-header .lf-nav .wp-block-navigation__responsive-container-open {
		width: 44px;
		height: 44px;
		align-items: center;
		justify-content: center;
		border: 1px solid var(--lf-line);
		border-radius: 10px;
		color: var(--lf-ink);
	}
	.lf-header .lf-nav .wp-block-navigation__responsive-container.is-menu-open { padding: 18px 20px 32px; background: #fff; color: var(--lf-ink); }
	.lf-header .lf-nav .wp-block-navigation__responsive-container-close { top: 14px; right: 14px; width: 44px; height: 44px; align-items: center; justify-content: center; }
	.lf-header .lf-nav .is-menu-open .wp-block-navigation__responsive-container-content {
		align-items: stretch !important;
		padding-top: 56px;
		max-width: 560px;
		margin: 0 auto;
		width: 100%;
	}
	.lf-header .lf-nav .is-menu-open .wp-block-navigation__container { align-items: stretch !important; gap: 0; width: 100%; }
	.lf-header .lf-nav .is-menu-open .wp-block-navigation-item { align-items: stretch !important; width: 100%; }
	.lf-header .lf-nav .is-menu-open .wp-block-navigation-item__content {
		padding: 14px 4px;
		border-bottom: 1px solid #e8f0f4;
		border-radius: 0;
		font-size: 20px;
		font-weight: 700;
	}
	.lf-header .lf-nav .is-menu-open .has-child .wp-block-navigation__submenu-container {
		min-width: 0 !important;
		padding: 4px 0 10px 14px !important;
		border: 0 !important;
		box-shadow: none;
		background: transparent;
	}
	.lf-header .lf-nav .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
		padding: 9px 4px;
		border-bottom: 0;
		font-size: 16px;
	}
	.lf-header .lf-nav .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__label { font-weight: 600; }
	.lf-header .lf-nav .is-menu-open .wp-block-navigation-item__description { display: none; }
	.lf-header .lf-topbar-contact { display: none; }
	.lf-topbar-in { justify-content: center; }
}
@media (max-width: 600px) {
	.admin-bar .lf-header { top: calc(-1 * var(--lf-topbar-h)); }
}
@media (max-width: 480px) {
	.lf-header { --lf-topbar-h: 34px; }
	.lf-header .lf-announce { font-size: 13px; }
	.lf-header .lf-announce-extra { display: none; }
	.lf-logo img,
	.lf-logo .custom-logo { width: 112px; }
}
@media (max-width: 380px) {
	.lf-header .lf-cta-extra { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.lf-header * { transition: none !important; }
}

/* Results 2026 page (built on Odoo) carries its own old menu inside the content – the site header replaces it. */
.lf-page .lrp-nav { display: none !important; }

/* ---------- Footer (September 2026 redesign) ----------
 * Brand column with address, contact and hours + Programmes, Free resources and Academy link columns + bottom bar.
 */
.lf-site-footer {
	background: #f3f8fb;
	border-top: 1px solid #d3e3ea;
	color: #0b1f2a;
	font-family: var(--wp--preset--font-family--assistant);
}
.lf-site-footer p,
.lf-site-footer ul { margin: 0; }
.lf-footer { padding: 60px 20px 0; }
.lf-footer .lf-footer-in > *,
.lf-footer .lf-footer-brand > *,
.lf-footer .lf-footer-col > *,
.lf-footer .lf-footer-bottom > * { margin-block: 0; }
.lf-footer-in {
	max-width: 1240px;
	margin: 0 auto;
	padding-bottom: 48px;
	display: grid;
	grid-template-columns: minmax(0, 1.45fr) repeat(3, minmax(0, 1fr));
	gap: 40px;
}
.lf-footer-brand { display: grid; align-content: start; gap: 18px; }
.lf-footer .lf-footer-logo { margin: 0; }
.lf-footer .lf-footer-logo img { display: block; width: 150px; height: auto; }
.lf-footer .lf-footer-about { max-width: 40ch; font-size: 16px; line-height: 1.6; color: #3f5561; }
.lf-footer .lf-footer-contact { list-style: none; padding: 0; display: grid; gap: 9px; font-size: 15px; line-height: 1.45; }
.lf-footer .lf-footer-contact li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 10px; }
.lf-footer .lf-footer-contact strong { padding-top: 2px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #3f5561; }
.lf-footer .lf-footer-contact a { color: #0b1f2a; text-decoration: none; }
.lf-footer .lf-footer-contact a:hover { color: #0f6d9c; text-decoration: underline; }
.lf-footer .lf-footer-social { gap: 10px; margin: 2px 0 0; }
.lf-footer .lf-footer-social .wp-social-link { color: #0f6d9c !important; }
.lf-footer .lf-footer-social .wp-social-link svg { width: 22px; height: 22px; }
.lf-footer .lf-footer-title {
	margin-bottom: 16px !important;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #0f6d9c;
}
.lf-footer .lf-footer-links { list-style: none; padding: 0; display: grid; gap: 11px; font-size: 15.5px; line-height: 1.35; }
.lf-footer .lf-footer-links a { color: #0b1f2a; text-decoration: none; }
.lf-footer .lf-footer-links a:hover,
.lf-footer .lf-footer-links a:focus-visible { color: #0f6d9c; text-decoration: underline; text-underline-offset: 3px; }
.lf-footer-bottom {
	max-width: 1240px;
	margin: 0 auto;
	padding: 20px 0 26px;
	border-top: 1px solid #d3e3ea;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 10px 24px;
	font-size: 14px;
	color: #3f5561;
}
.lf-footer .lf-copyright { padding: 0; border: 0; font-size: 14px; color: #3f5561; }
.lf-footer .lf-footer-legal { display: flex; gap: 20px; }
.lf-footer .lf-footer-legal a { color: #3f5561; text-decoration: none; }
.lf-footer .lf-footer-legal a:hover { color: #0f6d9c; text-decoration: underline; }
@media (max-width: 1000px) {
	.lf-footer-in { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.lf-footer-brand { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
	.lf-footer .lf-footer-logo,
	.lf-footer .lf-footer-about,
	.lf-footer .lf-footer-social { grid-column: 1; }
	.lf-footer .lf-footer-contact { grid-column: 2; grid-row: 1 / span 3; }
}
@media (max-width: 640px) {
	.lf-footer { padding-top: 44px; }
	.lf-footer-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 20px; }
	.lf-footer-brand { grid-template-columns: minmax(0, 1fr); }
	.lf-footer .lf-footer-contact { grid-column: 1; grid-row: auto; }
	.lf-footer-bottom { flex-direction: column; }
}
@media (max-width: 380px) {
	.lf-footer-in { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Blog ---------- */
.lf-blog { padding: 48px 20px 72px; }
.lf-blog-title { font-size: clamp(2rem, 4vw, 2.75rem); margin: 0 0 28px; }
.lf-query .wp-block-post-template { gap: 24px; }
.lf-query .wp-block-post {
	display: flex;
	flex-direction: column;
	border: 1px solid #e1edf2;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
}
.lf-query .wp-block-post > * { margin: 0 18px 12px; }
.lf-query .wp-block-post > .wp-block-post-featured-image { margin: 0 0 16px; }
.lf-query .wp-block-post-terms a { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
.lf-query .wp-block-post-title { font-size: 1.3rem; line-height: 1.25; }
.lf-query .wp-block-post-title a { color: #041319; text-decoration: none; }
.lf-query .wp-block-post-title a:hover { color: #2395cb; }
.lf-query .wp-block-post-excerpt { color: #3d4f57; margin-bottom: 20px; }
.lf-query .wp-block-query-pagination { margin-top: 32px; }

.lf-post { padding: 40px 20px 72px; }
.lf-post-cat a { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
.lf-post-title { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.15; margin: 8px 0; }
.lf-post-date { color: #5b6770; font-size: 14px; margin: 0 0 20px; }
.lf-post-cover img { border-radius: 12px; }
.lf-post-content { margin-top: 24px; }

/* ---------- 404 ---------- */
.lf-404 { padding: 88px 20px; text-align: center; }
.lf-404 h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 12px; }
.lf-404 .wp-block-search { max-width: 460px; margin: 28px auto 0; }

/* ---------- Contact page & form ---------- */
.lf-contact { padding: 56px 20px 72px; font-family: var(--wp--preset--font-family--assistant); }
.lf-contact-in {
	max-width: 1140px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
	gap: 48px;
	align-items: start;
}
.lf-contact h1 { font-size: clamp(2rem, 4vw, 2.75rem); margin: 0 0 10px; }
.lf-contact-lead { color: #3d4f57; margin: 0 0 28px; font-size: 18px; max-width: 60ch; }
.lf-contact-card { background: #edf7fb; border-radius: 14px; padding: 26px; }
.lf-contact-card h2 { font-size: 1.3rem; margin: 0 0 14px; }
.lf-contact-card p { margin: 0 0 14px; line-height: 1.6; }
.lf-contact-card iframe { display: block; width: 100%; height: 240px; border: 0; border-radius: 10px; margin-top: 6px; }
.lf-wa { display: inline-block; background: #25d366; color: #fff !important; font-weight: 700; border-radius: 6px; padding: 10px 18px; text-decoration: none; }
.lf-wa:hover { background: #1eb655; }

.lf-form { max-width: 640px; }
.lf-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 18px; }
.lf-form p { margin: 0 0 16px; }
.lf-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: #041319; }
.lf-form input, .lf-form select, .lf-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #c6d6de;
	border-radius: 6px;
	font: inherit;
	color: #041319;
	background: #fff;
}
.lf-form input:focus, .lf-form select:focus, .lf-form textarea:focus { border-color: #2395cb; outline: 3px solid rgba(35, 149, 203, .2); outline-offset: 0; }
.lf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.lf-submit { background: #2395cb; color: #fff; border: 0; border-radius: 6px; padding: 12px 28px; font-weight: 700; font-size: 16px; cursor: pointer; }
.lf-submit:hover { background: #1b7fae; }
.lf-form-success { background: #e3f4e8; color: #1e7b3a; border-radius: 8px; padding: 12px 16px; margin: 0 0 18px; font-weight: 600; }
.lf-form-error { background: #fdecec; color: #b42318; border-radius: 8px; padding: 12px 16px; margin: 0 0 18px; font-weight: 600; }

@media (max-width: 781px) {
	.lf-contact-in { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
