/* Google-like fonts (mateix esperit que el HTML model) */
@import url("https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;700&family=Roboto:wght@400;700&family=Bebas+Neue&display=swap");

/* Pàgina en blanc sempre */
html, body {
  background: #ffffff !important;
  margin: 0;
  padding: 0;
}

/* si el layout posa fons amb pseudo-elements */
body::before,
body::after {
  content: none !important;
}

/* Contenidor */
.annual-calendar {
  display: grid;
  gap: 2.5rem;
  align-items: start;

  /* “marges” tipus document */
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 28px 28px 36px;

  font-family: "Roboto Condensed", "Roboto", Arial, sans-serif;
  color: #434343;
}

/* Intro */
.annual-calendar__intro {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  color: #7a7a7a;
}

/* Logo */
.annual-calendar__logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.annual-calendar__logo-mark {
  font-size: 14px;
  color: #93b95d; /* verd model */
  text-transform: uppercase;
  font-family: "Roboto", Arial, sans-serif;
}

.annual-calendar__logo-name {
  font-size: 18px;
  color: #7a7a7a;
  font-family: "Roboto", Arial, sans-serif;
}

.annual-calendar__logo-subtitle {
  font-size: 11px;
  text-transform: uppercase;
  color: #9c9aa4;
  font-family: "Roboto", Arial, sans-serif;
}

/* Curs (model: lletra “display” gris) */
.annual-calendar__course {
  width: 100%;
  display: block;
  background: #708090;
  color: #ffffff;
  padding: 0.75rem 1rem;
  margin: 0 0 0.9rem 0;
  font-family: "Bebas Neue", "Roboto Condensed", Arial, sans-serif;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Llegenda */
.annual-calendar__legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, max-content));
  gap: 10px;
  font-size: 12px;
  color: #434343;
}

.annual-calendar__legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.annual-calendar__legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid #b2abbf; /* lila model */
}

/* Grid mesos (estructura igual, només look) */
.annual-calendar__months {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
}

/* Targeta mes = bloc de taula Google Docs */
.month-card {
  border: 0;
  border-radius: 0;         /* Google Docs: cantonades rectes */
  overflow: hidden;
  background: #ffffff;
}

/* Capçalera mes (lila) */
.month-card__header {
  background: #b2abbf;
  color: #ffffff;
  text-align: center;

  padding: 6px 0;
  font-family: "Bebas Neue", "Roboto Condensed", Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Taula */
.month-card__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: #434343;
}

/* Header setmana (dl dt...) */
.month-card__table th {
  background: #e4dfee;      /* lila clar model */
  font-weight: 700;
  padding: 6px 0;
  text-transform: lowercase;

  border: 1px solid #b2abbf;
}

/* Cel·les */
.month-card__table td {
  text-align: center;
  padding: 7px 0;

  border: 1px solid #b2abbf; /* vores marcades */
  background: #ffffff;
}

/* Buides */
.month-card__empty {
  background: #ffffff;
  border: 1px solid #b2abbf;
}

/* Dies */
.calendar-day--lectiu {
  background: #ffffff;
}

/* Festius i caps de setmana (rosa model) */
.calendar-day--festiu {
  background: #f4cccc;
  color: #434343;
}

/* Centre obert no lectiu (taronja model) */
.calendar-day--obert {
  background: #fce5cd;
  color: #434343;
}

/* Si tens “closed” */
.calendar-day--closed {
  background: #f4f4f6;
  color: #7b7b7b;
}

/* Evita que width:100% + padding desbordi */
.annual-calendar,
.annual-calendar * {
  box-sizing: border-box;
}

/* (opcional però útil) assegura que el grid pot “encongir” */
.annual-calendar__months,
.month-card {
  min-width: 0;
}


/* Responsive */
@media (max-width: 900px) {
  .annual-calendar {
    grid-template-columns: 1fr;
  }
}

/* =========================
   COLORS DIES (funcionin sí o sí)
   ========================= */

/* assegurem que la cel·la pot canviar de fons */
.month-card__table td {
  background: #fff; /* base */
}

/* suport tant a "calendar-day--X" com a "X" */
.month-card__table td.calendar-day--festiu,
.month-card__table td.festiu {
  background: #f4cccc !important;
  color: #434343 !important;
}

.month-card__table td.calendar-day--obert,
.month-card__table td.obert {
  background: #fce5cd !important;
  color: #434343 !important;
}

.month-card__table td.calendar-day--lectiu,
.month-card__table td.lectiu {
  background: #ffffff !important;
  color: #434343 !important;
}

/* També per la llegenda (els swatches) */
.annual-calendar__legend-swatch.calendar-day--festiu,
.annual-calendar__legend-swatch.festiu { background:#f4cccc; }

.annual-calendar__legend-swatch.calendar-day--obert,
.annual-calendar__legend-swatch.obert { background:#fce5cd; }

.annual-calendar__legend-swatch.calendar-day--lectiu,
.annual-calendar__legend-swatch.lectiu { background:#ffffff; }


/* =========================
   CEL·LES BUIDES SENSE VORES INTERIORS
   ========================= */

/* per defecte: cap vora */
.month-card__table td.month-card__empty {
  background: #fff;
  border: 0 !important;
}

/* mantenim la vora exterior esquerra i dreta del mes */
.month-card__table tr > td.month-card__empty:first-child {
  border-left: 1px solid #b2abbf !important;
}
.month-card__table tr > td.month-card__empty:last-child {
  border-right: 1px solid #b2abbf !important;
}

/* =========================
   NOMÉS VORA EXTERIOR DEL MES
   ========================= */

/* cap vora interna */
.month-card__table,
.month-card__table th,
.month-card__table td {
  border: 0 !important;
}

/* la vora bona: el contorn del mes */
.month-card__table {
  outline: 2px solid #b2abbf; /* mateix lila del model */
  outline-offset: -2px;       /* enganxada al contingut */
}

/* mantenim el fons de capçaleres */
.month-card__table th {
  background: #e4dfee;
}

.month-card__table td {
  height: 1rem;
}

/* 4 columnes fixes per als mesos */
.annual-calendar__months {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Botons de descàrrega PDF */
.annual-calendar__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: .8rem;
}

.annual-calendar__action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 280px;
  padding: 10px 18px;
  background: #e83e8c;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border: 2px solid #e83e8c;
  transition: transform .2s ease, box-shadow .2s ease;
}

.app-main:not(.has-menuppal) .app-container .pagina-body-main a.annual-calendar__action-btn {
  color: #fff !important;
  text-decoration: none !important;
}

.annual-calendar__action-btn:hover,
.annual-calendar__action-btn:focus {
  background: #e83e8c;
  border-color: #e83e8c;
  color: #fff;
  transform: scale(1.04);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
}

.app-main:not(.has-menuppal) .app-container .pagina-body-main a.annual-calendar__action-btn:hover,
.app-main:not(.has-menuppal) .app-container .pagina-body-main a.annual-calendar__action-btn:focus {
  color: #fff !important;
  text-decoration: none !important;
}

@media (max-width: 1200px) {
  .annual-calendar__months {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .annual-calendar__months {
    grid-template-columns: 1fr;
  }

  .annual-calendar__action-btn {
    width: 100%;
    min-width: 0;
  }
}
