/*
Theme Name: Margalla Digital
Theme URI: https://margalladigital.com/
Author: Margalla Digital
Description: Lightweight theme for margalladigital.com. Header, footer, brand styles, contact and audit forms, built for pages made with Elementor (free).
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: margalla
*/

:root {
	--md-pine: #0B3D2E;
	--md-leaf: #127046;
	--md-mint: #CFE3D8;
	--md-mint-bg: #E3F1E9;
	--md-mist: #F3F7F4;
	--md-line: #DCE5E0;
	--md-line-dark: #1F5A46;
	--md-amber: #F4B740;
	--md-ink: #0E1B15;
	--md-body: #24322B;
	--md-muted: #4A5A52;
	--md-white: #FFFFFF;
	--md-radius: 14px;
	--md-wrap: 1200px;
	--md-head: "Plus Jakarta Sans", system-ui, sans-serif;
	--md-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--md-white);
	color: var(--md-ink);
	font-family: var(--md-text);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--md-leaf); text-underline-offset: 3px; }
a:hover { color: var(--md-pine); }
:focus-visible { outline: 3px solid var(--md-amber); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--md-head); color: var(--md-ink); line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.md-skip:focus {
	position: fixed; top: 12px; left: 12px; z-index: 1000; width: auto; height: auto; clip: auto;
	background: var(--md-white); color: var(--md-ink); padding: 12px 16px; border-radius: 8px;
}
.md-wrap { max-width: var(--md-wrap); margin: 0 auto; padding: 0 24px; }

/* Header ---------------------------------------------------------- */
.md-header {
	position: sticky; top: 0; z-index: 100;
	background: var(--md-white); border-bottom: 1px solid var(--md-line);
}
.admin-bar .md-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .md-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .md-header { top: 0; } }
.md-header__inner {
	max-width: var(--md-wrap); margin: 0 auto; padding: 12px 24px;
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.md-logo { display: inline-flex; align-items: center; min-height: 44px; }
.md-logo img { display: block; width: 210px; height: auto; }
.md-nav { display: flex; align-items: center; gap: 28px; }
.md-nav ul { list-style: none; margin: 0; padding: 0; }
.md-nav__list { display: flex; align-items: center; gap: 26px; }
.md-nav__list > li { position: relative; }
.md-nav__list a {
	display: block; padding: 12px 0; color: var(--md-ink); text-decoration: none;
	font-size: 15px; font-weight: 500;
}
.md-nav__list a:hover, .md-nav__list .current-menu-item > a, .md-nav__list .current-menu-ancestor > a { color: var(--md-leaf); }
.md-nav__list .menu-item-has-children > a::after {
	content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px;
	border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
	transform: translateY(-3px) rotate(45deg);
}
.md-nav__list .sub-menu {
	position: absolute; top: 100%; left: -16px; min-width: 250px; padding: 8px;
	background: var(--md-white); border: 1px solid var(--md-line); border-radius: 12px;
	box-shadow: 0 14px 30px rgba(11, 61, 46, .12);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: .15s ease;
}
.md-nav__list li:hover > .sub-menu, .md-nav__list li:focus-within > .sub-menu {
	opacity: 1; visibility: visible; transform: none;
}
.md-nav__list .sub-menu a { padding: 9px 12px; border-radius: 8px; }
.md-nav__list .sub-menu a:hover { background: var(--md-mist); }
.md-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	background: var(--md-leaf); color: var(--md-white); text-decoration: none;
	font-family: var(--md-text); font-weight: 600; font-size: 15px; line-height: 1.2;
	padding: 13px 20px; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
}
.md-btn:hover { background: var(--md-pine); color: var(--md-white); }
.md-btn--amber { background: var(--md-amber); color: var(--md-ink); font-weight: 700; }
.md-btn--amber:hover { background: #FFCB66; color: var(--md-ink); }
.md-menu-toggle {
	display: none; background: none; border: 1px solid var(--md-line); border-radius: 8px;
	width: 44px; height: 44px; padding: 0; cursor: pointer; color: var(--md-ink);
}
.md-menu-toggle span, .md-menu-toggle span::before, .md-menu-toggle span::after {
	display: block; width: 20px; height: 2px; margin: 0 auto; background: currentColor; position: relative; content: "";
}
.md-menu-toggle span::before { position: absolute; top: -6px; }
.md-menu-toggle span::after { position: absolute; top: 6px; }

@media (max-width: 1024px) {
	.md-menu-toggle { display: inline-block; }
	.md-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: 16px;
		background: var(--md-white); border-bottom: 1px solid var(--md-line);
		padding: 8px 24px 24px; max-height: calc(100vh - 70px); overflow-y: auto;
	}
	.md-header.is-open .md-nav { display: flex; }
	.md-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
	.md-nav__list > li { border-bottom: 1px solid var(--md-line); }
	.md-nav__list a { padding: 14px 0; font-size: 16px; }
	.md-nav__list .sub-menu {
		position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
		border: 0; padding: 0 0 10px 14px; min-width: 0;
	}
	.md-nav__list .sub-menu a { padding: 8px 0; }
	.md-nav__list .menu-item-has-children > a::after { display: none; }
	.md-nav .md-btn { width: 100%; padding: 15px 20px; }
	.md-logo img { width: 180px; }
}

/* Landing header (free audit) */
.md-header--landing { position: static; }
.md-header--landing .md-header__inner { justify-content: center; }

/* Footer ---------------------------------------------------------- */
.md-footer { background: var(--md-pine); color: var(--md-mint); font-size: 15px; line-height: 1.6; }
.md-footer a { color: var(--md-mint); text-decoration: none; }
.md-footer a:hover { color: var(--md-white); text-decoration: underline; }
.md-footer__inner { max-width: var(--md-wrap); margin: 0 auto; padding: 64px 24px 32px; }
.md-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 40px; }
.md-footer__brand img { width: 200px; display: block; margin-bottom: 16px; }
.md-footer__brand p { margin: 0; max-width: 300px; }
.md-footer h2 {
	margin: 0 0 12px; font-family: var(--md-text); font-size: 13px; font-weight: 700; color: var(--md-white);
	text-transform: uppercase; letter-spacing: .08em;
}
.md-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.md-footer__bottom {
	margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--md-line-dark);
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 14px;
}
.md-footer__bottom ul { display: flex; flex-wrap: wrap; gap: 20px; }
@media (max-width: 1024px) { .md-footer__grid { grid-template-columns: repeat(2, 1fr); } .md-footer__brand { grid-column: 1 / -1; } }
@media (max-width: 560px) { .md-footer__grid { grid-template-columns: 1fr; } }
.md-footer--landing .md-footer__inner { padding: 28px 24px; }
.md-footer--landing .md-footer__bottom { margin: 0; padding: 0; border: 0; }

/* Generic page and post templates (pages not built with Elementor) */
.md-main { min-height: 50vh; }
.md-page-head { background: var(--md-mist); padding: 64px 0 48px; }
.md-page-head h1 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 800; letter-spacing: -.02em; margin: 0; }
.md-page-head p { color: var(--md-muted); margin: 12px 0 0; }
.md-content { max-width: 800px; margin: 0 auto; padding: 56px 24px 96px; font-size: 18px; line-height: 1.75; color: var(--md-body); }
.md-content h2 { font-size: 30px; font-weight: 800; margin-top: 1.6em; }
.md-content h3 { font-size: 22px; font-weight: 700; margin-top: 1.4em; }
.md-post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; padding: 56px 0 96px; }
.md-post-card { border: 1px solid var(--md-line); border-radius: var(--md-radius); padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.md-post-card h2 { font-size: 22px; margin: 0; }
.md-post-card h2 a { color: var(--md-ink); text-decoration: none; }
.md-post-card h2 a:hover { color: var(--md-leaf); }
.md-post-card p { color: var(--md-muted); margin: 0; font-size: 16px; }
.md-pagination { padding-bottom: 96px; }
.md-404 { text-align: center; padding: 120px 24px; }
.md-404 h1 { font-size: clamp(36px, 5vw, 60px); font-weight: 800; }

/* Elementor content helpers -------------------------------------- */
.elementor-widget-text-editor p:last-child,
.elementor-widget-text-editor ul:last-child,
.elementor-widget-text-editor ol:last-child { margin-bottom: 0; }
.elementor-widget-text-editor ul, .elementor-widget-text-editor ol { margin: 0 0 1em; padding-left: 1.3em; }
.elementor-widget-text-editor li { margin-bottom: .45em; }
.elementor-widget-text-editor strong { color: var(--md-ink); font-weight: 600; }
.md-on-dark .elementor-widget-text-editor strong { color: var(--md-white); }
.elementor-widget-text-editor a { color: var(--md-leaf); font-weight: 500; }
.md-on-dark .elementor-widget-text-editor a { color: var(--md-amber); }
.md-on-dark .elementor-widget-text-editor a:hover { color: var(--md-white); }

/* Check list */
.md-checks ul { list-style: none; padding: 0; display: grid; gap: 12px; }
.md-checks li { position: relative; padding-left: 34px; margin: 0; }
.md-checks li::before {
	content: ""; position: absolute; left: 0; top: .15em; width: 22px; height: 22px; border-radius: 50%;
	background: var(--md-mint-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5 8.8 13 14 7.5' fill='none' stroke='%23127046' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.md-on-dark .md-checks li::before {
	background: var(--md-line-dark) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5 8.8 13 14 7.5' fill='none' stroke='%23F4B740' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.md-on-dark .md-checks strong { color: var(--md-white); }

/* Numbered steps list */
.md-steps ol { list-style: none; padding: 0; counter-reset: md-step; display: grid; gap: 14px; }
.md-steps li { counter-increment: md-step; position: relative; padding-left: 48px; margin: 0; min-height: 32px; }
.md-steps li::before {
	content: counter(md-step); position: absolute; left: 0; top: -.05em; width: 32px; height: 32px; border-radius: 50%;
	background: var(--md-leaf); color: var(--md-white); font: 700 15px/32px var(--md-head); text-align: center;
}

/* Tables */
.md-table-wrap { overflow-x: auto; border: 1px solid var(--md-line); border-radius: var(--md-radius); }
.md-table-wrap table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; min-width: 560px; margin: 0; }
.md-table-wrap th, .md-table-wrap td { padding: 14px 20px; text-align: left; vertical-align: top; border: 0; }
.md-table-wrap tr + tr th, .md-table-wrap tr + tr td { border-top: 1px solid var(--md-line); }
.md-table-wrap th { color: var(--md-ink); font-weight: 600; background: var(--md-mist); }
.md-table-wrap tbody th { width: 30%; }
.md-table-wrap thead th { background: var(--md-mint-bg); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.md-table-wrap thead + tbody tr:first-child th, .md-table-wrap thead + tbody tr:first-child td { border-top: 1px solid var(--md-line); }

/* Facts (label + value) */
.md-facts ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.md-facts li { margin: 0; }
.md-facts li strong { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--md-leaf); font-weight: 700; }
.md-on-dark .md-facts li strong { color: var(--md-amber); }
.md-facts--row ul { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 20px 24px; }

/* Arrow text links */
.md-more { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.md-more a { font-weight: 600; text-decoration: none; }
.md-more a::after { content: " \2192"; }
.md-more a:hover { text-decoration: underline; }

/* Placeholders (logos, photos, screenshots, embeds) */
.md-placeholder {
	display: flex; align-items: center; justify-content: center; text-align: center;
	min-height: 64px; padding: 16px; border: 1px dashed #9DB5A8; border-radius: 12px;
	background: var(--md-white); color: var(--md-muted); font-size: 14px;
}
.md-placeholder--tall { min-height: 260px; background: var(--md-mint-bg); }
.md-logos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
@media (max-width: 767px) { .md-logos { grid-template-columns: repeat(2, 1fr); } }
.md-avatar {
	width: 72px; height: 72px; flex: none; border-radius: 50%; background: var(--md-mint-bg);
	border: 1px dashed #9DB5A8; display: flex; align-items: center; justify-content: center;
	font-size: 11px; color: var(--md-muted);
}
.md-person { display: flex; gap: 18px; align-items: flex-start; }
.md-person__name { font-family: var(--md-head); font-weight: 700; font-size: 19px; color: var(--md-ink); margin: 0 0 2px; }
.md-person__role { font-size: 14px; font-weight: 600; color: var(--md-leaf); margin: 0 0 8px; }
.md-byline { display: flex; align-items: center; gap: 14px; font-size: 15px; }
.md-byline .md-avatar { width: 48px; height: 48px; }
.md-byline span { display: block; color: var(--md-muted); }
.md-on-dark .md-person__name { color: var(--md-white); }
.md-on-dark .md-person__role { color: var(--md-amber); }

/* Stats */
.md-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.md-stat { border-top: 2px solid var(--md-amber); padding-top: 14px; }
.md-stat b, .md-stat strong { display: block; font-family: var(--md-head); font-size: 34px; font-weight: 800; line-height: 1.1; color: var(--md-white); }
.md-stat span { color: var(--md-mint); font-size: 15px; }

/* Quotes */
.md-quote blockquote { margin: 0 0 18px; font-size: 19px; line-height: 1.6; color: var(--md-ink); }
.md-quote figcaption { font-size: 15px; color: var(--md-muted); }
.md-quote figure { margin: 0; }

/* Hills divider */
.md-hills svg { display: block; width: 100%; height: 120px; }
@media (max-width: 767px) { .md-hills svg { height: 70px; } }

/* Breadcrumbs */
.md-crumbs { font-size: 14px; }
.md-crumbs a { text-decoration: none; }
.md-crumbs a:hover { text-decoration: underline; }
.md-on-dark .md-crumbs, .md-on-dark .md-crumbs a { color: var(--md-mint); }

/* Pills */
.md-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.md-pills span { border: 1px solid var(--md-line); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--md-muted); background: var(--md-white); }

/* Forms ----------------------------------------------------------- */
.md-form { display: grid; gap: 18px; }
.md-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .md-form__row { grid-template-columns: 1fr; } }
.md-form label { display: block; font-size: 14px; font-weight: 600; color: var(--md-ink); margin-bottom: 6px; }
.md-form label .md-req { color: #B42318; margin-left: 2px; }
.md-form input[type="text"], .md-form input[type="email"], .md-form input[type="url"],
.md-form select, .md-form textarea {
	width: 100%; font: inherit; font-size: 16px; color: var(--md-ink); background: var(--md-white);
	border: 1px solid #B9CBC1; border-radius: 8px; padding: 12px 14px; min-height: 48px;
}
.md-form textarea { min-height: 140px; resize: vertical; }
.md-form input:focus, .md-form select:focus, .md-form textarea:focus { outline: 3px solid rgba(18, 112, 70, .25); border-color: var(--md-leaf); }
.md-form .md-btn { justify-self: start; font-size: 16px; padding: 15px 26px; }
.md-form__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.md-form__notice { padding: 14px 16px; border-radius: 8px; font-size: 15px; }
.md-form__notice--error { background: #FDECEA; color: #8A1C12; border: 1px solid #F5C2BC; }
@media (max-width: 640px) { .md-form .md-btn { width: 100%; } }
