/**
 * GrandScreen Fixes - UI/UX Fixes
 * @package GrandScreen
 */

/* ========================================================================
   SEARCH BUTTON FIX - Clean icon without weird fill
   ======================================================================== */

/* Generic search form layout - input and button on same line */
form.search-form {
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	gap: 0.5rem !important;
}

form.search-form label {
	flex: 1 !important;
	margin: 0 !important;
}

form.search-form .search-field {
	width: 100% !important;
	height: 48px !important;
	box-sizing: border-box !important;
}

form.search-form .search-submit {
	flex-shrink: 0 !important;
}

/* Search submit button - clean styling */
.search-form .search-submit {
	background-color: #667eea !important;
	background-image: none !important;
	border: none !important;
	width: 48px !important;
	height: 48px !important;
	min-width: 48px !important;
	border-radius: 8px !important;
	cursor: pointer !important;
	position: relative !important;
	transition: background-color 0.2s ease !important;
}

.search-form .search-submit::before {
	content: '' !important;
	position: absolute !important;
	top: 50% !important;
	left: 50% !important;
	transform: translate(-50%, -50%) !important;
	width: 20px !important;
	height: 20px !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") !important;
	background-size: contain !important;
	background-repeat: no-repeat !important;
}

.search-form .search-submit:hover {
	background-color: #5568d3 !important;
}

/* Hide duplicate search on "Nothing found" page */
.no-results .page-content .search-form {
	display: none !important;
}

/* ========================================================================
   HEADER - Don't break theme's native functionality
   ======================================================================== */

/* Just ensure proper z-index */
.site-header {
	z-index: 998 !important;
}

.humburger.js-humburger {
	z-index: 1000 !important;
	cursor: pointer !important;
}

/* Header search icon */
.header-search .search-icon {
	cursor: pointer !important;
}


/* ========================================================================
   ЗАДАЧА 2: РЕДИЗАЙН HERO СЕКЦИИ
   Проблема: Нужен светлый, чистый стиль как у Naver Webtoon
   Решение: Светлый минималистичный дизайн с акцентным цветом на кнопке
   ======================================================================== */

.hero-section {
	margin: 0 0 3rem 0 !important;
	padding: 4rem 2rem !important;
	background: #ffffff !important;
	border-radius: 0 !important;
	color: #1a1a1a !important;
	position: relative !important;
	overflow: hidden !important;
	box-shadow: none !important;
	border-bottom: 1px solid #e5e5e5 !important;
}

/* Удаляем все декоративные элементы - чистый дизайн */
.hero-section::before {
	display: none !important;
}

.hero-section::after {
	display: none !important;
}

@keyframes pulse {
	0%, 100% { opacity: 0.5; transform: scale(1); }
	50% { opacity: 0.8; transform: scale(1.1); }
}

.hero-content {
	max-width: 800px !important;
	margin: 0 auto !important;
	text-align: center !important;
	position: relative !important;
	z-index: 1 !important;
}

.hero-content > div:first-child {
	font-size: 2.8rem !important;
	margin-bottom: 1.2rem !important;
	font-weight: 700 !important;
	color: #1a1a1a !important;
	text-shadow: none !important;
	line-height: 1.2 !important;
	letter-spacing: -0.02em !important;
	text-transform: none !important;
}

.hero-content p {
	font-size: 1.1rem !important;
	margin-bottom: 2rem !important;
	color: #666 !important;
	font-weight: 400 !important;
	line-height: 1.6 !important;
	letter-spacing: 0 !important;
}

/* Скрываем статистику */
.hero-stats {
	display: none !important;
}

.hero-stat-item {
	display: none !important;
}

.hero-stat-number {
	display: none !important;
}

.hero-stat-label {
	display: none !important;
}

/* Форма поиска в hero - светлый чистый стиль */
.hero-section .search-form {
	max-width: 600px !important;
	margin: 0 auto !important;
}

.hero-section .search-form form {
	display: flex !important;
	gap: 0.5rem !important;
	background: white !important;
	padding: 0.4rem !important;
	border-radius: 50px !important;
	border: 2px solid #e5e5e5 !important;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
	transition: all 0.3s ease !important;
}

.hero-section .search-form form:focus-within {
	border-color: #667eea !important;
	box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15) !important;
}

.hero-section .search-form input[type="search"] {
	flex: 1 !important;
	padding: 0.9rem 1.5rem !important;
	border: none !important;
	background: transparent !important;
	font-size: 1rem !important;
	color: #1a1a1a !important;
	outline: none !important;
}

.hero-section .search-form input[type="search"]::placeholder {
	color: #999 !important;
}

.hero-section .search-form button[type="submit"] {
	padding: 0.9rem 2rem !important;
	background: #667eea !important;
	color: white !important;
	border: none !important;
	border-radius: 50px !important;
	font-weight: 600 !important;
	font-size: 0.95rem !important;
	cursor: pointer !important;
	transition: all 0.2s ease !important;
	box-shadow: none !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
}

.hero-section .search-form button[type="submit"]:hover {
	background: #5568d3 !important;
	transform: translateY(-1px) !important;
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25) !important;
}

.hero-section .search-form button[type="submit"]:active {
	transform: translateY(0) !important;
}

/* Адаптивность hero секции */
@media (max-width: 768px) {
	.hero-section {
		padding: 2.5rem 1.5rem !important;
		margin-bottom: 2rem !important;
	}

	.hero-content > div:first-child {
		font-size: 2rem !important;
		margin-bottom: 1rem !important;
	}

	.hero-content p {
		font-size: 1rem !important;
		margin-bottom: 2rem !important;
	}

	.hero-section .search-form form {
		flex-direction: column !important;
		gap: 0.5rem !important;
	}

	.hero-section .search-form input[type="search"] {
		padding: 0.9rem 1.2rem !important;
		font-size: 1rem !important;
	}

	.hero-section .search-form button[type="submit"] {
		padding: 0.9rem 1.5rem !important;
		width: 100% !important;
	}

	.hero-stats {
		gap: 1rem;
	}

	.hero-stat-item {
		padding: 0.75rem 1rem;
	}

	.hero-stat-number {
		font-size: 1.5rem;
	}

	.hero-stat-label {
		font-size: 0.8rem;
	}
}

@media (max-width: 480px) {
	.hero-section {
		padding: 2rem 1rem !important;
		border-radius: 12px !important;
	}

	.hero-content > div:first-child {
		font-size: 1.6rem !important;
	}

	.hero-content p {
		font-size: 0.95rem !important;
		margin-bottom: 1.5rem !important;
	}

	.hero-section .search-form input[type="search"] {
		padding: 0.85rem 1rem !important;
		font-size: 0.95rem !important;
	}

	.hero-section .search-form button[type="submit"] {
		padding: 0.85rem 1.2rem !important;
		font-size: 0.95rem !important;
	}
}


/* ========================================================================
   ЗАДАЧА 3: СВОРАЧИВАЕМЫЕ ОПИСАНИЯ ТАКСОНОМИЙ
   Проблема: Длинные описания на страницах таксономий неудобны для пользователей
   Решение: Показываем 2 предложения, остальное сворачивается с градиентом
   ======================================================================== */

/* Контейнер описания с возможностью сворачивания */
.archive-description {
	position: relative !important;
	overflow: hidden !important;
	transition: max-height 0.4s ease !important;
}

/* Состояние "свернуто" - показываем только 2 предложения */
.archive-description.collapsed {
	max-height: 4.8em !important; /* ~3 строки текста при line-height 1.6 */
}

/* Градиент для плавного перехода */
.archive-description.collapsed::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 3em;
	background: linear-gradient(to bottom,
		rgba(255, 255, 255, 0) 0%,
		rgba(255, 255, 255, 0.5) 40%,
		rgba(255, 255, 255, 0.9) 80%,
		rgba(255, 255, 255, 1) 100%
	);
	pointer-events: none;
}

/* Состояние "развернуто" */
.archive-description.expanded {
	max-height: none !important;
}

.archive-description.expanded::after {
	display: none;
}

/* Toggle button - only arrow, centered, very subtle */
.archive-description-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	margin: 12px auto 0;
	padding: 0;
	background: transparent;
	border: none;
	color: #ddd;
	font-size: 0;
	cursor: default;
	transition: all 0.2s ease;
	text-decoration: none;
	width: fit-content;
}

.archive-description-toggle:hover {
	background: transparent;
	border: none;
	color: #ddd;
	transform: none;
	cursor: default;
}

.archive-description-toggle:active {
	transform: none;
}

/* Скрываем текст */
.archive-description-toggle span:not(.archive-description-toggle-icon) {
	display: none !important;
}

/* Стрелка в кнопке - только иконка */
.archive-description-toggle-icon {
	display: inline-block;
	width: 20px;
	height: 20px;
	transition: transform 0.3s ease;
}

.archive-description-toggle-icon svg {
	width: 100%;
	height: 100%;
	stroke: currentColor;
	stroke-width: 2;
	fill: none;
}

/* Поворот стрелки при раскрытии */
.archive-description.expanded + .archive-description-toggle .archive-description-toggle-icon {
	transform: rotate(180deg);
}

/* Адаптивность для описаний */
@media (max-width: 640px) {
	.archive-description.collapsed {
		max-height: 4.2em !important; /* Меньше на мобильных */
	}

	.archive-description-toggle {
		font-size: 13px;
		padding: 6px 14px;
	}
}


/* ========================================================================
   ЗАДАЧА 4: ВИДИМЫЙ ПОИСК НА СТРАНИЦЕ РЕЗУЛЬТАТОВ
   Проблема: Пользователям нужно кликать чтобы открыть поиск для новых запросов
   Решение: Показываем форму поиска по умолчанию на странице результатов
   ======================================================================== */

/* Контейнер поиска на странице результатов */
.search-results-search-form {
	margin-bottom: 2rem;
	padding: 1.5rem;
	background: white;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-results-search-form .search-form {
	margin: 0;
}

.search-results-search-form .search-form form {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.75rem;
	align-items: center;
}

.search-results-search-form .search-form .search-submit {
	flex-shrink: 0;
}

.search-results-search-form .search-form input[type="search"] {
	flex: 1;
	padding: 0.9rem 1.2rem;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 1rem;
	transition: all 0.2s ease;
	background: #fafafa;
}

.search-results-search-form .search-form input[type="search"]:focus {
	outline: none;
	border-color: #667eea;
	background: white;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-results-search-form .search-form button[type="submit"] {
	padding: 0.9rem 1.8rem;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	border: none;
	border-radius: 8px;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	transition: all 0.3s ease;
	white-space: nowrap;
}

.search-results-search-form .search-form button[type="submit"]:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.search-results-search-form .search-form button[type="submit"]:active {
	transform: translateY(0);
}

/* Hide search results page header */
.search .page-header {
	display: none !important;
}

/* Адаптивность формы поиска */
@media (max-width: 640px) {
	.search-results-search-form {
		padding: 1rem;
		margin-bottom: 1.5rem;
	}

	.search-results-search-form .search-form form {
		flex-direction: column;
		gap: 0.5rem;
	}

	.search-results-search-form .search-form input[type="search"] {
		width: 100%;
		padding: 0.85rem 1rem;
		font-size: 0.95rem;
	}

	.search-results-search-form .search-form button[type="submit"] {
		width: 100%;
		padding: 0.85rem 1.2rem;
	}

	.search .page-title {
		font-size: 1.5rem;
	}
}


/* Hide taxonomy chips on collections pages */
.tax-collections .taxonomy-chips-container {
	display: none !important;
}
