/*
Theme Name: Elmittemex Child
Theme URI: https://elmittemex.hu
Description: Custom child theme for elmittemex.hu — extends Kadence with brand-specific styles.
Author: Elmittemex Kft.
Version: 0.1.0
Template: kadence
*/

/* ─── Fonts (self-hosted Source Sans 3 variable, SIL OFL — Decision 010) ───── */

@font-face {
	font-family: 'Source Sans 3';
	font-style: normal;
	font-weight: 200 900;
	font-display: swap;
	src: url('assets/fonts/source-sans-3-latin-ext-wght-normal.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: 'Source Sans 3';
	font-style: normal;
	font-weight: 200 900;
	font-display: swap;
	src: url('assets/fonts/source-sans-3-latin-wght-normal.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ─── Base ─────────────────────────────────────────────────────────────────── */

/* Point Kadence's font variables at the brand font (body beats Kadence's :root) */
body {
	--global-body-font-family: 'Source Sans 3', sans-serif;
	--global-heading-font-family: 'Source Sans 3', sans-serif;
}

body {
	font-family: var(--font-family-base);
	font-size: var(--text-base);
	line-height: 1.6;
	color: var(--color-text-primary);
	background-color: var(--color-bg-page);
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-family-base);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--color-text-primary);
}

a {
	color: var(--color-brand-primary);
	text-decoration: none;
}

a:hover {
	color: #003d66;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */

.wp-block-button__link,
.btn-primary {
	background-color: var(--color-brand-primary);
	color: #fff !important;
	border: none;
	border-radius: 6px;
	padding: 12px 24px;
	font-family: var(--font-family-base);
	font-size: var(--text-base);
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.wp-block-button__link:hover,
.btn-primary:hover {
	background-color: #003d66;
	color: #fff !important;
}

.wp-block-button.is-style-outline .wp-block-button__link,
.btn-secondary {
	background-color: transparent;
	color: var(--color-brand-primary) !important;
	border: 1.5px solid var(--color-brand-primary);
	border-radius: 6px;
	padding: 12px 24px;
	font-weight: 600;
	letter-spacing: 0.02em;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.btn-secondary:hover {
	background-color: var(--color-brand-primary);
	color: #fff !important;
}

/* ─── Section label (gold uppercase — the deck's visual signature) ─────────── */

.section-label,
.wp-block-kadence-advancedheading.is-style-section-label {
	display: block;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 1.5rem;
	font-weight: 600;
	text-align: left !important;
	color: var(--color-accent-gold-text);
	margin-bottom: var(--space-3);
}

/* ─── Cards / panels ────────────────────────────────────────────────────────── */

.elmx-card {
	background: var(--color-bg-surface);
	border: 1px solid var(--color-border);
	border-radius: 8px;
	padding: var(--space-6);
	transition: box-shadow 0.2s ease;
}

.elmx-card:hover {
	box-shadow: 0 4px 12px rgba(0, 82, 133, 0.08);
}

/* ─── Contact CTA strip ─────────────────────────────────────────────────────── */

.elmx-cta-strip {
	background-color: var(--color-bg-subtle);
	padding: var(--space-10) var(--space-6);
	text-align: center;
}

.elmx-cta-strip h2 {
	margin-bottom: var(--space-5);
}

/* ─── Layout helpers ────────────────────────────────────────────────────────── */

.container-narrow {
	max-width: var(--container-narrow);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--gutter-mobile);
	padding-right: var(--gutter-mobile);
}

@media (min-width: 768px) {
	.container-narrow {
		padding-left: var(--gutter-tablet);
		padding-right: var(--gutter-tablet);
	}
}

/* ─── Typography refinements ────────────────────────────────────────────────── */

.lead {
	font-size: var(--text-lg);
	line-height: 1.5;
	color: var(--color-text-secondary);
}

.text-muted {
	color: var(--color-text-muted);
	font-size: var(--text-sm);
}

/* Legal pages — narrow readable column */
.page-template-legal .entry-content,
.page-impresszum .entry-content,
.page-adatvedelem .entry-content,
.page-cookie .entry-content {
	max-width: var(--container-narrow);
}

/* ─── Home page: split hero, rounded panels, CTA band (from Canva web01) ──── */

:root {
	--radius-blob: 58% 42% 55% 45% / 48% 56% 44% 52%;
	--radius-panel: 28px;
	--tint-sage: #E3E5D1; /* Canva "What we do" card colour; opaque so bubbles stay behind */
}

/* Pill buttons with arrow on hero + CTA */
.elmx-hero-split .wp-block-button__link,
.elmx-cta-band .wp-block-button__link {
	border-radius: 999px;
	padding: 16px 32px;
}

.elmx-hero-split .wp-block-button__link::after,
.elmx-cta-band .wp-block-button__link::after {
	content: "→";
	margin-left: 0.75em;
}

/* Hero */
.elmx-hero-split {
	position: relative;
	overflow: hidden;
	padding: var(--space-10) var(--gutter-mobile) var(--space-12);
}

.elmx-hero-split::before,
.elmx-hero-split::after {
	content: "";
	position: absolute;
	z-index: 0;
	pointer-events: none;
}

.elmx-hero-split::before {
	width: 280px;
	height: 280px;
	left: -140px;
	top: 40px;
	background: var(--color-brand-primary);
	border-radius: var(--radius-blob);
}

.elmx-hero-split::after {
	width: 340px;
	height: 340px;
	right: -170px;
	bottom: -60px;
	background: var(--color-brand-sage);
	opacity: 0.55;
	border-radius: var(--radius-blob);
}

.elmx-hero-split > * {
	position: relative;
	z-index: 1;
}

.elmx-hero-split h1 {
	font-size: clamp(1.75rem, 7.6vw, var(--text-4xl));
	color: var(--color-brand-primary);
	overflow-wrap: break-word;
	hyphens: auto;
}

.elmx-hero-split .lead {
	max-width: 30em;
}

.elmx-blob img {
	display: block;
	width: 100%;
	aspect-ratio: 5 / 4;
	object-fit: cover;
	border-radius: var(--radius-blob);
}

/* Services panel */
.elmx-services-panel,
.elmx-about-panel {
	border-radius: var(--radius-panel);
	padding: var(--space-8) var(--space-6);
	margin-left: var(--gutter-mobile);
	margin-right: var(--gutter-mobile);
}

.elmx-services-panel {
	background: var(--tint-sage);
}

.elmx-about-panel {
	background: var(--color-bg-subtle);
	margin-top: var(--space-6);
}

.elmx-services-panel .elmx-card {
	border-radius: 20px;
	text-align: center;
}

.elmx-services-panel .elmx-card[class*="elmx-icon-"]::before {
	content: "";
	display: block;
	width: 72px;
	height: 72px;
	margin: 0 auto var(--space-4);
	border-radius: 50%;
	background-color: var(--color-bg-surface);
	background-repeat: no-repeat;
	background-position: center;
	background-size: 34px;
	box-shadow: 0 2px 8px rgba(0, 82, 133, 0.1);
}

.elmx-icon-full::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23005285' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='13' rx='2'/%3E%3Cpath d='M8 7V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M3 13h18'/%3E%3C/svg%3E");
}

.elmx-icon-targeted::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23005285' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Ccircle cx='12' cy='12' r='3.5'/%3E%3Cpath d='M12 1.5v3M12 19.5v3M1.5 12h3M19.5 12h3'/%3E%3C/svg%3E");
}

.elmx-icon-guests::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23005285' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2 20c0-3.5 3-6 7-6s7 2.5 7 6'/%3E%3Ccircle cx='17.5' cy='9' r='2.5'/%3E%3Cpath d='M18 14c2.5.3 4 2 4 4.5'/%3E%3C/svg%3E");
}

/* CTA band */
.elmx-cta-band {
	background: var(--color-brand-primary);
	color: #fff;
	text-align: center;
	border-radius: var(--radius-panel);
	padding: var(--space-8) var(--space-6);
	margin: var(--space-8) var(--gutter-mobile) var(--space-10);
}

.elmx-cta-band h2 {
	color: #fff;
	margin-bottom: var(--space-5);
}

.elmx-cta-band .wp-block-button__link {
	background: var(--color-bg-page);
	color: var(--color-brand-primary) !important;
}

.elmx-cta-band .wp-block-button__link:hover {
	background: var(--color-bg-subtle);
	color: var(--color-brand-primary) !important;
}

@media (min-width: 768px) {
	.elmx-hero-split {
		padding: var(--space-12) var(--gutter-desktop);
	}

	.elmx-hero-split h1 {
		font-size: clamp(2.6rem, 3.5vw, var(--text-5xl));
		hyphens: manual;
	}

	.elmx-services-panel,
	.elmx-about-panel,
	.elmx-cta-band {
		margin-left: var(--gutter-desktop);
		margin-right: var(--gutter-desktop);
		padding: var(--space-10) var(--space-8);
	}
}

@media (min-width: 1280px) {
	.elmx-services-panel,
	.elmx-about-panel,
	.elmx-cta-band {
		max-width: var(--container-max);
		margin-left: auto;
		margin-right: auto;
	}
}

.elmx-hero-split h1 {
	line-height: 1.12;
}

/* Specificity fixes against Kadence's entry-content/button defaults */
.entry-content .elmx-hero-split {
	padding: var(--space-8) var(--gutter-mobile) var(--space-10);
}

.entry-content .elmx-hero-split > .wp-block-columns {
	max-width: var(--container-max);
	margin-left: auto;
	margin-right: auto;
}

.elmx-hero-split::before {
	width: 240px;
	height: 240px;
	left: -150px;
	top: -110px;
}

.entry-content .elmx-hero-split .wp-block-button__link {
	background-color: var(--color-brand-primary);
	color: #fff;
}

.entry-content .elmx-hero-split .wp-block-button__link:hover {
	background-color: #003d66;
}

.entry-content .elmx-cta-band .wp-block-button__link {
	background-color: var(--color-bg-page);
}

@media (min-width: 768px) {
	.entry-content .elmx-hero-split {
		padding: var(--space-10) var(--gutter-desktop) var(--space-12);
	}
}

.entry-content .elmx-hero-split > .wp-block-columns {
	width: min(var(--container-max), calc(100% - 2 * var(--gutter-mobile)));
	max-width: none;
	margin-left: auto;
	margin-right: auto;
}

@media (min-width: 768px) {
	.entry-content .elmx-hero-split > .wp-block-columns {
		width: min(var(--container-max), calc(100% - 2 * var(--gutter-desktop)));
	}
}

/* ─── Footer: rounded sage panel, same width as the body panels ──────────── */

.site-footer {
	background: transparent;
	padding: 0 var(--gutter-mobile);
	margin-top: var(--space-6);
	margin-bottom: var(--space-6);
}

.site-footer .site-footer-wrap {
	position: relative;
	overflow: hidden;
	max-width: var(--container-max);
	margin: 0 auto;
	background-color: var(--color-brand-sage);
	color: var(--color-brand-primary);
	border-radius: var(--radius-panel);
}

.site-footer .site-footer-row-container-inner,
.site-footer .site-footer-row {
	background: transparent;
}

.site-footer a,
.site-footer .footer-html,
.site-footer .footer-html p {
	color: var(--color-brand-primary);
}

.elmx-footer-brand p {
	font-size: 1.2rem;
	font-weight: 600;
}

@media (min-width: 768px) {
	.site-footer {
		padding: 0 var(--gutter-desktop);
	}
}

.elmx-footer-brand {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4) var(--space-8);
	width: 100%;
}

.elmx-footer-brand img {
	height: 44px;
	width: auto;
}

.elmx-footer-brand p {
	margin: 0;
}


.site-main-header-inner-wrap {
	min-height: 88px;
}

.site-branding {
	padding: var(--space-3) 0;
}

/* ─── Header menu: larger, brand teal (large bold text keeps AA at 3.2:1) ──── */

body .main-navigation .primary-menu-container > ul > li.menu-item > a {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--color-brand-teal);
}

body .main-navigation .primary-menu-container > ul > li.menu-item > a:hover,
body .main-navigation .primary-menu-container > ul > li.menu-item.current-menu-item > a {
	color: var(--color-brand-primary);
}

body .main-navigation .primary-menu-container > ul > li.menu-item-type-language > a img {
	width: 28px;
	height: auto;
}

/* ─── Palette: no black text, no white backgrounds (brand blues + Canva cream) ─ */

body {
	--global-palette1: #005285;
	--global-palette2: #2A9A9B;
	--global-palette3: #005285;
	--global-palette4: #005285;
	--global-palette5: #005285;
	--global-palette6: #005285;
	--global-palette7: #F8E9D2;
	--global-palette8: #FBF1E5;
	--global-palette9: #FBF1E5;
	background-color: var(--color-bg-page);
	color: var(--color-text-primary);
}

.site-header,
.site-header .site-header-row-container-inner,
.site-header .site-header-row {
	background-color: var(--color-bg-page);
}

.content-bg,
.entry.content-bg,
.single-content .wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background-color: var(--color-bg-subtle);
}

.entry-hero-container-inner,
.page-hero-section .entry-hero-container-inner {
	background-color: var(--color-bg-subtle);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
textarea,
select,
.ff-el-form-control {
	background-color: var(--color-bg-page) !important;
	color: var(--color-text-primary) !important;
	border-color: var(--color-brand-primary);
}

/* ─── Bubbles (decorative, brand colours only) ─────────────────────────────── */

.elmx-services-panel,
.elmx-about-panel,
.elmx-cta-band {
	position: relative;
	overflow: hidden;
}

.elmx-services-panel > *,
.elmx-about-panel > *,
.elmx-cta-band > * {
	position: relative;
	z-index: 1;
}

.elmx-services-panel::before,
.elmx-services-panel::after,
.elmx-about-panel::before,
.elmx-about-panel::after,
.elmx-cta-band::before,
.elmx-cta-band::after,
.site-footer .site-footer-wrap::before,
.site-footer .site-footer-wrap::after {
	content: "";
	position: absolute;
	z-index: 0;
	border-radius: 50%;
	pointer-events: none;
}

.elmx-services-panel::before {
	width: 220px; height: 220px; right: -70px; top: -80px;
	background: var(--color-brand-teal); opacity: 0.22;
}

.elmx-services-panel::after {
	width: 120px; height: 120px; left: -40px; bottom: 40px;
	background: var(--color-brand-primary); opacity: 0.14;
}

.elmx-about-panel::before {
	width: 180px; height: 180px; left: -60px; bottom: -70px;
	background: var(--color-brand-sage); opacity: 0.5;
}

.elmx-about-panel::after {
	width: 90px; height: 90px; right: 30%; top: 24px;
	background: var(--color-brand-primary); opacity: 0.12;
}

.elmx-cta-band::before {
	width: 200px; height: 200px; left: -60px; top: -90px;
	background: var(--color-brand-sage); opacity: 0.35;
}

.elmx-cta-band::after {
	width: 140px; height: 140px; right: -30px; bottom: -60px;
	background: var(--color-brand-teal); opacity: 0.55;
}

.site-footer .site-footer-wrap::before {
	width: 160px; height: 160px; right: 18%; top: -90px;
	background: var(--color-brand-teal); opacity: 0.3;
}

.site-footer .site-footer-wrap::after {
	width: 90px; height: 90px; left: 38%; bottom: -40px;
	background: var(--color-brand-primary); opacity: 0.15;
}

.site-footer .site-footer-wrap > * {
	position: relative;
	z-index: 1;
}

/* ─── Links + Fluent Forms submit in brand colours ─────────────────────────── */

body .entry-content a:not(.wp-block-button__link),
body .site-footer a {
	color: var(--color-brand-primary);
	text-decoration: underline;
	text-underline-offset: 3px;
}

body .entry-content a:not(.wp-block-button__link):hover {
	color: var(--color-brand-teal);
}

body .fluentform .ff-btn-submit,
body .fluentform button.ff-btn {
	background-color: var(--color-brand-primary) !important;
	color: var(--color-bg-page) !important;
	border: 0;
	border-radius: 999px;
	padding: 14px 32px;
	font-family: var(--font-family-base);
	font-size: var(--text-base);
	font-weight: 600;
	letter-spacing: 0.02em;
	min-width: 140px;
}

body .fluentform .ff-btn-submit:hover {
	background-color: #003d66 !important;
}

/* ─── Inner pages (About, Contact): same panel rhythm as Home ──────────────── */

.entry-content > .elmx-about-panel:first-child,
.entry-content > .elmx-services-panel:first-child {
	margin-top: var(--space-6);
}

.elmx-about-panel + .elmx-services-panel,
.elmx-services-panel + .elmx-about-panel {
	margin-top: var(--space-6);
}

.elmx-about-panel h1 {
	color: var(--color-brand-primary);
	margin-bottom: var(--space-4);
}

.elmx-about-panel .wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background-color: transparent;
}

.elmx-about-panel .wp-block-table td {
	border-color: var(--color-border);
}

/* Tables on the sage panel: soft brand-blue lines (the light grey would vanish on sage) */
.elmx-services-panel .wp-block-table td {
	border-color: rgba(0, 82, 133, 0.22);
}

.elmx-services-panel .wp-block-columns + .wp-block-columns {
	margin-top: var(--space-5);
}

.content-area {
	margin-top: 0;
	margin-bottom: 0;
}

.elmx-services-panel > h2.wp-block-heading {
	margin-bottom: var(--space-6);
}

/* ─── Language flag: larger ─────────────────────────────────────────────────── */

body .main-navigation .primary-menu-container > ul > li.menu-item-type-language > a img {
	width: 32px !important;
	height: auto !important;
}

/* ─── Home hero: one rounded bubble, same width as the other panels ─────────── */

.entry-content .elmx-hero-split.alignfull {
	width: auto;
	max-width: var(--container-max);
	margin: var(--space-6) var(--gutter-mobile) var(--space-6);
	padding: var(--space-8) var(--space-6);
	background: var(--color-bg-subtle);
	border-radius: 72px 110px 80px 100px / 80px 90px 100px 70px;
	overflow: hidden;
}

.entry-content .elmx-hero-split > .wp-block-columns {
	width: 100%;
}

/* no edge half-bubbles on the Home hero */
.elmx-hero-split::before,
.elmx-hero-split::after {
	display: none;
}

@media (min-width: 768px) {
	.entry-content .elmx-hero-split.alignfull {
		margin-left: var(--gutter-desktop);
		margin-right: var(--gutter-desktop);
		padding: var(--space-10) var(--space-8);
	}
}

@media (min-width: 1280px) {
	.entry-content .elmx-hero-split.alignfull {
		margin-left: auto;
		margin-right: auto;
	}
}

/* ─── Half bubbles at the page edges on inner pages (About, Contact) ───────── */

body {
	overflow-x: clip;
}

.single-content:has(> .elmx-about-panel) {
	position: relative;
}

.single-content:has(> .elmx-about-panel)::before,
.single-content:has(> .elmx-about-panel)::after {
	content: "";
	position: absolute;
	z-index: 0;
	pointer-events: none;
	border-radius: var(--radius-blob);
}

.single-content:has(> .elmx-about-panel)::before {
	width: 240px;
	height: 240px;
	left: -150px;
	top: 40px;
	background: var(--color-brand-primary);
}

.single-content:has(> .elmx-about-panel)::after {
	width: 340px;
	height: 340px;
	right: -170px;
	top: 420px;
	background: var(--color-brand-sage);
	opacity: 0.55;
}

.single-content:has(> .elmx-about-panel) > .wp-block-group {
	position: relative;
	z-index: 1 !important;
}

/* Hero heading: wrap only between words (long Hungarian words must stay whole) */
.elmx-hero-split h1 {
	overflow-wrap: normal;
	word-break: normal;
	hyphens: manual;
	font-size: clamp(1.6rem, 6.4vw, 3.4rem);
}

@media (min-width: 768px) {
	.elmx-hero-split h1 {
		font-size: clamp(2rem, 3.1vw, 3.4rem);
	}
}

/* ─── Policy pages: readable text inside the panels ────────────────────────── */

.elmx-policy > p,
.elmx-policy > .wp-block-list {
	max-width: 52rem;
}

.elmx-policy .wp-block-list {
	padding-left: 1.25em;
}

.elmx-policy .wp-block-list li {
	margin-bottom: var(--space-3);
}

.elmx-policy .wp-block-table {
	max-width: 52rem;
}

.elmx-policy .wp-block-table {
	overflow-x: auto;
}

.elmx-policy .wp-block-table th {
	text-align: left;
	color: var(--color-brand-primary);
	border-color: var(--color-border);
}

.elmx-policy .wp-block-table code {
	background: transparent;
	padding: 0;
	font-size: var(--text-sm);
	color: var(--color-brand-primary);
	word-break: break-word;
}

/* Footer policy links */
.elmx-footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2) var(--space-6);
	font-size: 1.2rem;
	font-weight: 600;
}

body .site-footer .elmx-footer-links a {
	color: var(--color-brand-primary);
	text-decoration: underline;
	text-underline-offset: 3px;
}
