/* Projecte web d’Oriol Solà i Solà · © 2026 */
:root{--purple:#bb29bb;--ink:#202020;--paper:#f7f5ef;font-family:"DM Sans",Arial,sans-serif;color:var(--ink)}*{box-sizing:border-box}body{margin:0;background:#fff}a{color:inherit}.masthead{height:64px;padding:0 clamp(20px,4vw,64px);display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e8e2e8;background:#fff}.brand{display:flex;align-items:center;gap:11px;text-decoration:none}.brand img{width:34px;height:43px;object-fit:contain}.brand span{display:flex;flex-direction:column;line-height:1}.brand strong{font-size:17px;font-weight:800}.brand small{font-size:11px;font-weight:700;margin-top:4px}.masthead nav{display:flex;align-items:center;gap:22px;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}.masthead nav a{text-decoration:none}.masthead nav span{padding:8px 11px;border:1px solid #e8d9e8;color:#692269;background:#fbf4fb}.hero{padding:34px clamp(20px,4vw,64px) 30px;background:var(--paper);display:flex;align-items:end;justify-content:space-between;border-bottom:1px solid #e8e2e8}.kicker{margin:0 0 13px;color:#a51fa5;font-size:10px;font-weight:800;letter-spacing:.16em}.hero h1{margin:0;font-size:clamp(40px,4.2vw,66px);line-height:.93;letter-spacing:-.06em}.hero h1 em{font-style:normal;color:var(--purple)}.hero>p{max-width:390px;margin:0 0 5px;padding-left:28px;border-left:1px solid #d9ccd7;font-size:15px;line-height:1.5}.stats-shell{padding:24px clamp(20px,4vw,64px) 28px}.summary{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:16px}.summary article{padding:17px 19px;border:1px solid #e5dfe5;background:#fff}.summary span{display:block;color:#786a78;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.1em}.summary strong{display:block;margin-top:5px;font-size:29px;letter-spacing:-.04em}.level-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;margin:0 0 16px}.level-summary article{border:1px solid #e5dfe5;background:#f8f5f8;padding:15px 18px}.level-summary h2{margin:0 0 12px;color:#7c207c;font-size:12px;text-transform:uppercase;letter-spacing:.1em}.level-total{display:flex;align-items:baseline;gap:7px;margin-bottom:12px}.level-total strong{font-size:25px;line-height:1}.level-total span{color:#786a78;font-size:10px;text-transform:uppercase;letter-spacing:.08em}.level-summary dl{margin:0}.level-summary dl div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 0;border-top:1px solid #e4dbe4}.level-summary dt{font-size:11px;color:#665a66}.level-summary dd{display:flex;align-items:baseline;gap:8px;margin:0}.level-summary dd b{font-size:13px}.level-summary dd span{min-width:48px;color:#7c207c;font-size:12px;font-weight:800;text-align:right}.toolbar{display:grid;grid-template-columns:1.5fr .7fr;gap:12px;padding:15px 17px;background:#f8f5f8;border:1px solid #e5dfe5;border-bottom:0}.toolbar label{font-size:9px;font-weight:800;letter-spacing:.12em;color:#755b81}.toolbar input,.toolbar select{display:block;width:100%;height:41px;margin-top:5px;padding:0 11px;border:1px solid #d9d1d9;background:#fff;color:#2b202b;font-family:inherit;font-size:13px;font-weight:600}.table-wrap{overflow:auto;border:1px solid #e5dfe5}table{width:100%;min-width:930px;border-collapse:collapse}thead{background:#2a202a;color:#fff}th,td{padding:12px 13px;border-bottom:1px solid #ebe5eb;text-align:right;font-size:13px}thead th{font-size:9px;text-transform:uppercase;letter-spacing:.08em}thead th:first-child,tbody th{text-align:left}tbody th{width:25%;font-size:14px}.result-bar{position:relative;display:block;height:4px;margin-top:7px;background:#eee7ee;overflow:hidden}.result-bar i,.result-bar b{position:absolute;top:0;bottom:0}.result-bar i{left:0;background:var(--purple)}.result-bar b{background:#702270}.empty{text-align:center;padding:35px;color:#756875}.method{margin:12px 0 0;color:#6f636f;font-size:11px;line-height:1.5}footer{padding:11px clamp(20px,4vw,64px);border-top:1px solid #e8e2e8;display:flex;justify-content:space-between;gap:20px;color:#716371;font-size:9px}footer p{margin:0}footer strong{color:#7c207c}@media(max-width:700px){.masthead{height:58px;padding:0 13px}.brand img{width:28px;height:36px}.brand strong{font-size:14px}.brand small{font-size:9px}.masthead nav{gap:8px;font-size:8px}.masthead nav span{padding:6px}.hero{display:block;padding:22px 15px}.hero h1{font-size:40px}.hero>p{border-left:0;padding:15px 0 0;font-size:13px}.stats-shell{padding:14px 10px 20px}.summary{grid-template-columns:1fr 1fr}.summary article{padding:13px}.summary strong{font-size:23px}.level-summary{grid-template-columns:1fr}.level-summary article{padding:14px 16px}.level-summary h2{margin-bottom:10px}.level-total{margin-bottom:9px}.level-total strong{font-size:24px}.level-summary dl{display:grid;grid-template-columns:1fr 1fr;gap:12px}.level-summary dl div{display:block;padding:8px 0 0}.level-summary dd{justify-content:space-between;margin-top:4px}.level-summary dd span{min-width:0}.toolbar{grid-template-columns:1fr;padding:12px}.table-wrap{margin-top:0}th,td{padding:10px;font-size:12px}footer{display:block;padding:12px}footer small{display:block;margin-top:5px}}

/* Navegació principal entre el mapa i les estadístiques */
.masthead .section-nav{display:flex;align-items:stretch;gap:0;border:1px solid var(--purple);background:#fff;font-size:10px;letter-spacing:.06em}
.masthead .section-nav a{display:flex;align-items:center;justify-content:center;min-height:34px;padding:0 15px;color:#6f1d6f;background:#fff;text-decoration:none;white-space:nowrap}
.masthead .section-nav a+a{border-left:1px solid var(--purple)}
.masthead .section-nav a:hover,.masthead .section-nav a:focus-visible{background:#faeafa;color:#681568}
.masthead .section-nav a.active{background:var(--purple);color:#fff}
@media(max-width:700px){.masthead .section-nav{font-size:8px}.masthead .section-nav a{min-height:31px;padding:0 9px}}

/* Els filtres governen tots els resums que tenen a sota */
.toolbar{margin-bottom:16px;border-bottom:1px solid #e5dfe5}
@media(max-width:700px){
  html,body{max-width:100%;overflow-x:hidden}
  .table-wrap{overflow:visible;border:0}
  table{display:block;width:100%;min-width:0}
  thead{display:none}
  tbody{display:grid;gap:10px}
  tbody tr{display:grid;grid-template-columns:1fr 1fr;border:1px solid #e5dfe5;background:#fff}
  tbody th{grid-column:1/-1;width:auto;padding:14px 15px;background:#f8f5f8;border-bottom:1px solid #e5dfe5;font-size:15px;text-align:left}
  tbody td{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border-bottom:1px solid #eee8ee;text-align:right;font-size:13px}
  tbody td:nth-of-type(odd){border-right:1px solid #eee8ee}
  tbody td::before{content:attr(data-label);color:#766a76;font-size:9px;font-weight:800;letter-spacing:.05em;text-align:left;text-transform:uppercase}
  tbody td strong{color:#7c207c}
  tbody .empty{grid-column:1/-1;display:block;padding:28px 14px;text-align:center}
  tbody .empty::before{content:none}
  .result-bar{margin-top:9px}
}

/* Resum separat dels pilars */
.pillar-section{margin:0 0 16px}
.pillar-section>h2{margin:0 0 9px;color:#7c207c;font-size:10px;font-weight:800;letter-spacing:.13em;text-transform:uppercase}
.pillar-summary{margin-bottom:0}

/* Mode compacte quan se cerca un castell */
.summary[hidden],.level-summary[hidden],.pillar-section[hidden],.search-status[hidden]{display:none!important}
.summary small{display:block;margin-top:2px;color:#7c207c;font-size:11px;font-weight:800}
@media(max-width:700px){.level-summary dl{display:block}.level-summary dl div{display:flex;padding:7px 0}.level-summary dd{margin-top:0}}
.search-status{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0;padding:11px 14px;border:1px solid #e5dfe5;border-bottom:0;background:#f8f5f8;color:#665a66;font-size:12px}
.search-status strong{color:#7c207c;font-size:16px}
.search-status button{border:0;border-bottom:1px solid #8b1f8b;padding:2px 0;background:none;color:#8b1f8b;font:800 10px inherit;letter-spacing:.04em;text-transform:uppercase;cursor:pointer}
@media(max-width:700px){.search-status{padding:10px 12px}.search-status button{font-size:9px}}

@media(max-width:700px){.masthead{padding-left:6px;padding-right:6px}.brand{gap:4px}.brand img{width:24px;height:32px}.masthead .section-nav a{padding-left:5px;padding-right:5px;font-size:7px;letter-spacing:.03em}}
