/*
Theme Name: Teo Jakob Real Estate
Theme URI: https://tjre.digitalpath.pt
Author: Make It Digital
Description: Custom theme for Teo Jakob Real Estate AG — Swiss-minimal, Helvetica Neue, DE/FR/IT/EN via Polylang.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: tjre
*/

/* ==========================================================================
   1. Design tokens — extracted from the Figma file (Desktop/Home)
   ========================================================================== */
:root {
	/* Palette */
	--tj-white: #ffffff;
	--tj-black: #000000;
	--tj-ink: #1e1e1e;
	--tj-red: #e71b13;
	--tj-grey: #7e7e7e;
	--tj-grey-2: #d9d9d9;

	/* Type — Helvetica Neue only, per the design */
	--tj-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
	--tj-fs-body: 17px;
	--tj-lh-body: 23px;
	--tj-fs-h1: 47px;
	--tj-lh-h1: 53px;
	--tj-fs-h2: 32px;
	--tj-lh-h2: 36px;
	--tj-fs-h3: 20px;
	--tj-lh-h3: 25px;
	--tj-fs-small: 14px;
	--tj-lh-small: 18px;

	/* Layout */
	--tj-max: 1440px;
	--tj-gutter: 25px;
	--tj-radius: 14px;
	--tj-pill: 999px;
	--tj-section-y: 96px;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--tj-font);
	font-size: var(--tj-fs-body);
	line-height: var(--tj-lh-body);
	font-weight: 500;
	color: var(--tj-black);
	background: var(--tj-white);
	-webkit-font-smoothing: antialiased;
	-moz-osx-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--tj-red); }

h1, h2, h3, h4 {
	margin: 0 0 24px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0;
}

h1 { font-size: var(--tj-fs-h1); line-height: var(--tj-lh-h1); }
h2 { font-size: var(--tj-fs-h2); line-height: var(--tj-lh-h2); }
h3 { font-size: var(--tj-fs-h3); line-height: var(--tj-lh-h3); text-transform: none; }

p { margin: 0 0 20px; }

/* ==========================================================================
   3. Layout helpers
   ========================================================================== */
.tj-container {
	width: 100%;
	max-width: var(--tj-max);
	margin: 0 auto;
	padding: 0 var(--tj-gutter);
}

.tj-section { padding: var(--tj-section-y) 0; }
.tj-section--grey { background: #f4f4f4; }
.tj-section--black { background: var(--tj-black); color: var(--tj-white); }

.tj-lead { max-width: 62ch; }

.screen-reader-text {
	position: absolute !important;
	clip-path: inset(50%);
	width: 1px; height: 1px;
	overflow: hidden; white-space: nowrap;
}

.tj-skip-link {
	position: absolute; left: -9999px;
	background: var(--tj-black); color: var(--tj-white);
	padding: 12px 20px; z-index: 1000;
}
.tj-skip-link:focus { left: 0; top: 0; }

/* ==========================================================================
   4. Buttons — pill outline, solid black, and the red mark
   ========================================================================== */
.tj-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 28px;
	border: 1px solid var(--tj-black);
	border-radius: var(--tj-pill);
	background: transparent;
	color: var(--tj-black);
	font-size: var(--tj-fs-small);
	line-height: var(--tj-lh-small);
	font-weight: 700;
	text-transform: uppercase;
	cursor: pointer;
	transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.tj-btn:hover { background: var(--tj-black); color: var(--tj-white); }

.tj-btn--solid {
	background: var(--tj-black);
	color: var(--tj-white);
	border-color: var(--tj-black);
}
.tj-btn--solid:hover { background: var(--tj-red); border-color: var(--tj-red); color: var(--tj-white); }

.tj-btn__arrow { flex: 0 0 auto; width: 16px; height: 16px; }

/* ==========================================================================
   5. Header / navigation
   ========================================================================== */
.tj-header {
	position: relative;
	z-index: 20;
	background: var(--tj-white);
}
/* 60px tall, logo left, no border — Figma "Desktop/Navigation". */
.tj-header__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 40px;
	min-height: 60px;
}
.tj-logo { display: inline-flex; align-items: center; }
.tj-logo img { display: block; width: auto; height: 28px; }
.tj-logo__text { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

/* Right side stacks the language switcher above the menu + phone number. */
.tj-header__side {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
}
.tj-header__nav { display: flex; align-items: center; gap: 22px; }

.tj-nav ul { display: flex; align-items: center; gap: 22px; margin: 0; padding: 0; list-style: none; }
.tj-nav a,
.tj-header__phone {
	font-size: var(--tj-fs-body);
	line-height: 22px;
	font-weight: 700;
	color: var(--tj-black);
	text-decoration: none;
	transition: color .18s ease;
}
.tj-nav a:hover,
.tj-header__phone:hover { color: var(--tj-red); }
.tj-nav .current-menu-item > a { color: var(--tj-red); }

.tj-header__langs { display: flex; }
.tj-langs { display: flex; gap: 8px; align-items: center; margin: 0; padding: 0; list-style: none; }
.tj-langs a { font-size: 13px; line-height: 13px; font-weight: 700; color: #7d7d7d; text-decoration: none; }
.tj-langs a:hover,
.tj-langs .lang-item-active a { color: var(--tj-red); }

/* Burger — hidden on desktop, shown once the menu collapses. */
.tj-burger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}
.tj-burger__bar {
	display: block;
	width: 100%;
	height: 2px;
	background: var(--tj-black);
	transition: transform .2s ease, opacity .2s ease;
}
.tj-header.is-menu-open .tj-burger__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.tj-header.is-menu-open .tj-burger__bar:nth-child(2) { opacity: 0; }
.tj-header.is-menu-open .tj-burger__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   6. Hero
   ========================================================================== */
.tj-hero {
	position: relative;
	height: 703px;
	overflow: hidden;
	color: var(--tj-black);
}
.tj-hero__media { position: absolute; inset: 0; }
.tj-hero__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity .9s ease;
}
.tj-hero__img.is-active { opacity: 1; }
/* Faint white wash so the black headline stays legible on any photograph. */
.tj-hero__scrim {
	position: absolute;
	inset: 0 0 auto;
	height: 280px;
	background: linear-gradient(180deg, rgba(255,255,255,.72) 0%, rgba(255,255,255,0) 100%);
	pointer-events: none;
}
.tj-hero__inner { position: absolute; top: 35px; left: 0; right: 0; z-index: 2; }
/* Figma: textAutoResize WIDTH_AND_HEIGHT — a single 743px line at 47px.
   No max-width here: any cap forces a wrap the design does not have.
   It still wraps naturally once the viewport is narrower than the line. */
.tj-hero__title { color: var(--tj-black); }
.tj-hero__actions {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 40px;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 25px;
}
.tj-btn.tj-hero__btn {
	min-width: 180px;
	height: 50px;
	padding: 0 15px 0 20px;
	justify-content: space-between;
	gap: 16px;
	border: 0;
	border-radius: 0;
	background: var(--tj-white);
	color: var(--tj-black);
	font-size: var(--tj-fs-body);
}
.tj-btn.tj-hero__btn:hover { background: var(--tj-black); color: var(--tj-white); }
.tj-hero__dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 12px;
	z-index: 2;
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.tj-hero__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0,0,0,.28);
	cursor: pointer;
}
.tj-hero__dot.is-active { background: var(--tj-red); }

/* "Signature Property" badge — 234px, 120px in from the content edge,
   108px off the bottom, per Figma "Desktop/Header". */
.tj-hero__seal {
	position: absolute;
	right: calc(max(0px, (100% - var(--tj-max)) / 2) + 120px);
	bottom: 108px;
	width: 234px;
	height: 234px;
	z-index: 2;
	pointer-events: none;
}

/* Valuation card that overlaps the hero image */
.tj-card-valuation {
	position: relative;
	background: var(--tj-white);
	color: var(--tj-black);
	border-radius: var(--tj-radius);
	padding: 40px;
	max-width: 620px;
	box-shadow: 0 18px 50px rgba(0,0,0,.12);
}
.tj-card-valuation ul { margin: 0 0 24px; padding-left: 20px; }
.tj-card-valuation li { margin-bottom: 8px; }

/* ==========================================================================
   7. Valuation comparison (two circles)
   ========================================================================== */
.tj-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.tj-circle {
	width: 260px; height: 260px;
	border-radius: 50%;
	display: grid; place-items: center;
	text-align: center;
	padding: 24px;
	font-weight: 700; text-transform: uppercase;
	font-size: var(--tj-fs-small); line-height: var(--tj-lh-small);
}
.tj-circle--grey { background: var(--tj-grey-2); color: var(--tj-black); }
.tj-circle--red { background: var(--tj-red); color: var(--tj-white); }

/* ==========================================================================
   8. Buy / Sell split
   ========================================================================== */
.tj-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.tj-split__col {
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
	padding: 56px 48px;
	border-top: 1px solid var(--tj-black);
}
.tj-split__col + .tj-split__col { border-left: 1px solid var(--tj-black); }
.tj-split__col h2 { margin: 0; }
.tj-split__col .tj-arrow { flex: 0 0 auto; }

/* ==========================================================================
   9. Sold-properties carousel
   ========================================================================== */
.tj-carousel { position: relative; }
.tj-carousel__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 300px;
	gap: 24px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 16px;
	scrollbar-width: none;
}
.tj-carousel__track::-webkit-scrollbar { display: none; }

.tj-property {
	position: relative;
	scroll-snap-align: start;
	background: var(--tj-white);
}
.tj-property__media { position: relative; overflow: hidden; }
.tj-property__media img { width: 100%; height: 380px; object-fit: cover; }
.tj-property__badge {
	position: absolute; top: 0; left: 0;
	background: var(--tj-black); color: var(--tj-white);
	padding: 6px 14px;
	font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.tj-property__seal {
	position: absolute; top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: 96px; height: 96px; border-radius: 50%;
	background: rgba(255,255,255,.92);
	display: grid; place-items: center; text-align: center;
	font-size: 9px; font-weight: 700; text-transform: uppercase; line-height: 1.2;
	padding: 8px;
}
.tj-property__body { padding: 18px 0 0; }
.tj-property__title { font-weight: 700; text-transform: none; font-size: var(--tj-fs-body); margin: 0 0 4px; }
.tj-property__meta { color: var(--tj-grey); font-size: var(--tj-fs-small); line-height: var(--tj-lh-small); margin: 0; }
.tj-property__price { font-weight: 700; margin: 8px 0 0; }

.tj-carousel__nav { display: flex; gap: 12px; margin-top: 8px; }
.tj-carousel__nav button {
	width: 44px; height: 44px; border-radius: 50%;
	border: 1px solid var(--tj-black); background: transparent;
	display: grid; place-items: center; cursor: pointer;
}
.tj-carousel__nav button:hover { background: var(--tj-black); color: var(--tj-white); }

/* ==========================================================================
   10. Expertise / article list
   ========================================================================== */
.tj-articles { display: grid; gap: 40px; }
.tj-article-wide {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
	align-items: center;
}
.tj-article-wide:nth-child(even) .tj-article-wide__media { order: 2; }
.tj-article-wide__media img { width: 100%; height: 380px; object-fit: cover; }

/* ==========================================================================
   11. Contact + lead form
   ========================================================================== */
.tj-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.tj-contact__portrait img { width: 100%; height: 520px; object-fit: cover; filter: grayscale(100%); }
.tj-contact__role { color: var(--tj-grey); font-size: var(--tj-fs-small); }
.tj-contact__details { margin-top: 20px; }
.tj-contact__details a { display: block; }

.tj-form { display: grid; gap: 18px; }
.tj-form__row { display: grid; gap: 18px; }
.tj-form label {
	display: block;
	font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
	margin-bottom: 6px;
}
.tj-form input[type="text"],
.tj-form input[type="email"],
.tj-form input[type="tel"],
.tj-form textarea {
	width: 100%;
	border: 1px solid var(--tj-black);
	border-radius: 0;
	padding: 14px 16px;
	font: inherit;
	background: var(--tj-white);
	color: var(--tj-black);
}
.tj-form textarea { min-height: 140px; resize: vertical; }
.tj-form input:focus, .tj-form textarea:focus { outline: 2px solid var(--tj-red); outline-offset: 1px; }
.tj-form__consent { display: flex; gap: 10px; align-items: flex-start; font-size: var(--tj-fs-small); }

/* ==========================================================================
   12. Footer
   ========================================================================== */
.tj-footer { background: #f4f4f4; color: var(--tj-black); padding: 72px 0 32px; }
.tj-footer__grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 48px; }
.tj-footer h3 { text-transform: uppercase; font-size: var(--tj-fs-small); letter-spacing: .06em; }
.tj-footer__address { font-style: normal; line-height: 1.6; }
.tj-newsletter { display: flex; gap: 10px; align-items: stretch; }
.tj-newsletter input { flex: 1 1 auto; min-width: 0; }
.tj-newsletter .tj-btn { flex: 0 0 auto; white-space: nowrap; }

.tj-footer__legal {
	margin-top: 56px; padding-top: 24px;
	border-top: 1px solid var(--tj-grey-2);
	display: flex; flex-wrap: wrap; gap: 20px;
	font-size: var(--tj-fs-small); color: var(--tj-grey);
}
.tj-footer__legal nav { display: flex; gap: 20px; }

/* ==========================================================================
   13. Responsive
   ========================================================================== */
@media (max-width: 1200px) {
	:root { --tj-section-y: 72px; --tj-fs-h1: 38px; --tj-lh-h1: 44px; }
}

@media (max-width: 900px) {
	:root { --tj-gutter: 20px; --tj-fs-h1: 32px; --tj-lh-h1: 38px; --tj-fs-h2: 26px; }
	.tj-compare, .tj-split, .tj-contact, .tj-article-wide, .tj-footer__grid { grid-template-columns: 1fr; }
	.tj-split__col + .tj-split__col { border-left: 0; }
	.tj-article-wide:nth-child(even) .tj-article-wide__media { order: 0; }
	.tj-hero { height: 520px; }
	.tj-hero__inner { top: 24px; }
	.tj-hero__actions { bottom: 28px; }
	.tj-hero__seal { display: none; }
	.tj-contact__portrait img { height: 380px; }
	.tj-header__bar { gap: 16px; }
	.tj-logo img { max-width: 150px; height: auto; }
	.tj-header__phone { white-space: nowrap; font-size: 15px; }
	.tj-header__nav { gap: 16px; }
	.tj-burger { display: inline-flex; }
	.tj-nav { display: none; }
	.tj-header.is-menu-open .tj-nav {
		display: block;
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		padding: 16px var(--tj-gutter) 24px;
		background: var(--tj-white);
		border-top: 1px solid var(--tj-grey-2);
		box-shadow: 0 18px 30px rgba(0,0,0,.08);
	}
	.tj-header.is-menu-open .tj-nav ul { flex-direction: column; align-items: flex-start; gap: 16px; }
	.tj-header.is-menu-open .tj-nav a { font-size: 20px; line-height: 26px; }
}

@media (max-width: 600px) {
	.tj-carousel__track { grid-auto-columns: 78vw; }
	.tj-circle { width: 200px; height: 200px; }
}

/* ==========================================================================
   14. Component extras
   ========================================================================== */
.tj-sold h2 { margin-bottom: 40px; }
.tj-contact-section h2 { margin-bottom: 48px; max-width: 26ch; }

.tj-appraisal__media img { width: 100%; height: 640px; object-fit: cover; }
.tj-appraisal .tj-card-valuation { margin: -140px auto 0; }

.tj-arrow__icon { width: 28px; height: 28px; }
.tj-arrow__icon--left { transform: rotate(180deg); }

/* Archive grid reuses the carousel track styles without the scroller. */
.tj-archive-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 32px;
	overflow: visible;
}

.tj-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 40px; }

.tj-property-single__hero img { width: 100%; height: 560px; object-fit: cover; margin: 32px 0; }
.tj-property-single__gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
	margin: 32px 0;
}
.tj-property-single__gallery img { width: 100%; height: 220px; object-fit: cover; }
.tj-property-single__facts {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 8px 24px;
	margin: 32px 0;
}
.tj-property-single__facts dt { font-weight: 700; text-transform: uppercase; font-size: var(--tj-fs-small); }
.tj-property-single__facts dd { margin: 0; }

.tj-form__notice {
	background: var(--tj-grey-2);
	padding: 14px 18px;
	border-left: 3px solid var(--tj-red);
	margin-bottom: 24px;
}

.tj-footer__menu { list-style: none; margin: 0; padding: 0; }
.tj-footer__menu li { margin-bottom: 10px; }
.tj-footer__menu a { font-size: var(--tj-fs-small); }

.tj-searchform { display: flex; gap: 10px; }

/* Motion preference */
@media (prefers-reduced-motion: reduce) {
	* { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
