/* =====================================================================
   racunaj.me — raspored časova
   ---------------------------------------------------------------------
   Two renderings of one dataset: a table above 900px, day tabs below.
   Colours read the racunaj.me custom properties with their own fallbacks,
   so this looks right under that theme and finished under any other.
   ===================================================================== */

.rmc-raspored {
	--rr-gold: #ffc866;
	--rr-line: var(--rmc-brd, rgba(255, 255, 255, 0.1));
}

/* ---------- header facts ---------- */
.rmc-rfacts {
	list-style: none;
	margin: 0 0 26px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
}

.rmc-rfacts li {
	padding: 14px 16px;
	border-radius: 14px;
	background: var(--rmc-glass, rgba(255, 255, 255, 0.045));
	border: 1px solid var(--rr-line);
}

.rmc-rfacts__k {
	display: block;
	font-size: 0.76rem;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	color: var(--rmc-dim, #7d86ad);
	margin-bottom: 5px;
}

.rmc-rfacts__v {
	display: block;
	font-weight: 600;
	color: var(--rmc-text, #eef1ff);
}

/* ---------- the table ---------- */
.rmc-rtable-wrap {
	border-radius: var(--rmc-radius, 20px);
	border: 1px solid var(--rr-line);
	background: var(--rmc-glass, rgba(255, 255, 255, 0.045));
	backdrop-filter: blur(16px) saturate(140%);
	-webkit-backdrop-filter: blur(16px) saturate(140%);
	overflow: hidden;
}

.rmc-rtable {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92rem;
}

.rmc-rtable caption { text-align: left; }

.rmc-rtable thead th {
	position: sticky;
	top: 0;
	z-index: 2;
	padding: 14px 12px;
	text-align: left;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--rmc-soft, #b9c0e0);
	background: rgba(13, 17, 48, 0.96);
	border-bottom: 1px solid var(--rr-line);
}

.rmc-rtable tbody th,
.rmc-rtable tbody td {
	padding: 12px;
	vertical-align: top;
	/* A hairline grid, not a spreadsheet: enough to follow a row, quiet
	   enough that the subjects stay the loudest thing on the page. */
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.rmc-rtable tbody tr:last-child th,
.rmc-rtable tbody tr:last-child td { border-bottom: 0; }
.rmc-rtable tbody td:last-child { border-right: 0; }

.rmc-rtable tbody tr:hover th,
.rmc-rtable tbody tr:hover td { background: rgba(255, 255, 255, 0.022); }

.rmc-rtable__num {
	width: 56px;
	text-align: center !important;
	font-weight: 800;
	color: var(--rr-gold);
	background: rgba(255, 200, 102, 0.05);
}

.rmc-rtable__time {
	width: 104px;
	white-space: nowrap;
	font-size: 0.84rem;
	color: var(--rmc-soft, #b9c0e0);
}

/* ---------- one lesson ---------- */
.rmc-rcell { display: block; }

/*
 * Two lessons in one slot — Monday's parallel language groups. Separated by
 * a rule rather than only by spacing, so the split survives at a glance.
 */
.rmc-rcell--split {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.rmc-rcell__subject {
	display: block;
	font-weight: 700;
	color: var(--rmc-text, #eef1ff);
	line-height: 1.3;
}

.rmc-rcell__group {
	display: block;
	margin-top: 3px;
	font-size: 0.78rem;
	color: var(--rmc-cyan, #52e2fb);
}

.rmc-rcell__teacher {
	display: block;
	margin-top: 3px;
	font-size: 0.84rem;
	color: var(--rmc-soft, #b9c0e0);
}

.rmc-rcell__room {
	display: block;
	margin-top: 2px;
	font-size: 0.8rem;
	font-style: italic;
	color: var(--rmc-violet, #b46bff);
}

/*
 * An empty slot is a dash, and it carries an aria-label. Relying on the empty
 * cell alone would leave a screen reader silent where a sighted reader sees
 * "no lesson".
 */
.rmc-rnone {
	color: var(--rmc-dim, #7d86ad);
	font-size: 1.1rem;
	opacity: 0.6;
}

/* ---------- day tabs (phone) ---------- */
.rmc-rtabs { display: none; }

.rmc-rtabs__list {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	padding-bottom: 6px;
	margin-bottom: 14px;
	scrollbar-width: none;
}

.rmc-rtabs__list::-webkit-scrollbar { display: none; }

.rmc-rtab {
	flex: none;
	padding: 10px 16px;
	border-radius: 999px;
	border: 1px solid var(--rr-line);
	background: var(--rmc-glass, rgba(255, 255, 255, 0.045));
	color: var(--rmc-soft, #b9c0e0);
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
}

.rmc-rtab:focus-visible {
	outline: 2px solid var(--rmc-cyan, #52e2fb);
	outline-offset: 2px;
}

/* The active tab is marked by weight and a border as well as colour. */
.rmc-rtab.is-on {
	color: #fff;
	font-weight: 700;
	background: var(--rmc-grad, linear-gradient(120deg, #52e2fb, #4d7cff 52%, #b46bff));
	border-color: transparent;
}

.rmc-rlist {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.rmc-rcard {
	display: flex;
	gap: 12px;
	padding: 12px 14px;
	border-radius: 14px;
	background: var(--rmc-glass, rgba(255, 255, 255, 0.045));
	border: 1px solid var(--rr-line);
}

.rmc-rcard--empty { opacity: 0.55; }

.rmc-rcard__no {
	flex: none;
	width: 30px;
	font-weight: 800;
	color: var(--rr-gold);
}

.rmc-rcard__body { flex: 1; min-width: 0; }

.rmc-rcard__time {
	display: block;
	font-size: 0.78rem;
	color: var(--rmc-dim, #7d86ad);
	margin-bottom: 4px;
}

.rmc-rcard__subject { display: block; }

/* ---------- download actions ---------- */
.rmc-ractions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 22px;
}

.rmc-note--left { text-align: left; }

/* ---------- breakpoints ----------------------------------------------
 * Seven columns stop being readable well before a phone. The swap happens
 * at 900px so tablets get cards rather than a cramped table.
 */
@media (max-width: 900px) {
	.rmc-rtable-wrap { display: none; }
	.rmc-rtabs { display: block; }

	.rmc-rpanel { display: none; }
	.rmc-rpanel.is-on { display: block; }

	/*
	 * Without JavaScript no panel is hidden, so every day is readable and the
	 * page still works. The script adds the hiding, not the content.
	 */
	.no-js .rmc-rpanel { display: block; }
	.no-js .rmc-rtabs__list { display: none; }
}

@media (min-width: 901px) and (max-width: 1100px) {
	.rmc-rtable { font-size: 0.86rem; }
	.rmc-rtable tbody th,
	.rmc-rtable tbody td { padding: 10px 9px; }
	.rmc-rtable__time { width: 92px; font-size: 0.78rem; }
}

@media (prefers-reduced-motion: reduce) {
	.rmc-rtable tbody tr:hover th,
	.rmc-rtable tbody tr:hover td { background: none; }
}

/* ---------- download button ----------------------------------------
 * .rmc-btn is already an inline-flex row with an 8px gap, so the icon
 * and the label line up on their own. All that is left is a size.
 */
.rmc-btn__icon {
	display: inline-flex;
	flex: none;
}

.rmc-btn__icon svg {
	width: 17px;
	height: 17px;
}

/* On a phone the two timetable actions stack, full width and thumb-sized. */
@media (max-width: 560px) {

	.rmc-ractions {
		flex-direction: column;
		align-items: stretch;
	}

	.rmc-ractions .rmc-btn {
		width: 100%;
		min-height: 46px;
	}
}

/* ---------- printable timetable, shown on the page ------------------
 * Same frame language as the table above: glass border, page radius,
 * clipped corners. The image keeps its own proportions — object-fit is
 * what guarantees that when next year's file has different dimensions
 * from this one's.
 */
.rmc-rimage {
	margin: clamp(22px, 3vw, 32px) 0 0;
	padding: 0;
	border: 1px solid var(--rmc-brd, rgba(255, 255, 255, 0.10));
	border-radius: var(--rmc-radius, 22px);
	overflow: hidden;
	background: rgba(255, 255, 255, 0.03);
	line-height: 0;
}

.rmc-rimage img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: contain;
}
