/*
Theme Name: Telegram Hub
Theme URI: https://tgstickers.su/
Author: Igor K.
Description: Каталог стикеров, эмодзи и ботов.
Version: 1.0
License: GPLv2 or later
Text Domain: telegram-hub
*/
*{
	margin:0;
	padding:0;
}
/* ===== :ROOT VARIABLES ===== */
:root {
  --bg: #ffffff;
  --text: #222;
  --link: #0088cc;
  --card-bg: #fff;
  --card-shadow: rgba(0,0,0,0.08);
  --border: #ddd;
  --hover: rgba(0,0,0,0.05);
  --bg-overlay: rgba(58, 58, 58, 0.8);
  --container-width: 1000px;
  --gap: 20px;
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
	--glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: 1px solid rgba(0, 0, 0, 0.06);
	
}

[data-theme='dark'] {
  --bg: #121212;
  --text: #e0e0e0;
  --link: #5eb8ff;
  --card-bg: #1e1e1e;
  --card-shadow: rgba(0,0,0,0.4);
  --border: #333;
  --hover: rgba(255,255,255,0.08);
  --bg-overlay: rgba(255, 255, 255, 0.8);
	--glass-bg: rgba(20, 22, 30, 0.45);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== BODY ===== */
body {
  font-family: 'Roboto',sans-serif;
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
	 
}

/* === СВЕТЛАЯ ТЕМА === */
[data-theme="light"] body {
  background-image: linear-gradient(to bottom right, rgba(245, 252, 188, 0.8), rgba(152, 228, 172, 0.7)), url('/wp-content/themes/telegram-hub/assets/img/space.webp');


}

/* === ТЁМНАЯ ТЕМА === */
[data-theme="dark"] body {
  background-image: linear-gradient(to bottom right, rgba(80, 70, 160, 0.6), rgba(30, 25, 60, 0.85)), url('/wp-content/themes/telegram-hub/assets/img/space.webp');

}


/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 50;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
  border-bottom:1px solid var(--border);
  background: var(--header-bg, #ffffff);
  backdrop-filter: none;
  box-shadow: none;
}

body:not(.ready) header {
  transition: none !important;
}

[data-theme="dark"] header {
  --header-bg: #1e1e1e;
}

/* ===== HEADER INNER ===== */
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: var(--container-width);
  padding: 0 var(--gap);
  box-sizing: border-box;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-icon {
  width: 28px;
  height: 28px;
  margin-right: 8px;
}

.logo-text {
  color: #4eb1ea;
  font-weight: 600;
  font-size: 1.1rem;
}

/* ===== NAV LINKS ===== */
.main-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition-fast), background var(--transition-fast);
  padding: 6px 10px;
  border-radius: 8px;
}

.main-nav a:hover {
  color: var(--link);
  background: var(--hover);
}

/* ===== ICON BUTTONS ===== */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  border-radius: 8px;
  transition: color var(--transition-fast), background var(--transition-fast), opacity 0.2s ease;
}

.icon-btn:hover {
  color: var(--link);
  background: var(--hover);
  opacity: 0.8;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
}

/* ===== THEME DROPDOWN ===== */
.theme-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.theme-menu {
  position: absolute;
  top: 120%;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  min-width: 180px;
  overflow: hidden;
  z-index: 100;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.25s ease;
}

.theme-dropdown.open .theme-menu {
  max-height: 500px;
  opacity: 1;
}

.theme-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  background-clip: padding-box;
  width: 100%;
}

.theme-menu button svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
}

[data-theme='light'] .theme-menu button {
  color: #222;
}

[data-theme='dark'] .theme-menu button {
  color: #fff;
}

[data-theme='light'] .theme-menu button:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #0088cc;
}

[data-theme='dark'] .theme-menu button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #5eb8ff;
}

/* ===== BURGER MENU ===== */
.burger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 6px;
  color: var(--text);
}

.search{
    padding: 10px 15px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 4px;
    font-size: 15px;
	background: var(--bg, 0.05);
    border: 1px solid var(--border, 0.1);
    color: var(--text, #FFF);
}
}

.search:focus{
    outline: none;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 14px;
    display: none;
	transition: all var(--transition-medium);
    box-sizing: border-box;
    background: var(--glass-bg); 
    backdrop-filter: blur(12px) saturate(1.05);
}

/* Показываем инпут поиска при клике на кнопку */
.search-input.show {
    display: block; /* Теперь он занимает 100% ширины */
    opacity: 1;
}

.search-form{
    width: 100%;
    position: relative;
    margin-bottom: 1em;
}

/* Контейнер выпадающего списка */
.autocomplete-list {
    list-style-type: none;
    margin: 0;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
    position: absolute;
    z-index: 998;
    width: 100%; /* Ширина на весь блок */
    border-radius: 4px;
    background: var(--bg); 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Элементы списка */
.autocomplete-list li {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text);
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
    border-bottom: 1px solid var(--border);
	margin-bottom:0;
}

.autocomplete-list li:last-child{
    border-bottom: none;
}

/* Элемент при наведении */
.autocomplete-list li:hover {
    background: var(--hover);
}

/* По умолчанию скрываем список */
.autocomplete-list {
    display: none;
}

/* Показываем список с рамкой при фокусе и наличии текста */
#search-input:focus:not(:placeholder-shown) ~ .autocomplete-list {
    display: block;
    border: 1px solid #ddd;
}

/* Скрыть крестик в поле поиска */
.search-form input[type="search"]::-webkit-search-cancel-button {
    display: none;
}

.search-form input[type="search"]::-moz-search-clear-button {
    display: none;
}

/* ===== Related tags block ===== */
.related-tags {
    margin: 1rem 0;
    padding: 1rem;
}

/* ===== Tag list grid ===== */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.tag-list .tag-item:hover{
	text-decoration:underline;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .related-tags {
        padding: 1rem;
    }
}

.skeleton-item {
    padding: 10px;
    border-radius: 12px;
    animation: pulse 1.6s infinite ease-in-out;
}
@keyframes pulse {
    0% { opacity: .7; }
    50% { opacity: 1; }
    100% { opacity: .7; }
}
.skeleton-thumb {
    width: 100%;
    height: 120px;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    margin-bottom: 10px;
}
.skeleton-line {
    height: 12px;
    width: 80%;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    margin-bottom: 6px;
}
.skeleton-line.short {
    width: 60%;
}



/* ===== NAVIGATION (MOBILE) ===== */
.nav-links {
  display: flex;
  gap: 10px;
  transition: max-height 0.3s ease;
  overflow: hidden;
  max-height: 1000px;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px) saturate(1.05);
  -webkit-backdrop-filter: blur(12px) saturate(1.05);
	border: var(--glass-border);
  border-radius: 14px;
  transition: all var(--transition-medium);
}

#breadcrumbs {    
    padding: 10px 15px;
    border-radius: 8px;
    display: block;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 1em;
	font-size:.95rem;
}

/* Стили ссылок в хлебных крошках */
#breadcrumbs a {
    color: var(--text);
    transition: color 0.3s ease-in-out;
}

#breadcrumbs a:hover {
    color: var(--link);
}


@media (max-width: 900px) {
  header {
    position: fixed;
  }

  .header-left {
    gap: 5px;
  }

  .header-right {
    gap: 0;
  }

  main {
    padding-top: 80px !important;
  }

  .burger-btn {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 99;
  }

  .nav-links.show {
    max-height: 500px;
  }

  .nav-links a {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    border-radius: 0;
  }

  .nav-links a:hover {
    background: var(--hover);
    color: var(--link);
  }
}

/* ===== MAIN CONTAINER ===== */
main { max-width: var(--container-width); margin: 0 auto; padding: var(--gap); box-sizing: border-box; position: relative; z-index: 1; min-height:100vh; }

/* ===== FOOTER ===== */
footer { background: var(--card-bg); color: var(--text); padding: 20px var(--gap); text-align: center; border-top: 1px solid var(--border); position: relative; z-index: 1; }
.site-footer { max-width:var(--container-width); margin: 0 auto;}
.disclaimer { width: 100%; display: block; }

/* ===== LINKS ===== */
a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--link);
}


/* Заголовки */
h1 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.8rem; line-height: 1.25; color: var(--link); }
h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.5rem; line-height: 1.25; color: var(--text); }
h3 { font-size: 1rem; font-weight: 500; margin-bottom: 0.3rem; line-height: 1.25; color: var(--text); }
h4 { font-size: 0.95rem; font-weight: 500; margin-bottom: 0.25rem; line-height: 1.25; color: var(--text); }
h5 { font-size: 0.9rem; font-weight: 500; margin-bottom: 0.2rem; line-height: 1.25; color: var(--text); }
h6 { font-size: 0.85rem; font-weight: 500; margin-bottom: 0.2rem; line-height: 1.2; color: var(--text); }

/* Абзацы и текст */
p { font-size: 0.95rem; line-height: 1.5; margin-bottom: 1em; color: var(--text); }

/* Ссылки внутри текста */
p a { color: var(--link); text-decoration: underline; transition: color var(--transition-fast); }
p a:hover { color: var(--link); }

/* Дополнительные текстовые классы */
.text-small { font-size: 0.75rem; color: var(--text); }
.text-medium { font-size: 0.85rem; color: var(--text); }
.text-large { font-size: 0.95rem; color: var(--text); }
.text-bold { font-weight: 600; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ===== BLOCKQUOTES ===== */
blockquote {
  border-left: 3px solid var(--link);
  padding-left: 10px;
  color: var(--text);
  font-style: italic;
  margin: 0.6em 0;
  background: rgba(0, 136, 204, 0.05);
  border-radius: 5px;
}

/* ===== LISTS ===== */
ul, ol { padding-left: 1em; margin-bottom: 0.6em; color: var(--text); font-size:0.95rem}
ul li { list-style-type: disc; margin-bottom: 0.3em; }
ol li { list-style-type: decimal; margin-bottom: 0.3em; }

/* ===== HIGHLIGHTED TEXT ===== */
mark { background-color: rgba(255, 235, 59, 0.25); padding: 0 2px; border-radius: 3px; }

/* ===== HORIZONTAL RULE ===== */
hr { border: 0; height: 1px; background: var(--border); margin: 0.8em 0; }



/* ===== UTILITIES ===== */
.flex { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.hidden { display: none !important; }
.visible { display: block !important; }




.pagination { display: flex; justify-content: center; margin: 1em 0 .5em 0; gap: 5px;}
.pagination a, .pagination span { display: flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; font-size: 15px; color: var(--text); background-color: var(--card-bg); border: 1px solid var(--border); border-radius: 6px; text-decoration: none; transition: all 0.3s ease; white-space: nowrap; box-shadow: 0 2px 4px var(--card-shadow); }
.pagination a:hover { background-color: var(--link); border-color: var(--link); color: #fff; }
.pagination .current { font-weight: 600; color: #fff; background-color: var(--link); border: 1px solid var(--link); }
.pagination .dots { width: auto; height: 30px; color: var(--text); background: transparent; border: none; box-shadow:none; padding: 0 10px; }

/* === OFFCANVAS === */
#offcanvas-toggle{ display:none; }
#offcanvas-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-overlay); z-index: 9998; display: none; transition: opacity 0.3s ease; cursor: pointer; }
#offcanvas-overlay.active { display: block; opacity: 1; }
#offcanvas-menu { position: fixed; top: 0; left: -400px; width: 400px; height: 100%; background: var(--bg); color: var(--text); box-sizing: border-box; z-index: 9999; transition: left 0.3s ease; display: flex; flex-direction: column; max-width: 100%; }
#offcanvas-menu.open { left: 0; }
.offcanvas-header {	display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.offcanvas-title { margin: 0; font-size: 1.25rem; font-weight: 600; }
.btn-close { width: 1em; height: 1em; background: transparent; border: none; opacity: 0.7; position: relative; cursor: pointer; }
.btn-close::before, .btn-close::after { content: ''; position: absolute; top: 0; left: 50%;	width: 2px;	height: 100%; background: var(--text); transform-origin: center; }
.btn-close::before { transform: rotate(45deg); }
.btn-close::after {	transform: rotate(-45deg); }
.btn-close:hover { opacity: 1; }
.offcanvas-body { flex: 1; overflow-y: auto; }
.offcanvas-nav { margin: 0;	padding: 0; }
.offcanvas-nav li {	list-style: none; margin: 0; }
.offcanvas-nav a { display: block; padding: 1rem 1.5rem; color: var(--text); text-decoration: none;	border-bottom: 1px solid var(--border); transition: background-color 0.2s, color 0.2s; }
.offcanvas-nav a:hover { background-color: var(--border); color: var(--link); }
.offcanvas-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border);	background: var(--bg-card-color); text-align: center; }
.offcanvas-footer a { display: inline-block; padding: 0.5rem 1rem; color: var(--link); text-decoration: none; font-size: 0.95rem; }
.offcanvas-footer a:hover {	background-color: var(--accent-hover, #0b5ed7); }
@media (max-width: 768px) { #offcanvas-menu { width: 100%; left: -100%; } #offcanvas-toggle{ display:block;	} }



/* === Archive Filter === */
#archive-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#archive-filter select {
  padding: 4px 8px;
  border-radius: 6px;
}

#archive-filter .count {
  font-size: 0.8em;
  color: var(--text);
}

/* === Category Container (Glass Style) === */
.category-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
  gap: 1rem;
  margin: 1rem 0;
  padding: 10px 14px;
  max-width: 100%;
  color: var(--text);
}


/* === Filter Icon === */
.category-container .filter-icon {
  width: 20px;
  height: 20px;
}

html[data-theme='dark'] .filter-icon {
  filter: invert(1) brightness(2);
}


/* === Category List Links === */
.category-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.category-link {
  text-decoration: none;
  color: inherit;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  padding: 3px 6px;
  border-radius: 6px;
}

.category-link:hover {
  color: var(--link);
}

.category-link.active {
  color: var(--link);
  font-weight: 600;
}


/* === Select Elements in Category Filter === */
.category-container select {
  background: var(--bg, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 7px;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition-medium);
  min-width: 160px;
}

[data-theme='dark'] .category-container select {
  background: var(--bg, 0.05);
  border: 1px solid var(--border, 0.1);
  color: var(--text);
}

.category-container select:hover,
.category-container select:focus {
  background: var(--bg, 0.05);
  border-color: var(--link);
  outline: none;
}


/* === Stickers Grid === */
.stickers-grid{ display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; align-items: stretch; margin-bottom: 1.5rem; }
.sticker-item { display: flex; flex-direction: column; text-decoration: none; color: var(--text); background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 1rem; transition: all var(--transition-medium); box-shadow: 0 2px 6px var(--card-shadow); }
.sticker-item:hover { box-shadow: 0 4px 16px var(--card-shadow); text-decoration: none; }
.sticker-item h2 { font-size: 0.95rem; margin-top: 0.5rem; font-weight: 600; transition: color var(--transition-fast); word-wrap: break-word; }
.sticker-item:hover h2 { color: var(--link); }

/* === Sticker Preview === */
.sticker-preview { width: 100%; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; background: var(--hover); border-radius: 12px; overflow: hidden; margin-bottom: 0.5rem; position: relative; }
.sticker-preview img, .sticker-preview video { max-width: 80%; max-height: 80%; object-fit: contain; display:block; transition: transform var(--transition-medium); }

/* === Sticker Type Icons === */
.sticker-type-icon { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; background-size: contain; background-repeat: no-repeat; opacity: 0.9; z-index: 2; }
.sticker-preview .static { background-image: url('../telegram-hub/assets/img/icons/static.svg'); }
.sticker-preview .animated { background-image: url('../telegram-hub/assets/img/icons/animated.svg'); }
.sticker-preview .video { background-image: url('../telegram-hub/assets/img/icons/video.svg'); }


.box { background-color: var(--card-bg); padding: 1em; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 4px 10px var(--card-shadow); margin-bottom: 1em; transition: background-color var(--transition-fast), box-shadow var(--transition-fast); }

.btn { display: inline-block; font-size: 16px; font-weight: 500; padding: 12px 24px; border-radius: 5px; text-decoration: none; text-align: center; cursor: pointer; border: 0; margin: 20px auto; transition: background-color var(--transition-fast), transform var(--transition-fast), color var(--transition-fast); background-color: #0088cc; color: #fff; }
.btn:hover { text-decoration: none; background-color: #0078b0; color: #fff; }
.btn:active { transform: scale(0.98); }

.btn-tg-icon {
  filter: invert(100%) sepia(100%) saturate(0%) hue-rotate(0deg);
  width: 15px;
  height: 15px;
  position: relative;
  right: 5px;
  top: 2px;
  display: inline-block;
}

a.btn {
  display: inline-block;
}

/* Теги */
.tag { display: inline-block; background: #e0f0ff; color: #2f87fa; padding: 4px 10px; margin: 2px 4px 2px 0; border-radius: 8px; font-size: 13px; text-decoration: none; white-space: nowrap; transition: all 0.2s ease; }
.tag:hover { background: #2f87fa; color: #fff; text-decoration: none; }

/* Статистика на главной */
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin: 2rem 0; color: var(--text); }
.stat-item { padding: 1.2rem; text-align: center; border-radius: 14px; display: flex; flex-direction: column; align-items: center; opacity: 0; transform: translateY(20px); animation: statsFade 0.8s ease-out forwards; }
.stat-item:nth-child(2) { animation-delay: .15s; }
.stat-item:nth-child(3) { animation-delay: .30s; }
.stat-title { font-size: 16px; font-weight: 600; color: var(--link); }
.stat-number { font-size: 20px; font-weight: 700; margin-top: 0.1rem; }
.stat-sub { margin-top: 0.1rem; font-size: 13px; opacity: 0.8; }
@media (max-width: 600px) { .stats-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); gap:5px; } }

/* Анимация появления статистики */
@keyframes statsFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Responsive === */

@media (max-width: 600px) {
  .stickers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

	#archive-filter select {
		width:100%;
	}
	#archive-filter img.filter-icon, 
	#archive-filter .count{
		display:none;
	}
}
