/*
Theme Name: Fuster del Poble
Theme URI: https://fusterdelpoble.buildinghub.net
Author: BuildingHub
Author URI: https://buildinghub.net
Description: Tema a medida para Carpintería Fuster del Poble. Diseño moderno minimalista con galería de proyectos clasificada por sección (cocinas, baños, parquets, armarios, puertas, muebles) y subida de fotos simplificada para el cliente.
Version: 1.2.3
Requires at least: 6.0
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: fdp
Tags: portfolio, minimal, custom-colors, custom-menu
*/

/* ---------------------------------------------------------------
   1. Tokens
--------------------------------------------------------------- */
:root {
  --ink: #191512;
  --ink-2: #4a423b;
  --muted: #7d7268;
  --paper: #ffffff;
  --sand: #f7f4ef;
  --sand-2: #efe9e1;
  --line: #e4ddd3;
  --accent: #a9744f;
  --accent-dark: #8a5c3d;

  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 56px);

  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --step-4: clamp(2.6rem, 1.9rem + 3.4vw, 4.8rem);

  --radius: 2px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------------------------------------------------------------
   2. Reset
--------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------------------------------------------------------------
   3. Layout helpers
--------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 760px; }
.section { padding-block: clamp(64px, 9vw, 128px); }
.section--sand { background: var(--sand); }
.stack > * + * { margin-top: 1.1em; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: #fff; padding: 12px 20px;
}
.skip-link:focus { left: 12px; top: 12px; }

.eyebrow {
  font-family: "Inter", sans-serif;
  font-size: var(--step--1);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
  font-weight: 500;
}

.lead { font-size: var(--step-1); color: var(--ink-2); line-height: 1.5; }

/* ---------------------------------------------------------------
   4. Buttons
--------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 30px;
  border: 1px solid var(--ink);
  background: var(--ink); color: #fff;
  font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500;
  border-radius: var(--radius);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--light { background: #fff; color: var(--ink); border-color: #fff; }
.btn--light:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------------------------------------------------------------
   5. Header
--------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 78px;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand__name {
  font-family: "Fraunces", Georgia, serif; font-size: 1.28rem; letter-spacing: -0.02em;
}
.brand__mark { color: var(--accent); }
.brand img { max-height: 46px; width: auto; }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 34px); }
.nav ul { display: flex; gap: clamp(18px, 2.4vw, 34px); list-style: none; margin: 0; padding: 0; }
.nav a {
  font-size: var(--step--1); letter-spacing: 0.04em; color: var(--ink-2);
  position: relative; padding-block: 6px; transition: color .2s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after,
.nav .current-menu-item > a::after { transform: scaleX(1); }
.nav .current-menu-item > a { color: var(--ink); }

.header__cta { display: none; }
@media (min-width: 900px) { .header__cta { display: inline-flex; } }

.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 0 10px;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
}
.nav-toggle span { display: block; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 899px) {
  .nav {
    position: fixed; inset: 78px 0 auto; background: var(--paper);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 32px; border-bottom: 1px solid var(--line);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
  }
  .nav.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav li { border-bottom: 1px solid var(--line); }
  .nav a { display: block; padding: 16px 0; font-size: 1.05rem; }
  .nav a::after { display: none; }
}
@media (min-width: 900px) { .nav-toggle { display: none; } }

/* ---------------------------------------------------------------
   6. Hero
--------------------------------------------------------------- */
.hero { position: relative; padding-block: clamp(72px, 11vw, 150px) clamp(56px, 8vw, 110px); overflow: hidden; }
.hero__grid { display: grid; gap: clamp(36px, 5vw, 72px); align-items: center; }
@media (min-width: 940px) { .hero__grid { grid-template-columns: 1.05fr 0.95fr; } }
.hero h1 { font-size: var(--step-4); margin-bottom: 24px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero__media { position: relative; }
.hero__media img,
.hero__media .ph {
  aspect-ratio: 4 / 5; width: 100%; object-fit: cover; border-radius: var(--radius);
}
.hero__badge {
  position: absolute; left: -14px; bottom: 26px;
  background: var(--paper); border: 1px solid var(--line);
  padding: 18px 24px; max-width: 230px; border-radius: var(--radius);
}
.hero__badge strong { display: block; font-family: "Fraunces", serif; font-size: 1.9rem; line-height: 1; }
.hero__badge span { font-size: var(--step--1); color: var(--muted); }

/* Placeholder blocks (before real photos are loaded) */
.ph {
  background:
    linear-gradient(135deg, rgba(169,116,79,.10), rgba(169,116,79,.02)),
    repeating-linear-gradient(90deg, var(--sand-2) 0 2px, var(--sand) 2px 9px);
  display: grid; place-items: center;
  color: var(--muted); font-size: var(--step--1); letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--line);
}

/* ---------------------------------------------------------------
   7. Trust strip
--------------------------------------------------------------- */
.strip { border-block: 1px solid var(--line); }
.strip__inner {
  display: grid; gap: 1px; background: var(--line);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.strip__item { background: var(--paper); padding: 30px 26px; }
.strip__item strong { display: block; font-family: "Fraunces", serif; font-size: 1.6rem; line-height: 1; margin-bottom: 6px; }
.strip__item span { font-size: var(--step--1); color: var(--muted); }

/* ---------------------------------------------------------------
   8. Section headers
--------------------------------------------------------------- */
.sec-head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 64px); }
.sec-head h2 { font-size: var(--step-3); }
.sec-head--split {
  max-width: none; display: flex; flex-wrap: wrap; gap: 24px;
  align-items: end; justify-content: space-between;
}
.sec-head--split > div { max-width: 620px; }

/* ---------------------------------------------------------------
   9. Services
--------------------------------------------------------------- */
.services { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 700px) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .services { grid-template-columns: repeat(3, 1fr); } }
.service {
  background: var(--paper); padding: clamp(28px, 3.4vw, 44px);
  display: flex; flex-direction: column; gap: 12px; min-height: 230px;
  transition: background .3s var(--ease);
}
.service:hover { background: var(--sand); }
.service__num { font-size: var(--step--1); color: var(--accent); letter-spacing: .12em; }
.service h3 { font-size: var(--step-1); margin: 0; }
.service p { color: var(--muted); font-size: 0.96rem; margin: 0; }
.service__link {
  margin-top: auto; font-size: var(--step--1); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); display: inline-flex; align-items: center; gap: 8px;
}
.service__link::after { content: "\2192"; transition: transform .25s var(--ease); }
.service:hover .service__link::after { transform: translateX(5px); }

/* ---------------------------------------------------------------
   10. Gallery + filters
--------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 38px; }
.filter {
  padding: 10px 20px; border: 1px solid var(--line); background: transparent;
  border-radius: 100px; font-size: var(--step--1); letter-spacing: .04em; color: var(--ink-2);
  transition: all .22s var(--ease);
}
.filter:hover { border-color: var(--ink); color: var(--ink); }
.filter.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter__count { opacity: .55; margin-left: 6px; font-variant-numeric: tabular-nums; }

.grid {
  display: grid; gap: clamp(14px, 1.6vw, 22px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  align-items: start; /* cards keep their own height instead of stretching */
}
.card { position: relative; overflow: hidden; background: var(--sand); border-radius: var(--radius); }
.card__media { aspect-ratio: 4 / 3; overflow: hidden; }
.card--tall .card__media { aspect-ratio: 3 / 4; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.card:hover .card__media img { transform: scale(1.045); }
.card__body {
  position: absolute; inset: auto 0 0 0; padding: 20px 22px;
  background: linear-gradient(to top, rgba(25,21,18,.85), rgba(25,21,18,0));
  color: #fff; opacity: 0; transform: translateY(8px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.card:hover .card__body, .card:focus-within .card__body { opacity: 1; transform: none; }
.card__body h3 { font-size: 1.1rem; margin: 0 0 2px; color: #fff; }
.card__body span { font-size: var(--step--1); opacity: .8; }
.card__link { position: absolute; inset: 0; }
.grid__empty { grid-column: 1 / -1; padding: 60px 0; text-align: center; color: var(--muted); }

.is-hidden { display: none !important; }

/* ---------------------------------------------------------------
   11. Split feature
--------------------------------------------------------------- */
.split { display: grid; gap: clamp(32px, 5vw, 80px); align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }
.split--flip .split__media { order: -1; }
@media (max-width: 899px) { .split--flip .split__media { order: 0; } }
.split__media img, .split__media .ph { aspect-ratio: 1 / 1; width: 100%; object-fit: cover; }
.split h2 { font-size: var(--step-3); }
.ticks { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); }
.ticks li::before {
  content: ""; flex: 0 0 auto; width: 7px; height: 7px; margin-top: 10px;
  background: var(--accent); border-radius: 50%;
}

/* ---------------------------------------------------------------
   12. Contact
--------------------------------------------------------------- */
.contact-grid { display: grid; gap: clamp(32px, 5vw, 72px); }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 26px; }
.contact-list dt, .contact-list .label {
  font-size: var(--step--1); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.contact-list a { font-size: var(--step-1); border-bottom: 1px solid var(--line); transition: border-color .2s; }
.contact-list a:hover { border-color: var(--accent); color: var(--accent); }
.map-embed { aspect-ratio: 4 / 3; border: 1px solid var(--line); }
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------------------------------------------------------------
   12b. Reviews
--------------------------------------------------------------- */
.reviews { max-width: 680px; }
.reviews__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

/* ---------------------------------------------------------------
   13. CTA band
--------------------------------------------------------------- */
.cta {
  background: var(--ink); color: #fff; text-align: center;
  padding-block: clamp(60px, 8vw, 110px);
}
.cta h2 { font-size: var(--step-3); color: #fff; }
.cta p { color: rgba(255,255,255,.72); max-width: 540px; margin-inline: auto; }
.cta__actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 32px; }

/* ---------------------------------------------------------------
   14. Footer
--------------------------------------------------------------- */
.site-footer { background: var(--sand); border-top: 1px solid var(--line); padding-block: clamp(48px, 6vw, 80px) 32px; }
.footer-grid { display: grid; gap: 36px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h4 { font-family: "Inter", sans-serif; font-size: var(--step--1); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.site-footer a { color: var(--ink-2); transition: color .2s; }
.site-footer a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: var(--step--1); color: var(--muted);
}

/* ---------------------------------------------------------------
   15. Single project / pages
--------------------------------------------------------------- */
.page-hero { padding-block: clamp(56px, 7vw, 96px) clamp(30px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: var(--step-3); margin: 0; }
.page-hero p { margin-top: 14px; color: var(--muted); max-width: 620px; }
.crumbs { font-size: var(--step--1); color: var(--muted); margin-bottom: 14px; }
.crumbs a:hover { color: var(--accent); }

.entry { max-width: 760px; }
.entry img { margin-block: 2em; }
.entry h2 { font-size: var(--step-2); margin-top: 1.6em; }
.entry h3 { font-size: var(--step-1); margin-top: 1.4em; }
.entry ul, .entry ol { padding-left: 1.3em; }
.entry li { margin-bottom: .45em; }
.entry blockquote {
  margin: 2em 0; padding-left: 24px; border-left: 2px solid var(--accent);
  font-family: "Fraunces", serif; font-size: var(--step-1); font-style: italic; color: var(--ink-2);
}

.project-gallery { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); margin-top: 40px; }
.project-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.chip {
  font-size: var(--step--1); letter-spacing: .06em; padding: 7px 16px;
  border: 1px solid var(--line); border-radius: 100px; color: var(--ink-2);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.pager { display: flex; justify-content: space-between; gap: 20px; margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); font-size: var(--step--1); }

/* WP core alignment classes */
.alignleft { float: left; margin: .4em 1.6em 1em 0; }
.alignright { float: right; margin: .4em 0 1em 1.6em; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, figcaption { font-size: var(--step--1); color: var(--muted); text-align: center; margin-top: .6em; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap;
}

/* ---------------------------------------------------------------
   16. Reveal on scroll
--------------------------------------------------------------- */
/* Only hide when JS is present, so content is never invisible without it. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
