/* Calendario de eventos 2027 — Cootraban.
   Verde #1B5E20 (principal) · #4caf50 (secundario) · naranja #F07D00 (único acento: hoy / próximo) · rojo solo errores.
   Sin degradados decorativos, sin emojis. Breakpoints: 960 / 768 / 480. */
.evcal { --verde: #1B5E20; --verde-osc: #134a17; --verde2: #4caf50; --naranja: #F07D00;
  --bg: #f4f6f4; --txt: #1f2d20; --muted: #5b6b5c; --borde: #dbe5dc; --r: 14px;
  background: var(--bg); color: var(--txt); font-family: 'Roboto', system-ui, sans-serif; padding-bottom: 56px; }
.evc { max-width: 1248px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 480px) { .evc { padding: 0 16px; } }
.evcal button, .evcal select { font-family: inherit; }
.evcal :focus-visible { outline: 3px solid var(--naranja); outline-offset: 2px; }

/* ---------- Encabezado ---------- */
.evh { background: var(--verde); color: #fff; padding: 40px 0 56px; }
.evh-in { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: center; }
.evh-sub { margin: 0 0 6px; color: #c8e6c9; font-weight: 500; }
.evh h1 { margin: 0 0 10px; font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.1; font-weight: 900; color: #fff; }
.evh-lead { margin: 0 0 22px; max-width: 56ch; color: #e8f5e9; line-height: 1.55; }
.evh-cifras { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 28px; }
.evh-cifras li { display: flex; flex-direction: column; }
.evh-cifras b { font-size: 2rem; font-weight: 900; line-height: 1; }
.evh-cifras span { font-size: .85rem; color: #c8e6c9; margin-top: 4px; }

.evh-prox { text-align: left; background: #fff; color: var(--txt); border: 0; border-left: 8px solid var(--naranja); border-radius: var(--r);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  transition: transform .2s ease, box-shadow .2s ease; }
.evh-prox:not(:disabled):hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0,0,0,.24); }
.evh-prox:disabled { cursor: default; }
.evh-prox__t { font-size: .8rem; font-weight: 700; color: var(--naranja); }
.evh-prox__f { font-size: 1.35rem; font-weight: 900; color: var(--verde); line-height: 1.2; }
.evh-prox__n { font-size: .95rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.evh-prox__d { font-size: .85rem; color: var(--muted); font-weight: 700; margin-top: 4px; }
@media (max-width: 960px) { .evh-in { grid-template-columns: 1fr; } .evh-prox { max-width: 460px; } }

/* ---------- Herramientas ---------- */
.evcal-cuerpo { margin-top: -28px; position: relative; }
.evcal-barra { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; background: #fff; border: 1px solid var(--borde);
  border-radius: var(--r); padding: 14px 16px; box-shadow: 0 4px 16px rgba(27,94,32,.08); margin-bottom: 14px; }
.evcal-barra label { display: flex; flex-direction: column; font-size: .78rem; font-weight: 700; gap: 4px; color: var(--muted); }
.evcal-barra select { min-width: 190px; max-width: 300px; min-height: 44px; padding: 8px 10px; border: 1px solid #c4d3c6; border-radius: 10px; background: #fff; font-size: 1rem; color: var(--txt); }
@media (max-width: 480px) { .evcal-barra label, .evcal-barra select { width: 100%; max-width: none; } }
.evcal-vista { display: inline-flex; border: 2px solid var(--verde); border-radius: 10px; overflow: hidden; }
.evcal-vista button { min-height: 40px; padding: 0 16px; border: 0; background: #fff; color: var(--verde); font-weight: 700; cursor: pointer; }
.evcal-vista button[aria-pressed="true"] { background: var(--verde); color: #fff; }
.evcal-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; background: var(--verde); color: #fff; border: 2px solid var(--verde);
  border-radius: 10px; padding: 0 18px; font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none; transition: background .2s, transform .2s; }
.evcal-btn:hover { background: var(--verde-osc); transform: translateY(-1px); }
.evcal-btn--sec { background: #fff; color: var(--verde); }
.evcal-btn--sec:hover { background: #e8f5e9; }
.evcal-ultima { font-size: .8rem; color: var(--muted); margin-left: auto; }
.evcal-error { background: #fdecea; color: #b71c1c; border: 1px solid #f5c2c0; border-radius: 10px; padding: 10px 14px; }

/* ---------- Leyenda y meses ---------- */
.evcal-ley-det { background: #fff; border: 1px solid var(--borde); border-radius: var(--r); padding: 4px 16px; margin-bottom: 14px; }
.evcal-ley-det summary { cursor: pointer; font-weight: 700; color: var(--verde); min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; }
.evcal-ley-det summary::-webkit-details-marker { display: none; }
.evcal-ley-det summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--verde); border-bottom: 2px solid var(--verde); transform: rotate(45deg); margin-left: auto; transition: transform .2s; }
.evcal-ley-det[open] summary::after { transform: rotate(-135deg); }
.evcal-leyenda { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 12px; margin: 0; }
.evcal-ley { display: flex; align-items: center; min-height: 36px; border: 1px solid var(--borde); background: #fff; border-radius: 999px; padding: 4px 14px 4px 10px; font-size: .82rem; cursor: pointer; color: var(--txt); text-align: left; }
.evcal-ley:hover { background: #f1f8f2; }
.evcal-ley--on { border-color: var(--verde); background: #e8f5e9; font-weight: 700; }
.evcal-sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; margin-right: 8px; }

.evcal-meses { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 8px; scrollbar-width: thin; }
.evcal-meses a { flex: none; min-width: 52px; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px;
  background: #fff; border: 1px solid var(--borde); color: var(--verde); font-weight: 700; font-size: .85rem; text-decoration: none; text-transform: capitalize; }
.evcal-meses a small { font-size: .68rem; color: var(--muted); font-weight: 400; text-transform: none; }
.evcal-meses a:hover { background: #e8f5e9; }
.evcal-meses a[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---------- Vista calendario ---------- */
.evcal-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .evcal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .evcal-grid { grid-template-columns: 1fr; } }
.evcal-mes { background: #fff; border: 1px solid var(--borde); border-radius: var(--r); padding: 14px 12px 12px; box-shadow: 0 1px 4px rgba(27,94,32,.07);
  scroll-margin-top: 90px; animation: evcal-sube .45s ease both; animation-delay: calc(var(--i, 0) * 40ms); }
.evcal-mes header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; padding: 0 4px; }
.evcal-mes h3 { margin: 0; color: var(--verde); text-transform: capitalize; font-size: 1.1rem; font-weight: 900; }
.evcal-mes header span { font-size: .75rem; color: var(--muted); }
.evcal-sem, .evcal-dias { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.evcal-sem span { font-size: .72rem; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.evcal-sem span:nth-child(n+6), .evcal-dia:nth-child(7n), .evcal-dia:nth-child(7n-1) { color: #7c8c7d; }
.evcal-dia { min-height: 92px; min-width: 0; font-size: .85rem; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 3px 1px; border-radius: 8px; }
.evcal-dia:nth-child(7n), .evcal-dia:nth-child(7n-1) { background: #f8faf8; }
.evcal-dia__n { line-height: 28px; }
.evcal-dia--hoy { outline: 2px solid var(--naranja); outline-offset: -2px; background: #fff4e5 !important; }
.evcal-dia--hoy .evcal-dia__n { font-weight: 900; color: var(--naranja); }

.evcal-ev { position: relative; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--c, var(--verde2)); color: #fff; font-weight: 700; font-size: .82rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: transform .15s ease; }
.evcal-ev:hover { transform: scale(1.12); }
.evcal-ev::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--c, var(--verde2)); opacity: .5; animation: evcal-pulso 2s ease-out infinite; }
.evcal-ev span { position: relative; }
.evcal-ev--oculto { opacity: .55; outline: 2px dashed #546E7A; outline-offset: 2px; } /* solo se ve en la vista admin */
.evcal-ev--oculto::before { display: none; }
.evcal-pie { display: block; max-width: 100%; font-size: .66rem; line-height: 1.25; color: var(--c, var(--verde)); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; margin-top: 2px; text-align: left; }
.evcal-pie--mas { color: var(--muted); font-weight: 400; }
@keyframes evcal-pulso { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes evcal-sube { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .evcal-ev::before { animation: none; opacity: 0; } .evcal-mes, .evcal-fila { animation: none; } .evh-prox, .evcal-ev, .evcal-btn { transition: none; } }

/* ---------- Vista lista ---------- */
.evcal-lista[hidden], .evcal-grid[hidden] { display: none; }
.evl-mes { margin-bottom: 22px; scroll-margin-top: 90px; }
.evl-mes h3 { margin: 0 0 8px; font-size: 1.15rem; font-weight: 900; color: var(--verde); text-transform: capitalize; display: flex; gap: 10px; align-items: baseline; }
.evl-mes h3 span { font-size: .78rem; font-weight: 400; color: var(--muted); text-transform: none; }
.evl-mes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.evcal-fila { width: 100%; display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; text-align: left; background: #fff; border: 1px solid var(--borde);
  border-left: 6px solid var(--c, var(--verde2)); border-radius: 12px; padding: 10px 14px; min-height: 64px; cursor: pointer; color: var(--txt);
  transition: transform .15s, box-shadow .15s; animation: evcal-sube .35s ease both; }
.evcal-fila:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(27,94,32,.12); }
.evcal-fila--pasado { opacity: .62; }
.evcal-fila--hoy { border-color: var(--naranja); border-left-color: var(--naranja); background: #fff4e5; }
.evl-fecha { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.evl-fecha b { font-size: 1.7rem; font-weight: 900; color: var(--c, var(--verde)); }
.evl-fecha small { font-size: .75rem; color: var(--muted); text-transform: capitalize; }
.evl-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.evl-info strong { font-size: 1rem; line-height: 1.3; }
.evl-info small { color: var(--muted); font-size: .82rem; }

/* ---------- Sin fecha / admin ---------- */
.evcal-sinfecha, .evcal-admin { margin-top: 32px; background: #fff; border: 1px solid var(--borde); border-radius: var(--r); padding: 18px 22px; }
.evcal-sinfecha h2, .evcal-admin h2 { margin: 0 0 10px; color: var(--verde); font-size: 1.2rem; font-weight: 900; }
.evcal-sinfecha ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px 24px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.evcal-sinfecha li { display: flex; align-items: flex-start; font-size: .9rem; line-height: 1.4; padding: 4px 0; }
.evcal-sinfecha .evcal-sw { margin-top: 4px; }
.evcal-admin ul { padding-left: 18px; }
.evcal-subir { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.evcal-subir label { display: flex; flex-direction: column; font-size: .85rem; font-weight: 700; gap: 4px; }

/* ---------- Detalle (modal) ---------- */
.evcal-modal[hidden] { display: none; }
.evcal-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.evcal-modal__fondo { position: absolute; inset: 0; background: rgba(15, 30, 16, .55); }
.evcal-modal__caja { position: relative; background: #fff; border-radius: 16px; max-width: 500px; width: 100%; max-height: 88vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.3); animation: evcal-sube .25s ease both; }
.evcal-modal__x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.2); cursor: pointer; z-index: 1; }
.evcal-modal__x::before, .evcal-modal__x::after { content: ""; position: absolute; left: 12px; top: 21px; width: 20px; height: 2px; background: #fff; transform: rotate(45deg); }
.evcal-modal__x::after { transform: rotate(-45deg); }
.evcal-modal__x:hover { background: rgba(255,255,255,.35); }
.evm-item + .evm-item { border-top: 1px solid var(--borde); }
.evm-cab { background: var(--c, var(--verde)); color: #fff; padding: 22px 64px 18px 22px; }
.evm-cab p { margin: 0 0 4px; font-size: .85rem; opacity: .9; }
.evm-cab h2 { margin: 0; font-size: 1.25rem; line-height: 1.3; font-weight: 900; color: #fff; }
.evm-fecha { font-size: 1.05rem; font-weight: 700; margin-top: 8px; }
.evm-cuerpo { padding: 14px 22px 18px; display: grid; gap: 12px; }
.evm-cuerpo dt { font-size: .78rem; font-weight: 700; color: var(--muted); }
.evm-cuerpo dd { margin: 2px 0 0; line-height: 1.45; }
.evm-cuerpo table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 4px; }
.evm-cuerpo td { padding: 5px 4px; border-bottom: 1px solid #eef3ee; }
.evm-cuerpo td:last-child { text-align: right; white-space: nowrap; font-weight: 700; }

/* ---------- Compartir (detalle del evento) ---------- */
.evm-pie { padding: 0 22px 20px; border-top: 1px solid var(--borde); }
.evm-acciones { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; }
.evm-acciones .evcal-btn { min-height: 40px; font-size: .85rem; padding: 0 14px; }

/* ---------- Impresión: 12 meses en hojas A4, sin controles ---------- */
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body * { visibility: hidden; }
  .evcal, .evcal * { visibility: visible; }
  .evcal { position: absolute; left: 0; top: 0; width: 100%; background: #fff; padding: 0; }
  .evcal-barra, .evcal-meses, .evcal-ley-det, .evcal-error, .evcal-modal, .evcal-sinfecha, .evcal-admin, .evh-prox, .evh-lead { display: none !important; }
  .evh { background: #fff !important; color: #000; padding: 0 0 8px; }
  .evh h1, .evh-sub, .evh-cifras b, .evh-cifras span { color: #1B5E20 !important; }
  .evc { max-width: none; padding: 0; }
  .evcal-cuerpo { margin-top: 0; }
  .evcal-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 6px; }
  .evcal-mes { break-inside: avoid; box-shadow: none; padding: 6px; animation: none; border-radius: 6px; }
  .evcal-dia { min-height: 34px; font-size: .62rem; }
  .evcal-ev { width: 20px; height: 20px; font-size: .6rem; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .evcal-ev::before { display: none; }
  .evcal-pie { font-size: .5rem; }
  .evcal-lista { display: none !important; }
}

/* Festivos de Colombia */
.evcal-dia--fest { background: #fdecea !important; }
.evcal-dia--fest .evcal-dia__n { color: #b3261e; font-weight: 800; }
.evcal-fest { display: block; max-width: 100%; padding: 0 2px; font-size: .56rem; line-height: 1.1; color: #8c1d18; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evcal-nota-fest { margin: 4px 0 10px; font-size: .85rem; color: #4a5a4c; display: flex; align-items: center; }
.evcal-sw--fest { background: #f3b6b1; border: 1px solid #b3261e; }
@media print { .evcal-dia--fest { background: #fdecea !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
@media (max-width: 600px) { .evcal-fest { display: none; } }

/* Descripción en la vista lista (máx. 2 líneas; el texto completo está en el detalle) */
.evl-desc { margin-top: 2px; color: #3b4a3d; font-size: .86rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
