/* ============================
   Cronovies 2026 – style.css (NET)
   ============================ */

/* Colors */
:root{
  --ink: #1f2937;        /* blau tinta */
  --paper: #ffffff;
  --muted: #6b7280;      /* gris */
  --line: #e5e7eb;       /* línia suau */
  --accent: #b08b3a;     /* ocre */
}

/* Base */
html { font-size: 19px; }

body{
  font-size: 1rem;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

.container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

/* ============================
   Top bar
   ============================ */
.topbar{
  background: var(--ink);
  color:#fff;
}

.topbar-inner{
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
}

.brand{
  display:flex;
  flex-direction:column;
}

.brand-link{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:#fff;
}

.brand-logo{
  height: 60px;
  width: auto;
  display:block;
  filter: drop-shadow(0 0 2px rgba(0,0,0,.2));
}

.brand-text{
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: .3px;
}

.brand-sub{
  font-size: .75rem;
  margin-top: 2px;
  opacity: .7;
}

.navlinks a,
.lang a{
  color:#fff;
  text-decoration:none;
  margin-left:14px;
  opacity:.95;
}

.lang a{ opacity:.85; }

.lang a{
  position: relative;
}

.lang a.is-active{
  color: var(--accent);
  opacity: 1;
  font-weight: 900;
  text-decoration: none;
}

.lang a.is-active::after{
  content:"";
  position:absolute;
  left:0; right:0;
  bottom:-6px;
  height:3px;
  border-radius:999px;
  background: var(--accent);
}

.navlinks a:hover,
.lang a:hover{
  text-decoration: underline;
}

.topbar .navlinks a{ font-size: 18px; font-weight:800; }
.topbar .lang a{ font-size: 16px; }

/* General links inside main */
main a{ color:#1a73e8; }

/* Small muted */
.muted{
  opacity: .8;
  font-size: 13px;
}

/* ============================
   Day header bar
   ============================ */
.daybar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:12px 0 14px;
}

.daybtn{
  padding:6px 10px;
  border:1px solid #ddd;
  border-radius:10px;
  text-decoration:none;
  color:#111;
  font-size:13px;
  background:#fff;
}

.daytitle{
  font-weight:800;
  font-size:22px;
  letter-spacing:.3px;
}

/* ============================
   Badges
   ============================ */
.kpis{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.badge{
  display:inline-block;
  padding:4px 10px;
  border:1px solid #d7e9ff;
  border-radius:999px;
  font-size:13px;
  background:#eef6ff;
  color:#111;
  text-decoration:none;
}

.badge:hover{ text-decoration: underline; }

/* ============================
   Section separators
   ============================ */
.section-title{
  margin: 2px 0 4px 0;
  font-size: 18px;
  font-weight: 900;
}

.section-sub{
  margin: 2px 0;
  font-size: 15px;
  font-weight: 800;
  opacity: .9;
}

/* ============================
   Grid
   ============================ */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap:16px;
}

@media (min-width: 700px){
  .grid{ grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1100px){
  .grid{ grid-template-columns: repeat(3, 1fr); }
}

/* ============================
   Cards
   ============================ */
.card{
  border:1px solid var(--line);
  border-radius:12px;
  padding:8px;
  background: var(--paper);
}

.imgbox{
  display:flex;
  align-items:center;
  justify-content:center;
  background:#fafafa;
  border-radius:10px;
  overflow:hidden;
}
/* Mides plaques: horitzontal 500x375, vertical 375x500 */
.card.h .imgbox{ height: 375px !important; }
.card.v .imgbox{ height: 500px !important; }

/* If image is inside an <a> (novetats/cerca), ensure it fills box */
.imgbox a{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}

/* Image always adapts to the box */
.imgbox img{
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Meta under image */
.meta{
  margin-top:8px;
  font-size:14px;
  line-height:1.35;
}

.meta .small{
  opacity:.75;
  font-size:13px;
  margin-top:4px;
}

.meta .row{ margin-top:4px; }

.meta a{
  text-decoration:none;
}

.meta a:hover{
  text-decoration: underline;
}

/* ============================
   Home (index.php)
   ============================ */
.logo{
  height:44px;
  width:auto;
  display:block;
}

.home-hero{ margin-top: 8px; }

.home-hero + .home-side{
  margin-top: 28px;  /* abans 24px */
}

.home-title{
  margin:10px 0 6px;
  font-weight:900;
  font-size: 1.25rem;
}

.home-hero p.muted{
  font-size: 1rem;
  line-height: 1.5;
}

.home-card{
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  overflow:hidden;
}

.home-img{
  background:#fff;
  display:flex;
  justify-content:center;
  padding:8px;
}

.home-img img{
  width:auto;
  max-width:100%;
  height:auto;
  max-height:520px;
  display:block;
  border-radius:10px;
}

.home-meta{
  padding:12px;
  font-size: 15px;
}

.home-meta .row.small,
.home-meta .row a,
.home-meta .btn-link{
  font-size: 14px;
}

.home-meta .row.small.muted{
  font-size: 13px;
  opacity: .75;
  line-height: 1.4;
}

.home-side{
  margin-top:14px;
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
}

.home-box{
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  padding:12px;
}

.home-h2{
  margin:0 0 6px;
  font-size:1.05rem;
  font-weight:900;
}

.home-calendar{ margin-top:18px; }

.home-totals{
  background: #fafafa;
}

@media (min-width: 950px){
  .home-hero{
    display:grid;
    grid-template-columns: 2fr 1fr;
    gap:14px;
    align-items:start;
  }
  .home-side{ margin-top:0; }
}

.invite{
  font-size:1rem;
  line-height:1.4;
}

.totals-text{
  font-size:.95rem;
  font-weight:400;
  margin:0;
}

.totals-sub{
  font-size:.95rem;
  margin-top:6px;
}

/* Remove underline only on home small-row links */
body.home .row.small a{
  text-decoration:none;
}
body.home .row.small a:hover{
  text-decoration: underline;
}

/* ============================
   Buttons as links (Mapa)
   ============================ */
.btn-link{
  background:none;
  border:0;
  padding:0;
  margin:0;
  color:#2563eb;     /* blau més fi */
  cursor:pointer;
  font-size:12.5px;
  font-weight:500;
  letter-spacing:.2px;
  text-decoration:none;
  opacity:.85;
}

.btn-link:hover{
  text-decoration:underline;
  opacity:1;
}

/* Make btn-link inside meta smaller if needed */
.meta .btn-link{ font-size: 13px; }

/* ============================
   Footer
   ============================ */

.footer{
  border-top:1px solid var(--line);
  margin-top:40px;
}

.footer-inner{
  padding:18px 16px 24px;
  text-align:center;
}

.footer-main{
  font-size:14px;
  margin-bottom:6px;
  opacity:.85;
}

.footer-note{
  font-size:14px;
  line-height:1.4;
  opacity:.75;
}

/* ============================
   Modal (generic)
   ============================ */
.modal{
  display:none;
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.6);
  z-index:9999;
  padding:18px;
}

.modal.show{ display:block; }

.modal-content{
  background:#fff;
  max-width:900px;
  margin:4vh auto;
  border-radius:12px;
  padding:14px 16px;
  position:relative;
}

.modal-close{
  position:absolute;
  top:8px;
  right:10px;
  border:0;
  background:#eee;
  border-radius:10px;
  padding:6px 10px;
  cursor:pointer;
  font-size:20px;
}

.modal-title{
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-title .small{
  font-size: 13px;
  font-weight: 400;
  opacity: .75;
}

.modal-body{ line-height:1.35; }

/* ============================
   Modal image (cercar/novetats)
   ============================ */
.open-img{ display:block; cursor: zoom-in; }

.modal-img-content{
  max-width:95vw;
  max-height:90vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px;
}

.modal-img-tag{
  max-width:92vw;
  max-height:82vh;
  width:auto;
  height:auto;
  object-fit: contain;
  display:block;
}

/* ============================
   Leaflet map modal
   ============================ */
.modal-map-content{
  max-width:96vw;
  width:900px;
  padding:10px;
}

.mapbox{
  width:100%;
  height: 55vh;
  border-radius:10px;
  overflow:hidden;
  border:1px solid var(--line);
}

@media (max-width: 700px){
  .modal-map-content{ width:96vw; }
  .mapbox{ height:55vh; }
}

/* ============================
   Search
   ============================ */
.searchbox{ margin:10px 0 18px; }
.searchform label{ display:block; margin-bottom:6px; }

.searchrow{
  display:flex;
  gap:10px;
  align-items:center;
}

.searchrow input[type="search"]{
  flex:1;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  font:inherit;
  max-width:520px;
}

.searchrow button{
  padding:10px 14px;
  border:1px solid var(--line);
  border-radius:10px;
  background: var(--ink);
  color:#fff;
  cursor:pointer;
}

@media (max-width:700px){
  .searchrow{ flex-direction:column; align-items:stretch; }
  .searchrow input[type="search"]{ max-width:100%; }
  .searchrow button{ width:100%; }
}

/* ============================
   Stats
   ============================ */
.stats{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  margin:10px 0 16px;
}

.stat{
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
  min-width:160px;
}

.stat strong{
  font-size:22px;
  display:block;
}

.stat span{ color: var(--muted); }

/* ============================
   Back to top
   ============================ */
.toTop{
  position:fixed;
  right:16px;
  bottom:18px;
  width:44px;
  height:44px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  color: var(--ink);
  font-size:20px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 8px 20px rgba(0,0,0,.15);
  display:none;
  z-index:9999;
}

.toTop.show{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.toTop:active{ transform: translateY(1px); }

.meta .open-modal{
  font-size: 13px;
  text-decoration: none;
  color: #2563eb;
  opacity: .85;
}

.meta .open-modal:hover{
  text-decoration: underline;
  opacity: 1;
}

/* autor.php: 4 columnes en pantalles grans */
.grid-author{
  gap: 12px;
}
@media (min-width: 1200px){
  .grid-author{
    grid-template-columns: repeat(4, 1fr);
  }
}

.section-card{
  background: #fff;
}

.iconlink{
  text-decoration:none;
  font-size: 20px;
  margin-left: 10px;
  line-height: 1;
}
.iconlink:hover{ text-decoration:none; opacity:.85; }

.autor-card{
  text-align:center;
}

.autor-card strong{
  font-size:1.05rem;
}

.autor-card .muted{
  margin-top:6px;
}

/* ============================
   Streetendar (year calendar)
   ============================ */

.yearcal{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 12px;
}

/* 2 mesos en horitzontal */
@media (min-width: 900px){
  .yearcal{ grid-template-columns: repeat(2, 1fr); }
}

/* 3 mesos si hi cap */
@media (min-width: 1500px){
  .yearcal{ grid-template-columns: repeat(3, 1fr); }
}

.monthcal{
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px 10px 12px;
}

.monthcal-title{
  font-weight: 900;
  margin: 2px 2px 10px;
  font-size: 1.05rem;
  border-left: 6px solid var(--accent);
  padding-left: 10px;
}

.cal-head{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 8px 8px 6px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}

.cal-dow{
  font-size: 12px;
  opacity: .75;
  text-align:center;
  font-weight: 800;
}

.cal-grid{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

/* Cells */
/* ===== Fix robust (iPhone/Windows) perquè el badge no trepitgi el dia ===== */

.cal-empty{
  border: 0;
  background: transparent;
}

.cal-cell{
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-height: 56px;

  /* RESERVA espai pel badge */
  padding: 26px 6px 8px;

  /* Col·loca el dia cap avall */
  display: flex;
  align-items: flex-end;
  justify-content: center;

  text-decoration: none;
  color: var(--ink);
  box-sizing: border-box;
}

.cal-num{
  font-weight: 900;
  line-height: 1;
  font-size: 16px;      /* pots pujar-ho si vols */
}

.cal-badge{
  position:absolute;
  top: 6px;
  right: 6px;

  font-size: 11px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;

  background: rgba(176,139,58,.80); /* ocre més suau */
  color: #fff;
  font-weight: 900;

  min-width: 22px;      /* aguanta 3 dígits */
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
}

/* Mòbil: una mica més d'aire a dalt */
@media (max-width: 430px){
  .cal-cell{ min-height: 54px; padding-top: 28px; }
  .cal-num{ font-size: 16px; }
  .cal-badge{ font-size: 11px; padding: 3px 7px; }
}

/* Hover + avui */
.cal-cell:hover{
  background: #f3f6fb;
  border-color: #cbd5e1;
}

.cal-cell.is-today{
  background: #fff7e6;
  border-color: rgba(176,139,58,.55);
  box-shadow: 0 0 0 2px rgba(176,139,58,.18) inset;
}

.cal-cell.has-count{
  background: #fffdf6;
  box-shadow: inset 0 0 0 2px rgba(176,139,58,.10);
}

/* Caps de setmana (Ds i Dg) */
.cal-grid > .cal-cell:nth-child(7n),
.cal-grid > .cal-cell:nth-child(7n-1){
  background: #fbfbfd;
}

/* 29 extra */
.cal-extra{
  background: #f9fafb;
  border-style: dashed;
  opacity: .95;
}

.cal-extra-label{
  font-size: 10px;
  opacity: .75;
  margin-top: 2px;
  color: var(--muted);
}

.blog-body{
  font-size: 1rem;
  line-height: 1.45;
}

.blog-body p{
  margin: 0 0 10px;      /* espai “normal” */
}

.blog-body p:last-child{
  margin-bottom: 0;
}

.blog-body ul,
.blog-body ol{
  margin: 0 0 10px 20px;
}

.blog-body li{
  margin: 4px 0;
}

/* Blog */
.blog-images{
  display: grid;
  gap: 10px;
  margin: 12px 0 14px;
}



/* limitar imatges verticals */
.blog-images img{
  display:block;
  width:auto;
  max-width:520px;
  max-height:420px;
  height:auto;
  margin:8px auto 14px;
  border-radius:8px;
}

.blog-thumb{
  width:100%;
  height:180px;
  object-fit:cover;
  border-radius:10px;
  margin-bottom:8px;
}

.card{
  overflow:hidden;
}

/* ============================
   Blog – portada (revista)
   ============================ */

.blog-hero{
  margin: 10px 0 16px;
}

.blog-hero-card{
  display:grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  overflow:hidden;
  text-decoration:none;
  color: var(--ink);
}

.blog-hero-media{
  position:relative;
  height:280px;               /* altura consistent */
  background:#f8fafc;
  overflow:hidden;
}

.blog-hero-media img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.blog-hero-media--empty{
  height:280px;
  background: linear-gradient(135deg, #f1f5f9, #ffffff);
}

/* Overlay títol + data sobre la imatge */
.blog-hero-overlay{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  padding:18px;
  background:linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0));
  color:#fff;
}

.blog-hero-date{
  font-size:.85rem;
  opacity:.95;
  margin-bottom:4px;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

.blog-hero-title{
  font-size:1.6rem;
  font-weight:900;
  line-height:1.2;
  letter-spacing:.2px;
  text-shadow: 0 2px 6px rgba(0,0,0,.6);
}

.blog-hero-meta{
  padding: 12px 12px 14px;
}

.blog-readmore{
  margin-top: 10px;
  font-weight: 900;
  color:#2563eb;
  opacity:.9;
  transition: transform .15s ease;
}

.blog-hero-card:hover{
  border-color:#cbd5e1;
}

.blog-hero-card:hover .blog-readmore{
  transform: translateX(4px);
}

@media (max-width: 900px){
  .blog-hero-card{
    grid-template-columns: 1fr;
  }
  .blog-hero-media,
  .blog-hero-media--empty{
    height: 200px;
  }
  .blog-hero-title{
    font-size:1.25rem;
  }
}

/* ============================
   Blog – grid d’articles (miniatures)
   ============================ */

.blog-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.blog-card{
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  overflow:hidden;
  text-decoration:none;
  color: var(--ink);
  display:flex;
  flex-direction: column;
}

.blog-card-media{
  background:#f8fafc;
  height: 150px;
  overflow:hidden;
}

.blog-card-media img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.blog-card-media--empty{
  width:100%;
  height:150px;
  background: linear-gradient(135deg, #f1f5f9, #ffffff);
}

.blog-card-meta{
  padding: 10px 12px 12px;
}

.blog-card:hover{
  border-color:#cbd5e1;
}
.blog-card:hover .blog-readmore{
  transform: translateX(4px);
}

.brand-sub{
  font-size: 0.9rem;
  margin-top: 2px;
  letter-spacing: .02em;
  opacity: .85;
}