/*
Theme Name: alpk2
Text Domain: alpk2
*/

:root {
	--header-height: 60px;
	--site-width: 1248px;
	--border-radius-1: 6px;
}

.light-theme {
  --link: #003D99;
  --border: #dadce0;
  --bg: #f8f8f8;
  --bg-2: #fff;
  --bg-3: #f8f8fc;
  --bg-4: #f2f2f2;
  --text: #333;
  --text-2: #555;
  --text-3: #707070;
}

.dark-theme {
	--bg: #212121;
	--bg-2: #171717;
	--bg-3: #0d0d0d;
	--bg-4: #2b2b2b;
	--border: #3a4048;
	--text: #eef0f3;
	--text-2: #a9adb5;
	--text-3: #8f96a0;
	--link: #6db9f8;
}

/* *******************************************************************
 *
 *  1. NORMALIZE
 *  
 * *******************************************************************/
*,:after,:before {
	box-sizing: border-box;
}
body {
	font-family: system-ui, sans-serif;
	font-size: 16px; /* это 1rem */
	line-height: 1.5;
	overflow-x:hidden;
}
h1 {
  font-size: 24px;
  line-height: 1.15; /* Было 1.2 */
}
h2 {
  font-size: 20px;
  line-height: 1.3; /* Было 1.35 */
}
h3 {
  font-size: 18px;
  line-height: 1.35; /* Было 1.4 */
}
h4 {
  font-size: 16px;
  line-height: 1.4; /* Было 1.45 */
}
body,h1,h2,h3,h4,h5,h6,p,figure,dd,hr {
	margin: 0;
}
a {
	color: var(--link);
}
input, button {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}
input[type="submit"], hr, button, iframe {    
	border: 0;
}
input[type="submit"], button {    
	cursor: pointer;
	font-size: initial;
}
button, nav a {
	color: var(--text);	
	text-decoration: none;
}
textarea, input, table {
	border: 1px solid var(--border);
}
input::placeholder, textarea::placeholder, textarea, input {	
	color: var(--text-3);
}
button, table, textarea, input {
	border-radius: var(--border-radius-1);
}
textarea, input  {
    background: var(--bg-2); /* Фон для textarea и input */
	line-height:1.5;
	padding:.75rem;
}
input[type="submit"] {
    background: var(--text);
}
table {
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
}
thead {
	background-color: var(--bg-4);
}
th,td {
	padding: .75rem 1rem;
}
th {
  	text-align: left;
}
th:not(:last-child),td:not(:last-child) {
	border-right: 1px solid var(--border);
}
tr:not(:last-child) th:not(:last-child), tbody tr:not(:last-child) td, thead td, thead th {
    border-bottom: 1px solid var(--border);
}
figcaption {
	color: var(--text-2);
	font-size: 0.9rem;
	padding-top: 0.5rem;
	font-style: italic;
}
img {
	height: auto;
	max-width: 100%;
	display: block;
}
hr {
	border-top: 1px solid var(--border);
}
/* Text meant only for screen readers. */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}


/* *******************************************************************
 *
 *  2. HEADER
 *  
 * *******************************************************************/
#masthead {
  height: var(--header-height);
  z-index: 100;
}
/* Не показывать подменю */
#menu-primary-menu ul.sub-menu {
  height: 0;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  width: 0;
}
/* Menu List Items */
#menu-primary-menu > li {
	position: relative;
}
#menu-primary-menu > li > a {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1rem;
}
#menu-primary-menu > li.current-menu-item > a {
	color: var(--link) !important;
}
/* Mobile Menu */
#menu-primary-menu.menu-open {
	position: absolute;
	flex-flow: column wrap;
	padding: 6rem 1.5rem 1.5rem;
	top: 0;
	right: 0;
	margin-right: -1rem;
	margin-left: -1rem;
	width: calc(100% + 2rem);
	max-width: 320px;
	height: 100vh;
	z-index: 20;
}
#menu-primary-menu.menu-open > li {
	width: 100%;
}
/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.666); /* Transparent black background */
    z-index: 10; /* Ensures overlay is on top */
}

/* 
=========================
Close Button Styling
=========================
*/
.close-btn {
    margin-left: 1rem;
}
.close-btn span {
    width: 24px;
    height: 24px;
}
.close-btn span::before,
.close-btn span::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--border);
}

/* 
=========================
Menu Toggle Button Styling
=========================
*/
.menu-toggle {
    z-index: 999;
    width: 28px;
    height: 20px;
}
.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
    display: block;
    width: 100%;
    height: 2px;
    background-color: currentColor;
}
.menu-toggle span::before,
.menu-toggle span::after {
	position: absolute;
}
.menu-toggle span::before {
    content: '';
    transform: translateY(-8px);
}
.menu-toggle span::after {
    content: '';
    transform: translateY(8px);
}
.menu-toggle[aria-expanded="true"] span {
    background-color: transparent; /* Hide the central line */
}

/* 
=========================
Rotate lines for MENU and CLOSE SEATCH icons
=========================
*/
.menu-toggle[aria-expanded="true"] span::before, 
.close-btn span::before {
    transform: rotate(45deg); /* Rotate the top line */
}
.menu-toggle[aria-expanded="true"] span::after,
.close-btn span::after {
    transform: rotate(-45deg); /* Rotate the bottom line */
}

/* 
=========================
Menu Badge Styling
=========================
*/
.menu-top > a:before {
    content: "Top";
    background-color: #cee8ff;
}
.menu-new > a::before {
    content: "New";
    background-color: #ceffdb;
}
.menu-badge > a:before {
    position: absolute;
    font-size: 12.5px;
    line-height: 1;
    padding: 1.25px 2.5px;
    font-weight: 600;
    border-radius: 3px;
    color: #444;
    top: calc(var(--header-height) / 2 - 1.5em - 7px);
    right: 3px;
}

/* 
=========================
SEARCH
=========================
*/
#search-toggle {
    margin-left: auto;
}
#search-container {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
}
#search-container .search-submit {
	border-radius: 0 6px 6px 0 ;
	background: #E63946;
}
#search-field {
	border-radius: 6px 0 0 6px;
	border:0;
}
.search-form {
    margin: 0 auto;
}


/* *******************************************************************
 *
 *  3. GLOBAL
 *  
 * *******************************************************************/
#content {
	max-width: var(--site-width);
	margin-left: auto;
	margin-right: auto;
}
.post-content > *, .post-content  > .wp-block-group__inner-container > *, section > .wp-block-group__inner-container > *:not(:last-child) {
	margin-bottom: 1.5rem;
}
.site-content section:not(.has-background) {
	margin-bottom: 3rem;
}

/* 
=========================
WIDGETS
=========================
*/
#secondary ul, #footer-1 ul {
	padding: 0;
}
#secondary li, #footer-1 li {
	list-style: none;
	margin-bottom: .5rem;
}
#secondary li a, #footer-1 li a {
	color: var(--text-2);
	text-decoration:none;
}
#sidebar-1 > li + li {
	padding-top: 1.5rem;
}
#secondary li.current-menu-item a {
	color:var(--text);
	font-weight:600;
}

/* 
=========================
LOOP
=========================
*/
.post-meta a {
	color:var(--text);
}
.archive-template p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 
=========================
Pagination
=========================
*/
.pagination-nav ul {
	display: flex;
	padding: 0;
	list-style: none;
	gap:.5rem;
}
.pagination-nav a,
.pagination-nav span {
    display: flex;
    padding: 0.4rem 1rem;
    border-radius: var(--border-radius-1);
}
.pagination-nav .current {
	background-color: var(--bg-2);
	font-weight:600;
}

/* 
=========================
POST COMMENTS
=========================
*/
ol.children {
	list-style:none;
}
#commentform input[type="text"] {
  flex: 1 1 48%; /* Поля ввода занимают половину ширины */
}


/* *******************************************************************
 *
 *  4. Wordpress
 *  
 * *******************************************************************/
body .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: calc(var(--site-width) - 2rem);
  margin-right: auto;
  margin-left: auto;
}
.wp-block-image img {
	border-radius:var(--border-radius-1);
}
.alignright {
  float: right;
  margin-bottom: 2rem;
  margin-left: 2rem;
}
.alignfull {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: auto;
}
/* IS-... */
.is-layout-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.is-layout-grid {
  display: grid;
  gap: 1rem;
}
.is-position-sticky {
	position: sticky;
	width:100%;
	top:0;
}
.is-content-justification-center {
  justify-content: center;
}
/* HAS-... */
.has-text-align-center {
  text-align: center;
}
.has-text-align-left {
  text-align: left;
}
.has-background {
  padding: 1rem;
}
.has-global-padding {
  padding-left: 1rem;
  padding-right: 1rem;
}
/* WP-BLOCK-...*/ 
.wp-block-columns {
  align-items: normal !important;
}
.wp-block-buttons {
  margin-top: 1rem;
}
.wp-block-button__link {
	background-color: var(--link);
	color: var(--bg);
	border-radius: var(--border-radius-1);
	display: block;
	border: 1px solid var(--link);
    padding: .75rem;
	text-decoration: none;
	font-size:16px;
}
.wp-block-button.is-style-outline .wp-block-button__link {
  background-color: transparent;
	color: var(--text);
	border: 1px solid var(--border);
    padding: .75rem 1rem;
}
figure.wp-block-table {
  overflow-x: auto; /* Включаем горизонтальный скроллинг */
}
figure.wp-block-table table {
  table-layout: auto; /* Таблица автоматически подстраивается под содержимое */
}


/* *******************************************************************
 *
 *  5. MY CLASSES
 *  
 * *******************************************************************/
.absolute {
  position: absolute;
}
.relative {
  position: relative;
}
.box-100 {
  width: 100%;
}
.height-100 {
  height: 100%;
}
.list-reset {
  margin: 0;
  padding: 0;
  list-style-type: none;
}
.fixed {
	position: fixed;
}
.pointer {
	cursor: pointer;
}
.no-decoration {
	text-decoration: none;
}
/* TEXT */
.font-size-16 {
  font-size: 16px;
}
.font-size-18 {
  font-size: 18px;
}
.uppercase {
  text-transform: uppercase;
}
.strong {
  font-weight: 500 !important;
}
.stronger {
  font-weight: 600 !important;
}
.light {
  font-weight: 300;
}
.text-muted {
  font-size: 15px;
  color: var(--text-2);
}
.text-muted-2 {
  font-size: 14px;
  color: var(--text-3);
}
.smallest {
  font-size: 12.5px;
}
.text-nowrap {
    white-space: nowrap;
}
/* FLEX */
.flex {
  display: flex;
}
.flex-wrap {
  flex-wrap: wrap;
}
.justify-between {
  justify-content: space-between;
}
.align-between {
  align-content: space-between;
}
.layout-column {
  flex-direction: column;
  display: flex;
}
.vertical-align-middle {
	vertical-align: middle;
}
.align-center {
  align-items: center;
}
.flex-start {
    align-self: flex-start;
}
.justify-end {
    justify-content: end;
}
.flex-1 {
  flex: 1;
}
.gap-1 {
  gap: 0.25rem !important;
}
.gap-2 {
  gap: 0.5rem !important;
}
.gap-3 {
  gap: 1rem !important;
}
.gap-4 {
  gap: 1.5rem !important;
}
.gap-5 {
  gap: 3rem !important;
}
/* HIDDEN */
.hidden {
  display: none;
}
.overflow-hidden {	
	overflow: hidden;
}
.overflow-x-hidden {	
	overflow-x:hidden;
}
.overflow-x-auto {	
	overflow-x:auto;
}
/* BORDERS */
.border {
  border: 1px solid var(--border);
}
.border-top {
  border-top: 1px solid var(--border);
}
.border-bottom {
  border-bottom: 1px solid var(--border);
}
.border-left {
  border-left: 1px solid var(--border);
}
.border-radius-1 {
  border-radius: var(--border-radius-1);
}
/* PADDINGS */
.p-0 {
  padding: 0;
}
.p-1 {
  padding: 0.25rem;
}
.p-2 {
  padding: 0.5rem;
}
.p-3 {
  padding: 1rem;
}
.p-4 {
  padding: 1.5rem;
}
.pt-0 {
  padding-top: 0;
}
.pt-2 {
  padding-top: .5rem;
}
.pt-3 {
  padding-top: 1rem;
}
.pt-4 {
  padding-top: 1.5rem;
}
.pt-5 {
  padding-top: 3rem;
}
.pb-0 {
  padding-bottom: 0;
}
.pb-2 {
  padding-bottom: .5rem;
}
.pb-3 {
  padding-bottom: 1rem;
}
.pb-5 {
  padding-bottom: 3rem;
}
/* MARGINS */
.mb-0 {
  margin-bottom: 0 !important;
}
.mb-1 {
  margin-bottom: 0.25rem !important;
}
.mb-2 {
  margin-bottom: 0.5rem !important;
}
.mb-3 {
  margin-bottom: 1rem !important;
}
.mb-4 {
  margin-bottom: 1.5rem !important;
}
.mb-5 {
  margin-bottom: 3rem !important;
}
.mt-0 {
  margin-top: 0 !important;
}
.mt-1 {
  margin-top: 0.25rem;
}
.mt-2 {
  margin-top: 0.5rem !important;
}
.mt-3 {
  margin-top: 1rem !important;
}
.mt-4 {
  margin-top: 1.5rem !important;
}
.mt-5 {
  margin-top: 3rem !important;
}
/* BG COLORS */
.bg-color-link {
  background: var(--link) !important;
}
.bg-color-1 {
  background: var(--bg) !important;
}
.bg-color-2 {
  background: var(--bg-2);
}
.bg-color-3 {
  background: var(--bg-3);
}
.bg-color-4 {
  background: var(--bg-4);
}
.bg-transparent {
  background: transparent;
}
/* TEXT COLORS */
.text-color {
  color: var(--text) !important;
}
.text-color-2 {
  color: var(--text-2) !important;
}
.text-color-3 {
  color: var(--text-3) !important;
}
/* SVG */
.filled {
	fill:var(--text);
}
/* OTHER */
#alpaka-scrolltotop {      
	bottom: 8rem; 
	right: 1.5rem; 
	z-index: 1000;
    opacity: 0.8;
}
#progress-bar {
	height: 4px; 
	top: 0; 
	z-index: 9999; 
}

/* *******************************************************************
 *
 *  6. Стили для ПК
 *  
 * *******************************************************************/
@media screen and (min-width: 480px) {
  .columns-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .columns-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media screen and (min-width: 719px) {
  .columns-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .columns-3 {
    grid-template-columns: repeat(3, 1fr);
  }	
  .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
    flex-basis: 0;
    flex-grow: 1;
  }
}
@media screen and (min-width: 992px) {
  .columns-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .columns-5 {
    grid-template-columns: repeat(5, 1fr);
  }
	body {
		font-size: 18px;
	}
	h1 {
		font-size: 32px;
	}
	h2 {
	  font-size: 24px;
	}
	h3 {
	  font-size: 20px;
	}
	h4 {
	  font-size: 18px;
	}
	.single-post h1 {
		font-size: 42px;
	}
	figure.wp-block-table table.has-fixed-layout {
    width: 100%; /* Фиксированная ширина таблицы */
    table-layout: fixed; /* Фиксированная раскладка таблицы */
	}
    .menu-toggle {
        display: none;
    }
	.search-field {
		width: 320px;
	}
    #site-navigation,
    #menu-primary-menu,
    #menu-primary-menu li,
    #menu-primary-menu li a {
        height: 100%;
    }
	#menu-primary-menu {
		display:flex;
	}
   #menu-primary-menu > li.current-menu-item:before {
        border-bottom: 0.1rem solid var(--link);
        bottom: 1rem;
        content: "";
        position: absolute;
        width: 100%;
    }
	/* Стили для шаблона с сайдбаром */
    .active-sidebar-1 #primary-and-secondary {
		display: grid;
		grid-template-columns: minmax(0, 824px) 300px;
		justify-content: space-between;
		width: 100%;
		gap:1rem;
	}
}

/* *******************************************************************
 *
 *  7. Стили для ПК (устройств, которые поддерживают hover)
 *  
 * *******************************************************************/
@media (hover: hover) and (pointer: fine) {
	a:hover {
		text-decoration: none;
	}
	.hover-underline:hover, #secondary li:hover > a, #colophon li:hover > a, .pagination-nav li:hover > a, .wp-block-button__link:hover {
		text-decoration: underline;
	}
	#menu-primary-menu li:hover > a {
		color: var(--link) !important;
	}
	#menu-primary-menu li:hover:before {
		border-bottom: 0.1rem solid var(--link);
		bottom: 1rem;
		content: "";
		position: absolute;
		width: 100%;
	}
	#alpaka-scrolltotop:hover {
		opacity: 1;
	}
}