/*
Theme Name: DALTO Help Theme
Theme URI: https://help.dalto.es
Author: AVDevelopment
Author URI: https://avdevelopment.es
Description: Custom theme for the DALTO Help Center. Requires dalto-help-center plugin.
Version: 1.0.0
Text Domain: dalto-help-theme
*/


/* ==========================================================================
   1. CSS Custom Properties
   ========================================================================== */

:root {
	/* Colors */
	--color-primary: #1E1B4B;
	--color-accent: #8B5CF6;
	--color-gradient: linear-gradient(135deg, #8B5CF6, #EC4899);
	--color-bg: #FAFAF9;
	--color-white: #FFFFFF;
	--color-text: #0F172A;
	--color-muted: #64748B;
	--color-border: #E2E8F0;
	--color-success: #10B981;
	--color-error: #EF4444;

	/* Typography */
	--font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--font-size-base: 1rem;
	--font-size-sm: 0.875rem;
	--font-size-xs: 0.75rem;
	--font-size-h1: 2rem;
	--font-size-h2: 1.5rem;
	--font-size-h3: 1.25rem;
	--line-height-base: 1.6;

	/* Spacing */
	--space-1: 8px;
	--space-2: 16px;
	--space-3: 24px;
	--space-4: 32px;
	--space-6: 48px;
	--space-8: 64px;

	/* Layout */
	--container-max: 1200px;
	--container-padding: 24px;

	/* Borders */
	--radius-sm: 4px;
	--radius-md: 8px;
	--radius-lg: 12px;
	--radius-full: 50px;

	/* Shadows */
	--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
	--shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
}


/* ==========================================================================
   2. Reset / Base Styles
   ========================================================================== */

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	font-family: var(--font-family);
	font-size: var(--font-size-base);
	line-height: var(--line-height-base);
	color: var(--color-text);
	background-color: var(--color-bg);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a {
	color: var(--color-accent);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	line-height: 1.3;
}

h1 {
	font-size: var(--font-size-h1);
	font-weight: 700;
}

h2 {
	font-size: var(--font-size-h2);
	font-weight: 700;
}

h3 {
	font-size: var(--font-size-h3);
	font-weight: 600;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

ul,
ol {
	list-style: none;
}

button {
	font-family: inherit;
	cursor: pointer;
}

input,
textarea,
select {
	font-family: inherit;
	font-size: inherit;
}


/* ==========================================================================
   3. Layout Classes
   ========================================================================== */

.help-container {
	max-width: var(--container-max);
	margin: 0 auto;
	padding: 0 var(--container-padding);
}

.help-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-6);
}

.help-grid--sidebar-left {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-6);
}

.help-main {
	min-width: 0;
}

.help-sidebar {
	min-width: 0;
}

.help-section {
	padding: var(--space-6) 0;
}

@media (min-width: 1025px) {
	.help-grid {
		grid-template-columns: 2fr 1fr;
	}

	.help-grid--sidebar-left {
		grid-template-columns: 1fr 2fr;
	}

	.help-grid--sidebar-left .help-sidebar {
		order: -1;
	}
}


/* ==========================================================================
   4. Header (.help-header)
   ========================================================================== */

.help-header {
	background-color: var(--color-primary);
}

/* Top Bar */
.help-header__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-2) 0;
}

.help-header__logo {
	color: var(--color-white);
	font-size: 1.5rem;
	font-weight: 700;
	text-decoration: none;
	letter-spacing: 0.02em;
}

.help-header__logo:hover {
	text-decoration: none;
	opacity: 0.9;
}

.help-header__logo img {
	height: 32px;
	width: auto;
}

.help-header__nav {
	display: none;
}

.help-header__nav-list {
	display: flex;
	gap: var(--space-3);
	list-style: none;
}

.help-header__nav-link {
	color: var(--color-white);
	font-size: var(--font-size-sm);
	text-decoration: none;
	opacity: 0.85;
	transition: opacity 0.2s;
}

.help-header__nav-link:hover {
	opacity: 1;
	text-decoration: none;
}

/* Hamburger toggle */
.help-header__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: none;
	border: none;
	color: var(--color-white);
	cursor: pointer;
	padding: 0;
}

.help-header__toggle svg {
	width: 24px;
	height: 24px;
}

/* Mobile nav open */
.help-header__nav.is-open {
	display: block;
	padding-bottom: var(--space-2);
}

.help-header__nav.is-open .help-header__nav-list {
	flex-direction: column;
	gap: var(--space-1);
}

.help-header__nav.is-open .help-header__nav-link {
	display: block;
	padding: var(--space-1) 0;
}

@media (min-width: 769px) {
	.help-header__nav {
		display: block;
	}

	.help-header__toggle {
		display: none;
	}
}

/* Hero */
.help-header__hero {
	padding: var(--space-8) 0 var(--space-6);
	text-align: center;
	background: var(--color-gradient);
	background-blend-mode: overlay;
}

.help-header__hero-title {
	color: var(--color-white);
	font-size: var(--font-size-h1);
	font-weight: 700;
	margin-bottom: var(--space-3);
}

@media (min-width: 769px) {
	.help-header__hero-title {
		font-size: 2.5rem;
	}
}

/* Subpage header (compact, no hero) */
.help-header--subpage {
	padding-bottom: var(--space-2);
}


/* ==========================================================================
   5. Search (.help-search)
   ========================================================================== */

.help-search {
	position: relative;
	max-width: 640px;
	margin: 0 auto;
}

.help-search__icon {
	position: absolute;
	top: 50%;
	left: var(--space-2);
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	color: var(--color-muted);
	pointer-events: none;
}

.help-search__input {
	width: 100%;
	padding: var(--space-2) var(--space-3) var(--space-2) 56px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-full);
	background-color: var(--color-white);
	font-size: var(--font-size-base);
	color: var(--color-text);
	box-shadow: var(--shadow-md);
	transition: border-color 0.2s, box-shadow 0.2s;
	outline: none;
}

.help-search__input::placeholder {
	color: var(--color-muted);
}

.help-search__input:focus {
	border-color: var(--color-accent);
	box-shadow: var(--shadow-md), 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* Hero variant */
.help-search--hero {
	max-width: 640px;
}

/* Compact variant for subpage headers */
.help-search--compact {
	max-width: 480px;
	margin: var(--space-2) auto;
}

.help-search--compact .help-search__input {
	padding: 10px var(--space-2) 10px 44px;
	font-size: var(--font-size-sm);
	box-shadow: var(--shadow-sm);
}

.help-search--compact .help-search__icon {
	left: 12px;
	width: 20px;
	height: 20px;
}


/* ==========================================================================
   6. Category Grid (.help-categories)
   ========================================================================== */

.help-categories {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-4);
}

@media (min-width: 769px) {
	.help-categories {
		grid-template-columns: 1fr 1fr;
	}
}


/* ==========================================================================
   7. Category Card (.help-category-card)
   ========================================================================== */

.help-category-card {
	display: flex;
	align-items: flex-start;
	gap: var(--space-2);
	text-decoration: none;
	color: inherit;
	padding: var(--space-2);
	border-radius: var(--radius-md);
	transition: background-color 0.2s;
}

.help-category-card:hover {
	background-color: var(--color-white);
	text-decoration: none;
}

.help-category-card:hover .help-category-card__title {
	color: var(--color-accent);
}

.help-category-card__icon {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--color-accent);
}

.help-category-card__icon svg {
	width: 32px;
	height: 32px;
}

.help-category-card__content {
	flex: 1;
	min-width: 0;
}

.help-category-card__title {
	font-size: var(--font-size-base);
	font-weight: 700;
	margin-bottom: var(--space-1);
	color: var(--color-text);
	transition: color 0.2s;
	line-height: 1.4;
}

.help-category-card__description {
	color: var(--color-muted);
	font-size: var(--font-size-sm);
	line-height: 1.5;
}


/* ==========================================================================
   7b. Category Header (.help-category-header)
   ========================================================================== */

.help-category-header__icon {
	width: 64px;
	height: 64px;
	flex-shrink: 0;
	color: var(--color-accent);
}

.help-category-header__icon svg {
	width: 100%;
	height: 100%;
}


/* ==========================================================================
   7c. Homepage (.help-home)
   ========================================================================== */

.help-home {
	padding-top: var(--space-6);
}


/* ==========================================================================
   8. Breadcrumbs (.dalto-breadcrumbs)
   ========================================================================== */

.dalto-breadcrumbs {
	margin-bottom: var(--space-3);
}

.dalto-breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-1);
	list-style: none;
	font-size: var(--font-size-sm);
}

.dalto-breadcrumbs__item a {
	color: var(--color-muted);
	text-decoration: none;
	transition: color 0.2s;
}

.dalto-breadcrumbs__item a:hover {
	color: var(--color-accent);
	text-decoration: none;
}

.dalto-breadcrumbs__item--current {
	color: var(--color-text);
}

.dalto-breadcrumbs__separator {
	display: inline-flex;
	align-items: center;
	color: var(--color-muted);
	opacity: 0.5;
}

.dalto-breadcrumbs__separator svg {
	width: 14px;
	height: 14px;
}


/* ==========================================================================
   9. Article List (.help-article-list)
   ========================================================================== */

.help-article-list {
	list-style: none;
}

.help-article-list__item {
	padding: var(--space-2) 0;
	border-bottom: 1px solid var(--color-border);
}

.help-article-list__item:first-child {
	padding-top: 0;
}

.help-article-list__item:last-child {
	border-bottom: none;
}

.help-article-list__link {
	font-weight: 600;
	color: var(--color-text);
	text-decoration: none;
	transition: color 0.2s;
}

.help-article-list__link:hover {
	color: var(--color-accent);
	text-decoration: none;
}

.help-article-list__excerpt {
	color: var(--color-muted);
	font-size: var(--font-size-sm);
	margin-top: var(--space-1);
	line-height: 1.5;
}


/* ==========================================================================
   10. Article Content (.help-article)
   ========================================================================== */

.help-article {
	max-width: 100%;
}

.help-article p {
	margin-bottom: var(--space-2);
}

.help-article h2 {
	margin-top: var(--space-6);
	margin-bottom: var(--space-2);
}

.help-article h3 {
	margin-top: var(--space-4);
	margin-bottom: 12px;
}

.help-article ul,
.help-article ol {
	padding-left: var(--space-3);
	margin-bottom: var(--space-2);
	list-style: disc;
}

.help-article ol {
	list-style: decimal;
}

.help-article li {
	margin-bottom: var(--space-1);
}

.help-article blockquote {
	border-left: 4px solid var(--color-accent);
	padding-left: var(--space-2);
	color: var(--color-muted);
	margin: var(--space-3) 0;
}

.help-article code {
	background-color: #F1F5F9;
	padding: 2px 6px;
	border-radius: var(--radius-sm);
	font-size: var(--font-size-sm);
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.help-article pre {
	background-color: #F1F5F9;
	padding: var(--space-2);
	border-radius: var(--radius-md);
	overflow-x: auto;
	margin-bottom: var(--space-2);
}

.help-article pre code {
	background: none;
	padding: 0;
	border-radius: 0;
}

.help-article img {
	border-radius: var(--radius-md);
	margin: var(--space-3) 0;
}

.help-article iframe,
.help-article video {
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius-md);
	border: none;
	margin: var(--space-3) 0;
}

.help-article a {
	color: var(--color-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.help-article a:hover {
	text-decoration: none;
}

.help-article table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: var(--space-2);
}

.help-article th,
.help-article td {
	padding: var(--space-1) var(--space-2);
	border: 1px solid var(--color-border);
	text-align: left;
}

.help-article th {
	background-color: var(--color-bg);
	font-weight: 600;
}


/* ==========================================================================
   11. Table of Contents (.help-toc)
   ========================================================================== */

.help-toc {
	position: sticky;
	top: var(--space-3);
}

.help-toc__title {
	font-weight: 700;
	font-size: var(--font-size-sm);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--color-muted);
	margin-bottom: var(--space-2);
}

.help-toc__list {
	list-style: none;
}

.help-toc__link {
	display: block;
	padding: 6px 0;
	padding-left: var(--space-2);
	font-size: var(--font-size-sm);
	color: var(--color-muted);
	text-decoration: none;
	border-left: 2px solid transparent;
	transition: color 0.2s, border-color 0.2s;
}

.help-toc__link:hover {
	color: var(--color-accent);
	text-decoration: none;
}

.help-toc__link.is-active {
	border-left-color: var(--color-accent);
	color: var(--color-accent);
}

.help-toc__link--h3 {
	padding-left: var(--space-4);
}


/* ==========================================================================
   12. Sidebar Widgets (.help-widget)
   ========================================================================== */

.help-widget {
	background-color: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	padding: var(--space-3);
	margin-bottom: var(--space-3);
}

.help-widget__title,
.help-widget .widget-title {
	font-weight: 700;
	font-size: var(--font-size-base);
	margin-bottom: 12px;
}

/* CTA Widget */
.help-widget--cta .dalto-cta__title {
	font-weight: 700;
	font-size: var(--font-size-base);
	margin-bottom: var(--space-1);
}

.help-widget--cta .dalto-cta__text {
	color: var(--color-muted);
	font-size: var(--font-size-sm);
	margin-bottom: var(--space-2);
}

.help-widget--cta .dalto-cta__button {
	display: inline-block;
	background: var(--color-gradient);
	color: var(--color-white);
	border-radius: var(--radius-md);
	padding: 12px 24px;
	font-weight: 600;
	font-size: var(--font-size-sm);
	text-decoration: none;
	transition: opacity 0.2s;
}

.help-widget--cta .dalto-cta__button:hover {
	opacity: 0.9;
	text-decoration: none;
}

/* Categories Widget */
.help-widget--categories .dalto-help-categories {
	list-style: none;
}

.help-widget--categories .dalto-help-categories__item {
	padding: 6px 0;
}

.help-widget--categories .dalto-help-categories__item a {
	color: var(--color-text);
	font-size: var(--font-size-sm);
	text-decoration: none;
	transition: color 0.2s;
}

.help-widget--categories .dalto-help-categories__item a:hover {
	color: var(--color-accent);
}

.help-widget--categories .dalto-help-categories__item.is-active a {
	font-weight: 700;
	color: var(--color-accent);
}

/* Popular Articles Widget */
.dalto-popular-articles {
	list-style: none;
}

.dalto-popular-articles__item {
	padding: 6px 0;
	border-bottom: 1px solid var(--color-border);
}

.dalto-popular-articles__item:last-child {
	border-bottom: none;
}

.dalto-popular-articles__item a {
	color: var(--color-text);
	font-size: var(--font-size-sm);
	text-decoration: none;
	transition: color 0.2s;
}

.dalto-popular-articles__item a:hover {
	color: var(--color-accent);
}

/* Support Widget */
.dalto-support {
	text-align: center;
}

.dalto-support__title {
	font-weight: 700;
	font-size: var(--font-size-base);
	margin-bottom: var(--space-1);
}

.dalto-support__text {
	color: var(--color-muted);
	font-size: var(--font-size-sm);
	margin-bottom: var(--space-2);
}

.dalto-support__button {
	display: inline-block;
	background: var(--color-gradient);
	color: var(--color-white);
	border-radius: var(--radius-md);
	padding: 12px 24px;
	font-weight: 600;
	font-size: var(--font-size-sm);
	text-decoration: none;
	transition: opacity 0.2s;
}

.dalto-support__button:hover {
	opacity: 0.9;
	text-decoration: none;
}


/* ==========================================================================
   13. Feedback Widget (.dalto-feedback)
   ========================================================================== */

.dalto-feedback {
	margin: var(--space-6) 0 var(--space-4);
	padding: var(--space-3);
	text-align: center;
	border-top: 1px solid var(--color-border);
}

.dalto-feedback__question {
	margin: 0 0 var(--space-2);
	font-size: var(--font-size-sm);
	color: var(--color-muted);
}

.dalto-feedback__buttons {
	display: flex;
	justify-content: center;
	gap: var(--space-2);
}

.dalto-feedback__btn {
	display: inline-flex;
	align-items: center;
	gap: var(--space-1);
	padding: var(--space-1) var(--space-2);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	background: var(--color-white);
	color: var(--color-muted);
	cursor: pointer;
	font-size: var(--font-size-sm);
	transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.dalto-feedback__btn:hover:not(:disabled) {
	border-color: var(--color-accent);
	color: var(--color-accent);
	background-color: var(--color-bg);
}

.dalto-feedback__btn--up.dalto-feedback__btn--voted,
.dalto-feedback__btn--up.is-voted {
	background-color: var(--color-accent);
	color: var(--color-white);
	border-color: var(--color-accent);
}

.dalto-feedback__btn--down.dalto-feedback__btn--voted,
.dalto-feedback__btn--down.is-voted {
	background-color: var(--color-accent);
	color: var(--color-white);
	border-color: var(--color-accent);
}

.dalto-feedback__btn:disabled {
	cursor: default;
}

.dalto-feedback__count {
	font-size: var(--font-size-xs);
	font-weight: 600;
	color: var(--color-muted);
}

.dalto-feedback__btn--voted .dalto-feedback__count,
.dalto-feedback__btn.is-voted .dalto-feedback__count {
	color: var(--color-white);
}


/* ==========================================================================
   14. Footer (.help-footer)
   ========================================================================== */

.help-footer {
	background-color: var(--color-primary);
	padding: var(--space-6) 0;
	color: var(--color-white);
}

.help-footer__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-4);
}

.help-footer__brand {
	margin-bottom: var(--space-2);
}

.help-footer__logo {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--color-white);
	text-decoration: none;
	display: inline-block;
	margin-bottom: var(--space-1);
}

.help-footer__logo:hover {
	text-decoration: none;
	opacity: 0.9;
}

.help-footer__tagline {
	font-size: var(--font-size-sm);
	opacity: 0.7;
}

.help-footer__column-title {
	font-weight: 700;
	font-size: var(--font-size-sm);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: var(--space-2);
	opacity: 0.9;
}

.help-footer__links {
	list-style: none;
}

.help-footer__links li {
	margin-bottom: var(--space-1);
}

.help-footer__links a {
	color: var(--color-white);
	opacity: 0.7;
	font-size: var(--font-size-sm);
	text-decoration: none;
	transition: opacity 0.2s;
}

.help-footer__links a:hover {
	opacity: 1;
	text-decoration: none;
}

.help-footer__bottom {
	margin-top: var(--space-6);
	padding-top: var(--space-3);
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.help-footer__copyright {
	font-size: var(--font-size-xs);
	opacity: 0.5;
}

@media (min-width: 769px) {
	.help-footer__grid {
		grid-template-columns: 1fr 1fr;
		gap: var(--space-4);
	}
}

@media (min-width: 1025px) {
	.help-footer__grid {
		grid-template-columns: 2fr 1fr 1fr 1fr;
		gap: var(--space-6);
	}
}


/* ==========================================================================
   15. Responsive Styles
   ========================================================================== */

/* Tablet: max-width 1024px — grid collapses to single column */
/* Already handled via min-width media queries above for grids */

/* Mobile adjustments */
@media (max-width: 768px) {
	:root {
		--font-size-h1: 1.75rem;
		--font-size-h2: 1.25rem;
		--font-size-h3: 1.125rem;
		--container-padding: 16px;
	}

	.help-header__hero {
		padding: var(--space-6) 0 var(--space-4);
	}

	.help-section {
		padding: var(--space-4) 0;
	}

	.help-toc {
		position: static;
	}
}

@media (max-width: 480px) {
	:root {
		--font-size-h1: 1.5rem;
		--container-padding: 12px;
	}

	.help-header__hero-title {
		font-size: 1.5rem;
	}

	.help-footer {
		padding: var(--space-4) 0;
	}

	.dalto-feedback__buttons {
		flex-direction: column;
		align-items: center;
	}
}


/* ==========================================================================
   16. Utility Classes
   ========================================================================== */

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.text-muted {
	color: var(--color-muted);
}

.text-center {
	text-align: center;
}

.mb-0 {
	margin-bottom: 0;
}

.mb-1 {
	margin-bottom: var(--space-1);
}

.mb-2 {
	margin-bottom: var(--space-2);
}

.mb-3 {
	margin-bottom: var(--space-3);
}

.mb-4 {
	margin-bottom: var(--space-4);
}
