/*
 * Terraços da Luz — theme base layer.
 *
 * Component styles are Bricks global classes (editable in the builder).
 * This file only holds what Bricks classes can't express well: self-hosted
 * fonts, the base reset, inline-text utilities, interactive states
 * (drawer, nav reveal, age gate) and motion.
 */

/* ── Fonts (self-hosted, no third-party requests) ──────────────────────── */
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/cormorant-garamond-variable-latin.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; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/cormorant-garamond-variable-latin-ext.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: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/geist-variable-latin.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; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/geist-variable-latin-ext.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: "Stigmature"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/stigmature.otf") format("opentype"); }
/* Metric-matched fallbacks keep layout shift near zero while the web fonts load. */
@font-face { font-family: "Cormorant Garamond Fallback"; src: local("Times New Roman"); ascent-override: 95.27%; descent-override: 29.59%; line-gap-override: 0%; size-adjust: 96.98%; }
@font-face { font-family: "Geist Fallback"; src: local("Arial"); ascent-override: 95.94%; descent-override: 28.16%; line-gap-override: 0%; size-adjust: 104.76%; }

/* ── Base ──────────────────────────────────────────────────────────────── */
html { overflow-x: hidden; scroll-behavior: auto; }
body {
	overflow-x: hidden;
	margin: 0;
	background-color: #FAF8F4;
	color: #0A0A0A;
	/* The original site's default face is the browser serif (Times); Geist and
	   Cormorant are applied per component. Kept identical on purpose. */
	font-family: "Times New Roman", Times, serif;
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
body :where(h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, address) { margin: 0; }
body :where(h1, h2, h3, h4, h5, h6) { font-size: inherit; font-weight: inherit; line-height: inherit; }
body :where(ul, ol) { padding: 0; list-style: none; }
body :where(a) { color: inherit; text-decoration: inherit; }
body :where(img, svg, video) { display: block; max-width: 100%; height: auto; }
body :where(button) { font: inherit; color: inherit; }
body :where(strong, b) { font-weight: bolder; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #C9A96E; outline-offset: 3px; }
::selection { background: rgba(201, 169, 110, 0.3); }

/* ── Inline text utilities (used inside rich text) ─────────────────────── */
.tdl-accent { color: #C9A96E; }
.tdl-legal__text a { text-decoration: underline; text-underline-offset: 2px; }
.tdl-legal__text a:hover { color: #C9A96E; }
.tdl-detail__value a { transition: color 0.15s; }
.tdl-detail__value a:hover { color: #C9A96E; }

/* Feather-style arrow (→) used by CTA links and the menu */
.tdl-icon-arrow::after {
	content: "";
	display: inline-block;
	flex-shrink: 0;
	width: 1em;
	height: 1em;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Hide scrollbars on horizontally scrolling strips */
.tdl-photos__track::-webkit-scrollbar,
.tdl-hero__strip::-webkit-scrollbar { display: none; }

/* ── Burger icon ───────────────────────────────────────────────────────── */
/* Three 1px lines, 5px apart; the middle one is 75% wide. */
.tdl-burger { display: flex; flex-direction: column; justify-content: space-between; flex-shrink: 0; width: 16px; height: 11px; background: linear-gradient(currentColor, currentColor) left center / 75% 1px no-repeat; }
.tdl-burger::before,
.tdl-burger::after { content: ""; display: block; height: 1px; width: 100%; background-color: currentColor; }

/* ── Language switcher (Polylang element) ──────────────────────────────── */
.tdl-lang ul, ul.tdl-lang { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tdl-lang li { display: flex; align-items: center; gap: 6px; }
.tdl-lang li + li::before { content: "/"; font-size: 11px; line-height: 1.5; color: rgba(26, 23, 20, 0.25); }
.tdl-lang a { font-family: Geist, "Geist Fallback", ui-sans-serif, system-ui, sans-serif; font-size: 11px; line-height: 1.5; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(26, 23, 20, 0.4); transition: color 0.3s; }
.tdl-lang .current-lang a { font-weight: 600; color: #1A1714; }
.tdl-lang--dark li + li::before { color: rgba(250, 248, 244, 0.25); }
.tdl-lang--dark a { color: rgba(250, 248, 244, 0.4); }
.tdl-lang--dark .current-lang a { color: #FAF8F4; }

/* ── Navigation: scroll-driven reveal (values set by tdl.js) ───────────── */
.tdl-nav { --tdl-rest: 1; --tdl-rest-y: 0px; --tdl-progress: 0; }
.tdl-nav[data-nav-mode="reveal"] { --tdl-rest: 0; --tdl-rest-y: -8px; }
.tdl-nav__backdrop { opacity: var(--tdl-rest); }
.tdl-nav__region { opacity: var(--tdl-rest); transform: translate(-50%, calc(-50% + var(--tdl-rest-y))); }
.tdl-nav__actions { opacity: var(--tdl-rest); transform: translateY(var(--tdl-rest-y)); }
.tdl-nav[data-nav-mode="reveal"]:not(.is-revealed) .tdl-nav__actions { pointer-events: none; }
.tdl-nav__progress { opacity: var(--tdl-rest); transform: scaleX(var(--tdl-progress)); }

.tdl-nav-about .tdl-nav-about__logo-img { filter: brightness(0) invert(1); }
.tdl-nav-about .tdl-nav-about__menu { color: rgba(255, 255, 255, 0.7); }
.tdl-nav-about .tdl-nav-about__menu:hover { color: #FFFFFF; }
.tdl-nav-about.is-scrolled { background-color: rgba(250, 248, 244, 0.92); border-bottom-color: rgba(201, 169, 110, 0.2); }
.tdl-nav-about.is-scrolled .tdl-nav-about__logo-img { filter: none; }
.tdl-nav-about.is-scrolled .tdl-nav-about__menu { color: rgba(26, 23, 20, 0.6); }
.tdl-nav-about.is-scrolled .tdl-nav-about__menu:hover { color: #1A1714; }
.tdl-nav-about.is-scrolled .tdl-lang li + li::before { color: rgba(26, 23, 20, 0.25); }
.tdl-nav-about.is-scrolled .tdl-lang a { color: rgba(26, 23, 20, 0.4); }
.tdl-nav-about.is-scrolled .tdl-lang .current-lang a { color: #1A1714; }

/* ── Menu drawer ───────────────────────────────────────────────────────── */
.tdl-drawer-backdrop { opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0s linear 0.45s; }
.tdl-drawer { visibility: hidden; transform: translateX(100%); transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0s linear 0.45s; }
.tdl-drawer .tdl-drawer__item { opacity: 0; transform: translateX(16px); transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
html.tdl-menu-open .tdl-drawer-backdrop { opacity: 1; visibility: visible; transition: opacity 0.3s; }
html.tdl-menu-open .tdl-drawer { visibility: visible; transform: none; transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
html.tdl-menu-open .tdl-drawer .tdl-drawer__item { opacity: 1; transform: none; }
html.tdl-menu-open .tdl-drawer__item:nth-child(1) { transition-delay: 0.15s; }
html.tdl-menu-open .tdl-drawer__item:nth-child(2) { transition-delay: 0.22s; }
html.tdl-menu-open .tdl-drawer__item:nth-child(3) { transition-delay: 0.29s; }
html.tdl-menu-open .tdl-drawer__item:nth-child(4) { transition-delay: 0.36s; }
html.tdl-menu-open .tdl-drawer__item:nth-child(5) { transition-delay: 0.43s; }
html:not(.tdl-menu-open) .tdl-drawer .tdl-drawer__item { transform: translateX(24px); }

/* ── Age gate ──────────────────────────────────────────────────────────── */
html:not(.tdl-age-ok) body { overflow: hidden; }
html.tdl-age-ok .tdl-age { display: none; }
/* The decorative monogram is drawn as a pseudo-element so the browser doesn't treat
   this huge, nearly invisible text as the page's Largest Contentful Paint. */
.tdl-age__mono { visibility: hidden; }
.tdl-age::before { content: "TDL"; position: absolute; right: -4%; bottom: -8%; pointer-events: none; user-select: none; font-family: "Cormorant Garamond", "Cormorant Garamond Fallback", serif; font-weight: 300; font-size: clamp(280px, 40vw, 620px); line-height: 0.8; color: rgba(201, 169, 110, 0.04); }
.tdl-age.is-leaving { opacity: 0; transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.tdl-age__box { animation: tdl-age-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes tdl-age-in { from { opacity: 0; transform: translateY(24px); } }

/* ── Cookie consent ────────────────────────────────────────────────────── */
.tdl-consent { position: fixed; left: 24px; right: 24px; bottom: 24px; z-index: 180; display: flex; justify-content: center; }
.tdl-consent[hidden] { display: none !important; }
.tdl-consent:focus { outline: none; }
.tdl-consent__inner { width: 100%; max-width: 760px; padding: 28px 32px; background: #1A1714; color: #FAF8F4; border-top: 1px solid #C9A96E; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25); }
.tdl-consent__title { margin-bottom: 10px; font-family: "Cormorant Garamond", "Cormorant Garamond Fallback", serif; font-style: italic; font-size: 24px; line-height: 1.2; }
.tdl-consent__text { margin-bottom: 20px; font-family: "Cormorant Garamond", "Cormorant Garamond Fallback", serif; font-size: 16px; line-height: 1.6; color: rgba(250, 248, 244, 0.7); }
.tdl-consent__text a { color: #C9A96E; text-decoration: underline; text-underline-offset: 2px; }
.tdl-consent__details { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; padding: 16px 0; border-top: 1px solid rgba(250, 248, 244, 0.1); border-bottom: 1px solid rgba(250, 248, 244, 0.1); }
.tdl-consent__details[hidden] { display: none; }
.tdl-consent__opt { display: flex; gap: 12px; align-items: flex-start; font-family: Geist, "Geist Fallback", sans-serif; font-size: 12px; line-height: 1.6; color: rgba(250, 248, 244, 0.65); cursor: pointer; }
.tdl-consent__opt input { margin-top: 3px; accent-color: #C9A96E; }
.tdl-consent__opt strong { color: #FAF8F4; font-weight: 600; }
.tdl-consent__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.tdl-consent__btn { min-width: 170px; padding: 14px 24px; border: 1px solid #C9A96E; background: transparent; color: #C9A96E; cursor: pointer; font-family: Geist, "Geist Fallback", sans-serif; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; transition: background-color 0.3s, color 0.3s; }
.tdl-consent__btn:hover, .tdl-consent__btn:focus-visible { background: #C9A96E; color: #1A1714; }
.tdl-consent__btn[hidden] { display: none; }
.tdl-consent__link { padding: 8px 0; border: 0; background: none; color: rgba(250, 248, 244, 0.6); cursor: pointer; font-family: Geist, "Geist Fallback", sans-serif; font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 639px) {
	.tdl-consent { left: 12px; right: 12px; bottom: 12px; }
	.tdl-consent__inner { padding: 22px 20px; }
	.tdl-consent__btn { flex: 1 1 100%; }
}
/* Footer link only makes sense when an analytics service is configured. */
html:not([data-ga]) .tdl-footer__consent { display: none; }

/* ── Decorative motion ─────────────────────────────────────────────────── */
.tdl-hero__scroll-line::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: linear-gradient(to bottom, transparent, #C9A96E, transparent);
	animation: tdl-scroll-line 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes tdl-scroll-line { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

.tdl-marquee__track { animation: tdl-marquee 60s linear infinite; }
@keyframes tdl-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Grape variety rows: gold underline + soft glow on hover */
.tdl-variety::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: linear-gradient(to right, rgba(201, 169, 110, 0), rgba(201, 169, 110, 0.04), rgba(201, 169, 110, 0));
	opacity: 0;
	transition: opacity 0.5s;
}
.tdl-variety::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 1px;
	background-color: #C9A96E;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.tdl-variety:hover::before { opacity: 1; }
.tdl-variety:hover::after { transform: scaleX(1); }
.tdl-variety > * { position: relative; }

/* Hero headline: word-by-word reveal */
.tdl-reveal { display: inline-block; vertical-align: top; overflow: hidden; padding-bottom: 0.12em; padding-right: 0.22em; margin-right: -0.12em; }
.tdl-reveal > span { display: inline-block; }
.tdl-reveal--1 > span { --delay: 0.25s; }
.tdl-reveal--2 > span { --delay: 0.4s; }
.tdl-reveal--3 > span { --delay: 0.55s; }

/* Per-item geometry for polaroids and gallery (values come from element custom properties) */
.tdl-polaroid { rotate: var(--r, 0deg); translate: 0 var(--dy, 0px); }
.tdl-polaroid__img { width: var(--w); height: var(--h); }
.tdl-polaroid__cap { width: var(--w); }
.tdl-polaroid__text { transform: rotate(var(--cr, 0deg)); }
.tdl-gallery__img { rotate: var(--r, 0deg); }

/* ── Scroll-triggered entrances (only when JS runs; content stays visible otherwise) ── */
html.tdl-js [data-anim] {
	transition-property: opacity, transform, translate, rotate, scale;
	transition-duration: var(--dur, 0.8s);
	transition-delay: var(--delay, 0s);
	transition-timing-function: var(--ease, cubic-bezier(0.25, 0.46, 0.45, 0.94));
}
html.tdl-js [data-anim="up"]:not(.is-in) { opacity: 0; transform: translateY(var(--y, 28px)); }
html.tdl-js [data-anim="fade"]:not(.is-in) { opacity: 0; }
html.tdl-js [data-anim="line"]:not(.is-in) { transform: scaleX(0); }
html.tdl-js [data-anim="pop"]:not(.is-in) { opacity: 0; transform: scale(0.92); }
html.tdl-js [data-anim="polaroid"]:not(.is-in) { opacity: 0; translate: 0 calc(var(--dy, 0px) + 30px); }
html.tdl-js [data-anim="gallery"]:not(.is-in) { opacity: 0; translate: 0 40px; rotate: calc(var(--r, 0deg) * 0.3); }
html.tdl-js .tdl-reveal > span { transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1); transition-delay: var(--delay, 0s); }
html.tdl-js .tdl-hero:not(.is-in) .tdl-reveal > span { transform: translateY(110%); }
html.tdl-js [data-anim="line"] { transform-origin: left center; }
html.tdl-js [data-anim="line"].tdl-wines__rule,
html.tdl-js [data-anim="line"].tdl-quote__rule { transform-origin: center; }
html.tdl-js [data-anim].is-in { opacity: 1; }

/* Parallax layers are moved by tdl.js via --py */
[data-parallax] { translate: 0 var(--py, 0px); }
html.tdl-js [data-anim][data-parallax] { transition-property: opacity, transform; }

/* ── Bricks builder: show everything statically, keep overlays out of the way ── */
html.tdl-builder body.single-bricks_template .tdl-age { display: flex; position: relative; inset: auto; min-height: 100vh; }
html.tdl-builder [data-anim] { opacity: 1 !important; transform: none !important; translate: none !important; }
html.tdl-builder .tdl-reveal > span { transform: none !important; }
/* The off-canvas menu is only shown while editing the header template itself. */
html.tdl-builder body:not(.single-bricks_template) :is(.tdl-drawer, .tdl-drawer-backdrop) { display: none; }
html.tdl-builder body.single-bricks_template :is(.tdl-drawer, .tdl-drawer-backdrop) { position: relative; visibility: visible; transform: none; opacity: 1; }
html.tdl-builder .tdl-drawer .tdl-drawer__item { opacity: 1; transform: none; }
/* Bricks gives empty elements a 90px drop placeholder; hairlines must stay hairlines. */
html.tdl-builder span.brx-draggable:empty { min-width: 1px; min-height: 1px; }
html.tdl-builder .tdl-nav { position: relative; }

@media (prefers-reduced-motion: reduce) {
	html.tdl-js [data-anim] { transition: none !important; }
	html.tdl-js [data-anim]:not(.is-in) { opacity: 1 !important; transform: none !important; translate: 0 var(--dy, 0px) !important; }
	html.tdl-js .tdl-reveal > span { transform: none !important; transition: none !important; }
	.tdl-marquee__track, .tdl-hero__scroll-line::after, .tdl-age__box { animation: none; }
	[data-parallax] { translate: none; }
}
