/* ==========================================================================
   Tanuva theme — layout, header menu, journal cards and post pages.
   Colour and type tokens are defined in design.css (--tnv-*).
   ========================================================================== */

:root {
	--tnv-cream: #FDFBF7;
	--tnv-cream-2: #F8F2E7;
	--tnv-gold: #B08A3C;
	--tnv-gold-light: #C9A24A;
	--tnv-gold-deep: #8A6A20;
	--tnv-gold-line: rgba(176, 138, 60, .28);
	--tnv-ink: #2B2B2B;
	--tnv-muted: #6F6A64;
	--tnv-serif: "Cormorant Garamond", Georgia, serif;
	--tnv-sans: "Jost", "Montserrat", -apple-system, sans-serif;
}

.tnv-wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.tnv-wrap--narrow { max-width: 820px; }

/* ---------- header shell ---------- */

#masthead {
	position: relative;
	z-index: 50;
	background: var(--tnv-cream);
	border-bottom: 1px solid var(--tnv-gold-line);
}
#masthead .elementor-section,
#masthead .elementor-top-section { background-color: var(--tnv-cream); }

/* Top information strip. */
.tnv-topbar .elementor-widget-text-editor,
.tnv-topbar .elementor-widget-text-editor p {
	font-family: var(--tnv-sans);
	font-size: 14px !important;
	letter-spacing: .02em;
	color: var(--tnv-ink);
	margin: 0;
}
.tnv-topbar a { color: inherit; text-decoration: none; }
.tnv-topbar a:hover { color: var(--tnv-gold); }

/* ---------- logo ---------- */

.tnv-logo { line-height: 0; }
.tnv-logo a { display: inline-block; }
.tnv-logo img { display: block; width: 190px; height: auto; }
.tnv-logo__text {
	font-family: var(--tnv-serif);
	font-size: 28px;
	line-height: 1.2;
	font-weight: 600;
	color: var(--tnv-gold) !important;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: .04em;
}

/* ---------- desktop menu ---------- */

.tnv-nav { display: flex; align-items: center; justify-content: flex-end; }
.tnv-nav__toggle { display: none; }

.tnv-menu,
.tnv-menu ul { list-style: none; margin: 0; padding: 0; }

.tnv-menu { display: flex; flex-wrap: wrap; align-items: center; }
.tnv-menu li { position: relative; }

.tnv-menu > li > a {
	display: block;
	padding: 12px 15px;
	font-family: var(--tnv-sans);
	font-size: 17.5px;
	font-weight: 400;
	letter-spacing: .02em;
	color: var(--tnv-ink);
	text-decoration: none;
	transition: color .18s ease;
}
.tnv-menu > li > a:hover,
.tnv-menu > li:focus-within > a,
.tnv-menu > .current-menu-item > a,
.tnv-menu > .current-menu-ancestor > a { color: var(--tnv-gold); }

/* Gold rule under the active item. */
.tnv-menu > .current-menu-item > a::after,
.tnv-menu > .current-menu-ancestor > a::after {
	content: "";
	display: block;
	height: 1px;
	margin-top: 5px;
	background: var(--tnv-gold);
}

/* Chevron on items with a dropdown. */
.tnv-menu .menu-item-has-children > a { padding-right: 30px; }
.tnv-menu .menu-item-has-children > a::before {
	content: "";
	position: absolute;
	right: 14px;
	top: 22px;
	width: 6px;
	height: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
}
.tnv-menu .sub-menu .menu-item-has-children > a::before { top: 17px; transform: rotate(-45deg); }

/* Dropdowns. */
.tnv-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 100;
	width: 300px;
	padding: 6px 0;
	background: #fff;
	border: 1px solid var(--tnv-gold-line);
	border-radius: 14px;
	box-shadow: 0 18px 40px rgba(120, 95, 40, .12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
/* Group flyouts open to the side (no scrolling list); theme.js flips them
   to the left when there is no room on the right. */
.tnv-menu .sub-menu .sub-menu { top: -7px; left: calc(100% + 4px); transform: translateX(8px); }
.tnv-menu .sub-menu .sub-menu.tnv-flip { left: auto; right: calc(100% + 4px); transform: translateX(-8px); }
/* Invisible bridge so the pointer can cross the small gap to the flyout. */
.tnv-menu .sub-menu .menu-item-has-children::after {
	content: "";
	position: absolute;
	top: 0;
	right: -8px;
	width: 12px;
	height: 100%;
}
.tnv-menu li:hover > .sub-menu,
.tnv-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }

.tnv-menu .sub-menu a {
	display: block;
	padding: 10px 18px;
	font-family: var(--tnv-sans);
	font-size: 15.5px;
	line-height: 1.4;
	color: var(--tnv-ink);
	text-decoration: none;
}
.tnv-menu .sub-menu a:hover,
.tnv-menu .sub-menu .current-menu-item > a { background: var(--tnv-cream-2); color: var(--tnv-gold); }

.tnv-sub-toggle { display: none; }

/* ---------- mobile menu (tablet and below) ---------- */

@media (max-width: 1024px) {
	.tnv-nav__toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 46px;
		height: 46px;
		padding: 0;
		border: 1px solid var(--tnv-gold-line);
		border-radius: 50%;
		background: #fff;
		color: var(--tnv-gold);
		cursor: pointer;
	}
	.tnv-nav__bars { display: grid; gap: 4px; width: 18px; }
	.tnv-nav__bars span { display: block; height: 1.5px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
	.tnv-nav__toggle[aria-expanded="true"] .tnv-nav__bars span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
	.tnv-nav__toggle[aria-expanded="true"] .tnv-nav__bars span:nth-child(2) { opacity: 0; }
	.tnv-nav__toggle[aria-expanded="true"] .tnv-nav__bars span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

	.tnv-nav__panel {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 9999;
		width: min(340px, 88vw);
		padding: 80px 18px 30px;
		overflow-y: auto;
		background: var(--tnv-cream);
		border-left: 1px solid var(--tnv-gold-line);
		box-shadow: -18px 0 40px rgba(120, 95, 40, .14);
		transform: translateX(100%);
		visibility: hidden;
		transition: transform .25s ease, visibility .25s;
	}
	.tnv-nav.is-open .tnv-nav__panel { transform: none; visibility: visible; }
	.tnv-nav.is-open .tnv-nav__toggle { position: fixed; top: 18px; right: 18px; z-index: 10000; }
	body.admin-bar .tnv-nav.is-open .tnv-nav__toggle { top: 64px; }
	body.admin-bar .tnv-nav__panel { top: 46px; }

	.tnv-menu { display: block; }
	.tnv-menu > li { border-bottom: 1px solid var(--tnv-gold-line); }
	.tnv-menu > li > a { padding: 14px 44px 14px 6px; }
	.tnv-menu > .current-menu-item > a::after,
	.tnv-menu > .current-menu-ancestor > a::after { display: none; }
	.tnv-menu .menu-item-has-children > a::before { display: none; }

	.tnv-menu .sub-menu,
	.tnv-menu .sub-menu .sub-menu {
		position: static;
		width: auto;
		max-height: none;
		padding: 0 0 10px 12px;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		background: transparent;
		opacity: 1;
		visibility: visible;
		transform: none;
		display: none;
	}
	.tnv-menu li.is-open > .sub-menu { display: block; }
	.tnv-menu .sub-menu a { padding: 9px 6px; background: transparent !important; }

	.tnv-sub-toggle {
		position: absolute;
		top: 6px;
		right: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 0;
		background: transparent;
		color: var(--tnv-gold);
		cursor: pointer;
	}
	.tnv-sub-toggle::before {
		content: "";
		width: 8px;
		height: 8px;
		border-right: 1.5px solid currentColor;
		border-bottom: 1.5px solid currentColor;
		transform: rotate(45deg);
		transition: transform .2s ease;
	}
	.tnv-menu li.is-open > .tnv-sub-toggle::before { transform: rotate(-135deg); }
	.tnv-menu .sub-menu .tnv-sub-toggle { top: 0; }

	.tnv-nav-backdrop {
		position: fixed;
		inset: 0;
		z-index: 9998;
		background: rgba(43, 43, 43, .35);
	}
}

/* ---------- journal cards ---------- */

.tnv-posts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 36px;
	margin-top: 24px;
}
@media (max-width: 767px) {
	.tnv-posts { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
.tnv-post {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--tnv-gold-line);
	border-radius: 22px;
	box-shadow: 0 14px 34px rgba(120, 95, 40, .07);
	transition: transform .2s ease, box-shadow .2s ease;
	text-align: left;
}
.tnv-post:hover { transform: translateY(-3px); box-shadow: 0 20px 44px rgba(120, 95, 40, .12); }
.tnv-post__media { display: block; aspect-ratio: 2 / 1; overflow: hidden; }
.tnv-post__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tnv-post:hover .tnv-post__media img { transform: scale(1.03); }
.tnv-post__body { display: flex; flex: 1; flex-direction: column; padding: 26px 28px 28px; }
.tnv-post__meta {
	margin: 0 0 10px;
	font-family: var(--tnv-sans);
	font-size: 12.5px !important;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--tnv-gold);
}
.tnv-post__title {
	margin: 0 0 12px;
	font-family: var(--tnv-serif);
	font-size: 28px;
	font-weight: 500;
	line-height: 1.2;
}
.tnv-post__title a { color: var(--tnv-ink); text-decoration: none; }
.tnv-post__title a:hover { color: var(--tnv-gold); }
.tnv-post__excerpt p { margin: 0 0 18px; font-family: var(--tnv-sans); line-height: 1.75; color: var(--tnv-muted); }
.tnv-post__more {
	margin-top: auto;
	font-family: var(--tnv-sans);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: .04em;
	color: var(--tnv-gold);
	text-decoration: none;
}
.tnv-post__more:hover { color: var(--tnv-gold-deep); }
.tnv-posts__empty, .tnv-nav__empty { font-family: var(--tnv-sans); color: var(--tnv-muted); }

/* ---------- posts, pages and archives outside Elementor ---------- */

.tnv-entry, .tnv-archive { padding-top: 70px; padding-bottom: 80px; }
.tnv-entry__meta {
	margin: 0 0 14px;
	font-family: var(--tnv-sans);
	font-size: 12.5px !important;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--tnv-gold);
}
.tnv-entry__meta a { color: inherit; text-decoration: none; }
.tnv-entry__title {
	margin: 0 0 28px;
	font-family: var(--tnv-serif);
	font-size: clamp(34px, 4vw, 54px);
	font-weight: 500;
	line-height: 1.1;
	color: var(--tnv-ink);
}
.tnv-entry__media { margin: 0 0 36px; }
.tnv-entry__media img { display: block; width: 100%; border-radius: 22px; }
.tnv-entry__content { font-family: var(--tnv-sans); line-height: 1.8; color: var(--tnv-muted); }
.tnv-entry__content h2,
.tnv-entry__content h3,
.tnv-entry__content h4 { font-family: var(--tnv-serif); font-weight: 500; color: var(--tnv-ink); line-height: 1.2; margin: 1.6em 0 .5em; }
.tnv-entry__content h2 { font-size: 36px; }
.tnv-entry__content h3 { font-size: 28px; }
.tnv-entry__content img { border-radius: 16px; }
.tnv-entry__nav {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	margin-top: 50px;
	padding-top: 24px;
	border-top: 1px solid var(--tnv-gold-line);
	font-family: var(--tnv-sans);
}
.tnv-entry__nav a { color: var(--tnv-gold); text-decoration: none; }
.tnv-archive__header { text-align: center; }
.tnv-pagination { margin-top: 40px; text-align: center; font-family: var(--tnv-sans); }
.tnv-pagination .page-numbers { display: inline-block; padding: 6px 12px; color: var(--tnv-ink); text-decoration: none; }
.tnv-pagination .current { color: var(--tnv-gold); }

.tnv-button {
	display: inline-block;
	padding: 15px 32px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--tnv-gold-light), var(--tnv-gold-deep));
	color: #fff !important;
	font-family: var(--tnv-sans);
	font-size: 14px;
	text-decoration: none;
}

/* ---------- fallback header and footer (when Elementor is off) ---------- */

.tnv-fallback-header .tnv-wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: 90px;
}
.tnv-fallback-footer {
	padding: 40px 0;
	background: linear-gradient(180deg, #FDFBF7 0%, #F6EDDC 100%);
	border-top: 1px solid var(--tnv-gold-line);
	font-family: var(--tnv-sans);
	color: var(--tnv-muted);
	text-align: center;
}
.tnv-footer-menu { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; list-style: none; margin: 0 0 16px; padding: 0; }
.tnv-footer-menu a { color: var(--tnv-muted); text-decoration: none; }
.tnv-footer-menu a:hover { color: var(--tnv-gold); }

/* Phones and tablets: nested groups open inline, so no flyout offset or hover bridge. */
@media (max-width: 1024px) {
	.tnv-menu .sub-menu .sub-menu,
	.tnv-menu .sub-menu .sub-menu.tnv-flip { left: auto; right: auto; transform: none; }
	.tnv-menu .sub-menu .menu-item-has-children::after { display: none; }
	.tnv-menu .sub-menu .sub-menu { padding-left: 14px; }
}
