/* ===================================================================
   Pain & Spine Center - main stylesheet
   Brand palette/type per pain-spine-center-logo.pdf: Azul Marinho #02223f,
   Cinza #86909a, headings in Adobe Arabic (licensed font - not bundled
   here, falls back to Georgia), UI/body text in Montserrat (self-hosted,
   see assets/fonts/montserrat-latin.woff2).
   =================================================================== */

@font-face {
	font-family: 'Montserrat';
	src: url('../fonts/montserrat-latin.woff2') format('woff2');
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

:root {
	/* Blue family, all derived from the brand navy #02223f - kept to blue
	   variations rather than mixing in the brand gray as a background
	   color, which read as a flat, muddy block in large areas. Gray is
	   reserved for small supporting text/borders, as in the logo. */
	--color-primary: #02223f;
	--color-primary-dark: #010e1c;
	--color-primary-mid: #123f6b;
	--color-primary-soft: #3a6ea5;
	--color-primary-light: #e4ebf3;
	--color-gray: #86909a;
	--color-text: #1c2530;
	--color-text-muted: #56626c;
	--color-bg: #ffffff;
	--color-bg-muted: #f4f5f7;
	--color-border: #e2e5e9;
	--radius: 14px;
	--shadow: 0 10px 30px rgba(2, 34, 63, 0.1);
	--font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-heading: 'Adobe Arabic', Georgia, "Times New Roman", serif;
}

.eyebrow {
	font-family: var(--font-body);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.25em;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font-body);
	color: var(--color-text);
	background: var(--color-bg);
	line-height: 1.6;
	font-size: 16px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }

h1, h2, h3, h4 {
	font-family: var(--font-heading);
	color: var(--color-primary-dark);
	line-height: 1.2;
	margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.container {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 24px;
}

.section { padding: 72px 0; }
.section--muted { background: var(--color-bg-muted); }
.section--center { text-align: center; }
.section--narrow { max-width: 860px; }
main .section--narrow { padding-top: 0; }

.section__heading {
	max-width: 640px;
	margin: 0 auto 40px;
	text-align: center;
}
.section__heading p { color: var(--color-text-muted); }
.section__cta { text-align: center; margin: 32px 0 0; }

/* Ambient spine/knee illustrations, scattered through a few content
   sections (see theme/assets/icons/decor-spine.png, decor-knee.png -
   cropped from the same treatment icon artwork, minus their circular
   badge ring) so the site isn't only text + brand-mark watermarks. */
.section--decor-spine-left,
.section--decor-spine-right,
.section--decor-knee-right { position: relative; overflow: hidden; }

.section--decor-spine-left::before,
.section--decor-spine-right::after {
	content: '';
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 200px;
	height: 220px;
	background: url('../icons/decor-spine.png') no-repeat center / contain;
	opacity: 0.14;
	pointer-events: none;
}
.section--decor-spine-left::before { left: -30px; }
.section--decor-spine-right::after { right: -30px; }

.section--decor-knee-right::after {
	content: '';
	position: absolute;
	right: -20px;
	bottom: -10px;
	width: 190px;
	height: 190px;
	background: url('../icons/decor-knee.png') no-repeat center / contain;
	opacity: 0.14;
	pointer-events: none;
}

@media (max-width: 900px) {
	.section--decor-spine-left::before,
	.section--decor-spine-right::after,
	.section--decor-knee-right::after {
		display: none;
	}
}

.screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
}

/* ---------- Icons ---------- */
.icon { width: 28px; height: 28px; color: var(--color-primary); flex-shrink: 0; }
.icon--sm { width: 16px; height: 16px; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 13px 26px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.95rem;
	border: 2px solid transparent;
	cursor: pointer;
	transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-dark); color: #fff; transform: translateY(-1px); }
.btn--outline { border-color: var(--color-primary); color: var(--color-primary); }
.btn--outline:hover { background: var(--color-primary); color: #fff; }
.btn--light { background: #fff; color: var(--color-primary-dark); }
.btn--light:hover { background: var(--color-bg-muted); }
.btn--nav { margin-left: 12px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--color-primary-dark); color: #ccd4db; font-size: 0.85rem; }
.topbar__inner { display: flex; justify-content: space-between; align-items: center; padding: 8px 24px; flex-wrap: wrap; gap: 6px; }
.topbar__contact { display: flex; gap: 24px; flex-wrap: wrap; }
.topbar__contact a { color: #ccd4db; display: inline-flex; align-items: center; gap: 6px; }
.topbar__contact a:hover { color: #fff; }
.topbar .icon { width: 14px; height: 14px; color: inherit; }
.topbar__note { opacity: 0.85; }

/* ---------- Header / nav ---------- */
.site-header { border-bottom: 1px solid var(--color-border); background: #fff; position: sticky; top: 0; z-index: 40; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; gap: 24px; }
.site-logo { display: flex; align-items: center; }
.site-logo, .site-logo a { display: flex; align-items: center; }
.site-logo img,
.site-logo .custom-logo { max-height: 56px; width: auto; max-width: 260px; }
.site-logo__text { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 700; color: var(--color-primary-dark); }
.footer__logo { height: 40px; width: auto; margin-bottom: 16px; }

.nav-toggle {
	display: none;
	flex-direction: column;
	gap: 5px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 6px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--color-primary-dark); display: block; }

.primary-nav { display: flex; align-items: center; }
.nav-menu { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-menu li { position: relative; }
.nav-menu > li > a {
	display: block;
	padding: 10px 14px;
	color: var(--color-text);
	font-weight: 600;
	font-size: 0.95rem;
	border-radius: 8px;
}
.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-parent > a,
.nav-menu > li.current-menu-ancestor > a { color: var(--color-primary); background: var(--color-primary-light); }

.nav-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 8px;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 240px;
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: 10px;
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.15s ease, transform 0.15s ease;
	z-index: 50;
}
.nav-menu li:hover > .sub-menu,
.nav-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-menu .sub-menu a { padding: 10px 12px; border-radius: 6px; display: block; font-weight: 500; }
.nav-menu .sub-menu a:hover { background: var(--color-primary-light); color: var(--color-primary); }
.nav-menu li.menu-item-has-children > a::after { content: " \25BE"; font-size: 0.7em; }

/* ---------- Hero ---------- */
.hero--home {
	position: relative;
	overflow: hidden;
	background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary) 55%, var(--color-primary-mid));
	color: #fff;
	padding: 96px 0;
}
.hero--home h1 { color: #fff; }
.hero__lede { font-size: 1.15rem; max-width: 620px; color: rgba(255,255,255,0.9); }
.hero__actions { display: flex; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.hero--home .btn--outline { border-color: #fff; color: #fff; }
.hero--home .btn--outline:hover { background: #fff; color: var(--color-primary-dark); }

/* Brand-mark watermark filling the empty space a hero photo would
   normally take, since we have no real photography to show yet. */
.hero__decoration {
	position: absolute;
	top: 50%;
	right: -40px;
	transform: translateY(-50%);
	width: 440px;
	max-width: 45vw;
	opacity: 0.16;
	pointer-events: none;
}
@media (max-width: 900px) {
	.hero__decoration { display: none; }
}

.hero--simple {
	position: relative;
	overflow: hidden;
	background: var(--color-bg-muted);
	padding: 56px 0;
	border-bottom: 1px solid var(--color-border);
}
.hero--simple .hero__lede { color: var(--color-text-muted); }
.hero--simple h1 { display: flex; align-items: center; gap: 16px; }
.hero__icon { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; background: var(--color-primary-light); border-radius: 50%; flex-shrink: 0; }
.hero__icon .icon { width: 24px; height: 24px; }

/* Same brand-mark watermark idea as .hero--home, applied via CSS so every
   page using this hero (Tratamentos, Contactos, Áreas de Dor...) gets it
   without editing each template. */
.hero--simple::before {
	content: '';
	position: absolute;
	top: 50%;
	right: -30px;
	transform: translateY(-50%);
	width: 300px;
	height: 300px;
	background: url('../logo/icon.png') no-repeat center / contain;
	opacity: 0.1;
	pointer-events: none;
}
@media (max-width: 900px) {
	.hero--simple::before { display: none; }
}

/* Real illustrated icons (see theme/assets/icons) already carry their own
   circular outline, so they get a bigger, background-less badge instead of
   sitting inside the flat-color placeholder badge used for the SVG icons. */
.card__icon-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.card__icon:has(.card__icon-img),
.hero__icon:has(.card__icon-img) {
	background: transparent;
	width: 64px;
	height: 64px;
}

.breadcrumb { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 12px; }
.breadcrumb a { color: var(--color-text-muted); text-decoration: underline; }

/* ---------- Cards ---------- */
.card-grid { display: grid; gap: 24px; margin-top: 8px; }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 28px;
	box-shadow: var(--shadow);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(13, 92, 99, 0.14); }
.card__icon {
	display: inline-flex;
	width: 52px; height: 52px;
	align-items: center; justify-content: center;
	background: var(--color-primary-light);
	border-radius: 50%;
	margin-bottom: 6px;
}
.card h3 { margin-bottom: 4px; }
.card p { color: var(--color-text-muted); font-size: 0.95rem; flex-grow: 1; }
.card__link { font-weight: 600; color: var(--color-primary); }
.card.is-current { border-color: var(--color-primary); background: var(--color-primary-light); }

/* ---------- Prose (rich text content) ---------- */
.prose h2 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; }
.content-block { max-width: 860px; margin: 0 auto; }

.indications-box {
	background: var(--color-bg-muted);
	border-left: 4px solid var(--color-primary);
	border-radius: 10px;
	padding: 24px 28px;
	margin: 32px 0;
}
.indications-box h2 { margin-top: 0; font-size: 1.1rem; }
.indications-box ul { margin: 0; padding-left: 1.2em; }

.cta-inline { margin: 32px 0; }

/* ---------- Testimonials ---------- */
.testimonial-grid { display: grid; gap: 24px; grid-template-columns: repeat(3, 1fr); }
.testimonial {
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 28px;
	margin: 0;
	box-shadow: var(--shadow);
}
.testimonial p { font-style: italic; color: var(--color-text); }
.testimonial cite { font-style: normal; font-weight: 600; color: var(--color-text-muted); font-size: 0.9rem; }

/* ---------- CTA strip ---------- */
.cta-strip { background: linear-gradient(120deg, var(--color-primary), var(--color-primary-mid)); color: #fff; padding: 48px 0; }
.cta-strip__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-strip h2 { color: #fff; margin-bottom: 6px; }
.cta-strip p { margin: 0; color: rgba(255,255,255,0.85); }

/* ---------- Forms ---------- */
.contact-form { max-width: 560px; }
.form-row { margin-bottom: 18px; }
.form-row--split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row--hidden { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.contact-form input,
.contact-form textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--color-border);
	border-radius: 8px;
	font-family: inherit;
	font-size: 1rem;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: 2px solid var(--color-primary); border-color: var(--color-primary); }

.form-notice { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; font-weight: 600; }
.form-notice--success { background: #e5f4ea; color: #1f7a3f; }
.form-notice--error { background: #fbe9e7; color: #b3361c; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.contact-details { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.contact-details li { display: flex; flex-direction: column; gap: 4px; }
.contact-details strong { display: flex; align-items: center; gap: 8px; color: var(--color-primary-dark); }
.contact-details .icon { width: 20px; height: 20px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-primary-dark); color: #c3ccd4; }
.footer__grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr 1.4fr;
	gap: 40px;
	padding: 56px 24px 40px;
}
.footer__col h3 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.footer__links, .footer__contact { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer__links a { color: #c3ccd4; }
.footer__links a:hover { color: #fff; }
.footer__contact li { display: flex; align-items: center; gap: 8px; }
.footer__contact .icon, .footer__contact svg { color: #c3ccd4; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,0.12); }
.footer__bottom-inner { padding: 18px 24px; font-size: 0.85rem; color: #93a0ab; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.card-grid--3 { grid-template-columns: 1fr 1fr; }
	.testimonial-grid { grid-template-columns: 1fr 1fr; }
	.footer__grid { grid-template-columns: 1fr 1fr; }
	.contact-grid { grid-template-columns: 1fr; }
}

/* Nav collapses to the hamburger menu earlier than the rest of the layout
   reflows, since the logo plus the full menu and CTA button don't fit
   comfortably on tablet/small-laptop widths even though there's still
   room for a 2-column card grid etc. */
@media (max-width: 1040px) {
	.nav-toggle { display: flex; }
	.primary-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: #fff;
		border-bottom: 1px solid var(--color-border);
		padding: 16px 24px 24px;
	}
	.primary-nav.is-open { display: block; }
	.site-header { position: relative; }
	.nav-menu { flex-direction: column; align-items: flex-start; width: 100%; }
	.nav-menu .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding-left: 12px; display: none; }
	.nav-menu li.is-open > .sub-menu { display: block; }
	.btn--nav { margin-left: 0; margin-top: 12px; width: 100%; justify-content: center; }
}

@media (max-width: 680px) {
	.topbar__inner { flex-direction: column; align-items: flex-start; }
	.card-grid--3 { grid-template-columns: 1fr; }
	.testimonial-grid { grid-template-columns: 1fr; }
	.footer__grid { grid-template-columns: 1fr; padding: 40px 24px; }
	.form-row--split { grid-template-columns: 1fr; }
	.cta-strip__inner { flex-direction: column; align-items: flex-start; }
}
