/* meteo.relleus.cat — estils (identitat de Relleus, vegeu la maqueta v2) */
:root {
  --verd-fosc: #213602;
  --verd: #3A8024;
  --enllac: #2c5e14;
  --enllac-hover: #1d4209;
  --groc: #C4C40E;
  --fons: #f2f3ee;
  --text: #1f2419;
  --text-2: #4a4f43;
  --vora: #d4d7ca;
  --vora-2: #c8cbbd;
  --verd-suau: #e7f1dc;
  --verd-suau-text: #24480f;
  --groc-suau: #fbf9df;
  --groc-vora: #e6e39a;
  --bo: #7fbf5a;
  --acc: #f0c46e;
  --no: #f1d2cf;
  --s-verd: #2E6B1C;
  --s-taronja: #E8A33D;
  --s-vermell: #B3261E;
  --s-gris: #8d927f;
  --pluja: #2f6fb3;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Barlow', system-ui, sans-serif; color: var(--text); background: var(--fons); font-size: 16px; line-height: 1.35; }
a { color: var(--enllac); }
a:hover { color: var(--enllac-hover); }
button, select { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, .num { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; }
h1, h2 { margin: 0; }
.amagat { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--groc); outline-offset: 2px; }

/* ------------------------------------------------ capçalera */
.barra { background: #fff; border-bottom: 1px solid var(--vora); }
.barra-dins { max-width: 1240px; margin: 0 auto; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.marca { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.marca img { height: 42px; width: auto; display: block; }
.marca span { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: 1px; color: var(--verd-fosc); }
.opcions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.boto { min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--vora-2); background: #fff; font-weight: 700; font-size: 14px; cursor: pointer; }
.boto:hover { background: var(--fons); }
.boto.primari { border: none; background: var(--groc); color: var(--text); }
.boto.actiu { border-color: var(--verd-fosc); background: var(--verd-fosc); color: #fff; }
.idiomes { background: #fff; border-bottom: 1px solid var(--vora); }
.idiomes-dins { max-width: 1240px; margin: 0 auto; padding: 0 12px 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 700px) { .idiomes-dins { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.capcal { background: var(--verd-fosc); color: #fff; }
.capcal-dins { max-width: 1240px; margin: 0 auto; padding: 12px 16px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.capcal h1 { font-weight: 700; font-size: 30px; line-height: 1; flex: 1 1 auto; }
.capcal .sub { font-size: 13px; color: rgba(255,255,255,.85); flex-basis: 100%; }
.capcal .viu { display: flex; align-items: center; gap: 6px; font-size: 13px; color: rgba(255,255,255,.85); flex-basis: 100%; }
.punt { width: 8px; height: 8px; border-radius: 50%; background: #9fd36b; flex: none; }
.punt.vell { background: var(--s-taronja); }
.capcal .altres { min-height: 40px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.4); color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; }
@media (min-width: 900px) {
  .capcal h1 { font-size: 36px; flex: 0 1 auto; }
  .capcal .sub { flex-basis: auto; font-size: 15px; }
  .capcal .viu { flex-basis: auto; margin-left: auto; }
}

/* ------------------------------------------------ contenidor */
.pagina { max-width: 1240px; margin: 0 auto; padding: 10px 12px 24px; }
@media (min-width: 900px) { .pagina { padding: 20px 24px 32px; } }
.targeta { background: #fff; border: 1px solid var(--vora); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.targeta h2 { font-size: 22px; }
@media (min-width: 900px) { .targeta { padding: 18px; } .targeta h2 { font-size: 24px; } }
.cap-targeta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.nota { font-size: 13px; color: var(--text-2); }
.peita { font-size: 12px; color: var(--text-2); }

/* ------------------------------------------------ resum */
.resum { display: grid; gap: 12px; }
@media (min-width: 900px) { .resum { grid-template-columns: minmax(250px, 1fr) minmax(290px, 1.2fr) minmax(340px, 1.6fr); gap: 18px; align-items: stretch; } }
.semafor-fila { display: flex; align-items: center; gap: 10px; }
.llums { display: flex; gap: 4px; padding: 5px 7px; border-radius: 999px; background: var(--text); flex: none; }
.llums span { width: 14px; height: 14px; border-radius: 50%; }
.llums .r { background: #4a2320; } .llums .t { background: #4d3a1c; } .llums .v { background: #234a20; }
.llums .r.on { background: #e5483f; box-shadow: 0 0 8px #e5483f; }
.llums .t.on { background: #f2b544; box-shadow: 0 0 8px #f2b544; }
.llums .v.on { background: #5fbf3a; box-shadow: 0 0 8px #5fbf3a; }
@media (min-width: 900px) {
  .llums { flex-direction: column; gap: 7px; padding: 9px; border-radius: 16px; }
  .llums span { width: 24px; height: 24px; }
  .semafor-fila { gap: 16px; padding-right: 18px; border-right: 1px solid #e3e5dc; }
}
.semafor-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.semafor-text .pregunta { font-size: 12px; font-weight: 600; color: var(--text-2); }
.semafor-text strong { font-family: 'Barlow Condensed', sans-serif; font-size: 24px; line-height: 1.05; }
.semafor-text .motius { font-size: 13px; color: var(--text-2); }
@media (min-width: 900px) { .semafor-text .pregunta { font-size: 14px; } .semafor-text strong { font-size: 34px; } .semafor-text .motius { font-size: 14px; } }
.nivell-green { color: var(--s-verd); } .nivell-orange { color: #a5650a; } .nivell-red { color: var(--s-vermell); } .nivell-grey, .nivell-none { color: var(--s-gris); }
.boto-rodo { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--vora-2); background: var(--fons); color: var(--enllac); font-weight: 700; font-size: 18px; cursor: pointer; flex: none; }
.llegenda-curta { display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.4; background: var(--fons); border-radius: 12px; padding: 12px; }
.llegenda-curta div, .llegenda div { display: flex; gap: 8px; }
.rodona { width: 14px; height: 14px; border-radius: 50%; flex: none; margin-top: 3px; }
.rodona.v { background: var(--s-verd); } .rodona.t { background: var(--s-taronja); } .rodona.r { background: var(--s-vermell); }

.vent-ara { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--verd-suau); color: var(--verd-suau-text); }
.vent-ara svg { flex: none; width: 52px; height: 52px; }
.vent-ara .xifra { display: flex; align-items: baseline; gap: 6px; color: var(--text); }
.vent-ara .xifra b { font-family: 'Barlow Condensed', sans-serif; font-size: 40px; line-height: 1; }
.vent-ara .xifra span { font-size: 15px; font-weight: 600; }
.vent-ara .nom { font-size: 17px; font-weight: 700; }
.vent-ara .det { font-size: 13px; }
@media (min-width: 900px) { .vent-ara svg { width: 76px; height: 76px; } .vent-ara .xifra b { font-size: 50px; } .vent-ara .nom { font-size: 19px; } .vent-ara .det { font-size: 14px; } }

.rajoles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.rajola { background: var(--fons); border-radius: 12px; padding: 8px; min-width: 0; }
.rajola span { display: block; font-size: 12px; color: var(--text-2); }
.rajola strong { font-size: 19px; white-space: nowrap; }
.rajola.groga { background: var(--groc-suau); border: 1px solid var(--groc-vora); }
.rajola .tend { font-size: 15px; color: #8a5a00; }
@media (min-width: 900px) { .rajola { padding: 10px; } .rajola span { font-size: 13px; } .rajola strong { font-size: 22px; } }
.pista { font-size: 12px; color: var(--text-2); text-align: center; }
@media (min-width: 900px) { .pista { display: none; } }

/* ------------------------------------------------ personalitzar */
.pers-obrir { display: flex; justify-content: flex-end; padding: 12px 0 0; }
.pers { margin-top: 10px; border: 2px solid var(--verd); }
.pers-llista { display: grid; gap: 8px; }
@media (min-width: 900px) { .pers-llista { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pers-item { display: flex; align-items: center; gap: 6px; min-height: 52px; border: 1px solid var(--vora); border-radius: 12px; padding: 4px 6px; background: #f8f9f4; }
.pers-item.arrossegant { opacity: .5; }
.pers-item .nanses { color: var(--s-gris); font-size: 18px; cursor: grab; padding: 0 2px; user-select: none; }
.pers-item .nom { flex: 1; font-size: 15px; font-weight: 600; min-width: 0; }
.interruptor { width: 40px; height: 40px; flex: none; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 17px; border: 2px solid var(--vora-2); background: #fff; color: #fff; }
.interruptor[aria-checked="true"] { border: none; background: var(--verd); }
.fletxa { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--vora); background: #fff; cursor: pointer; flex: none; }
.enllac-boto { align-self: flex-start; min-height: 44px; border: none; background: transparent; color: var(--enllac); font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0; }

/* ------------------------------------------------ targetes */
.targetes { display: grid; gap: 12px; margin-top: 12px; }
@media (min-width: 900px) { .targetes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; } .ampla { grid-column: span 2; } }
.rosa { align-self: center; width: 100%; max-width: 320px; height: auto; }
.claus { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text-2); }
.claus.centre { justify-content: center; }
.clau { display: inline-flex; align-items: center; gap: 6px; }
.clau i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.clau i.linia { height: 3px; width: 16px; border-radius: 0; }
.periodes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 900px) { .periodes { display: flex; } .periodes .boto { min-width: 64px; } }
.grafic { width: 100%; height: auto; display: block; overflow: visible; }
.grafic text { font-family: 'Barlow', sans-serif; fill: var(--text-2); }
.gran { font-family: 'Barlow Condensed', sans-serif; font-size: 52px; line-height: 1; font-weight: 700; }
.mitja { font-family: 'Barlow Condensed', sans-serif; font-size: 40px; line-height: 1; font-weight: 700; }
.fila { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.parella { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.caixa { background: var(--fons); border-radius: 12px; padding: 10px; }
.caixa span { display: block; font-size: 13px; color: var(--text-2); }
.caixa strong { font-size: 20px; }
.caixa.groga { background: var(--groc-suau); border: 1px solid var(--groc-vora); }
.desplega { min-height: 44px; border-radius: 12px; border: 1px solid var(--vora-2); background: var(--fons); color: var(--enllac); font-weight: 700; font-size: 15px; cursor: pointer; }
@media (min-width: 900px) { .desplega { display: none; } .plegable { display: flex !important; flex-direction: column; gap: 8px; } }
.plegable { flex-direction: column; gap: 8px; }
.subtitol { font-size: 13px; font-weight: 700; color: var(--text-2); }
.subtitol.sol-ara { color: #6b6a0a; }
.fila .tend { font-size: 15px; color: #8a5a00; }
.estat-graella { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; font-size: 14px; }
.estat-graella strong { display: block; font-size: 18px; }
.webcam-marc { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: repeating-linear-gradient(135deg, #dfe3d4 0 12px, #e9ece1 12px 24px); display: flex; align-items: center; justify-content: center; }
.webcam-marc iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.webcam-dialeg { width: min(96vw, 1400px); max-width: none; padding: 12px; border: none; border-radius: 16px; background: #111; color: #fff; }
.webcam-dialeg::backdrop { background: rgba(0, 0, 0, .8); }
.webcam-dialeg .webcam-marc { background: #000; max-height: calc(100vh - 110px); }
.dialeg-cap { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.dialeg-cap strong { font-family: 'Barlow Condensed', sans-serif; font-size: 22px; }
.dialeg-cap .boto { background: #fff; color: var(--text); }

.llegenda { display: grid; gap: 12px; font-size: 14px; line-height: 1.45; }
@media (min-width: 900px) { .llegenda { grid-template-columns: repeat(3, minmax(0, 1fr)); } .llegenda-targeta { grid-column: 1 / -1; } }

/* ------------------------------------------------ portada */
.llocs { display: grid; gap: 10px; }
@media (min-width: 900px) { .llocs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
.lloc { text-decoration: none; color: var(--text); background: #fff; border: 1px solid var(--vora); border-left: 6px solid var(--s-gris); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.lloc.green { border-left-color: var(--s-verd); } .lloc.orange { border-left-color: var(--s-taronja); } .lloc.red { border-left-color: var(--s-vermell); }
.lloc.aviat { border: 1px dashed var(--vora-2); color: var(--text-2); }
.lloc .titol { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lloc .titol strong { font-family: 'Barlow Condensed', sans-serif; font-size: 24px; line-height: 1; color: var(--text); }
.lloc .titol span { font-size: 12px; }
.lloc .dades { display: flex; align-items: center; gap: 12px; }
.xip { border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; white-space: nowrap; color: #fff; background: var(--s-gris); }
.xip.green { background: var(--s-verd); } .xip.orange { background: var(--s-taronja); color: var(--text); } .xip.red { background: var(--s-vermell); }

/* ------------------------------------------------ peu */
.peu { border-top: 1px solid var(--vora); }
.peu div { max-width: 1240px; margin: 0 auto; padding: 18px 16px 28px; font-size: 13px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.error { background: #fdecea; border: 1px solid #f3c2bd; color: #7a1d16; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-top: 10px; }
