/* Piulades UECC Cornellà — identitat: verd i groc del logo, des de 1948 */

:root {
  --verd: #44601c;
  --verd-fosc: #2c3f10;
  --groc: #f2e434;
  --paper: #f6f4ea;
  --tinta: #22281a;
  --tinta-suau: #5c6350;
  --blanc: #ffffff;
  --linia: #ddd8c4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--tinta);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, .fita, .marca-text, .boto {
  font-family: "Oswald", "Source Sans 3", sans-serif;
  letter-spacing: 0.01em;
}
h1 { font-size: 1.9rem; font-weight: 600; color: var(--verd-fosc); margin: 0.2em 0 0.5em; }
h2 { font-size: 1.25rem; font-weight: 600; color: var(--verd-fosc); }
a { color: var(--verd); }

/* ---- capçalera amb carena ---- */
.capcalera { background: var(--blanc); }
.capcalera-int {
  max-width: 900px; margin: 0 auto; padding: 0.6rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem;
}
.marca { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; }
.marca img { height: 56px; width: auto; }
.marca-text {
  font-weight: 600; font-size: 1.15rem; color: var(--verd-fosc);
  text-transform: uppercase; letter-spacing: 0.04em;
  border-left: 3px solid var(--groc); padding-left: 0.8rem;
}
.nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav-enllac { color: var(--verd-fosc); font-weight: 600; text-decoration: none; }
.nav-enllac:hover { text-decoration: underline; }
.carena { display: block; width: 100%; height: 26px; }
.carena path { fill: var(--verd); }

/* ---- contingut ---- */
.contingut { flex: 1; width: 100%; max-width: 900px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.avis {
  background: var(--groc); color: var(--verd-fosc);
  padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-weight: 600;
}

/* ---- botons ---- */
.boto {
  display: inline-block; border: 0; border-radius: 6px; cursor: pointer;
  padding: 0.55rem 1.1rem; font-size: 1rem; font-weight: 600;
  text-decoration: none; text-transform: uppercase; letter-spacing: 0.03em;
}
.boto-verd { background: var(--verd); color: var(--blanc); }
.boto-verd:hover { background: var(--verd-fosc); }
.boto-groc { background: var(--groc); color: var(--verd-fosc); }
.boto-groc:hover { filter: brightness(0.95); }
.boto-clar { background: var(--linia); color: var(--tinta); }
.boto-nu { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.boto-perill {
  background: none; border: 1px solid #b0432c; color: #b0432c;
  border-radius: 6px; padding: 0.35rem 0.8rem; cursor: pointer; margin-top: 1rem;
}
.boto-perill:hover { background: #b0432c; color: var(--blanc); }
.esborra { color: #b0432c; font-size: 0.85rem; text-decoration: underline; }
.inline { display: inline; }

/* ---- filtres de categoria ---- */
.filtres {
  display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.6rem;
  margin-bottom: 1rem; -webkit-overflow-scrolling: touch;
}
.xip {
  white-space: nowrap; text-decoration: none; font-weight: 600; font-size: 0.95rem;
  padding: 0.35rem 0.9rem; border-radius: 99px;
  border: 1.5px solid var(--verd); color: var(--verd); background: var(--blanc);
}
.xip.actiu { background: var(--verd); color: var(--groc); }

/* ---- llista de piulades ---- */
.llista-piulades { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.targeta-piulada {
  display: flex; gap: 1rem; align-items: stretch; text-decoration: none;
  color: inherit; background: var(--blanc); border: 1px solid var(--linia);
  border-radius: 8px; overflow: hidden;
}
.targeta-piulada:hover { border-color: var(--verd); }
.fita {
  background: var(--verd-fosc); color: var(--groc); min-width: 72px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0.5rem;
}
.fita-dia { font-size: 1.7rem; font-weight: 600; line-height: 1; }
.fita-mes { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.targeta-cos { padding: 0.7rem 1rem 0.7rem 0; min-width: 0; }
.targeta-cos h2 { margin: 0.25rem 0 0.15rem; }
.targeta-meta { margin: 0; color: var(--tinta-suau); font-size: 0.92rem; }

/* Marca de sender: dues franges (verd/groc) com les marques pintades als camins */
.marca-sender {
  display: inline-block; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--verd-fosc);
  padding-left: 1.5rem; position: relative;
}
.marca-sender::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1.1rem; height: 0.75rem;
  background: linear-gradient(to bottom, var(--verd) 0 45%, var(--groc) 55% 100%);
  border-radius: 1px;
}

/* ---- pàgina d'una piulada ---- */
.enrere { text-decoration: none; font-weight: 600; }
.piulada {
  background: var(--blanc); border: 1px solid var(--linia); border-radius: 8px;
  padding: 1.2rem 1.4rem;
}
.piulada-meta { color: var(--tinta-suau); margin-top: -0.4rem; }
.piulada-text { white-space: pre-line; }
.galeria {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem; margin-top: 1rem;
}
.galeria img {
  width: 100%; height: 160px; object-fit: cover; border-radius: 6px; display: block;
}

/* ---- comentaris (estil xat) ---- */
.comentaris { margin-top: 1.5rem; }
.comentari {
  background: var(--blanc); border: 1px solid var(--linia);
  border-radius: 10px 10px 10px 2px; padding: 0.6rem 0.9rem; margin-bottom: 0.6rem;
  max-width: 85%;
}
.comentari.meu {
  margin-left: auto; border-radius: 10px 10px 2px 10px;
  background: #eef3e2; border-color: #cfdcae;
}
.comentari-meta { font-size: 0.85rem; color: var(--tinta-suau); display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.comentari-meta strong { color: var(--verd-fosc); }
.comentari-text { margin: 0.2rem 0 0; white-space: pre-line; }
.form-comentari { margin-top: 1rem; display: grid; gap: 0.5rem; }
.form-comentari button { justify-self: end; }

/* ---- formularis ---- */
.targeta-auth, .targeta-form, .bloc-admin {
  background: var(--blanc); border: 1px solid var(--linia); border-radius: 8px;
  padding: 1.3rem 1.5rem;
}
.targeta-auth { max-width: 430px; margin: 2rem auto; }
label { display: block; font-weight: 600; margin: 0.9rem 0 0.25rem; }
.etiqueta-check { font-weight: 400; display: flex; gap: 0.4rem; align-items: center; }
input[type=text], input[type=email], select, textarea {
  width: 100%; padding: 0.55rem 0.7rem; font: inherit;
  border: 1.5px solid var(--linia); border-radius: 6px; background: var(--paper);
}
input:focus, select:focus, textarea:focus, .boto:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--verd); outline-offset: 1px;
}
textarea { resize: vertical; }
.camp-codi { font-size: 1.6rem; letter-spacing: 0.5em; text-align: center; }
form .boto { margin-top: 1.1rem; }
.accions { display: flex; gap: 0.7rem; align-items: center; }
.menuda { font-size: 0.9rem; color: var(--tinta-suau); }
.visualment-ocult {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- administració ---- */
.graella-admin { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.taula-socis { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.taula-socis th, .taula-socis td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--linia); }
.taula-socis tr.inactiu td { color: var(--tinta-suau); text-decoration: line-through; }
.taula-socis td.col-accions { text-decoration: none; }

/* ---- estats buits i peu ---- */
.buit { text-align: center; padding: 3rem 1rem; }
.peu {
  background: var(--verd-fosc); color: var(--paper); text-align: center;
  padding: 1.2rem 1rem; font-size: 0.88rem;
}
.peu p { margin: 0.2rem 0; }
.peu a { color: var(--groc); }

/* ---- mòbil ---- */
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .marca img { height: 44px; }
  .marca-text { display: none; }
  .piulada { padding: 1rem; }
  .comentari { max-width: 95%; }
  .taula-socis { display: block; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- respostes a comentaris ---- */
.citacio {
  display: block; font-size: 0.82rem; color: var(--tinta-suau);
  text-decoration: none; border-left: 3px solid var(--groc);
  padding-left: 0.5rem; margin-bottom: 0.3rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.citacio:hover { color: var(--verd-fosc); }
.respon { color: var(--verd); font-size: 0.85rem; text-decoration: underline; margin-top: 0.3rem; }
.responent {
  background: #eef3e2; border: 1px solid #cfdcae; border-radius: 6px;
  padding: 0.4rem 0.7rem; font-size: 0.9rem;
  display: flex; gap: 0.7rem; align-items: baseline;
}
.responent[hidden] { display: none; }
.comentari:target { outline: 2px solid var(--groc); }

/* ---- primer accés, normes i perfil ---- */
.targeta-ampla { max-width: 760px; margin: 1.5rem auto; }
.targeta-mitjana { max-width: 520px; margin: 1.5rem auto; }
.avis-esborrany {
  background: #fff4d6; border: 2px dashed #b07b00; color: #5a3e00;
  padding: 0.7rem 1rem; border-radius: 6px; margin: 0.5rem 0 1rem;
}
.caixa-normes {
  max-height: 22rem; overflow-y: auto; margin: 1rem 0;
  border: 1px solid var(--linia); border-radius: 6px;
  padding: 0.5rem 1rem; background: var(--paper);
}
.text-normes h2 { font-size: 1.1rem; margin: 1.1rem 0 0.4rem; }
.text-normes ul { padding-left: 1.2rem; }
.text-normes li { margin-bottom: 0.35rem; }
.dades dt { font-weight: 600; margin-top: 0.6rem; }
.dades dd { margin: 0.1rem 0 0 0; }
.form-sortir { margin-top: 0.8rem; text-align: right; }

/* Verificació en dos passos */
.passos { padding-left: 1.2rem; }
.passos li { margin-bottom: .8rem; }
.qr { background: #fff; padding: 12px; width: 220px; max-width: 100%; margin: .6rem 0; border-radius: 6px; }
.qr svg { display: block; width: 100%; height: auto; }
.clau-totp code { font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
.codis-recuperacio { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .4rem; }
.codis-recuperacio code { font-size: 1.05rem; }
.enllac-surt { display: block; margin-top: .9rem; text-decoration: underline; }
.taula-registre td { vertical-align: top; } .taula-registre td:first-child { white-space: nowrap; }
.form-resum { margin-top: 1.4rem; }
.taula-desplacable { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.taula-desplacable table { min-width: 640px; }
.form-cerca { margin-bottom: 1rem; }

/* Data de la sortida */
.opcional { font-weight: normal; color: var(--tinta-suau); font-size: 0.85em; }
.piulada-publicacio { font-size: 0.85rem; color: var(--tinta-suau); margin-top: -0.3rem; }
