/* ==========================================================================
   Morada theme — base, header, mobile navigation, footer.
   Components (sections, cards, forms) live in the Morada Core plugin.
   ========================================================================== */

/* Reset & base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
	margin: 0;
	background: var(--mb-bg, #f7f4ee);
	color: var(--mb-text, #3b3934);
	font-family: var(--mb-sans, "Manrope", system-ui, sans-serif);
	font-size: 1rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
svg.mb-icon { display: inline-block; }
a { color: var(--mb-green, #1e3a32); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, h4 { font-family: var(--mb-serif); font-weight: 400; line-height: 1.15; color: var(--mb-ink); }
:focus-visible { outline: 3px solid var(--mb-wood-light, #c19a6b); outline-offset: 3px; }
::selection { background: #d9e5df; color: var(--mb-ink); }
.site-main { display: block; min-height: 50vh; }
.site-main:focus { outline: none; }

.skip-link {
	position: absolute; left: 12px; top: -100px; z-index: 1000; padding: .8rem 1.2rem; border-radius: 8px;
	background: var(--mb-green); color: #fff; font-weight: 700; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* Header ------------------------------------------------------------------- */
.site-header {
	position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--mb-header-h);
	background: rgba(247, 244, 238, .92); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
	border-bottom: 1px solid rgba(226, 217, 202, .7);
	transition: background-color .35s var(--mb-ease), border-color .35s, box-shadow .35s, height .35s var(--mb-ease), color .35s;
}
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { body.admin-bar .site-header { position: absolute; } body.admin-bar.is-scrolled .site-header { position: fixed; top: 0; } }
.site-header.is-scrolled { box-shadow: 0 6px 24px rgba(29, 28, 26, .06); }

.has-dark-hero .site-header:not(.is-scrolled):not(.nav-open) { background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; color: #fff; }
.has-dark-hero .site-header:not(.is-scrolled):not(.nav-open) .site-brand__name,
.has-dark-hero .site-header:not(.is-scrolled):not(.nav-open) .site-nav a { color: #fff; }
.has-dark-hero .site-header:not(.is-scrolled):not(.nav-open) .site-brand__logo { filter: brightness(0) invert(1); }
.has-dark-hero .site-header:not(.is-scrolled):not(.nav-open) .header-cta--fin { --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, .65); }
.has-dark-hero .site-header:not(.is-scrolled):not(.nav-open) .header-cta--fin:hover { --btn-bg: #fff; --btn-fg: var(--mb-green); }
.has-dark-hero .site-header:not(.is-scrolled):not(.nav-open) .header-cta--orc,
.has-dark-hero .site-header:not(.is-scrolled):not(.nav-open) .header-cta--mobile { --btn-bg: #fff; --btn-fg: var(--mb-green); --btn-bd: #fff; }
.has-dark-hero .site-header:not(.is-scrolled):not(.nav-open) .site-header__burger span { background: #fff; }
.has-dark-hero .site-header:not(.is-scrolled):not(.nav-open) .site-nav a::after { background: #fff; }

.site-header__inner {
	height: 100%; display: flex; align-items: center; gap: 1.5rem;
	max-width: calc(var(--mb-container) + 2 * var(--mb-gutter) + 80px); margin-inline: auto; padding-inline: var(--mb-gutter);
}

.site-brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--mb-ink); flex: none; min-height: 44px; }
.site-brand__logo { height: 40px; width: auto; max-width: 180px; object-fit: contain; transition: filter .35s; }
.site-brand__name { font-family: var(--mb-serif); font-size: 1.35rem; line-height: 1; letter-spacing: -.01em; color: var(--mb-ink); white-space: nowrap; font-variation-settings: "opsz" 72, "SOFT" 50; transition: color .35s; }

.site-nav { margin-left: auto; display: none; }
.site-nav__menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: clamp(.9rem, 1.4vw, 1.75rem); }
.site-nav a {
	position: relative; display: inline-flex; align-items: center; min-height: 44px; color: var(--mb-text);
	text-decoration: none; font-size: .92rem; font-weight: 600; white-space: nowrap; transition: color .25s;
}
.site-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 1.5px; background: var(--mb-green); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--mb-ease); }
.site-nav a:hover { color: var(--mb-green); }
.site-nav a:hover::after, .site-nav .current-menu-item > a::after, .site-nav .current_page_item > a::after { transform: scaleX(1); }
.site-nav .current-menu-item > a, .site-nav .current_page_item > a { color: var(--mb-green); }

.site-header__actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.header-cta { display: none; white-space: nowrap; flex: none; }
.site-header__actions { flex: none; }
.header-cta--fin { --btn-bg: transparent; --btn-fg: var(--mb-green); --btn-bd: var(--mb-wood-light); }
.header-cta--fin:hover { --btn-bg: var(--mb-sand); --btn-bd: var(--mb-wood); --btn-fg: var(--mb-green); box-shadow: none; }
.header-cta--fin .mb-icon { width: 16px; height: 16px; color: var(--mb-wood); }
.has-dark-hero .site-header:not(.is-scrolled):not(.nav-open) .header-cta--fin .mb-icon { color: #e8d6bd; }
.header-cta--mobile { min-height: 40px; padding: .5rem .95rem; font-size: .7rem; letter-spacing: .1em; }

.site-header__toggle {
	display: inline-grid; place-items: center; width: 46px; height: 46px; border: 0; background: transparent; border-radius: 50%;
	cursor: pointer; color: inherit; -webkit-tap-highlight-color: transparent;
}
.site-header__toggle:hover { background: rgba(30, 58, 50, .06); }
.site-header__burger { position: relative; width: 22px; height: 14px; display: block; }
.site-header__burger span { position: absolute; left: 0; width: 100%; height: 1.8px; border-radius: 2px; background: var(--mb-ink); transition: transform .35s var(--mb-ease), opacity .2s, top .35s var(--mb-ease), background-color .35s; }
.site-header__burger span:nth-child(1) { top: 0; }
.site-header__burger span:nth-child(2) { top: 6px; }
.site-header__burger span:nth-child(3) { top: 12px; }
.nav-open .site-header__burger span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.nav-open .site-header__burger span:nth-child(2) { opacity: 0; }
.nav-open .site-header__burger span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

@media (min-width: 720px) {
	.header-cta--orc, .header-cta--fin { display: inline-flex; }
	.header-cta--mobile { display: none; }
}
@media (min-width: 1280px) {
	.site-nav { display: block; }
	.site-header__actions { margin-left: 0; }
	.site-header__toggle { display: none; }
	.mobile-panel { display: none !important; }
}
@media (min-width: 1280px) and (max-width: 1439px) {
	.site-header__inner { gap: 1.1rem; }
	.site-nav__menu { gap: .95rem; }
	.site-nav a { font-size: .86rem; }
	.header-cta { padding-inline: .9rem; }
	.header-cta--fin .mb-icon { display: none; }
}
@media (max-width: 380px) {
	.site-brand__name { font-size: 1.1rem; }
	.site-brand__logo { height: 34px; max-width: 120px; }
	.site-header__inner { gap: .5rem; }
	.header-cta--mobile { padding-inline: .75rem; }
}
@media (max-width: 340px) {
	.has-logo .site-brand__name { display: none; }
}

/* Mobile panel ------------------------------------------------------------- */
.mobile-panel {
	position: fixed; inset: var(--mb-header-h) 0 0 0; z-index: 99; background: var(--mb-bg); overflow-y: auto; overscroll-behavior: contain;
	opacity: 0; transform: translateY(-8px); transition: opacity .3s var(--mb-ease), transform .3s var(--mb-ease);
}
body.admin-bar .mobile-panel { top: calc(var(--mb-header-h) + 46px); }
@media (min-width: 783px) { body.admin-bar .mobile-panel { top: calc(var(--mb-header-h) + 32px); } }
.mobile-panel.is-open { opacity: 1; transform: none; }
.mobile-panel__inner { padding: 12px var(--mb-gutter) 40px; max-width: 640px; margin-inline: auto; }
.mobile-panel__menu { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.mobile-panel__menu li { border-bottom: 1px solid var(--mb-line); }
.mobile-panel__menu a {
	display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: .5rem 0;
	font-family: var(--mb-serif); font-size: 1.5rem; color: var(--mb-ink); text-decoration: none;
}
.mobile-panel__menu a::after { content: "→"; font-family: var(--mb-sans); font-size: 1rem; color: var(--mb-wood); transition: transform .25s; }
.mobile-panel__menu a:hover::after { transform: translateX(4px); }
.mobile-panel__menu .current-menu-item > a { color: var(--mb-green); }
.mobile-panel__ctas { display: grid; gap: 10px; margin-bottom: 2rem; }
.mobile-panel__ctas .header-cta { display: inline-flex; min-height: 54px; font-size: .8rem; }
.mobile-panel .footer-contacts { color: var(--mb-text); }
.mobile-panel .footer-contacts a { color: var(--mb-green); }
body.nav-locked { overflow: hidden; }

/* Footer ------------------------------------------------------------------- */
.site-footer { background: var(--mb-night); color: #b8c3be; padding: clamp(56px, 8vw, 96px) 0 28px; font-size: .95rem; }
.site-footer a { color: #e6ece9; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__top { display: grid; gap: 48px; padding-bottom: clamp(40px, 6vw, 64px); border-bottom: 1px solid rgba(255, 255, 255, .1); }
@media (min-width: 1000px) { .site-footer__top { grid-template-columns: minmax(280px, 1.1fr) 2fr; gap: 64px; } .site-footer__top.no-brand { grid-template-columns: 1fr; } }
.site-footer__brand { max-width: 420px; }
.site-footer .site-brand { color: #fff; margin-bottom: 1rem; }
.site-footer .site-brand__name { color: #fff; font-size: 1.6rem; }
.site-footer .site-brand__logo { filter: brightness(0) invert(1); height: 44px; }
.site-footer__desc { margin: 0 0 1.5rem; line-height: 1.7; }
.footer-contacts { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: .9rem; }
.footer-contacts li { display: flex; gap: .8rem; align-items: flex-start; line-height: 1.55; }
.footer-contacts .mb-icon { width: 20px; height: 20px; color: var(--mb-wood-light); margin-top: 2px; flex: none; }
.footer-contacts small { display: block; font-size: .78rem; opacity: .75; }
.footer-contacts a { overflow-wrap: anywhere; }
.mb-social--footer a { border-color: rgba(255, 255, 255, .2); color: #fff; }
.mb-social--footer a:hover { background: #fff; color: var(--mb-green); border-color: #fff; text-decoration: none; }
.site-footer__cols { display: grid; gap: 36px 24px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .site-footer__cols { grid-template-columns: repeat(3, 1fr); } }
.site-footer__title { font-family: var(--mb-sans); font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--mb-wood-light); margin: 0 0 1.1rem; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.footer-menu a { display: inline-flex; min-height: 36px; align-items: center; }
.site-footer__bottom { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; padding-top: 24px; font-size: .85rem; }
.site-footer__copy { margin: 0; }
.site-footer__nif { display: inline-block; margin-left: .5rem; opacity: .75; }
.site-footer__livro { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .4rem .9rem; border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; }
.site-footer__livro .mb-icon { width: 18px; height: 18px; }
.site-footer__livro:hover { background: rgba(255, 255, 255, .08); text-decoration: none !important; }

/* Generic pages ----------------------------------------------------------- */
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2 { font-size: 1.7rem; margin-top: 2em; }
.entry-summary { padding: 1.75rem 0; border-bottom: 1px solid var(--mb-line); }
.entry-summary__title { font-size: 1.6rem; margin: 0 0 .4rem; }
.entry-summary__title a { color: var(--mb-ink); text-decoration: none; }
.entry-summary__meta { margin: 0 0 .75rem; color: var(--mb-muted); font-size: .9rem; }
.nav-links { display: flex; gap: .5rem; margin-top: 2rem; }
.nav-links .page-numbers { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 .75rem; border-radius: 999px; border: 1px solid var(--mb-line); text-decoration: none; }
.nav-links .current { background: var(--mb-green); color: #fff; border-color: var(--mb-green); }
.error-404 { min-height: 70vh; display: flex; align-items: center; }

/* Elementor integration --------------------------------------------------- */
.elementor-page .site-main > .elementor { width: 100%; }
.page .site-main > .elementor > .e-con:first-child, .page .site-main > .elementor > .elementor-section:first-child { margin-top: 0; }
