/* ----------------------------------------------------------
   CALENDAR: Tanggalan Indo (Optimized Final Version)
   - Desktop: original larger fonts
   - Mobile ≤540px: compact 11px/10px
   - ≤375px: show full pasaran words
----------------------------------------------------------- */

.kalender-indo,
.kalender-indo * {
  box-sizing: border-box;
}

.kalender-indo {
  max-width: 960px;
  margin: 24px auto;
  font: 500 15px/1.45 "Arial", "Helvetica Neue", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, sans-serif;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  margin-bottom: 24px;
}

.kalender-indo.flush {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* ----------------------------------------------------------
   TITLE
----------------------------------------------------------- */
.kalender-indo .kal-title {
  text-align: center;
  font-weight: 700;
  color: #1a5fe0;
  font-size: 1rem;
  margin: 0 0 10px;
}
.kalender-indo .kal-title a {
  color: inherit;
  text-decoration: none;
}
.kalender-indo .kal-title a:hover {
  text-decoration: underline;
}

/* RESET ul/li */
.kalender-indo ul,
.kalender-indo li {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ----------------------------------------------------------
   ALIGNMENT FIX: header + body share the same 7-column grid
----------------------------------------------------------- */
.kalender-indo .kal-grid-head > li,
.kalender-indo .kal-grid-body {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-collapse: collapse;
}

/* ----------------------------------------------------------
   WEEK HEADER (Desktop default)
----------------------------------------------------------- */
.kalender-indo .kal-grid-head > li:first-child {
  border: 1px solid #e2e8f0;
  border-bottom: none;
  background: linear-gradient(#fff, #fbfdff);
  overflow: hidden;
}
.kalender-indo .kal-grid-head > li:last-child {
  border: 1px solid #e2e8f0;
  border-top: none;
}

.kalender-indo b {
  /* padding: 10px 8px; */
  padding: 10px 4px;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem; /* ≈13.6px desktop */
  text-transform: capitalize;
  color: #43536e;
  white-space: nowrap;
  border-right: 1px solid #e2e8f0;
  overflow: visible;
  text-overflow: unset;
}
.kalender-indo b:first-child { color: #AD182E; } /* Sunday */
.kalender-indo b:last-child { border-right: none; }

/* ----------------------------------------------------------
   DATE GRID
----------------------------------------------------------- */
.kalender-indo .kal-grid-body > s,
.kalender-indo .kal-grid-body > a {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  min-height: 84px;
  box-sizing: border-box;
}
.kalender-indo .kal-grid-body > s { background: #fcfdff; }
.kalender-indo .kal-grid-body > a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.kalender-indo .kal-grid-body > s:nth-child(7n),
.kalender-indo .kal-grid-body > a:nth-child(7n) {
  border-right: none;
}
.kalender-indo .kal-grid-body > a:hover { background: #f9fbff; }

/* ----------------------------------------------------------
   DATE & PASARAN (Desktop defaults)
----------------------------------------------------------- */
.kalender-indo .kal-grid-body > a > div:first-child {
  font-weight: 700;
  font-size: 1.1rem; /* ≈17.6px desktop */
  font-variant-numeric: tabular-nums;
  color: #111;
  line-height: 1.2;
  letter-spacing: -0.2px;
}
.kalender-indo .kal-grid-body > a > div:last-child {
  font-size: 0.85rem; /* ≈13.6px desktop */
  font-weight: 700;
  color: rgba(67, 83, 110, 0.85);
  text-transform: lowercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Weekend & highlights */
.kalender-indo .kal-grid-body > a.sun > div:first-child { color: #AD182E; }
.kalender-indo .kal-grid-body > a.libur > div { color: #AD182E !important; }
.kalender-indo .kal-grid-body > a.bersama > div { color: #1e73be !important; }

/* Background tints */
.kalender-indo .kal-grid-body > a.libur { background: #fff6f6; }
.kalender-indo .kal-grid-body > a.bersama { background: #f6f9ff; }
.kalender-indo .kal-grid-body > a.libur:hover { background: #ffecec; }
.kalender-indo .kal-grid-body > a.bersama:hover { background: #eef3ff; }

/* ----------------------------------------------------------
   HOLIDAY LIST
----------------------------------------------------------- */
.kal-separator { border-top: 1px solid #e2e8f0; margin: 20px 0 12px; }
.kal-libur-heading { font-size: 1rem; font-weight: 600; margin: 6px 0 8px; color: #333; text-align: left; }
.kal-libur-list { margin: 0; padding: 12px 16px; font-size: 0.85rem; line-height: 1.55; }
.kal-libur-list li { margin: 4px 0; }
.kal-libur-day { font-weight: 700; color: #AD182E; margin-right: 4px; }
.kal-libur-list a { color: #1a5fe0; text-decoration: none; }
.kal-libur-list a:hover { color: #0b49d3; text-decoration: underline; }

/* ----------------------------------------------------------
   MOBILE (≤540px) - compact 11px/10px
----------------------------------------------------------- */
@media (max-width: 540px) {

  /* Week header + date = 11px */
  .kalender-indo b,
  .kalender-indo .kal-grid-body > a > div:first-child {
    font-weight: 700;
    font-size: 0.6875rem; /* 11px */
  }

  /* Pasaran = 10px */
  .kalender-indo .kal-grid-body > a > div:last-child {
    font-size: 0.625rem; /* 10px */
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .kalender-indo .kal-grid-body > a,
  .kalender-indo .kal-grid-body > s {
    min-height: 62px;
  }
  .kalender-indo .kal-grid-body > a {
    gap: 4px;
    padding: 8px;
  }
}

/* ----------------------------------------------------------
   SMALL SCREEN (≤375px) - show full pasaran words
----------------------------------------------------------- */
@media (max-width: 375px) {
  .kalender-indo .kal-grid-body > a > div:last-child {
    font-size: 0.625rem;       /* 10px */
    white-space: nowrap;       /* keep single line */
    overflow: visible;         /* show full word */
    text-overflow: unset;      /* no ellipsis */
    letter-spacing: -0.1px;    /* tighter fit */
  }
}

/* ----------------------------------------------------------
   PRINT
----------------------------------------------------------- */
@media print {
  .kalender-indo {
    color: #000;
    background: #fff;
    box-shadow: none;
    border-color: #ccc;
  }
  .kalender-indo .kal-grid-head > li:first-child { background: #fff; }
  .kalender-indo .kal-grid-body > a:hover { background: #fff; }
  .kalender-indo .kal-grid-body > a.libur,
  .kalender-indo .kal-grid-body > a.bersama {
    background: #fff !important;
  }
}

/* Title with nav arrows */
.kalender-indo .kal-title{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  font-weight:800;
  margin:0 0 10px;
}
.kalender-indo .kal-title a.kal-title-link{
  color:inherit;
  text-decoration:none;
}
.kalender-indo .kal-title a.kal-title-link:hover{ text-decoration:underline; }

/* Left/Right arrow buttons */
.kalender-indo .kal-nav{
  position:absolute; top:50%; transform:translateY(-50%);
  display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px; border-radius:999px;
  color:#d62828; background:#fff; border:1px solid #e2e8f0;
  box-shadow:0 1px 3px rgba(15,23,42,.06);
  text-decoration:none;
}
.kalender-indo .kal-prev{ left:6px; }
.kalender-indo .kal-next{ right:6px; }
.kalender-indo .kal-nav:hover{ background:#fff5f5; border-color:#ef9a9a; }
.kalender-indo .kal-nav:active{ transform:translateY(-50%) scale(.98); }

@media (max-width:540px){
  .kalender-indo .kal-nav{ width:26px; height:26px; }
}
@media print{
  .kalender-indo .kal-nav{ display:none !important; }
}