/*
Theme Name: Oviedo Student Rooms
Theme URI: https://oviedostudentrooms.com
Description: Tema a medida para mostrar los pisos de estudiantes de Víctor Chavarrí y Gascona (Oviedo), con galería de fotos, 4 idiomas y reseñas con moderación.
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: oviedo-student-rooms
*/

:root {
	--green: #1f4d3f;
	--green-dark: #163a2f;
	--terra: #c8643b;
	--terra-dark: #a94f2b;
	--cream: #f6efe4;
	--sand: #ece2d2;
	--ink: #1d2320;
	--muted: #5d6661;
	--line: #e3d9c8;
	--white: #fff;
	--star: #e0a02a;
	--radius: 14px;
	--shadow: 0 10px 30px -12px rgba(29, 35, 32, .25);
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Book Antiqua", serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
	margin: 0;
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.6;
	color: var(--ink);
	background: var(--cream);
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--green); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 860px; }
.muted { color: var(--muted); }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--terra); margin-bottom: .6em; }
.lead { font-size: 1.2rem; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 10px; top: 10px; background: #fff; padding: 8px 12px; z-index: 100; }
:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; }

/* Botones */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .4em;
	padding: .8em 1.4em; border-radius: 999px; font-weight: 600; text-decoration: none;
	border: 2px solid transparent; cursor: pointer; font-size: 1rem; font-family: inherit;
	transition: background .2s, color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--terra); color: #fff; }
.btn-primary:hover { background: var(--terra-dark); }
.btn-ghost { border-color: rgba(255,255,255,.8); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.15); }
.btn-ghost-dark { border-color: var(--green); color: var(--green); }
.btn-ghost-dark:hover { background: var(--green); color: #fff; }
.btn-block { width: 100%; }

/* Cabecera */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(246, 239, 228, .92);
	backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green); }
.brand-text { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.brand-text em { font-style: normal; color: var(--green); }
.main-nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.main-nav a { text-decoration: none; color: var(--ink); font-weight: 500; font-size: .96rem; }
.main-nav a:hover { color: var(--terra); }
.main-nav .nav-cta { background: var(--green); color: #fff; padding: .45em 1.1em; border-radius: 999px; }
.main-nav .nav-cta:hover { background: var(--green-dark); color: #fff; }
.lang-switch { display: flex; background: var(--sand); border-radius: 999px; padding: 3px; }
.lang-switch button {
	border: 0; background: transparent; font: inherit; font-size: .75rem; font-weight: 700;
	padding: .35em .6em; border-radius: 999px; cursor: pointer; color: var(--muted);
}
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.menu-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .2s, opacity .2s; }

/* Portada */
.hero { position: relative; min-height: min(86vh, 720px); display: flex; align-items: flex-end; color: #fff; overflow: hidden; }
.hero-media, .hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(22,58,47,.15) 0%, rgba(22,58,47,.55) 50%, rgba(22,58,47,.92) 100%);
}
.hero-content { position: relative; padding-top: 120px; padding-bottom: 72px; max-width: 1180px; }
.hero h1 { max-width: 15ch; }
.hero .lead { max-width: 52ch; opacity: .95; }
.hero .kicker { color: #f3c9a8; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 1.5em; }

.facts { background: var(--white); border-bottom: 1px solid var(--line); }
.facts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding-top: 28px; padding-bottom: 28px; }
.fact { display: flex; gap: 14px; align-items: center; }
.fact svg { color: var(--terra); flex: none; }
.fact strong { display: block; }
.fact .muted { font-size: .9rem; }

.section { padding: 88px 0; }
.section-alt { background: var(--sand); }
.section-dark { background: var(--green); color: #fff; }
.section-head { max-width: 640px; margin-bottom: 40px; }

/* Tarjetas de pisos */
.flat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.flat-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.flat-card-img { aspect-ratio: 4 / 3; overflow: hidden; display: block; }
.flat-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.flat-card:hover .flat-card-img img { transform: scale(1.04); }
.flat-card-body { padding: 28px; display: flex; flex-direction: column; flex: 1; }
.flat-card-body h3 { font-size: 1.7rem; }
.flat-card-body h3 a { color: var(--ink); text-decoration: none; }
.flat-card-body .btn { align-self: flex-start; margin-top: auto; }
.chips { list-style: none; padding: 0; margin: 0 0 1em; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: .25em .85em; font-size: .9rem; }
.chips-light li { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.35); color: #fff; }

/* Pasos */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.steps li { background: var(--white); border-radius: var(--radius); padding: 30px; }
.step-num {
	display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
	background: var(--green); color: #fff; font-weight: 700; margin-bottom: 14px; font-family: var(--serif); font-size: 1.2rem;
}

/* Reseñas */
.stars { position: relative; display: inline-block; font-size: 1.05rem; line-height: 1; letter-spacing: 2px; color: #d9d2c5; }
.stars::before { content: "★★★★★"; }
.stars-fill { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: var(--star); }
.stars-fill::before { content: "★★★★★"; }
.rating-badge { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 1em; font-size: .95rem; }
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.reviews-list { display: grid; gap: 18px; margin-bottom: 48px; }
.review { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,.04); display: flex; flex-direction: column; }
.review-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.review-head .stars { margin-left: auto; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.review-meta { font-size: .85rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.review-body p:last-child { margin-bottom: 0; }
.review-flat { margin-top: 14px; font-size: .9rem; font-weight: 600; text-decoration: none; color: var(--terra); }
.empty { background: var(--white); border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); }
.leave-review { margin: 32px 0 0; display: flex; align-items: flex-start; gap: 10px; max-width: 720px; font-size: .95rem; }
.leave-review svg { color: var(--green); flex: none; margin-top: 2px; }
.review-invite { background: var(--white); border-radius: var(--radius); padding: 24px 28px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.review-invite p { margin: 0; flex: 1 1 320px; color: var(--muted); }
/* Formulario de reseña */
.review-form-wrap { background: var(--white); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow); }
.review-form label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.review-form input[type="text"], .review-form input[type="email"], .review-form textarea {
	width: 100%; padding: .75em .9em; border: 1.5px solid var(--line); border-radius: 10px;
	font: inherit; background: var(--cream);
}
.review-form input:focus, .review-form textarea:focus { border-color: var(--green); outline: none; background: #fff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.rating-input { border: 0; padding: 0; margin: 0 0 18px; }
.rating-input legend { font-weight: 600; font-size: .92rem; margin-bottom: 4px; padding: 0; }
.rating-stars { display: inline-flex; flex-direction: row-reverse; }
.rating-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating-stars label { font-size: 2.2rem; color: #d9d2c5; cursor: pointer; padding: 0 3px; margin: 0; line-height: 1; transition: color .15s, transform .15s; }
.rating-stars label:hover, .rating-stars label:hover ~ label, .rating-stars input:checked ~ label { color: var(--star); }
.rating-stars label:hover { transform: scale(1.12); }
.rating-stars input:focus-visible + label { outline: 3px solid var(--terra); border-radius: 6px; }
.consent { display: flex; gap: 10px; align-items: flex-start; }
.consent input { margin-top: 5px; width: 18px; height: 18px; flex: none; accent-color: var(--green); }
.consent label { font-weight: 400; }
.hp { position: absolute !important; left: -9999px !important; }
.notice-ok { background: #e3f1e8; border: 1px solid #9cc9ad; color: #1b4d32; border-radius: 10px; padding: 14px 18px; font-weight: 600; }

/* Contacto */
.contact { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.contact-list { display: grid; gap: 14px; }
.contact-item {
	display: flex; flex-direction: column; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
	border-radius: var(--radius); padding: 18px 22px; color: #fff; text-decoration: none; font-size: 1.15rem; margin: 0;
}
a.contact-item:hover { background: rgba(255,255,255,.14); }
.contact-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; opacity: .7; }
.muted-light { opacity: .75; }
.admin-hint { background: #fff6d6; color: #5a4a12; padding: 12px 16px; border-radius: 10px; font-size: .9rem; }
.admin-hint a { color: inherit; }

/* Página de piso */
.flat-hero { position: relative; color: #fff; min-height: 460px; display: flex; align-items: flex-end; overflow: hidden; }
.flat-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.flat-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(22,58,47,.2), rgba(22,58,47,.9)); }
.flat-hero-content { position: relative; z-index: 1; padding-top: 100px; padding-bottom: 40px; }
.flat-hero .kicker { color: #f3c9a8; }
.flat-hero .rating-badge .muted { color: rgba(255,255,255,.8); }
.back { color: #fff; opacity: .85; text-decoration: none; font-weight: 600; font-size: .95rem; display: inline-block; margin-bottom: 18px; }
.back:hover { opacity: 1; }

.flat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; padding-top: 56px; padding-bottom: 72px; align-items: start; }
.h-photos { margin-top: 1.4em; }
.photo-group { margin-bottom: 30px; }
.photo-group h3 { font-family: var(--sans); font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gallery-item { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--sand); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s, opacity .2s; }
.gallery-item:hover img { transform: scale(1.05); }

.flat-side { position: sticky; top: 92px; display: grid; gap: 18px; }
.card { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.card h2 { font-size: 1.25rem; }
.card-accent { border: 2px solid var(--terra); }
.checklist { list-style: none; padding: 0; margin: 0 0 1em; }
.checklist li { padding: .35em 0 .35em 30px; position: relative; }
.checklist li::before {
	content: ""; position: absolute; left: 0; top: .6em; width: 18px; height: 18px; border-radius: 50%;
	background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z' fill='%23fff'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.other-flat { display: flex; gap: 24px; align-items: center; background: var(--white); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.other-flat img { width: 260px; aspect-ratio: 4 / 3; object-fit: cover; flex: none; }
.other-flat h3 { font-size: 1.6rem; }
.other-flat:hover h3 { color: var(--terra); }

.page-content { padding-top: 60px; padding-bottom: 80px; }

/* Visor de fotos */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(12, 18, 15, .95); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 92vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 92vw; max-height: 82vh; object-fit: contain; border-radius: 6px; }
.lightbox figcaption { color: #fff; margin-top: 12px; font-size: .95rem; opacity: .85; }
.lightbox button { position: absolute; background: rgba(255,255,255,.1); color: #fff; border: 0; cursor: pointer; font-size: 2rem; width: 52px; height: 52px; border-radius: 50%; line-height: 1; }
.lightbox button:hover { background: rgba(255,255,255,.22); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* Pie */
.site-footer { background: var(--green-dark); color: rgba(255,255,255,.8); padding: 48px 0 32px; font-size: .95rem; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 20px 40px; }
.footer-brand { font-family: var(--serif); font-size: 1.25rem; color: #fff; display: block; margin-bottom: 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: flex-start; }
.footer-links a { color: #fff; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.copy { grid-column: 1 / -1; font-size: .85rem; opacity: .6; margin: 12px 0 0; }

/* Responsive */
@media (max-width: 960px) {
	.facts-grid { grid-template-columns: repeat(2, 1fr); }
	.flat-layout { grid-template-columns: 1fr; }
	.flat-side { position: static; }
	.contact { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
	.menu-toggle { display: block; }
	.header-inner { gap: 12px; }
	.lang-switch { margin-left: auto; }
	.main-nav {
		position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
		background: var(--cream); border-bottom: 1px solid var(--line); padding: 8px 20px 20px;
		display: none;
	}
	.main-nav.open { display: flex; }
	.main-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
	.main-nav .nav-cta { text-align: center; margin-top: 12px; border: 0; padding: 12px; }
	.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
	.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
	.flat-cards, .steps { grid-template-columns: 1fr; }
	.section { padding: 64px 0; }
}
@media (max-width: 560px) {
	body { font-size: 16px; }
	.container { padding: 0 16px; }
	.brand-text { font-size: 1rem; white-space: normal; line-height: 1.1; }
	.brand-text em { display: block; font-size: .8rem; }
	.facts-grid { grid-template-columns: 1fr; gap: 16px; }
	.form-grid { grid-template-columns: 1fr; }
	.review-form-wrap { padding: 22px; }
	.gallery { grid-template-columns: repeat(2, 1fr); }
	.other-flat { flex-direction: column; align-items: stretch; }
	.other-flat img { width: 100%; }
	.other-flat div { padding: 0 20px 20px; }
	.footer-inner { grid-template-columns: 1fr; }
	.lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
