/* ============================================================
   LVG — adaptīvais slānis (ielādējas pēc main.css)
   Režīmi: >=1200 dators | <=1199 mobilā navigācija |
           <=991 planšete | <=767 telefons | <=575 mazs telefons
   ============================================================ */

/* ---------- 1. Dizaina tokeni un pamats ---------- */
:root {
	--lvg-shell: 1200px;
	--lvg-container: 1000px;
	--lvg-gap: 20px;
	--lvg-blue: #153758;
	--lvg-text: #597079;
	--lvg-orange: #f48024;
	--lvg-orange-strong: #c25f10;
	--lvg-border: #bbd6e1;
	--lvg-radius: 6px;
	--lvg-shadow: 0 1px 2px rgba(21, 55, 88, .08), 0 8px 20px rgba(21, 55, 88, .06);
	--lvg-tap: 44px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
	width: auto;
	margin: 0;
	padding: 0;
	background-color: #393939;
}

body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	font-size: 16px;
}

#wrap { flex: 1 0 auto; min-height: 0; display: flex; flex-direction: column; }

#main {
	flex: 1 0 auto;
	width: 100%;
	max-width: var(--lvg-shell);
	margin: 0 auto;
	padding-bottom: 0;
	overflow: visible;
}

#footer {
	flex: 0 0 auto;
	width: 100%;
	max-width: var(--lvg-shell);
	height: auto;
	margin: 0 auto;
}

/* 1px šuve starp kājenes joslām (redzama pie daļskaitļu pozīcijām / DPR > 1) */
#footer #middle,
#footer #bottom { margin-top: -1px; }
#footer #top { box-shadow: 0 1px 0 #414141; }
#footer #middle { box-shadow: 0 1px 0 #212121; }

/* vecais Opera/IE sticky-footer triks vairs nav vajadzīgs */
body:before { content: none; display: none; }

#body {
	width: 100%;
	max-width: calc(var(--lvg-container) + 30px);
	margin: 0 auto;
	padding: 0 15px;
	overflow-wrap: break-word;
}

img { max-width: 100%; }

h1, h1 a { font-size: clamp(22px, 3.2vw, 30px); letter-spacing: 2px; }
h2 { font-size: clamp(20px, 2.8vw, 30px); }

/* virsraksta josla aizņem visu platumu (border-box dēļ 970px atstāja robu labajā malā) */
#body h2 a,
#body h2.page_title {
	display: block;
	width: 100%;
	height: 50px;
	padding: 10px 30px;
	background: #fff;
	box-sizing: border-box;
}

/* oranžais teksts uz balta fona — labāks kontrasts */
#body h2 a { color: var(--lvg-orange-strong); }
#body a { color: inherit; }

/* slaidera punkti - rādam tikai pogas, bez cipariem 1 2 3 */
#slider_box #slider .rslides_tabs li a {
	font-size: 0;
	line-height: 0;
	color: transparent;
	background-image: none;
	background-color: #f69950;
	border-radius: 0;
}

/* aktīvā slaidu poga - balts kvadrāts, nevis aplis */
#slider_box #slider .rslides_tabs li a:hover,
#slider_box #slider .rslides_tabs li.rslides_here a {
	background-color: #fff;
}

/* fokusa stils */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 3px solid #15a085;
	outline-offset: 2px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 3000;
	background: #fff;
	color: var(--lvg-blue);
	padding: 10px 16px;
	border-radius: 0 0 var(--lvg-radius) 0;
	font-weight: bold;
}
.skip-link:focus { left: 0; }

/* ---------- 2. Kartītes un satura attēli ---------- */
#page_block img,
.article_entery img,
#news_box img,
#description img { max-width: 100%; height: auto; }

/* Google kartes iegults rāmis - vienmēr konteinera platumā */
#google_map {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 400px;
	border: 0;
}

/* ---------- 2a. Galerijas attēlu skatītājs ---------- */
#galery {
	background: #fff;
	padding: 0 20px 20px;
	margin-bottom: 20px;
}

#galery .img_h1 {
	padding: 18px 0 14px;
	margin: 0 0 16px;
	border-bottom: 1px solid #eef4f7;
	letter-spacing: 0;
}

#galery .ad-gallery {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100% !important;
	max-width: 100%;
	margin: 0 !important;
	align-items: center;
}

/* attēls pa virsu, sīktēli apakšā */
#galery .ad-gallery .ad-image-wrapper { order: 1; }
#galery .ad-gallery .ad-nav { order: 2; width: 100%; }

/* bultiņas nav vajadzīgas - sīktēli ir klikšķināmi un pārnesas */
#galery .ad-gallery .ad-back,
#galery .ad-gallery .ad-forward,
#galery .ad-gallery .ad-controls { display: none !important; }

#galery .ad-gallery .ad-image-wrapper .ad-image .ad-image-description {
	left: 0 !important;
	right: 0;
	width: auto !important;
	padding: 26px 16px 12px;
	background: linear-gradient(to top, rgba(21, 55, 88, .88), rgba(21, 55, 88, 0));
	color: #fff;
	font-size: 13px;
	line-height: 1.4;
	text-align: left;
	box-sizing: border-box;
}
#galery .ad-gallery .ad-image-wrapper .ad-image .ad-image-description .ad-description-title {
	color: #fff;
	font-weight: bold;
}

/* sīktēlu rinda - pārnesas vairākās rindās, bez horizontālās ritināšanas */
#galery .ad-gallery .ad-nav .ad-thumbs { overflow: visible; width: 100%; }

#galery .ad-gallery .ad-thumb-list {
	display: flex !important;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	float: none !important;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
}

#galery .ad-gallery .ad-thumbs li {
	float: none !important;
	padding-right: 0 !important;
	margin: 0 !important;
}

#galery .ad-gallery .ad-thumbs li a.thumb {
	display: block;
	position: relative;
	line-height: 0;
	border: 2px solid #dfe9ef;
	background: #fff;
	box-shadow: 0 0 0 0 rgba(244, 128, 36, 0);
	transition: box-shadow .15s ease, transform .15s ease;
}
#galery .ad-gallery .ad-thumbs li a.thumb:hover {
	border-color: #f7b877;
	transform: translateY(-2px);
}
#galery .ad-gallery .ad-thumbs li a.thumb.ad-active {
	border-color: #f48024;
	box-shadow: 0 0 0 2px rgba(244, 128, 36, .25);
}

/* vecais sarkanais rāmis ap aktīvo sīktēlu nav vajadzīgs */
#galery .ad-gallery .ad-thumbs li a.thumb span.hover { display: none !important; }

#galery .ad-gallery .ad-thumbs li a img {
	width: 96px !important;
	height: 72px !important;
	object-fit: cover;
	display: block;
	opacity: 1 !important;
}

#galery #description {
	margin: 16px 0 0;
	padding: 16px 20px;
	background: #f6f9fb;
	border-left: 3px solid #f48024;
	text-align: left;
}

/* ---------- 2b. Sadaļa "Vecāki jautā" ---------- */
#parents_ask h3 {
	color: #004990;
	font-size: 18px;
	line-height: 1.6;
	text-transform: none;
	text-align: left;
	margin-bottom: 24px;
}

#parents_ask h3 span {
	display: inline-block;
	position: static;
	top: auto;
	width: auto;
	height: auto;
	margin-left: 4px;
	padding: 7px 16px;
	background: var(--lvg-orange);
	color: #fff;
	border-radius: var(--lvg-radius);
	font-size: 14px;
	font-weight: bold;
	line-height: 1.2;
	white-space: nowrap;
}
#parents_ask h3 span:hover { background: #e06f14; }

#parents_ask p:last-of-type { margin-bottom: 0; }

/* jautājumu modālais logs - vienmērīgi izkārtoti ievades lauki */
#contacts_form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 540px;
	max-width: calc(100vw - 100px);
	box-sizing: border-box;
	text-align: left;
}

#contacts_form input,
#contacts_form textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin: 0;
	font-size: 16px;
}
#contacts_form input:nth-child(1) { margin-right: 0; }
#contacts_form br { display: none; }

#contacts_form textarea {
	height: 140px;
	resize: vertical;
}

#contacts_form #send_mail {
	align-self: flex-end;
	width: auto;
	min-width: 160px;
	padding: 0 24px;
	margin: 0;
}

.nyroModalDom { text-align: left; }

#page_block { max-width: 100%; }

/* ---------- 3. Tabulu ritināšana ---------- */
.table-scroll {
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-bottom: 20px;
}
.table-scroll > table { margin-bottom: 0; }
.table-scroll::-webkit-scrollbar { height: 10px; }
.table-scroll::-webkit-scrollbar-thumb { background: #b9cdd8; border-radius: 5px; }

/* ---------- 4. Mobilā navigācija (poga + panelis) ---------- */
.nav-toggle {
	display: none;
	position: relative;
	z-index: 1001;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: #8e47ad;
	cursor: pointer;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 5px;
	flex: 0 0 auto;
}
.nav-toggle__bar { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; }
.nav-toggle[aria-expanded="true"] { background: #6d3387; }

.mobile-nav { display: none; }
.mobile-nav.is-open { display: block; }

.mobile-nav__panel {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 1200;
	width: min(380px, 92vw);
	height: 100%;
	height: 100dvh;
	display: flex;
	flex-direction: column;
	background: #fff;
	box-shadow: -8px 0 24px rgba(0, 0, 0, .18);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.mobile-nav__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: #8e47ad;
	color: #fff;
	flex: 0 0 auto;
}
.mobile-nav__title { font-weight: bold; text-transform: uppercase; letter-spacing: 1px; font-size: 14px; }
.mobile-nav__close {
	width: var(--lvg-tap);
	height: var(--lvg-tap);
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.mobile-nav__search {
	display: flex;
	gap: 8px;
	padding: 14px 16px;
	border-bottom: 1px solid #e6eef3;
	flex: 0 0 auto;
}
.mobile-nav__search input {
	flex: 1 1 auto;
	min-width: 0;
	height: var(--lvg-tap);
	padding: 0 12px;
	border: 1px solid #cfdfe8;
	border-radius: var(--lvg-radius);
	font-size: 16px;
	font-family: inherit;
	color: var(--lvg-text);
}
.mobile-nav__search button {
	height: var(--lvg-tap);
	padding: 0 16px;
	border: 0;
	border-radius: var(--lvg-radius);
	background: #15a085;
	color: #fff;
	font-weight: bold;
	font-size: 15px;
	cursor: pointer;
	font-family: inherit;
}

.mobile-nav__menus { padding: 8px 0 24px; }

.mobile-nav__section {
	padding: 14px 16px 6px;
	font-size: 12px;
	font-weight: bold;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #8099a3;
}

.mobile-nav__menus ul { list-style: none; margin: 0; padding: 0; }

.mobile-nav__menus li {
	position: relative;
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
	text-indent: 0;
	background: none;
	border-bottom: 1px solid #eef4f7;
}

.mobile-nav__menus li a {
	display: flex;
	align-items: center;
	min-height: var(--lvg-tap);
	padding: 10px 52px 10px 16px;
	color: var(--lvg-blue);
	font-size: 16px;
	font-weight: bold;
	line-height: 1.3;
	text-transform: none;
	text-decoration: none;
	background: none;
}
.mobile-nav__menus li li a { padding-left: 32px; font-size: 15px; font-weight: normal; min-height: 42px; }
.mobile-nav__menus li li li a { padding-left: 48px; font-size: 15px; }

.mobile-nav__menus ul ul { display: none; background: #f6f9fb; }
.mobile-nav__menus li.is-open > ul { display: block; }

.mobile-nav__menus li.active > a { color: var(--lvg-orange-strong); }

.submenu-toggle {
	position: absolute;
	top: 0;
	right: 0;
	width: 48px;
	height: var(--lvg-tap);
	border: 0;
	background: transparent;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.submenu-toggle::before {
	content: "";
	width: 9px;
	height: 9px;
	margin-top: -4px;
	border-right: 2px solid #8e47ad;
	border-bottom: 2px solid #8e47ad;
	transform: rotate(45deg);
	transition: transform .15s ease;
}
.submenu-toggle[aria-expanded="true"]::before { margin-top: 4px; transform: rotate(-135deg); }

.mobile-nav__overlay {
	position: fixed;
	inset: 0;
	z-index: 1100;
	background: rgba(21, 55, 88, .55);
}
.mobile-nav__overlay[hidden] { display: none; }

html.nav-open { overflow: hidden; }

/* ============================================================
   <= 1199 px — dators ar šauru ekrānu / planšete: mobilā navigācija
   ============================================================ */
@media (max-width: 1199.98px) {
	#main, #footer { padding-left: 15px; padding-right: 15px; }

	/* galvene */
	#header {
		height: auto;
		padding: 14px 10px 0;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		position: relative;
	}
	#header #top_box { display: none; }
	#header #header_logo {
		float: none;
		margin: 0;
		flex: 1 1 auto;
		min-width: 0;
	}
	#header #header_logo h1 { margin: 0; display: flex; align-items: center; gap: 10px; }
	#header #header_logo h1 a { display: flex; align-items: center; gap: 10px; min-width: 0; }
	#header #header_logo img {
		position: static;
		top: auto;
		margin: 0;
		width: auto;
		max-height: 52px;
		flex: 0 1 auto;
	}
	#header #header_logo h1 img:last-child {
		width: auto !important;
		max-width: 100%;
		height: auto;
		max-height: 44px;
		min-width: 0;
		flex: 0 1 auto;
		margin-bottom: 0 !important;
	}

	#menu, #menu_top, .menu-search { display: none; }

	.nav-toggle { display: inline-flex; margin-bottom: 12px; }

	/* sākumlapa */
	#body > .float_left,
	#body > .float_right { float: none; width: 100%; }
	#slider_box, #calendar_box, #banner_box,
	#news_box, #twt_box { width: 100%; margin-right: 0; }
	#slider_box {
		display: flex;
		height: auto;
		min-height: 280px;
		overflow: hidden;
		border-radius: 0;
		box-shadow: var(--lvg-shadow);
	}
	#slider_box #info_box {
		width: 38%;
		height: auto;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	#slider_box #info_box h4 { padding: 20px; font-size: 18px; }
	#slider_box #slider {
		position: relative;
		width: 62%;
		height: auto;
		aspect-ratio: 420 / 300;
		overflow: hidden;
	}
	#slider_box #slider ul.rslides {
		position: absolute;
		inset: 0;
		margin: 0;
		height: auto !important;
		aspect-ratio: auto;
		overflow: hidden;
	}
	#slider_box #slider ul.rslides > li {
		height: 100% !important;
		margin: 0;
	}
	#slider_box #slider ul.rslides > li > a {
		display: block;
		height: 100%;
	}
	#slider_box #slider img {
		display: block;
		width: 100% !important;
		height: 100% !important;
		object-fit: cover;
	}
	#slider_box #slider .rslides_tabs {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 10px;
		width: auto;
		margin: 0;
		text-align: center;
		z-index: 5;
	}
	#news_box #all_news_box { width: 100%; }
	#calendar_box { overflow-x: hidden; }
	#banner_box img { max-width: 46%; height: auto; margin: 0 8px 8px 0; }

	/* kājene */
	#footer #top { background-size: auto 100%; }
	#footer #middle { height: auto; padding: 20px 15px; text-align: center; }
	#footer #middle img.logo { margin: 0 auto 12px; display: block; }
	#footer #middle p { margin: 0 0 12px; display: block; }
	#footer #middle #f_links { position: static; display: inline-block; margin: 0 12px 0 0; top: auto; text-align: left; }
	#footer #middle #social { display: block; margin: 10px 0 0; }
	#footer #bottom { height: auto; padding: 10px 15px; }
	#footer #bottom p { margin: 0; padding: 0; line-height: 1.5; }
	#footer #bottom p span { display: block; margin: 4px 0 0; }

	/* vispārīgi konteineri */
	#body h2 a,
	#body h2.page_title { width: 100%; height: auto; }
	#site_map #menu_site_map li { width: calc(50% - 20px); }

	/* rakstu un galeriju kartītes */
	#articles {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
		gap: var(--lvg-gap);
		margin-top: var(--lvg-gap);
	}
	#articles .article_entery {
		width: auto !important;
		float: none !important;
		margin: 0 !important;
		position: static !important;
		border-radius: 0;
		box-shadow: var(--lvg-shadow);
	}
	#columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--lvg-gap); }
	.galery, .video {
		width: auto !important;
		float: none !important;
		position: static !important;
		margin: 0 !important;
		border-radius: 0;
		overflow: hidden;
		box-shadow: var(--lvg-shadow);
	}
	.galery img, .video img { width: 100%; height: auto; display: block; }

	/* skolotāji */
	#teachers { display: flex; flex-wrap: wrap; gap: var(--lvg-gap); }
	.teacher {
		width: auto;
		flex: 1 1 180px;
		max-width: 220px;
		margin: 0;
		background: #fff;
		border-radius: var(--lvg-radius);
		padding: 16px 10px;
		box-shadow: var(--lvg-shadow);
	}

	/* kontaktformas */
	#contacts_school .float_left { float: none; width: auto; padding: 24px 20px 0; }
	#contacts_school .float_left p span { margin-left: 0; display: block; }
	#contacts_school .float_right { float: none; padding: 16px 20px 24px; text-align: left; }
	#contacts_school .float_right input { width: 100% !important; }
	#contacts_school .float_right input:nth-child(1) { margin-right: 0; }
	#contacts_school .float_right textarea { width: 100% !important; }
	#contacts_school .float_right #contacts_sent { width: auto; padding-top: 20px; }

	/* kalendārs - 7 kolonnu režģis, kas iekļaujas ekrānā bez horizontālās ritināšanas */
	#cal {
		display: grid;
		grid-template-columns: repeat(7, minmax(0, 1fr));
		width: 100%;
		max-width: 100%;
		overflow: visible;
		border-left: 1px solid var(--lvg-border);
		border-bottom: 1px solid var(--lvg-border);
	}
	#months {
		grid-column: 1 / -1;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		padding: 12px 14px;
		font-size: 15px;
	}
	#months a { margin: 0; padding: 2px 10px; font-size: 17px; }
	#cal .day_name {
		width: auto;
		padding: 8px 2px;
		font-size: 10px;
		letter-spacing: 0;
		border-right: 1px solid rgba(255, 255, 255, .45);
	}
	#cal .day {
		width: auto;
		height: auto;
		min-height: 84px;
		padding: 20px 3px 6px;
		border-right: 1px solid var(--lvg-border);
		border-top: 1px solid var(--lvg-border);
	}
	#cal .day:nth-child(7n+1),
	#cal .day_name:nth-child(7n+1) { border-right: 0; }
	#cal .day span.date { top: 3px; right: 4px; font-size: 12px; }
	#cal .day span.date span { font-size: 0; }
	/* vairāku dienu notikumu joslas - bez absolūtās pozicionēšanas, lai nepārklājas ar datumu */
	#cal .day span.long {
		position: static;
		display: block;
		left: auto;
		right: auto;
		bottom: auto;
		width: auto;
		height: 4px;
		margin: 2px -3px 0;
		padding: 0;
		border-radius: 0;
		font-size: 0;
		overflow: hidden;
	}
	#cal .day span.long.start { border-radius: 3px 0 0 3px; }
	#cal .day span.long.end { border-radius: 0 3px 3px 0; }
	#cal .day span.long.start.end { border-radius: 3px; }
	/* vienas dienas notikumi - mazi krāsaini punktiņi */
	#cal .day p {
		position: relative;
		height: 9px;
		margin: 0;
		padding: 0;
		font-size: 0;
		line-height: 0;
	}
	#cal .day p::before {
		content: "";
		position: absolute;
		left: 3px;
		top: 2px;
		width: 6px;
		height: 6px;
		border-radius: 50%;
		background: currentColor;
	}
	#cal .day p span { display: none; }
	#info { width: 100%; margin: 16px 0 0; display: block; }

	/* stundu saraksts */
	#lesson_list th { width: auto; min-width: 110px; }
}

/* ============================================================
   <= 991 px — planšete
   ============================================================ */
@media (max-width: 991.98px) {
	#header #header_logo img { max-height: 46px; }
	#header #header_logo h1 img:last-child { max-height: 38px; }

	#slider_box { min-height: 0; flex-direction: column; }
	#slider_box #info_box,
	#slider_box #slider { width: 100%; }
	#slider_box #info_box { padding: 22px 16px; }

	#calendar_box h3 { padding: 12px 16px; }

	#articles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
	#columns { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

	#site_map #menu_site_map li { width: 100%; }

	#page_block .float_left,
	#page_block .float_right { float: none; width: 100%; }

	/* tabulas */
	.table-scroll > table { min-width: 620px; }
	#lesson_select { height: auto; padding: 12px 16px; }

	/* ad-gallery */
	.ad-gallery { max-width: 100%; }
	.ad-gallery .ad-nav,
	.ad-gallery .ad-nav .ad-thumbs { overflow-x: auto; overflow-y: hidden; }
}

/* ============================================================
   <= 767 px — telefons (ainava) / lielais telefons
   ============================================================ */
@media (max-width: 767.98px) {
	#header #header_logo h1 img:last-child { max-height: 34px; }

	#body { padding: 0 12px; }
	#main, #footer { padding-left: 12px; padding-right: 12px; }

	h1, h1 a { letter-spacing: 1px; }

	/* formas */
	input[type="text"],
	input[type="email"],
	input[type="tel"],
	input[type="password"],
	input[type="search"],
	input[type="date"],
	select,
	textarea {
		width: 100% !important;
		max-width: 100% !important;
		font-size: 16px !important;
	}
	.registration input,
	.registration textarea,
	.registration select,
	.nyroModalDom input,
	.nyroModalDom textarea { width: 100% !important; }
	.registration select { margin-left: 0 !important; }
	.registration table { display: block; overflow-x: auto; }
	.registration ul { width: auto; }

	/* lapu inline platumi (piem. salidojuma reģistrācija) */
	#body [style*="width:"] { max-width: 100% !important; }
	#rule_bord, #rule2_bord, #graddate_border {
		margin-left: 0 !important;
		width: auto !important;
		max-width: 100% !important;
	}
	input[type="checkbox"], input[type="radio"] { width: auto !important; }

	/* tabulas */
	.table-scroll > table { min-width: 560px; }
	#lesson_list th, #lesson_list td { padding-left: 8px; padding-right: 8px; font-size: 13px; }

	/* sākumlapas kalendārs - iekļaujas bloka platumā bez ritināšanas */
	#index_calendar { min-width: 0; table-layout: fixed; }
	#index_calendar thead th { font-size: 11px; padding: 8px 6px; }
	#index_calendar tbody td { font-size: 13px; padding: 10px 6px; overflow-wrap: break-word; }
	#index_calendar th:nth-child(1), #index_calendar td:nth-child(1) { width: 36%; }
	#index_calendar th:nth-child(2), #index_calendar td:nth-child(2) { width: 18%; }
	#index_calendar th:nth-child(3), #index_calendar td:nth-child(3) { width: 46%; }
	#calendar_box h3 { padding-right: 130px; }
	#calendar_box h3 a { right: 12px; margin-right: 0; }

	/* sākumlapa */
	#banner_box img { max-width: 44%; }
	#news_box h3, #calendar_box h3 { font-size: 14px; }

	/* raksti */
	#articles { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
	#columns { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
	#article_tags { display: flex; flex-wrap: wrap; gap: 6px 10px; }

	/* skolotāji */
	.teacher { flex: 1 1 calc(50% - 20px); max-width: none; }
	.teacher img { width: 100%; height: auto; }

	/* galerija */
	#galery { padding: 0 14px 16px; }
	#galery .img_h1 { padding: 14px 0 10px; margin-bottom: 12px; }
	#galery .ad-gallery { gap: 12px; }
	#galery .ad-gallery .ad-thumb-list { gap: 8px; }
	#galery .ad-gallery .ad-thumbs li a img { width: 74px !important; height: 56px !important; }
	#galery .ad-gallery .ad-image-wrapper .ad-image .ad-image-description { padding: 20px 10px 8px; font-size: 12px; }
	#galery #description { padding: 14px; margin-top: 12px; }

	/* lapas virsraksts */
	#body h2 a,
	#body h2.page_title { padding: 10px 16px; }

	/* "pajautā mums!" modālais logs */
	.nyroModalDom {
		min-width: 0 !important;
		min-height: 0 !important;
		padding: 20px !important;
	}
	#contacts_form { max-width: calc(100vw - 80px); }
	#contacts_form #send_mail { align-self: stretch; }

	/* kājene */
	#footer #top { height: 40px; }

	#google_map { height: 300px; }
}

/* ============================================================
   <= 575 px — mazs telefons
   ============================================================ */
@media (max-width: 575.98px) {
	#header { padding-top: 10px; padding-left: 8px; padding-right: 8px; }
	.nav-toggle { margin-bottom: 8px; }
	#header #header_logo img { max-height: 40px; }
	#header #header_logo h1 img:last-child { max-height: 28px; }

	#slider_box #info_box h4 { font-size: 16px; padding: 0; }
	#slider_box #info_box { padding: 16px; }
	#banner_box img { max-width: 100%; margin: 0 0 10px; }

	#articles { grid-template-columns: 1fr; }
	#columns { grid-template-columns: 1fr; }
	#articles .article_entery img { width: 100%; height: auto; }

	.teacher { flex: 1 1 100%; max-width: none; }
	.teacher img { max-width: 180px; }

	#lesson_select select { margin-top: 8px; }

	/* kalendārs - mazākas dienu šūnas uz telefona */
	#cal .day { min-height: 68px; padding: 18px 2px 5px; }
	#months { font-size: 13px; padding: 10px 8px; }
	#months a { padding: 2px 6px; font-size: 15px; }
	/* saīsināti dienu nosaukumi, lai tie iekļaujas šaurajās šūnās */
	#cal .day_name { font-size: 0; padding: 8px 0; }
	#cal .day_name::before { font-size: 10px; letter-spacing: 0; }
	#cal .day_name:nth-of-type(1)::before { content: "Pr"; }
	#cal .day_name:nth-of-type(2)::before { content: "Ot"; }
	#cal .day_name:nth-of-type(3)::before { content: "Tr"; }
	#cal .day_name:nth-of-type(4)::before { content: "Ce"; }
	#cal .day_name:nth-of-type(5)::before { content: "Pk"; }
	#cal .day_name:nth-of-type(6)::before { content: "Se"; }
	#cal .day_name:nth-of-type(7)::before { content: "Sv"; }

	#footer #middle { padding: 16px 12px; }
	#footer #bottom p { font-size: 11px; }
}
