/* calendariohabil.com — hoja de estilos única, sin dependencias externas */
:root {
  --paper: #ffffff;
  --sheet: #f3f4f6;
  --rule: #d9dde3;
  --ink: #18212d;
  --ink-2: #4b5665;
  --red: #c4122f;        /* rojo de calendario: festivos */
  --red-soft: #fbe7ea;
  --ochre: #9a5a06;      /* festivo local / insular */
  --ochre-soft: #fdf1dc;
  --blue: #1f4c8f;       /* enlaces */
  --ok: #1d6b3a;
  --focus: #1f4c8f;
  --radius: 6px;
  --cond: "Roboto Condensed", "Arial Narrow", "Avenir Next Condensed", "Helvetica Neue", Arial, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12161c; --sheet: #1b2129; --rule: #2e3742; --ink: #e8ecf1; --ink-2: #a9b3bf;
    --red: #ff5a6e; --red-soft: #3a1a20; --ochre: #f0b25a; --ochre-soft: #3a2c16; --blue: #8fb6ff;
    --ok: #6fd193; --focus: #8fb6ff; color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 var(--text); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

/* Cabecera */
.top { border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 21px/1 var(--cond); font-stretch: condensed; letter-spacing: .2px; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand b { color: var(--red); font-weight: 700; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--red); }

/* Tipografía */
h1, h2, h3 { font-family: var(--cond); font-stretch: condensed; line-height: 1.12; margin: 0 0 .4em; }
h1 { font-size: clamp(32px, 5.2vw, 50px); font-weight: 700; letter-spacing: -.3px; }
h2 { font-size: clamp(25px, 3.3vw, 32px); font-weight: 700; margin-top: 1.8em; }
h3 { font-size: 21px; font-weight: 700; margin-top: 1.4em; }
p, ul, ol { margin: 0 0 1em; }
.lead { font-size: 19px; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--ink-2); }
.small { font-size: 14.5px; }
.num { font-variant-numeric: tabular-nums; }
main { padding: 28px 0 56px; }
.crumbs { font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
.crumbs a { color: var(--ink-2); }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }

/* Hoja de calendario (elemento protagonista) */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 36px; align-items: center; padding: 18px 0 8px; }
.sheet { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 0 var(--rule), 0 10px 0 -4px var(--sheet), 0 11px 0 -4px var(--rule), 0 20px 0 -8px var(--sheet), 0 21px 0 -8px var(--rule); }
.sheet-head { background: var(--red); color: #fff; font: 700 17px/1 var(--cond); font-stretch: condensed; text-align: center; padding: 10px 12px; letter-spacing: .4px; }
.sheet-body { text-align: center; padding: 14px 16px 18px; }
.sheet-day { font: 700 clamp(96px, 16vw, 148px)/0.95 var(--cond); font-stretch: condensed; color: var(--red); font-variant-numeric: tabular-nums; }
.sheet-week { font: 600 20px/1.2 var(--cond); font-stretch: condensed; text-transform: capitalize; margin-top: 4px; }
.sheet-name { font-size: 17px; margin-top: 8px; }
.sheet-count { margin-top: 12px; font-size: 15px; color: var(--ink-2); }
.sheet-count strong { color: var(--ink); }
.sheet.is-work .sheet-day { color: var(--ink); }
.sheet.is-work .sheet-head { background: var(--ink); }

/* Formularios */
.tool { background: var(--sheet); border-radius: 10px; padding: 18px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .field legend { font-weight: 600; font-size: 15px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
select, input[type=date], input[type=number], input[type=text], input[type=email] {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 10px 12px; min-height: 46px; width: 100%;
}
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.radios { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.radios label { font-weight: 400; display: inline-flex; gap: 6px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 16px/1 var(--text); color: #fff; background: var(--ink);
  border: 0; border-radius: var(--radius); padding: 13px 18px; min-height: 46px; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.15); }
.btn.alt { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.btn.red { background: var(--red); }
.result { margin-top: 16px; background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--red); border-radius: var(--radius); padding: 14px 16px; }
.result[hidden] { display: none; }
.result .big { font: 700 30px/1.15 var(--cond); font-stretch: condensed; }
.result ul { margin: 8px 0 0; padding-left: 18px; }
.hint { font-size: 14px; color: var(--ink-2); }
.warn { border-left-color: var(--ochre); }

/* Tablas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 1.2em; }
table { border-collapse: collapse; width: 100%; font-size: 16px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; font-size: 14.5px; color: var(--ink-2); }
td.date { white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.sat td { color: var(--ink-2); }
.tag { display: inline-block; font-size: 12.5px; line-height: 1; padding: 4px 7px; border-radius: 99px; background: var(--sheet); color: var(--ink-2); white-space: nowrap; }
.tag.nac { background: var(--red-soft); color: var(--red); }
.tag.aut { background: var(--sheet); color: var(--ink); }
.tag.loc { background: var(--ochre-soft); color: var(--ochre); }

/* Año en miniatura */
.year { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 22px; margin: 10px 0 8px; }
.month abbr { text-decoration: none; }
.month h3 { font-size: 17px; margin: 0 0 6px; text-transform: capitalize; }
.month table { font-size: 13.5px; table-layout: fixed; }
.month th, .month td { text-align: center; padding: 3px 0; border: 0; font-variant-numeric: tabular-nums; }
.month th { font-size: 11.5px; }
.month td.we { color: var(--ink-2); }
.month td.h { color: #fff; background: var(--red); border-radius: 4px; font-weight: 700; }
.month td.hl { color: #fff; background: var(--ochre); border-radius: 4px; font-weight: 700; }
.month td.h.sat, .month td.hl.sat { opacity: .75; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--red); }
.legend .l::before { background: var(--ochre); }

/* Listas de enlaces */
.grid-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 18px; padding: 0; list-style: none; }
.grid-links li { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 12px 0; }
.card { border: 1px solid var(--rule); border-radius: 10px; padding: 16px; text-decoration: none; color: var(--ink); display: block; }
.card:hover { border-color: var(--ink-2); }
.card h3 { margin: 0 0 6px; font-size: 20px; }
.card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.card .flag { font-size: 13px; color: var(--red); font-weight: 600; margin-bottom: 6px; display: block; }

.note { background: var(--sheet); border-radius: var(--radius); padding: 12px 14px; font-size: 15.5px; margin: 14px 0; }
.source { font-size: 14.5px; color: var(--ink-2); border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 26px; }
.subscribe { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 4px; }
.ad-slot { margin: 24px 0; min-height: 100px; }
details { border-bottom: 1px solid var(--rule); padding: 10px 0; }
details summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; }

/* Pie */
.foot { border-top: 1px solid var(--rule); padding: 26px 0 40px; font-size: 14.5px; color: var(--ink-2); }
.foot .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.foot h2 { font-size: 16px; margin: 0 0 8px; color: var(--ink); }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin: 4px 0; }
.foot a { color: var(--ink-2); }

/* Insertable */
body.embed { background: transparent; font-size: 15px; }
body.embed main { padding: 0; }
body.embed .sheet { box-shadow: none; }
body.embed .credit { text-align: center; font-size: 12.5px; margin-top: 6px; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 22px; }
  .top .wrap { gap: 4px; padding-top: 8px; }
  .nav { gap: 16px; font-size: 14.5px; flex-wrap: nowrap; overflow-x: auto; width: 100%; white-space: nowrap; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  body { font-size: 16.5px; }
  .htable th:nth-child(3), .htable td:nth-child(3) { display: none; }
  .htable td.date { white-space: normal; }
  .year { gap: 16px 14px; }
  .month table { font-size: 12.5px; }
}
@media (prefers-reduced-motion: no-preference) {
  .sheet.flip { animation: flip .45s ease-out; transform-origin: top center; }
  @keyframes flip { from { transform: rotateX(-70deg); opacity: .2; } to { transform: none; opacity: 1; } }
}
@media print {
  .top, .foot, .tool, .ad-slot, .subscribe, .nav { display: none !important; }
  body { font-size: 12pt; }
}
