/* ==========================================================================
   MKN CALENDAR — month-grid view for sections with 'calendar' => true
   (Eventos). Enqueued by functions.php ONLY on those archive pages.
   No JS: view + month state live in GET params (see section-render.php,
   mkn_section_render_calendar). Depends on: mkn-sections (tokens, buttons).
   iter5, theme v1.27.0.
   ========================================================================== */

/* ---- View toggle: Lista | Calendario ------------------------------------- */
.mkn-viewtoggle {
	display: flex; justify-content: center; gap: 8px;
	padding: clamp(18px, 3vw, 28px) 20px 0;
}
.mkn-viewtoggle__btn {
	display: inline-flex; align-items: center;
	padding: 9px 22px; min-height: 44px;
	border: 1px solid rgba(42, 26, 74, 0.22); border-radius: 999px;
	font-weight: 600; font-size: 0.95rem; text-decoration: none;
	color: var(--mkn-primary); background: transparent;
	transition: background 220ms var(--mkn-ease), color 220ms var(--mkn-ease),
		border-color 220ms var(--mkn-ease);
}
.mkn-viewtoggle__btn:hover { border-color: var(--mkn-accent); background: rgba(157, 123, 234, 0.08); }
.mkn-viewtoggle__btn.is-active {
	background: var(--mkn-primary); border-color: var(--mkn-primary); color: #fff;
}

/* v1.56.1 — Events LIST view: the shared .mkn-dirbar__form carries a
   margin-top:-34px so it overlaps the HERO on the directory (no toggle there).
   On events the view toggle sits between hero and search bar, so that negative
   pull dragged the bar up over the toggle — its z-index:3 then painted over the
   bottom ~34px of the Lista/Calendario buttons, making Calendar look "hidden"
   and (worse) unclickable. Scoped to the sibling case so the directory overlap
   is untouched; positive gap mirrors the toggle's own top padding. */
.mkn-viewtoggle + .mkn-dirbar .mkn-dirbar__form {
	margin-top: clamp(18px, 3vw, 28px);
}

/* ---- Wrapper + month nav --------------------------------------------------- */
.mkn-calwrap {
	max-width: 1160px; margin: 0 auto;
	padding: clamp(22px, 4vw, 44px) 20px clamp(30px, 5vw, 60px);
}
.mkn-cal__nav {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	margin: 0 0 18px;
}
.mkn-cal__month {
	font-family: var(--mkn-font-display); font-size: clamp(1.3rem, 2.6vw, 1.9rem);
	font-weight: 600; color: var(--mkn-primary); margin: 0; text-align: center;
}
.mkn-cal__navlink {
	display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px;
	font-weight: 600; font-size: 0.92rem; text-decoration: none;
	color: var(--mkn-accent-text); border-radius: 12px; white-space: nowrap;
	transition: background 200ms var(--mkn-ease);
}
.mkn-cal__navlink:hover { background: rgba(157, 123, 234, 0.1); }

/* ---- The grid --------------------------------------------------------------- */
.mkn-cal__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mkn-cal {
	width: 100%; border-collapse: separate; border-spacing: 0;
	table-layout: fixed; min-width: 640px;
	background: #fff; border: 1px solid rgba(42, 26, 74, 0.12);
	border-radius: var(--mkn-radius); overflow: hidden;
}
.mkn-cal thead th {
	background: var(--mkn-primary); color: var(--mkn-lavender);
	font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
	padding: 12px 8px; text-align: center;
}
.mkn-cal__day {
	position: relative; vertical-align: top; height: 104px; padding: 8px;
	border-top: 1px solid rgba(42, 26, 74, 0.09);
	border-left: 1px solid rgba(42, 26, 74, 0.06);
}
.mkn-cal__day:first-child { border-left: 0; }
.mkn-cal__day--void { background: rgba(42, 26, 74, 0.025); }
.mkn-cal__num {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 0.85rem; font-weight: 600; color: var(--mkn-muted-text);
}
.mkn-cal__day.is-today { box-shadow: inset 0 0 0 2px var(--mkn-gold); background: rgba(201, 162, 39, 0.05); }
.mkn-cal__day.is-today .mkn-cal__num { color: var(--mkn-primary); }
/* Darkened gold (#7a5e12) — AA on the near-white cell for this small label. */
.mkn-cal__todaytag {
	font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
	color: #7a5e12;
}
.mkn-cal__mdate { display: none; }

/* Event pills — gold, linking to the single */
.mkn-cal__evts { display: grid; gap: 5px; margin-top: 7px; }
.mkn-cal__evt {
	display: block; padding: 6px 9px; border-radius: 9px;
	background: linear-gradient(135deg, rgba(230, 201, 106, 0.35), rgba(201, 162, 39, 0.28));
	border: 1px solid rgba(168, 130, 28, 0.4);
	font-size: 0.78rem; font-weight: 600; line-height: 1.35; color: var(--mkn-primary);
	text-decoration: none;
	transition: transform 180ms var(--mkn-ease), box-shadow 180ms var(--mkn-ease);
}
.mkn-cal__evt:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(24, 15, 48, 0.14); }
.mkn-cal__evt-t {
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
/* Demo entries keep the Ejemplo cue in the pill: violet wash + dot
   (same family as .mkn-eg-chip in sections.css). */
.mkn-cal__evt.is-demo { background: #efe6ff; border: 1px dashed #d8c6f5; }
.mkn-cal__demodot {
	display: inline-block; width: 7px; height: 7px; border-radius: 50%;
	background: var(--mkn-accent); margin-right: 6px; vertical-align: 1px;
}

/* ---- Honest empty month ------------------------------------------------------ */
.mkn-cal__empty {
	margin: 22px auto 0; text-align: center;
	font-size: 1rem; color: var(--mkn-muted-text);
}
/* Specificity: must beat body.mkn-wow a { text-decoration:none } (polish-2 rule). */
body.mkn-wow .mkn-cal__empty a {
	color: var(--mkn-accent-text); font-weight: 600; text-decoration: underline;
}

/* ---- <600px: stacked agenda list (no wide grid to overflow) ------------------ */
@media (max-width: 599px) {
	.mkn-cal { min-width: 0; border-radius: 14px; }
	.mkn-cal thead { display: none; }
	.mkn-cal, .mkn-cal tbody, .mkn-cal tbody tr { display: block; width: 100%; }
	.mkn-cal tbody td { display: none; }
	.mkn-cal tbody td.has-evt,
	.mkn-cal tbody td.is-today { display: block; height: auto; border-left: 0; }
	/* Keep the day number for screen readers; show the weekday label visually. */
	.mkn-cal__num {
		position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
		overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
	}
	.mkn-cal__mdate {
		display: block; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em;
		text-transform: uppercase; color: var(--mkn-muted-text);
	}
	.mkn-cal__day.is-today { box-shadow: inset 3px 0 0 var(--mkn-gold); background: rgba(201, 162, 39, 0.05); }
	.mkn-cal__day.is-today .mkn-cal__mdate { color: #7a5e12; }
	.mkn-cal__nav { flex-wrap: wrap; justify-content: center; }
	.mkn-cal__month { width: 100%; order: -1; }
}

/* ---- Reduced motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.mkn-viewtoggle__btn, .mkn-cal__navlink, .mkn-cal__evt { transition: none; }
	.mkn-cal__evt:hover { transform: none; }
}
