/**
 * Hundikuu Docs - Frontend Styles
 *
 * Värvid ja gradient'id tulevad theme.json'ist (--wp--preset--*).
 * See fail sisaldab kõikide custom plokkide stiile + layout abikomponente.
 */

/* === BASE === */
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--text);
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 80px;
}

::selection {
	background: var(--wp--preset--color--accent);
	color: #ffffff;
}

/* === SECTION DIVIDERS - Hundikuu mustriga eraldatud pealkirjad === */
.hk-section-title {
	text-align: center;
	margin-bottom: var(--wp--preset--spacing--lg);
}

.hk-section-title::after {
	content: '';
	display: block;
	width: 60px;
	height: 1px;
	background: currentColor;
	opacity: 0.4;
	margin: 0.75rem auto 0;
}

.hk-section-subtitle {
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--wp--preset--color--text-muted);
	margin-bottom: var(--wp--preset--spacing--lg);
}

/* === LIGHT/DARK SECTION SWITCHING === */
.hk-section--dark {
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--text);
}

.hk-section--light {
	background: var(--wp--preset--color--background-light);
	color: var(--wp--preset--color--text-dark);
}

.hk-section--light .hk-section-subtitle {
	color: var(--wp--preset--color--text-muted-light);
}

/* === BUTTONS - Hundikuu lilla-sinine gradient === */
.wp-element-button,
.wp-block-button__link,
.hk-button {
	background: var(--wp--preset--gradient--hundikuu-primary) !important;
	color: #fff !important;
	border: none;
	padding: 0.75rem 1.5rem;
	border-radius: 8px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: transform 0.2s, box-shadow 0.2s;
	display: inline-block;
	text-decoration: none;
}

.wp-element-button:hover,
.wp-block-button__link:hover,
.hk-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35);
}

.hk-button--ghost {
	background: transparent !important;
	border: 1px solid var(--wp--preset--color--accent) !important;
	color: var(--wp--preset--color--accent) !important;
}

/* === LAYOUT: dokumentatsioon sidebariga === */
.hk-docs-layout {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: var(--wp--preset--spacing--xl);
	max-width: 1200px;
	margin: 0 auto;
	padding: var(--wp--preset--spacing--lg) var(--wp--preset--spacing--md);
}

.hk-docs-sidebar {
	position: sticky;
	top: var(--wp--preset--spacing--lg);
	align-self: start;
	max-height: calc(100vh - 4rem);
	overflow-y: auto;
	padding-right: 0.5rem;
}

.hk-docs-sidebar__back {
	display: inline-block;
	color: var(--wp--preset--color--text-muted);
	font-size: 0.85rem;
	margin-bottom: 1rem;
	text-decoration: none;
}
.hk-docs-sidebar__back:hover { color: var(--wp--preset--color--accent); }

.hk-docs-sidebar__group { margin-bottom: 1.5rem; }
.hk-docs-sidebar__group-title {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--text-muted);
	margin-bottom: 0.5rem;
	font-weight: 700;
}
.hk-docs-sidebar__group ul { list-style: none; padding: 0; margin: 0; }
.hk-docs-sidebar__group li { margin: 0.15rem 0; }
.hk-docs-sidebar__group a {
	display: block;
	padding: 0.4rem 0.75rem;
	border-radius: 6px;
	color: var(--wp--preset--color--text-muted);
	text-decoration: none;
	font-size: 0.92rem;
	border-left: 2px solid transparent;
}
.hk-docs-sidebar__group a:hover { color: var(--wp--preset--color--text); background: var(--wp--preset--color--surface); }
.hk-docs-sidebar__group .is-current a {
	color: var(--wp--preset--color--text);
	background: var(--wp--preset--color--surface);
	border-left-color: var(--wp--preset--color--accent);
	font-weight: 600;
}

@media (max-width: 900px) {
	.hk-docs-layout { grid-template-columns: 1fr; }
	.hk-docs-sidebar { position: static; max-height: none; }
}

/* === DOC ARTIKKEL === */
.hk-doc { max-width: 780px; }
.hk-doc__breadcrumb {
	font-size: 0.85rem;
	color: var(--wp--preset--color--text-muted);
	margin-bottom: 1rem;
}
.hk-doc__breadcrumb a { color: var(--wp--preset--color--text-muted); text-decoration: none; }
.hk-doc__breadcrumb a:hover { color: var(--wp--preset--color--accent); }
.hk-doc__breadcrumb span { margin: 0 0.5rem; }

.hk-doc__meta {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin: 0.75rem 0 2rem;
	font-size: 0.85rem;
}
.hk-doc__meta-item {
	padding: 0.25rem 0.65rem;
	background: var(--wp--preset--color--surface);
	border-radius: 6px;
	color: var(--wp--preset--color--text-muted);
}

/* === CALLOUT === */
.hk-callout {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.75rem 1rem;
	padding: 1.1rem 1.35rem;
	border-radius: 10px;
	border: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
	margin: 1.5rem 0;
	font-size: 0.95rem;
	line-height: 1.6;
}
.hk-callout__icon { font-size: 1.25rem; line-height: 1.3; font-style: normal; }
.hk-callout__title { font-weight: 700; margin-bottom: 0.25rem; }
.hk-callout__content > *:first-child { margin-top: 0; }
.hk-callout__content > *:last-child { margin-bottom: 0; }

.hk-callout--info {
	border-color: color-mix(in srgb, var(--wp--preset--color--info) 40%, transparent);
	background: color-mix(in srgb, var(--wp--preset--color--info) 10%, var(--wp--preset--color--surface));
}
.hk-callout--info .hk-callout__icon { color: var(--wp--preset--color--info); }

.hk-callout--tip {
	border-color: color-mix(in srgb, var(--wp--preset--color--success) 40%, transparent);
	background: color-mix(in srgb, var(--wp--preset--color--success) 10%, var(--wp--preset--color--surface));
}
.hk-callout--tip .hk-callout__icon { color: var(--wp--preset--color--success); }

.hk-callout--warning {
	border-color: color-mix(in srgb, var(--wp--preset--color--warning) 40%, transparent);
	background: color-mix(in srgb, var(--wp--preset--color--warning) 10%, var(--wp--preset--color--surface));
}
.hk-callout--warning .hk-callout__icon { color: var(--wp--preset--color--warning); }

.hk-callout--danger {
	border-color: color-mix(in srgb, var(--wp--preset--color--danger) 40%, transparent);
	background: color-mix(in srgb, var(--wp--preset--color--danger) 10%, var(--wp--preset--color--surface));
}
.hk-callout--danger .hk-callout__icon { color: var(--wp--preset--color--danger); }

/* Light-section variant - kasutab erinevat tausta */
.hk-section--light .hk-callout {
	background: var(--wp--preset--color--surface-light);
	border-color: var(--wp--preset--color--border-light);
}

/* === CODE SNIPPET === */
.hk-code-snippet {
	margin: 1.5rem 0;
	border-radius: 10px;
	overflow: hidden;
	background: #0a1020;
	border: 1px solid var(--wp--preset--color--border);
}
.hk-code-snippet__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.6rem 1rem;
	background: rgba(255, 255, 255, 0.03);
	border-bottom: 1px solid var(--wp--preset--color--border);
}
.hk-code-snippet__title {
	font-size: 0.8rem;
	color: var(--wp--preset--color--text-muted);
	font-family: var(--wp--preset--font-family--mono);
	letter-spacing: 0.02em;
}
.hk-code-snippet__lang {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--accent);
	background: rgba(124, 92, 255, 0.12);
	padding: 0.15rem 0.5rem;
	border-radius: 4px;
	margin-right: auto;
}
.hk-code-snippet__copy {
	background: transparent;
	border: 1px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--text-muted);
	padding: 0.3rem 0.7rem;
	border-radius: 6px;
	font-size: 0.75rem;
	cursor: pointer;
	transition: all 0.2s;
	font-family: inherit;
}
.hk-code-snippet__copy:hover { color: #fff; border-color: var(--wp--preset--color--accent); }
.hk-code-snippet__copy.is-copied { color: var(--wp--preset--color--success); border-color: var(--wp--preset--color--success); }
.hk-code-snippet pre {
	margin: 0;
	padding: 1rem 1.25rem;
	overflow-x: auto;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.875rem;
	line-height: 1.6;
	color: #e8e8ee;
}
.hk-code-snippet code { font-family: inherit; background: transparent; padding: 0; color: inherit; }

/* === VERSION BADGE === */
.hk-version-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.15rem 0.6rem;
	background: rgba(124, 92, 255, 0.15);
	color: var(--wp--preset--color--accent);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--accent) 35%, transparent);
	border-radius: 6px;
	font-size: 0.8rem;
	font-weight: 600;
	font-family: var(--wp--preset--font-family--mono);
	vertical-align: middle;
}
.hk-version-badge::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
}
.hk-version-badge--deprecated {
	background: rgba(239, 68, 68, 0.12);
	color: var(--wp--preset--color--danger);
	border-color: color-mix(in srgb, var(--wp--preset--color--danger) 35%, transparent);
}
.hk-version-badge--deprecated::before { background: var(--wp--preset--color--danger); }

/* === STEP LIST === */
.hk-step-list {
	list-style: none;
	counter-reset: hk-step;
	padding: 0;
	margin: 1.5rem 0;
}
.hk-step-list__item {
	counter-increment: hk-step;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 1rem;
	padding: 1rem 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
}
.hk-step-list__item:last-child { border-bottom: none; }
.hk-step-list__item::before {
	content: counter(hk-step);
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--wp--preset--gradient--hundikuu-primary);
	color: #fff;
	font-weight: 700;
	font-size: 1rem;
}
.hk-step-list__title {
	font-weight: 700;
	font-size: 1.1rem;
	margin: 0 0 0.35rem;
}
.hk-step-list__body > *:first-child { margin-top: 0; }
.hk-step-list__body > *:last-child { margin-bottom: 0; }

/* === PLUGIN CARD === */
.hk-plugin-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: var(--wp--preset--spacing--md);
}

.hk-plugin-card {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: var(--wp--preset--spacing--md);
	border-radius: 16px;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: transform 0.25s, border-color 0.25s;
}
.hk-plugin-card::before {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--wp--preset--gradient--hundikuu-card);
	opacity: 0;
	transition: opacity 0.3s;
	pointer-events: none;
}
.hk-plugin-card:hover {
	transform: translateY(-4px);
	border-color: var(--wp--preset--color--accent);
}
.hk-plugin-card:hover::before { opacity: 0.08; }

.hk-plugin-card__icon-wrap {
	position: relative;
	z-index: 1;
	width: 72px;
	height: 72px;
	border-radius: 16px;
	background: var(--wp--preset--gradient--hundikuu-primary);
	display: grid;
	place-items: center;
	margin-bottom: var(--wp--preset--spacing--sm);
}
.hk-plugin-card__icon {
	width: 56px;
	height: 56px;
	border-radius: 12px;
	object-fit: cover;
}
.hk-plugin-card__category {
	position: relative;
	z-index: 1;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--accent);
	margin-bottom: 0.35rem;
	font-weight: 700;
}
.hk-plugin-card__title {
	position: relative;
	z-index: 1;
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0 0 0.5rem;
	color: var(--wp--preset--color--text);
}
.hk-plugin-card__tagline {
	position: relative;
	z-index: 1;
	color: var(--wp--preset--color--text-muted);
	font-size: 0.95rem;
	margin: 0;
}

/* Light-section variant */
.hk-section--light .hk-plugin-card {
	background: var(--wp--preset--color--surface-light);
	border-color: var(--wp--preset--color--border-light);
}
.hk-section--light .hk-plugin-card__title { color: var(--wp--preset--color--text-dark); }
.hk-section--light .hk-plugin-card__tagline { color: var(--wp--preset--color--text-muted-light); }

/* === PLUGIN HERO (single plugin) === */
.hk-plugin-hero {
	background: var(--wp--preset--gradient--hundikuu-hero);
	padding: var(--wp--preset--spacing--xl) var(--wp--preset--spacing--md);
	border-radius: 0;
	margin-bottom: var(--wp--preset--spacing--lg);
	position: relative;
	overflow: hidden;
}
.hk-plugin-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--wp--preset--gradient--accent-glow);
	pointer-events: none;
}
.hk-plugin-hero__inner {
	position: relative;
	z-index: 1;
	max-width: 1200px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: var(--wp--preset--spacing--md);
	align-items: center;
}
.hk-plugin-hero__icon {
	width: 96px;
	height: 96px;
	border-radius: 20px;
	background: var(--wp--preset--gradient--hundikuu-primary);
	padding: 12px;
	object-fit: contain;
}
.hk-plugin-hero__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(2rem, 5vw, 3.5rem);
	font-weight: 400;
	line-height: 1.1;
}
.hk-plugin-hero__tagline {
	margin: 0.35rem 0 0;
	color: var(--wp--preset--color--text-muted);
	font-size: 1.1rem;
}
.hk-plugin-hero__meta {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin-top: 0.75rem;
	font-size: 0.85rem;
}
.hk-plugin-hero__meta-item {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.3rem 0.7rem;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 6px;
	color: var(--wp--preset--color--text-muted);
}
.hk-plugin-hero__meta-item strong { color: var(--wp--preset--color--text); font-weight: 600; }

@media (max-width: 700px) {
	.hk-plugin-hero__inner { grid-template-columns: 1fr; text-align: center; }
	.hk-plugin-hero__icon { margin: 0 auto; }
}

/* === PLUGIN PAGE SECTIONS === */
.hk-plugin {
	padding-bottom: var(--wp--preset--spacing--xl);
}
.hk-plugin__intro,
.hk-plugin__docs,
.hk-plugin__faq,
.hk-plugin__changelog {
	max-width: 1000px;
	margin: 0 auto var(--wp--preset--spacing--xl);
	padding: 0 var(--wp--preset--spacing--md);
}
.hk-plugin__docs h2,
.hk-plugin__faq h2,
.hk-plugin__changelog h2 {
	margin-bottom: var(--wp--preset--spacing--md);
}

.hk-doc-group {
	margin-bottom: var(--wp--preset--spacing--md);
	padding: var(--wp--preset--spacing--md);
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 12px;
}
.hk-doc-group__title { margin: 0 0 0.75rem; font-size: 1.15rem; }
.hk-doc-group__list { list-style: none; padding: 0; margin: 0; }
.hk-doc-group__list li {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
}
.hk-doc-group__list li:last-child { border-bottom: none; }
.hk-doc-group__list a { color: var(--wp--preset--color--text); text-decoration: none; }
.hk-doc-group__list a:hover { color: var(--wp--preset--color--accent); }
.hk-doc-group__time { font-size: 0.8rem; color: var(--wp--preset--color--text-muted); }

/* === FAQ ACCORDION === */
.hk-faq-accordion { margin: 1.5rem 0; }
.hk-faq-item {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 10px;
	margin-bottom: 0.75rem;
	overflow: hidden;
}
.hk-faq-item summary {
	padding: 1rem 1.25rem;
	cursor: pointer;
	font-weight: 600;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	list-style: none;
}
.hk-faq-item summary::-webkit-details-marker { display: none; }
.hk-faq-item summary::after {
	content: '+';
	font-size: 1.5rem;
	color: var(--wp--preset--color--accent);
	transition: transform 0.2s;
}
.hk-faq-item[open] summary::after { transform: rotate(45deg); }
.hk-faq-item__answer {
	padding: 0 1.25rem 1.25rem;
	color: var(--wp--preset--color--text-muted);
}
.hk-faq-item__answer > *:first-child { margin-top: 0; }
.hk-faq-item__answer > *:last-child { margin-bottom: 0; }

.hk-section--light .hk-faq-item {
	background: var(--wp--preset--color--surface-light);
	border-color: var(--wp--preset--color--border-light);
}
.hk-section--light .hk-faq-item__answer { color: var(--wp--preset--color--text-muted-light); }

/* === CHANGELOG === */
.hk-changelog-entry {
	padding: 1rem 1.25rem;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 10px;
	margin-bottom: 0.75rem;
}
.hk-changelog-entry__header {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	margin-bottom: 0.6rem;
	flex-wrap: wrap;
}
.hk-changelog-entry__version {
	font-family: var(--wp--preset--font-family--mono);
	font-weight: 700;
	font-size: 1.1rem;
	color: var(--wp--preset--color--accent);
}
.hk-changelog-entry__date {
	font-size: 0.8rem;
	color: var(--wp--preset--color--text-muted);
}
.hk-changelog-entry__type {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 0.2rem 0.55rem;
	border-radius: 4px;
	font-weight: 700;
}
.hk-changelog-entry__type--major    { background: rgba(124, 92, 255, 0.18); color: var(--wp--preset--color--accent); }
.hk-changelog-entry__type--minor    { background: rgba(74, 126, 255, 0.18); color: var(--wp--preset--color--accent-2); }
.hk-changelog-entry__type--patch    { background: rgba(16, 185, 129, 0.18); color: var(--wp--preset--color--success); }
.hk-changelog-entry__type--security { background: rgba(239, 68, 68, 0.18); color: var(--wp--preset--color--danger); }
.hk-changelog-entry__notes ul { padding-left: 1.25rem; }
.hk-changelog-entry__notes li { margin: 0.25rem 0; }

.hk-changelog-older {
	margin-top: 1rem;
	padding: 0.75rem 1rem;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
}
.hk-changelog-older > summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--wp--preset--color--accent);
}
.hk-changelog-older[open] > summary { margin-bottom: 1rem; }

/* === RELATED DOCS === */
.hk-related-docs {
	margin: 2rem 0;
	padding-top: 2rem;
	border-top: 1px solid var(--wp--preset--color--border);
}
.hk-related-docs__title {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--text-muted);
	margin-bottom: 0.75rem;
	font-weight: 700;
}
.hk-related-docs__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 0.75rem;
}
.hk-related-docs__item {
	display: block;
	padding: 0.85rem 1rem;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	color: var(--wp--preset--color--text);
	text-decoration: none;
	transition: border-color 0.2s, transform 0.2s;
}
.hk-related-docs__item:hover {
	border-color: var(--wp--preset--color--accent);
	transform: translateY(-2px);
}
.hk-related-docs__item-category {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--accent);
	margin-bottom: 0.25rem;
}
.hk-related-docs__item-title {
	font-size: 0.95rem;
	font-weight: 600;
}

/* === ARCHIVE & SEARCH HERO === */
.hk-archive {
	max-width: 1200px;
	margin: 0 auto;
	padding: var(--wp--preset--spacing--xl) var(--wp--preset--spacing--md);
}
.hk-archive__header { text-align: center; margin-bottom: var(--wp--preset--spacing--lg); }

.hk-search-hero {
	max-width: 720px;
	margin: var(--wp--preset--spacing--md) auto var(--wp--preset--spacing--xl);
}
.hk-search-hero input[type="search"] {
	width: 100%;
	padding: 1rem 1.5rem;
	font-size: 1.125rem;
	border-radius: 12px;
	border: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text);
}
.hk-search-hero input[type="search"]:focus {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* === BLOCK EDITOR ADJUSTMENTS === */
.editor-styles-wrapper .hk-callout,
.editor-styles-wrapper .hk-code-snippet,
.editor-styles-wrapper .hk-step-list__item {
	color: inherit;
}
