/*
Theme Name:   Tanol SM Colours
Theme URI:    https://tanol.es
Description:  Tema a medida de Tanol SM Colours. CSS portado 1:1 desde la web original en Flask (templates/index.html.j2). Contenido en post_meta (_mp_) via metaboxes en pestanas reordenables, mismo patron que el tema de PlayEdu.
Author:       Media Power
Author URI:   https://themediapower.com
Version:      1.0.0
Text Domain:  tanol
*/

:root {
  --bg:        #faf7f2;
  --bg-alt:    #efe9df;
  --bg-deep:   #2a2620;
  --ink:       #1f1c17;
  --ink-soft:  #4a443c;
  --muted:     #6b6258;
  --rule:      #d9cfc0;
  --accent:    #8a5a3b;
  --accent-dk: #6b432a;
  --serif:     "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans:      "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.15;
  color: var(--ink);
}

/* ---------- top nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
  background: rgba(250, 247, 242, 0);
  backdrop-filter: blur(6px);
  transition: background 200ms ease, box-shadow 200ms ease;
}
.nav.scrolled {
  background: rgba(250, 247, 242, 0.92);
  box-shadow: 0 1px 0 var(--rule);
}
.nav .brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  transition: color 200ms ease;
}
.nav.scrolled .brand { color: var(--ink); }
.nav .brand em { font-style: normal; color: var(--accent); }
.nav ul {
  display: flex; gap: clamp(1rem, 3vw, 2.5rem);
  list-style: none;
  font-size: 0.83rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.nav ul a {
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 200ms ease, color 200ms ease;
}
.nav.scrolled ul a { color: var(--ink-soft); }
.nav ul a:hover { opacity: 1; color: var(--accent); }
@media (max-width: 640px) {
  .nav ul { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: flex-end;
  padding: 6rem clamp(1.5rem, 5vw, 4rem) clamp(3rem, 8vh, 6rem);
  color: #fff;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--hero-img) center/cover no-repeat;
  transform: scale(1.03);
  z-index: 0;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.15) 35%, rgba(0,0,0,0.65) 100%);
  z-index: 1;
}
.hero > * { position: relative; z-index: 2; }
.hero .kicker {
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0.85;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  font-weight: 300;
  color: #fff;
  max-width: 22ch;
  margin-bottom: 1.4rem;
}
.hero h1 em { font-style: italic; color: #e6d6c1; }
.hero p.lead {
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  max-width: 50ch;
  font-weight: 300;
  opacity: 0.92;
}
.hero .scroll-cue {
  position: absolute; bottom: 1.8rem; right: clamp(1.5rem, 5vw, 4rem);
  font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase;
  writing-mode: vertical-rl;
  opacity: 0.75;
}

/* ---------- section scaffolding ---------- */
section {
  padding: clamp(4rem, 10vh, 7rem) clamp(1.5rem, 5vw, 4rem);
}
.wrap { max-width: 1200px; margin: 0 auto; }
.section-head { margin-bottom: clamp(2rem, 5vh, 3.5rem); }
.section-head .eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.section-head h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  max-width: 24ch;
}
.section-head h2 em { font-style: italic; color: var(--ink-soft); }
.section-head .lead {
  margin-top: 1.2rem;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* ---------- about ---------- */
.about { background: var(--bg); }
.about-grid {
  display: grid; gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 880px) {
  .about-grid { grid-template-columns: 1fr 1fr; align-items: center; }
}
.about p { color: var(--ink-soft); margin-bottom: 1rem; font-size: 1.05rem; }
.partner-badge {
  margin-top: 1.8rem;
  display: inline-flex; align-items: center; gap: 0.4rem 0.9rem;
  flex-wrap: wrap; justify-content: center;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--rule);
  background: var(--bg-alt);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.partner-badge > span, .partner-badge > strong { white-space: nowrap; }
.partner-badge strong { letter-spacing: 0.2em; color: var(--ink); font-weight: 500; }

/* ---------- services ---------- */
.services { background: var(--bg-alt); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(1.2rem, 2.5vw, 2rem);
}
.service {
  background: var(--bg);
  border: 1px solid var(--rule);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 300ms ease, box-shadow 300ms ease;
}
.service:hover { transform: translateY(-3px); box-shadow: 0 12px 32px -16px rgba(42,38,32,0.25); }
.service .img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-alt);
}
.service .img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 600ms ease;
}
.service:hover .img img { transform: scale(1.04); }
.service .body { padding: 1.4rem 1.4rem 1.6rem; }
.service h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.service p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ---------- materiales (MATTEOBRIONI feature) ---------- */
.materials { background: var(--bg-deep); color: #ece5d8; }
.materials .section-head .eyebrow { color: #d6a878; }
.materials .section-head h2 { color: #fff; }
.materials .section-head h2 em { color: #c9b89d; }
.materials .section-head .lead { color: #cbc1b1; }
.materials .lines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
  margin-top: 2.5rem;
}
.line {
  padding: 1.6rem;
  border: 1px solid #4a4239;
  background: rgba(255,255,255,0.02);
}
.line h3 {
  font-size: 1.3rem; color: #fff;
  margin-bottom: 0.4rem;
}
.line h3 small {
  display: block;
  font-family: var(--sans); font-size: 0.7rem;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: #d6a878; margin-bottom: 0.6rem; font-weight: 500;
}
.line p { color: #b6ac9c; font-size: 0.92rem; }
.materials .footnote {
  margin-top: 2.5rem;
  font-size: 0.92rem; color: #b6ac9c;
}
.materials .footnote a {
  color: #d6a878;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}

/* ---------- gallery ---------- */
.gallery { background: var(--bg); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(0.6rem, 1.2vw, 1rem);
}
.gallery-grid figure {
  overflow: hidden;
  background: var(--bg-alt);
}
.gallery-grid figure img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 700ms ease;
}
.gallery-grid figure:hover img { transform: scale(1.04); }
.g1 { grid-column: span 8; aspect-ratio: 16/10; }
.g2 { grid-column: span 4; aspect-ratio: 4/5; }
.g3 { grid-column: span 4; aspect-ratio: 4/5; }
.g4 { grid-column: span 8; aspect-ratio: 16/10; }
@media (max-width: 720px) {
  .g1, .g2, .g3, .g4 { grid-column: span 12; aspect-ratio: 4/3; }
}

/* ---------- contact ---------- */
.contact { background: var(--bg-alt); }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(1.4rem, 3vw, 2.5rem);
  margin-top: 2rem;
}
.contact-card {
  padding: 1.6rem 1.4rem;
  background: var(--bg);
  border: 1px solid var(--rule);
}
.contact-card .label {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.contact-card .value {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, color 200ms ease;
}
.contact-card .value:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Combined Teléfono · WhatsApp card: stacked number + action */
.contact-card .phone-line { display: block; }
.contact-card .phone-line + .phone-line { margin-top: 1.4rem; }
.contact-card .phone-line .value { display: inline-block; }
.contact-card .alt {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, color 200ms ease;
}
.contact-card .alt:hover { color: var(--accent-dk); border-bottom-color: var(--accent); }
.contact-card .phone-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--muted);
}

/* Showroom card: address block + 5-star badge */
.contact-card .address {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 0.7rem;
}
.contact-card .stars-badge {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.9rem;
  padding: 0.4rem 0.7rem;
  background: rgba(200, 154, 79, 0.10);
  border: 1px solid rgba(200, 154, 79, 0.40);
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 200ms ease, border-color 200ms ease;
}
.contact-card .stars-badge:hover {
  background: rgba(200, 154, 79, 0.18);
  border-color: rgba(200, 154, 79, 0.70);
}
.contact-card .stars-badge .stars {
  color: #c89a4f;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
  line-height: 1;
}
.contact-card .stars-badge .stars-text {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--bg-deep);
  color: #8c8377;
  padding: 2.5rem clamp(1.5rem, 5vw, 4rem);
  font-size: 0.82rem;
}
.site-footer .wrap {
  display: flex; gap: 1rem;
  flex-wrap: wrap; justify-content: space-between; align-items: center;
}
.site-footer .brand {
  font-family: var(--serif);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: #ece5d8;
}
.site-footer a { color: #c9b89d; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.credits { font-size: 0.74rem; max-width: 60ch; color: #6b6258; }

/* ---------- ajustes para el contexto WordPress ----------
   El marcado lo genera el tema, no un editor de bloques, asi que solo hace
   falta contemplar la barra de administracion y las clases que WordPress
   anade por su cuenta a las imagenes de la mediateca. */

body.admin-bar .nav { top: 32px; }
@media (max-width: 782px) { body.admin-bar .nav { top: 46px; } }

/* wp_get_attachment_image() emite width/height y clases propias. */
.service .img img,
.gallery-grid figure img { max-width: none; }

/* ---------- hero: formulario de visita (glass) ---------- */
.hero.has-form {
  align-items: flex-end;
  gap: clamp(2rem, 5vw, 5rem);
}
.hero.has-form > div:first-child { flex: 1 1 auto; }
/* hueco para el texto vertical de scroll, que va en la misma columna derecha */
.hero.has-form { padding-right: calc(clamp(1.5rem, 5vw, 4rem) + 2.2rem); }

.hero-form {
  flex: 0 0 clamp(320px, 32vw, 420px);
  padding: 1.8rem 1.8rem 1.4rem;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  color: #fff;
  font-family: var(--sans);
}
.hero-form .form-title {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 300;
  line-height: 1.1;
  margin: 0 0 0.3rem;
  color: #fff;
}
.hero-form .form-title em { font-style: italic; color: #e6d6c1; }
.hero-form .form-intro {
  font-size: 0.85rem;
  font-weight: 300;
  opacity: 0.85;
  margin: 0 0 1.2rem;
}
.hero-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.hero-form label {
  display: block;
  margin-bottom: 0.8rem;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.9;
}
.hero-form input,
.hero-form select,
.hero-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 0;
  color: #fff;
  font: 300 0.95rem/1.3 var(--sans);
  letter-spacing: 0;
  text-transform: none;
}
.hero-form textarea { resize: vertical; min-height: 2.6rem; }
.hero-form select {
  appearance: none;
  -webkit-appearance: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23fff'/%3E%3C/svg%3E") right 2px center/10px 6px no-repeat;
  cursor: pointer;
}
.hero-form select option { color: var(--ink); }
.hero-form ::placeholder { color: rgba(255, 255, 255, 0.55); }
.hero-form input:focus,
.hero-form select:focus,
.hero-form textarea:focus {
  outline: none;
  border-bottom-color: #e6d6c1;
}
.hero-form button {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.9rem 1rem;
  background: var(--accent);
  border: 0;
  border-radius: 2px;
  color: #fff;
  font: 500 0.72rem/1 var(--sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 200ms ease;
}
.hero-form button:hover { background: var(--accent-dk); }
.hero-form .legal {
  margin: 0.8rem 0 0;
  font-size: 0.7rem;
  font-weight: 300;
  opacity: 0.75;
}
.hero-form .legal a { color: #fff; }

@media (max-width: 880px) {
  .hero.has-form { flex-direction: column; align-items: stretch; justify-content: flex-end; padding-top: 7rem; padding-right: clamp(1.5rem, 5vw, 4rem); }
  .hero.has-form > div:first-child { flex: 0 0 auto; }
  .hero.has-form .hero-form { flex-basis: auto; }
  .hero.has-form .scroll-cue { display: none; }
}
@media (max-width: 420px) {
  .hero-form { padding: 1.4rem 1.2rem 1.1rem; }
  .hero-form .row { grid-template-columns: 1fr; gap: 0; }
}
/* Campo condicional (Empresa o estudio): label lleva display:block, [hidden] solo no basta. */
.hero-form [hidden] { display: none; }
/* Opciones largas ("Profesional del sector...") no deben ensanchar el formulario. */
.hero-form select { min-width: 0; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; padding-right: 1.2rem; }
.hero-form .row > label { min-width: 0; }
.hero-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hero-form .form-status {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 300;
  border-left: 2px solid #e6d6c1;
  background: rgba(0, 0, 0, 0.18);
}
.hero-form .form-status.is-ok { margin: 0.6rem 0 0; }
.hero-form .form-status.is-error { border-left-color: #f0a58a; }

/* Pie: enlaces legales + "Configurar cookies" (reabre el banner de Complianz). */
.credits .legal { display: block; margin-top: 0.5rem; }
.site-footer .footer-link {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: #c9b89d; cursor: pointer;
}
.site-footer .footer-link:hover { color: #fff; }

/* ---------- paginas interiores (textos legales) ---------- */
/* Fuera de la portada no hay hero oscuro debajo: la barra va siempre "con fondo". */
body:not(.home) .nav {
  background: rgba(250, 247, 242, 0.92);
  box-shadow: 0 1px 0 var(--rule);
}
body:not(.home) .nav .brand { color: var(--ink); }
body:not(.home) .nav ul a { color: var(--ink-soft); }

.page-text {
  padding: clamp(7rem, 14vh, 9rem) clamp(1.5rem, 5vw, 4rem) clamp(4rem, 10vh, 6rem);
}
.page-text h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 2.5rem;
}
.page-text .entry {
  max-width: 72ch;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.7;
}
.page-text .entry h2,
.page-text .entry h3,
.page-text .entry h4 { margin: 2.2rem 0 0.8rem; color: var(--ink); }
.page-text .entry h2 { font-size: 1.7rem; }
.page-text .entry h3 { font-size: 1.35rem; }
.page-text .entry h4 { font-size: 1.1rem; }
.page-text .entry p,
.page-text .entry ul,
.page-text .entry ol,
.page-text .entry table,
.page-text .entry details { margin-bottom: 1rem; }
.page-text .entry ul,
.page-text .entry ol { padding-left: 1.3rem; }
.page-text .entry a { color: var(--accent); }
.page-text .entry a:hover { color: var(--accent-dk); }
.page-text .entry table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.page-text .entry th,
.page-text .entry td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.page-text .entry summary { cursor: pointer; color: var(--ink); }
.page-text .entry button { font: inherit; }
