/* Print-oriented graduation calendar that mimics the BK (faculty)
   academic calendar format. Used by /dates/print/. */

@page {
  size: A4 landscape;
  margin: 12mm;
}

.bk-print-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.bk-print-controls a,
.bk-print-controls button {
  font: inherit;
  font-size: 0.9rem;
  color: #005b9c;
  background: #eef4fa;
  border: 1px solid #c6d8e8;
  border-radius: 4px;
  padding: 0.35rem 0.8rem;
  text-decoration: none;
  cursor: pointer;
}

.bk-calendar {
  font-family: Helvetica, Arial, sans-serif;
  color: #111;
  width: 100%;
}

.bk-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid #111;
  margin-bottom: 0.6rem;
  padding-bottom: 0.25rem;
}

.bk-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.bk-subtitle {
  font-size: 1rem;
  font-weight: 600;
}

.bk-section {
  margin-bottom: 0.6rem;
}

.bk-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.25rem;
  color: #333;
}

.bk-table {
  width: auto;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1.5px solid #111;
}

.bk-table th,
.bk-table td {
  border: 0.5px solid #8a8a8a;
  padding: 0;
  text-align: center;
  font-size: 7.2pt;
  line-height: 1.25;
  height: 12px;
  overflow: hidden;
}

/* --- Month boundaries (thicker lines, matching the BK calendars) --- */
.bk-table .mb-l { border-left: 1.5px solid #111; }
.bk-table .mb-t { border-top: 1.5px solid #111; }

/* Separator between the header rows and the month/day grid */
.bk-table .bk-month { border-top: 1.5px solid #111; }
.bk-table .bk-month-corner { border-top: 1.5px solid #111; }

.bk-table th {
  font-weight: 700;
  font-size: 6.6pt;
  background: #f0f0f0;
}

.bk-table .bk-cal-week {
  width: 2.2rem;
}

.bk-table .bk-corner {
  width: 74px;
  background: #f0f0f0;
  text-align: left;
  padding: 0 4px;
  white-space: nowrap;
  border-right: 1.5px solid #111;
}

.bk-teaching {
  font-weight: 700;
  color: #333;
}

.bk-table .bk-month {
  background: #fff;
  font-weight: 700;
  color: #666;
}

/* --- Week phase colours (matching the BK calendars) --- */
.education { background: #d9d9d9; }
.no-education { background: #9a9a9a; }
.a1 { background: #66ccff; }
.a1a4 { background: linear-gradient(135deg, #ffbf00 0 50%, #66ccff 50% 100%); }
.a2 { background: #cfb5fc; }
.a2a3 { background: linear-gradient(135deg, #91d14f 0 50%, #cfb5fc 50% 100%); }
.a3 { background: #91d14f; }
.a4 { background: #ffbf00; }

/* --- Deadlines: small triangle marker on top of the phase colour,
       instead of a special colour covering the phase (like the interactive
       calendar, where days with several things happening keep all of them
       visible). --- */
.bk-day { position: relative; }
.bk-day.deadline-a0::after,
.bk-day.deadline-a34::after,
.bk-day.deadline-a1::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-bottom: 10px solid transparent;
}
.bk-day.deadline-a0::after { border-bottom-color: #ff7b6b; }
.bk-day.deadline-a1::after { border-bottom-color: #66ccff; }
.bk-day.deadline-a34::after {
  border: none;
  width: 10px;
  height: 10px;
  background: #91d14f;
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
}

/* --- Individual public holidays: darker gray like the BK calendars --- */
.bk-day.holiday { background: #9a9a9a; }

.bk-swatch.deadline-a0 { background: #ff7b6b; }
.bk-swatch.deadline-a34 { background: #91d14f; }
.bk-swatch.deadline-a1 { background: #66ccff; }

.bk-legend .bk-swatch.deadline-a0,
.bk-legend .bk-swatch.deadline-a1,
.bk-legend .bk-swatch.deadline-a34 {
  border: none;
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
}

/* --- Panels: holidays + legends --- */
.bk-panels {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.bk-panel {
  border: 0.5px solid #8a8a8a;
  padding: 0.4rem 0.7rem 0.55rem;
  font-size: 7.6pt;
  background: #fafafa;
}

.bk-panel h3 {
  margin: 0 0 0.3rem;
  font-size: 8pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #333;
}

.bk-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bk-panel li {
  margin: 0.15rem 0;
}

.bk-panel .bk-hname { font-weight: 600; }
.bk-panel .bk-hwhen { color: #333; }

.bk-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bk-swatch {
  flex: 0 0 auto;
  width: 1.15em;
  height: 1.15em;
  border: 0.5px solid #777;
  display: inline-block;
}

/* --- Print: hide the toolbar and keep background colours --- */
@media print {
  .bk-print-controls { display: none; }
  .bk-table th,
  .bk-table td,
  .bk-panel,
  .bk-swatch {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
