/*
Theme Name: Es Finestró
Author: Es Finestró
Description: Tema de blocs per a Es Finestró: editable, responsive i preparat per a espectacles, escoles i biblioteques.
Version: 1.8.0
Requires at least: 6.6
Requires PHP: 7.4
Text Domain: es-finestro
License: GPL-2.0-or-later
*/

:root{--ef-teal:#08aaa6;--ef-dark:#276b68;--ef-ink:#17201f;--ef-paper:#fff;--ef-cream:#fbf8ef;--ef-mist:#eaf6f5;--ef-line:#dce9e8;--ef-shadow:0 12px 35px rgba(23,32,31,.10)}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;overflow-x:hidden}a{color:inherit;text-underline-offset:3px}img{max-width:100%;height:auto}figure{margin:0}.wp-site-blocks>*,.es-home>*{margin-block-start:0!important;margin-block-end:0!important}

/* Capçalera global */
.es-header-shell{position:relative;z-index:20;background:#fff url(assets/confeti.jpg) center/cover;border-bottom:1px solid rgba(39,107,104,.12)}
.es-header{display:flex;align-items:center;justify-content:space-between;max-width:1540px;margin:auto;padding:20px max(3vw,22px);gap:32px;min-height:112px}
.es-brand{display:flex;align-items:center;gap:14px;min-width:0}.es-brand .wp-block-site-logo{margin:0}.es-brand .wp-block-site-logo img{width:88px;height:88px;object-fit:contain;filter:brightness(0) saturate(100%)}.es-brand .wp-block-site-title{display:none}.es-brand a{text-decoration:none}
.es-header .wp-block-navigation{font-size:15px;font-weight:700}.es-header .wp-block-navigation__container{gap:clamp(18px,2.4vw,38px)}.es-header .wp-block-navigation a:hover{color:var(--ef-dark)}

/* Portada */
.es-hero{background:#eef8f7 url(assets/confeti.jpg) center/cover;padding:0;width:100%}.es-hero figure{width:100%;max-width:none;margin:0;overflow:hidden}.es-hero img{width:100%;height:auto;max-height:none;min-height:0;object-fit:cover;display:block}
.es-intro{text-align:center;padding:clamp(58px,8vw,105px) 24px;background:url(assets/confeti.jpg) center/cover}.es-kicker,.es-intro>p:first-child,.es-shows>p:first-child,.es-workshops>p:first-child{font-size:13px;letter-spacing:.13em;text-transform:uppercase;color:var(--ef-dark);font-weight:800}.es-intro h1{font-size:clamp(38px,5vw,68px);max-width:950px;margin:14px auto 30px;line-height:1.05;letter-spacing:-.035em}.wp-block-buttons{display:flex;gap:14px;flex-wrap:wrap}.es-intro .wp-block-buttons,.es-shows>.wp-block-buttons,.es-cta .wp-block-buttons{justify-content:center}.wp-block-button__link{display:inline-block;background:var(--ef-teal);color:#fff!important;text-decoration:none;padding:14px 25px;font-size:16px;font-weight:750;border-radius:999px;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}.wp-block-button__link:hover{background:var(--ef-dark);transform:translateY(-1px);box-shadow:0 8px 20px rgba(39,107,104,.18)}
.es-about{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(36px,6vw,84px);align-items:center;max-width:1450px;margin:auto!important;padding:clamp(65px,8vw,110px) 30px}.es-about h2{font-size:clamp(31px,3.7vw,50px);line-height:1.12;letter-spacing:-.025em}.es-about img{width:100%;max-height:610px;object-fit:cover;border-radius:22px;box-shadow:var(--ef-shadow)}.es-copy p{line-height:1.72}
.es-shows{text-align:center;padding:clamp(70px,8vw,105px) max(4vw,24px);background:var(--ef-cream) url(assets/fons-espectacles.jpg) bottom/cover}.es-shows>h2,.es-workshops>h2{font-size:clamp(31px,4vw,50px);max-width:900px;margin:15px auto 48px;line-height:1.12;letter-spacing:-.025em}
.es-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(20px,3vw,36px);max-width:1450px;margin:0 auto 44px!important}.es-card{text-align:left;background:#fff;padding-bottom:24px;overflow:hidden;border-radius:18px;box-shadow:0 5px 20px rgba(23,32,31,.07);transition:transform .18s ease,box-shadow .18s ease}.es-card:hover{transform:translateY(-3px);box-shadow:var(--ef-shadow)}.es-card img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block}.es-card h3{padding:0 22px;font-size:22px;line-height:1.2;margin-top:22px}.es-card p{padding:0 22px;color:#52605f}.es-card .wp-block-buttons{padding:0 22px}.es-card .wp-block-button__link{padding:11px 18px;font-size:14px}
.es-workshops{text-align:center;padding:clamp(70px,8vw,105px) max(6vw,24px);background:var(--ef-mist) url(assets/fons-tallers.jpg) top/cover}.es-workshops .es-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-width:880px}.es-cta{text-align:center;padding:clamp(85px,10vw,135px) 24px;background:url(assets/banderins.jpg) center/cover}.es-cta h2{font-size:clamp(31px,4vw,48px);max-width:800px;margin-left:auto;margin-right:auto;letter-spacing:-.02em}.es-cta p{max-width:700px;margin-left:auto;margin-right:auto}

/* Pàgines interiors */
.es-page{max-width:1450px;margin:auto!important;padding:clamp(48px,7vw,90px) 30px}.es-page>.wp-block-post-title{color:var(--ef-dark);font-size:clamp(34px,5vw,58px);line-height:1.08;margin-bottom:46px;letter-spacing:-.03em}.es-page .wp-block-post-content>p,.es-page .wp-block-post-content>h2,.es-page .wp-block-post-content>h3,.es-page .wp-block-post-content>ul,.es-page .wp-block-post-content>ol{max-width:850px}.es-page .wp-block-post-content>p{line-height:1.75}.es-page .wp-block-post-content>h2{font-size:clamp(27px,3vw,40px);line-height:1.18;margin-top:50px}.es-page .wp-block-post-content>h3{font-size:24px;margin-top:36px}.es-page .wp-block-post-content>.wp-block-image{max-width:900px;margin:34px 0}.es-page .wp-block-post-content>.wp-block-image img{max-height:650px;object-fit:contain;border-radius:18px}.es-page .es-grid{margin-left:0!important}.es-page-intro{max-width:850px;font-size:clamp(19px,2vw,23px);line-height:1.55;color:#43504f;margin-bottom:44px}.es-detail-hero{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(280px,.85fr);gap:clamp(28px,5vw,64px);align-items:center;margin-bottom:48px}.es-detail-hero img{width:100%;border-radius:20px;box-shadow:var(--ef-shadow)}.es-detail-meta{background:var(--ef-mist);padding:28px;border-radius:18px}.es-detail-meta p{margin:7px 0}.es-objectives{background:#f6faf9;border-left:4px solid var(--ef-teal);padding:25px 28px;border-radius:0 14px 14px 0}.es-objectives ul{margin-bottom:0}.ef-contact-strip{display:flex;gap:12px;flex-wrap:wrap;align-items:center;font-size:19px;font-weight:700;margin:16px 0 28px}.ef-contact-strip a{color:var(--ef-dark)}.ef-dynamic-button{margin-top:22px}

/* Peu global */
.es-footer-shell{background:#f2f6f5;border-top:1px solid var(--ef-line)}.es-footer{display:grid;grid-template-columns:minmax(220px,1.2fr) 1fr 1fr;gap:clamp(30px,6vw,80px);max-width:1450px;margin:auto;padding:60px 30px}.es-footer-brand{display:flex;align-items:flex-start;gap:16px}.es-footer .wp-block-site-logo img{width:72px;height:72px;object-fit:contain}.es-footer h3{margin:0 0 13px}.es-footer p{font-size:15px;margin:7px 0}.es-footer a{text-decoration:none}.es-footer a:hover{text-decoration:underline}.es-footer-legal{border-top:1px solid var(--ef-line);padding:18px 30px;text-align:center;font-size:13px;color:#65706f}

/* Utilitats i accessibilitat */
.es-section-heading{max-width:900px}.es-muted{color:#65706f}.es-404{max-width:900px;margin:auto;padding:100px 30px;text-align:center}.es-404 h1{font-size:clamp(38px,6vw,70px)}a:focus-visible,button:focus-visible{outline:3px solid #8a208c;outline-offset:4px;border-radius:4px}

@media(max-width:900px){.es-about,.es-detail-hero{grid-template-columns:1fr}.es-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.es-footer{grid-template-columns:1.2fr 1fr}.es-footer-nav{grid-column:2}.es-header{min-height:94px;padding-top:14px;padding-bottom:14px}.es-brand .wp-block-site-logo img{width:72px;height:72px}}
@media(max-width:650px){.es-header{gap:12px}.es-hero{padding:0}.es-hero figure{border-radius:0}.es-hero img{min-height:0;object-position:40% center}.es-grid,.es-workshops .es-grid{grid-template-columns:1fr}.es-card img{aspect-ratio:16/10}.es-about,.es-page{padding-left:20px;padding-right:20px}.es-footer{grid-template-columns:1fr;gap:28px;padding:45px 22px}.es-footer-nav{grid-column:auto}.ef-contact-strip{font-size:17px}.wp-block-button__link{width:100%;text-align:center}.wp-block-buttons{width:100%}.wp-block-button{width:100%}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.es-card,.wp-block-button__link{transition:none}}


/* V6 — Fitxes inspirades en el web original */
.es-activity-layout,.es-who-layout{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr);gap:clamp(38px,6vw,88px);align-items:start;margin-bottom:clamp(38px,5vw,62px)!important}
.es-activity-copy>p,.es-who-copy>p{line-height:1.72}.es-activity-copy>p:first-child{font-size:14px;font-weight:750;color:var(--ef-dark);text-transform:uppercase;letter-spacing:.06em}.es-activity-copy h2,.es-who-copy h2{font-size:clamp(30px,3.5vw,48px);line-height:1.12;margin-top:12px}
.es-activity-image,.es-who-image{position:sticky;top:28px}.es-activity-image figure,.es-who-image figure{width:100%;margin:0}.es-activity-image img,.es-who-image img{width:100%;height:auto;display:block;border-radius:0;box-shadow:none;object-fit:cover}
.es-purple-box{background:#76227b;color:#fff;padding:clamp(28px,4vw,48px);margin:0 0 30px!important}.es-purple-box>*:first-child{margin-top:0}.es-purple-box>*:last-child{margin-bottom:0}.es-purple-box h2,.es-purple-box h3,.es-purple-box p,.es-purple-box li,.es-purple-box a{color:#fff}.es-purple-box h2,.es-purple-box h3{font-size:clamp(23px,2.5vw,34px);margin-top:0}.es-purple-box p{line-height:1.72}.es-purple-box ul{padding-left:1.25em}
.es-page .es-activity-layout+.es-purple-box{max-width:none}.es-page .es-purple-box>p,.es-page .es-purple-box>h2,.es-page .es-purple-box>h3,.es-page .es-purple-box>ul,.es-page .es-purple-box>ol{max-width:none}

/* V6 — Graelles d'espectacles: imatge = enllaç i mida uniforme */
.es-grid .es-card{padding-bottom:20px}.es-grid .es-card figure.wp-block-image{width:100%;aspect-ratio:4/3;overflow:hidden;margin:0}.es-grid .es-card figure.wp-block-image>a.es-card-image-link{display:block;width:100%;height:100%}.es-grid .es-card figure.wp-block-image img{width:100%!important;height:100%!important;aspect-ratio:auto!important;object-fit:cover!important;display:block;transition:transform .22s ease}.es-grid .es-card figure.wp-block-image>a:hover img{transform:scale(1.025)}.es-grid .es-card .wp-block-buttons{display:none}.es-grid .es-card h3{margin-bottom:4px}

/* Qui som */
.es-who-image img{aspect-ratio:4/5;object-fit:cover}.es-who-copy h2{margin-top:0}

@media(max-width:900px){.es-activity-layout,.es-who-layout{grid-template-columns:1fr}.es-activity-image,.es-who-image{position:static}.es-activity-image{order:-1}.es-who-image{order:-1}.es-activity-image img,.es-who-image img{max-height:620px;object-fit:cover}.es-purple-box{padding:28px}}
@media(max-width:650px){.es-grid .es-card figure.wp-block-image{aspect-ratio:16/10}.es-purple-box{margin-left:-20px!important;margin-right:-20px!important;padding:26px 20px}}


/* V7: alineació exacta de les targetes i imatges fixes a les fitxes */
.es-grid > .es-card{margin-block-start:0!important;margin-block-end:0!important;align-self:start}
.es-activity-image{position:static!important;top:auto!important}


/* V8 — més amplada útil en pantalles grans */
@media(min-width:1200px){
  .es-header{padding-left:40px;padding-right:40px}
  .es-about,.es-page{padding-left:40px;padding-right:40px}
  .es-shows,.es-workshops{padding-left:40px;padding-right:40px}
  .es-grid{gap:32px}
  .es-footer{padding-left:40px;padding-right:40px}
}


/* V9 — amplada real del contingut en pantalles grans */
@media(min-width:1200px){
  .es-header,
  .es-about,
  .es-page,
  .es-footer{
    width:min(1680px, calc(100vw - 64px))!important;
    max-width:none!important;
    margin-left:auto!important;
    margin-right:auto!important;
    padding-left:0!important;
    padding-right:0!important;
  }
  .es-shows,
  .es-workshops{
    padding-left:32px!important;
    padding-right:32px!important;
  }
  .es-grid{
    width:min(1680px, calc(100vw - 64px))!important;
    max-width:none!important;
    margin-left:auto!important;
    margin-right:auto!important;
    gap:36px!important;
  }
  .es-page > .wp-block-post-content,
  .es-page .wp-block-post-content > .es-grid,
  .es-page .wp-block-post-content > .es-activity-layout,
  .es-page .wp-block-post-content > .es-who-layout,
  .es-page .wp-block-post-content > .es-purple-box{
    width:100%!important;
    max-width:none!important;
  }
  .es-activity-layout,.es-who-layout{
    grid-template-columns:minmax(0,1.25fr) minmax(360px,.75fr)!important;
  }
}


/* V10 — amplada gairebé completa de pantalla */
@media (min-width: 1100px){
  .es-header,
  .es-page,
  .es-about,
  .es-footer{
    width:calc(100vw - 80px)!important;
    max-width:1760px!important;
    margin-left:auto!important;
    margin-right:auto!important;
    padding-left:0!important;
    padding-right:0!important;
  }
  .es-page > .wp-block-post-title{
    max-width:none!important;
  }
  .es-page > .wp-block-post-content,
  .es-page .wp-block-post-content{
    width:100%!important;
    max-width:none!important;
  }
  .es-page .es-grid,
  .es-grid{
    width:100%!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
    gap:clamp(26px,2vw,42px)!important;
  }
  .es-page-intro,
  .es-page .wp-block-post-content > p,
  .es-page .wp-block-post-content > h2,
  .es-page .wp-block-post-content > h3,
  .es-page .wp-block-post-content > ul,
  .es-page .wp-block-post-content > ol{
    max-width:980px;
  }
  .es-activity-layout,
  .es-who-layout{
    width:100%!important;
    max-width:none!important;
  }
}
@media (min-width: 1600px){
  .es-header,.es-page,.es-about,.es-footer{
    width:calc(100vw - 96px)!important;
  }
}

/* V11 — amplades per tipus de pàgina, fitxes centrades i fotografia vertical fixa */
@media (min-width:1100px){
  /* La capçalera conserva l'amplada generosa de V10. */
  .es-header{width:calc(100vw - 80px)!important;max-width:1760px!important}

  /* Portada: contingut interior amb marges més còmodes; la foto hero continua a pantalla completa. */
  .es-about{width:min(1380px,calc(100vw - 150px))!important;max-width:1380px!important}

  /* Pàgines normals (Qui som i fitxes): marges amplis. */
  .es-page{width:min(1380px,calc(100vw - 150px))!important;max-width:1380px!important}

  /* Catàlegs d'Escoles i Teatres/Biblioteques: recuperen l'amplada més compacta d'abans. */
  body.es-catalogue-page .es-page{width:min(1100px,calc(100vw - 110px))!important;max-width:1100px!important}
  body.es-catalogue-page .es-page .es-grid{width:100%!important;max-width:1100px!important;gap:32px!important}
}

/* Fitxes d'activitats: títol i subtítol centrats abans de les dues columnes. */
body.es-activity-page .es-page>.wp-block-post-title{text-align:center;margin-left:auto;margin-right:auto;margin-bottom:12px;max-width:1120px!important}
.es-activity-heading{text-align:center;max-width:1080px;margin:0 auto clamp(34px,4vw,54px)!important}
.es-activity-heading .es-activity-kicker{margin:0 0 10px;font-size:14px;font-weight:800;letter-spacing:.07em;text-transform:uppercase;color:var(--ef-dark)}
.es-activity-heading h2{margin:0;font-size:clamp(27px,3vw,42px);line-height:1.16;color:var(--ef-ink)}

/* A sota, text a l'esquerra i una foto vertical gran, gairebé mitja pàgina. */
.es-activity-layout{grid-template-columns:minmax(0,1.08fr) minmax(390px,.92fr)!important;gap:clamp(40px,5vw,76px)!important;align-items:start!important}
.es-activity-copy>p:first-child{font-size:inherit;font-weight:inherit;color:inherit;text-transform:none;letter-spacing:normal}
.es-activity-image figure,.es-who-image figure{width:100%;aspect-ratio:4/5;overflow:hidden;margin:0;background:#f2f2f2}
.es-activity-image img,.es-who-image img{width:100%!important;height:100%!important;max-height:none!important;object-fit:cover!important;object-position:center center;display:block}

/* Qui som manté text a l'esquerra i fotografia vertical fixa a la dreta. */
.es-who-layout{grid-template-columns:minmax(0,1.1fr) minmax(390px,.9fr)!important;gap:clamp(42px,5vw,76px)!important}

@media(max-width:900px){
  .es-activity-heading{text-align:left;margin-bottom:28px!important}
  body.es-activity-page .es-page>.wp-block-post-title{text-align:left}
  .es-activity-layout,.es-who-layout{grid-template-columns:1fr!important}
  .es-activity-image figure,.es-who-image figure{max-width:560px;aspect-ratio:4/5}
}
