/*
Theme Name: Tudo Para Casa — NEXORA
Theme URI: https://tudoparacasa.tech/
Author: Tudo Para Casa
Description: Tema clásico para WordPress con el estilo visual NEXORA REALTY: fondo crema cálido, acentos dorados, tipografía sans-serif bold, botones tipo píldora y tarjetas redondeadas con sombras suaves. Compatible con editor clásico y widgets clásicos.
Version: 1.0.0
Requires at least: 5.9
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tudoparacasa
Tags: blog, news, one-column, two-columns, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   1. Variables y base
   ========================================================================== */
:root {
	--c-cream: #F6F2EA;
	--c-cream-2: #EFE9DD;
	--c-white: #FFFFFF;
	--c-ink: #1B1A17;
	--c-ink-soft: #2A2823;
	--c-gray: #6B665C;
	--c-gray-2: #A9A297;
	--c-gold: #C7A55C;
	--c-gold-dark: #A5823B;
	--c-panel: #211F1B;
	--c-panel-2: #2B2822;
	--c-border: #E2DBCE;
	--radius: 18px;
	--radius-sm: 12px;
	--shadow-sm: 0 2px 14px rgba(27, 26, 23, .06);
	--shadow-md: 0 14px 34px rgba(27, 26, 23, .12);
	--shadow-gold: 0 8px 22px rgba(165, 130, 59, .26);
	--font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.65;
	color: var(--c-ink);
	background: var(--c-cream);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var(--c-ink);
	margin: 0 0 .6em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

a { color: var(--c-ink); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--c-gold-dark); }

p { margin: 0 0 1.2em; }

ul, ol { padding-left: 1.3em; }

.container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding-left: 24px;
	padding-right: 24px;
}

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

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
}
.skip-link:focus {
	left: 12px;
	top: 12px;
	background: var(--c-gold);
	color: var(--c-ink);
	padding: .6rem 1rem;
	border-radius: 999px;
}

.gold { color: var(--c-gold); }

/* ==========================================================================
   2. Botones (píldora)
   ========================================================================== */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	padding: .8rem 1.7rem;
	border-radius: 999px;
	font-weight: 600;
	font-size: .95rem;
	letter-spacing: .01em;
	line-height: 1.2;
	border: 1px solid transparent;
	cursor: pointer;
	transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-gold {
	background: var(--c-gold);
	color: var(--c-ink);
	box-shadow: var(--shadow-gold);
}
.btn-gold:hover {
	background: var(--c-gold-dark);
	color: var(--c-white);
	box-shadow: 0 12px 28px rgba(165, 130, 59, .34);
}

.btn-outline {
	background: transparent;
	color: var(--c-ink);
	border-color: var(--c-ink);
}
.btn-outline:hover {
	background: var(--c-ink);
	color: var(--c-white);
}

/* ==========================================================================
   3. Cabecera
   ========================================================================== */
.site-header {
	background: rgba(246, 242, 234, .92);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--c-border);
	position: sticky;
	top: 0;
	z-index: 100;
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	justify-content: space-between;
	min-height: 72px;
	position: relative;
}

.site-branding {
	display: flex;
	align-items: center;
	gap: .6rem;
	flex-shrink: 0;
}

.site-branding .custom-logo { height: 44px; width: auto; }

.site-title {
	font-size: 1.35rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--c-ink);
	white-space: nowrap;
}
.site-title:hover { color: var(--c-gold-dark); }

.site-nav {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-left: auto;
}

.primary-menu {
	display: flex;
	align-items: center;
	gap: .2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.primary-menu li { position: relative; }

.primary-menu > li > a {
	display: inline-block;
	padding: .45rem .9rem;
	border-radius: 999px;
	font-weight: 500;
	font-size: .95rem;
	color: var(--c-ink);
}
.primary-menu > li > a:hover {
	background: rgba(199, 165, 92, .16);
	color: var(--c-gold-dark);
}

.primary-menu li.current-menu-item > a,
.primary-menu li.current_page_item > a { color: var(--c-gold-dark); font-weight: 600; }

/* submenús */
.primary-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	background: var(--c-white);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-md);
	padding: .5rem;
	list-style: none;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s;
	z-index: 10;
}
.primary-menu li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.primary-menu .sub-menu a {
	display: block;
	padding: .5rem .8rem;
	border-radius: 8px;
	color: var(--c-ink);
}
.primary-menu .sub-menu a:hover { background: var(--c-cream); color: var(--c-gold-dark); }

.header-cta { flex-shrink: 0; }

/* Hamburguesa (CSS-only) */
.nav-toggle { display: none; }
.nav-toggle-label {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 42px;
	height: 42px;
	padding: 8px;
	cursor: pointer;
	border-radius: 10px;
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
	display: block;
	height: 2px;
	background: var(--c-ink);
	border-radius: 2px;
	transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-label span { position: relative; }
.nav-toggle-label span::before,
.nav-toggle-label span::after {
	content: "";
	position: absolute;
	left: 0;
	width: 100%;
}
.nav-toggle-label span::before { top: -8px; }
.nav-toggle-label span::after { top: 8px; }

/* ==========================================================================
   4. Layout principal
   ========================================================================== */
.site-content { padding: 3rem 0 4rem; }

.layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2.5rem;
}
.layout.has-sidebar { grid-template-columns: minmax(0, 1fr) 320px; }
.layout.no-sidebar { grid-template-columns: 1fr; }

.content { min-width: 0; }

/* ==========================================================================
   5. Hero (portada)
   ========================================================================== */
.hero {
	background:
		radial-gradient(60% 80% at 80% 0%, rgba(199, 165, 92, .18), transparent 60%),
		radial-gradient(50% 70% at 10% 20%, rgba(165, 130, 59, .12), transparent 55%),
		var(--c-cream);
	border-bottom: 1px solid var(--c-border);
	padding: 4.5rem 0;
	text-align: center;
}

.hero-kicker {
	display: inline-block;
	padding: .35rem 1rem;
	border-radius: 999px;
	background: rgba(199, 165, 92, .18);
	color: var(--c-gold-dark);
	font-weight: 600;
	font-size: .85rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	margin-bottom: 1.2rem;
}

.hero-title {
	font-size: clamp(2.4rem, 6vw, 4rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	margin-bottom: .9rem;
}

.hero-sub {
	max-width: 640px;
	margin: 0 auto 2rem;
	color: var(--c-gray);
	font-size: 1.1rem;
}

.hero-actions {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: .9rem;
	margin-bottom: 3rem;
}

.hero-stats {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 3rem;
}

.stat { text-align: center; }
.stat-num {
	display: block;
	font-size: 2.4rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--c-gold);
}
.stat-label {
	display: block;
	color: var(--c-gray);
	font-size: .9rem;
	font-weight: 500;
}

/* ==========================================================================
   6. Contenido de portada / widgets
   ========================================================================== */
.home-widgets {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
	margin-bottom: 3rem;
}
.home-widgets > .widget {
	background: var(--c-white);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	padding: 1.5rem;
}
.home-widgets > .widget:first-child:last-child { grid-column: 1 / -1; }
.home-widgets > .widget:nth-child(1):nth-last-child(2),
.home-widgets > .widget:nth-child(2):nth-last-child(1) { grid-column: span 1; }

.page-content { margin-top: 2rem; }

/* ==========================================================================
   7. Tarjetas de entradas (grid)
   ========================================================================== */
.post-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
}

.post-card {
	background: var(--c-white);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow .2s ease, transform .2s ease;
}
.post-card:hover {
	box-shadow: var(--shadow-md);
	transform: translateY(-4px);
}

.post-card-thumb {
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 10;
}
.post-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .4s ease;
}
.post-card:hover .post-card-thumb img { transform: scale(1.05); }

.post-card-body {
	display: flex;
	flex-direction: column;
	gap: .6rem;
	padding: 1.25rem;
}

.post-card-cats { display: flex; flex-wrap: wrap; gap: .4rem; }
.post-card-cats a {
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--c-gold-dark);
	background: rgba(199, 165, 92, .16);
	padding: .28rem .7rem;
	border-radius: 999px;
}
.post-card-cats a:hover { background: var(--c-gold); color: var(--c-ink); }

.post-card-title { font-size: 1.15rem; margin: 0; line-height: 1.3; }
.post-card-title a { color: var(--c-ink); }
.post-card-title a:hover { color: var(--c-gold-dark); }

.post-card-excerpt {
	color: var(--c-gray);
	font-size: .92rem;
	margin: 0;
	flex-grow: 1;
}

.post-card-more {
	font-weight: 600;
	font-size: .9rem;
	color: var(--c-gold-dark);
	margin-top: .4rem;
}
.post-card-more:hover { color: var(--c-ink); }

/* ==========================================================================
   8. Entradas y páginas
   ========================================================================== */
.page-header { margin-bottom: 2rem; }
.page-title { margin: 0; }

.entry-header { margin-bottom: 1.5rem; }

.entry-thumb {
	border-radius: var(--radius);
	overflow: hidden;
	margin-bottom: 1.5rem;
}
.entry-thumb img { width: 100%; }

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem 1.2rem;
	color: var(--c-gray);
	font-size: .85rem;
	margin-bottom: 1.2rem;
}
.entry-meta a { color: var(--c-gray); }
.entry-meta a:hover { color: var(--c-gold-dark); }

.entry-content { font-size: 1.02rem; }
.entry-content a {
	color: var(--c-gold-dark);
	text-decoration: underline;
	text-decoration-color: var(--c-gold);
	text-underline-offset: 3px;
}
.entry-content a:hover { color: var(--c-ink); }
.entry-content img { border-radius: var(--radius-sm); }
.entry-content blockquote {
	border-left: 3px solid var(--c-gold);
	margin: 1.5rem 0;
	padding: .5rem 0 .5rem 1.3rem;
	color: var(--c-gray);
	font-size: 1.1rem;
}
.entry-content pre {
	background: var(--c-panel);
	color: var(--c-cream);
	padding: 1rem 1.2rem;
	border-radius: var(--radius-sm);
	overflow-x: auto;
}
.entry-content code {
	background: var(--c-cream-2);
	padding: .15em .4em;
	border-radius: 6px;
	font-size: .9em;
}
.entry-content pre code { background: transparent; padding: 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.entry-content th, .entry-content td { border: 1px solid var(--c-border); padding: .6rem .8rem; text-align: left; }
.entry-content th { background: var(--c-cream-2); }

/* ==========================================================================
   9. Barra lateral y widgets
   ========================================================================== */
.sidebar {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	align-self: start;
	position: sticky;
	top: 90px;
}

.widget {
	background: var(--c-white);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	padding: 1.5rem;
}

.widget-title {
	font-size: 1.05rem;
	font-weight: 700;
	margin-bottom: 1rem;
	padding-bottom: .6rem;
	border-bottom: 2px solid var(--c-gold);
	display: inline-block;
}

.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li {
	padding: .55rem 0;
	border-bottom: 1px solid var(--c-border);
}
.widget ul li:last-child { border-bottom: 0; }
.widget ul li a { color: var(--c-ink); }
.widget ul li a:hover { color: var(--c-gold-dark); }

.widget select, .widget input[type="text"], .widget input[type="search"], .widget input[type="email"] {
	width: 100%;
	padding: .65rem .9rem;
	border: 1px solid var(--c-border);
	border-radius: 999px;
	background: var(--c-cream);
	font-family: var(--font);
	font-size: .95rem;
}
.widget input:focus, .widget select:focus { outline: none; border-color: var(--c-gold); }

.widget .wp-block-search__button,
.widget input[type="submit"] {
	background: var(--c-gold);
	color: var(--c-ink);
	border: 0;
	border-radius: 999px;
	padding: .6rem 1.2rem;
	font-weight: 600;
	cursor: pointer;
	font-family: var(--font);
	margin-top: .6rem;
}
.widget input[type="submit"]:hover { background: var(--c-gold-dark); color: var(--c-white); }

/* ==========================================================================
   10. Paginación
   ========================================================================== */
.nav-links {
	display: flex;
	gap: .5rem;
	justify-content: center;
	margin-top: 2.5rem;
	flex-wrap: wrap;
}
.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 .9rem;
	border-radius: 999px;
	background: var(--c-white);
	box-shadow: var(--shadow-sm);
	color: var(--c-ink);
	font-weight: 600;
}
.page-numbers.current {
	background: var(--c-gold);
	color: var(--c-ink);
}
.page-numbers:hover { background: var(--c-gold-dark); color: var(--c-white); }

/* ==========================================================================
   11. Pie de página
   ========================================================================== */
.site-footer {
	background: var(--c-panel);
	color: var(--c-cream);
	margin-top: 2rem;
}

.footer-columns {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
	padding-top: 3.5rem;
	padding-bottom: 2.5rem;
}

.footer-col .widget {
	background: transparent;
	box-shadow: none;
	padding: 0;
	color: var(--c-cream);
}
.footer-col .widget-title {
	color: var(--c-gold);
	border-color: var(--c-gold);
}
.footer-col .widget a { color: #D9D3C6; }
.footer-col .widget a:hover { color: var(--c-gold); }
.footer-col .widget ul li { border-color: rgba(255, 255, 255, .1); }
.footer-col .widget p { color: #B9B2A3; }

.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, .1);
	padding: 1.4rem 0;
}
.footer-bottom .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
}
.footer-bottom p { margin: 0; color: #8F887A; font-size: .9rem; }

.footer-menu {
	display: flex;
	gap: 1.2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.footer-menu a { color: #B9B2A3; font-size: .9rem; }
.footer-menu a:hover { color: var(--c-gold); }

/* ==========================================================================
   12. Responsive
   ========================================================================== */
@media (max-width: 992px) {
	.post-grid { grid-template-columns: repeat(2, 1fr); }
	.home-widgets { grid-template-columns: repeat(2, 1fr); }
	.layout.has-sidebar { grid-template-columns: 1fr; }
	.sidebar { position: static; }
}

@media (max-width: 900px) {
	.nav-toggle-label { display: flex; }

	.site-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		flex-direction: column;
		align-items: stretch;
		gap: .5rem;
		background: var(--c-white);
		border-radius: 0 0 var(--radius) var(--radius);
		box-shadow: var(--shadow-md);
		padding: 1rem;
		display: none;
	}

	.nav-toggle:checked ~ .site-nav { display: flex; }

	.primary-menu {
		flex-direction: column;
		align-items: stretch;
	}
	.primary-menu > li > a { display: block; }
	.primary-menu .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		background: var(--c-cream);
		padding-left: 1rem;
	}
	.header-cta { justify-content: center; }
}

@media (max-width: 620px) {
	.post-grid { grid-template-columns: 1fr; }
	.home-widgets { grid-template-columns: 1fr; }
	.footer-columns { grid-template-columns: 1fr; }
	.hero-stats { gap: 2rem; }
	.hero { padding: 3rem 0; }
	.header-inner { min-height: 64px; }
}
