/**
 * Altegio Support Theme - Custom Styles
 * Migrated from Elementor kit custom CSS + header/footer widget styles.
 */

/* ==========================================================================
   BetterDocs Content Styles
   ========================================================================== */

.betterdocs-content a {
	text-decoration-color: var(--wp--preset--color--accent);
	text-decoration: underline;
	color: #000;
}

.betterdocs-content a:hover {
	color: var(--wp--preset--color--accent);
}

/* BetterDocs ships some content-box controls that can exceed narrow viewports. */
.betterdocs-searchform,
.betterdocs-searchform *,
.betterdocs-toc,
.betterdocs-toc * {
	box-sizing: border-box;
}

.betterdocs-searchform,
.betterdocs-searchform-input-wrap,
.betterdocs-toc {
	max-width: 100%;
}

.betterdocs-toc {
	display: block;
	width: 100%;
}

/* Lists - unordered */
.betterdocs-content ul {
	list-style: none;
	padding-left: 0;
	margin-top: 5px;
}

.betterdocs-content ul li {
	position: relative;
	padding-left: 22px;
	padding-bottom: 5px;
}

.betterdocs-content ul li::before {
	content: "";
	position: absolute;
	left: 0;
	margin-top: 7px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background-color: var(--wp--preset--color--accent);
}

/* Lists - ordered */
.betterdocs-content ol {
	list-style: none;
	counter-reset: item;
	padding-left: 0;
}

.betterdocs-content ol > li {
	counter-increment: item;
	position: relative;
	padding-left: 37px;
	padding-bottom: 5px;
	line-height: 25px;
}

.betterdocs-content ol > li::before {
	content: counter(item);
	position: absolute;
	left: 0;
	top: 0;
	width: 25px;
	height: 25px;
	line-height: 25px;
	border-radius: 50%;
	background-color: var(--wp--preset--color--accent);
	color: #000;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	font-size: 14px;
}

/* Nested ordered lists use bullets */
.betterdocs-content ol li ol {
	counter-reset: none;
	padding-left: 0;
	margin-top: 5px;
}

.betterdocs-content ol li ol li {
	counter-increment: none;
	padding-left: 30px;
	padding-bottom: 5px;
}

.betterdocs-content ol li ol li::before {
	content: "";
	width: 15px;
	height: 15px;
	border-radius: 50%;
	background-color: var(--wp--preset--color--accent);
	font-size: 0;
}

/* ==========================================================================
   Images in Content
   ========================================================================== */

#betterdocs-single-content img,
.betterdocs-content img {
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 60vh;
	object-fit: contain;
	display: block;
	margin: 0 auto;
}

#betterdocs-single-content figure.wp-block-image,
#betterdocs-single-content figure.wp-lightbox-container,
.betterdocs-content figure.wp-block-image,
.betterdocs-content figure.wp-lightbox-container {
	display: flex;
	justify-content: center;
	margin: 20px 0;
	width: 100%;
	background-color: var(--wp--preset--color--surface);
	padding: 20px;
	border-radius: 25px;
	position: relative;
}

/* Lightbox */
.wp-lightbox-overlay .scrim {
	background-color: rgba(255, 255, 255, 0.8);
	opacity: 1;
}

.wp-lightbox-overlay .close-button {
	background-color: rgba(0, 0, 0, 0.1);
	border-radius: 4px;
}

.wp-lightbox-overlay .close-button:hover {
	background-color: rgba(255, 255, 255, 0.2);
}

.wp-lightbox-overlay .close-button svg {
	fill: #fff;
}

/* ==========================================================================
   Quote / Tip / Note Blocks
   ========================================================================== */

.wp-block-quote {
	margin-top: 20px;
	background-color: var(--wp--preset--color--info);
	padding: 12px 40px 5px 45px;
	border-radius: 8px;
	border-left: none;
	position: relative;
	line-height: 16px;
}

.wp-block-quote::before {
	content: "";
	position: absolute;
	left: 16px;
	top: 12px;
	width: 16px;
	height: 16px;
	background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 14.6667C11.6819 14.6667 14.6667 11.6819 14.6667 8C14.6667 4.3181 11.6819 1.33333 8 1.33333C4.3181 1.33333 1.33333 4.3181 1.33333 8C1.33333 11.6819 4.3181 14.6667 8 14.6667ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z" fill="%236366F1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8 7.33333C8.36819 7.33333 8.66667 7.63181 8.66667 8V11.3333C8.66667 11.7015 8.36819 12 8 12C7.63181 12 7.33333 11.7015 7.33333 11.3333V8C7.33333 7.63181 7.63181 7.33333 8 7.33333Z" fill="%236366F1"/><path d="M8 6C8.55228 6 9 5.55228 9 5C9 4.44772 8.55228 4 8 4C7.44772 4 7 4.44772 7 5C7 5.55228 7.44772 6 8 6Z" fill="%236366F1"/></svg>');
	background-size: contain;
	background-repeat: no-repeat;
}

.wp-block-quote p {
	font-size: 14px;
	font-weight: normal;
	margin: 0;
	color: #000;
}

.wp-block-quote strong,
.wp-block-quote b {
	font-weight: 600;
}

.wp-block-quote p + p {
	margin-top: 8px;
}

/* ==========================================================================
   Related Articles
   ========================================================================== */

.related-articles-list {
	gap: normal;
}

/* ==========================================================================
   Header
   ========================================================================== */

.support-header-logo img {
	width: 120px;
	height: 36px;
	max-width: 100%;
	object-fit: contain;
}

/* Language switcher globe icon */
.support-lang-switcher {
	cursor: pointer;
}

/* Footer nav links */
.support-footer-nav a {
	text-decoration: none;
	color: var(--wp--preset--color--secondary);
}

.support-footer-nav a:hover {
	color: var(--wp--preset--color--accent);
}

/* ==========================================================================
   Sidebar (sticky on desktop)
   ========================================================================== */

.support-sidebar {
	position: sticky;
	top: 20px;
	align-self: flex-start;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
	.betterdocs-content img,
	.betterdocs-content figure.wp-block-image {
		max-width: 100%;
		width: 100%;
	}

	.betterdocs-content figure.wp-block-image {
		display: block;
	}

	/* Hide signup button on mobile — shown in nav overlay */
	.support-btn-signup {
		display: none;
	}

	/* Sidebar below content on mobile */
	.support-sidebar {
		position: static;
	}

	/* Header padding reduction */
	header.wp-block-group {
		padding-top: 10px;
		padding-bottom: 10px;
	}
}

@media (max-width: 480px) {
	/* Both header buttons hidden on small mobile — use nav overlay */
	.support-header-buttons {
		display: none;
	}
}

/* ==========================================================================
   BetterDocs Footer
   ========================================================================== */

.betterdocs-footer button:focus {
	background-color: #fff;
}

/* ==========================================================================
   Desktop: Hide mobile-only nav links
   ========================================================================== */

@media (min-width: 769px) {
	.wp-block-navigation-item.hide-on-desktop,
	.wp-block-navigation .hide-on-desktop {
		display: none !important;
	}
}

/* ==========================================================================
   WPML Language Switcher — globe icon style
   ========================================================================== */

.support-lang-switcher .wpml-ls {
	border: none;
	background: none;
	padding: 0;
}

.support-lang-switcher .wpml-ls-legacy-dropdown-click {
	width: auto;
	border: none;
}

.support-lang-switcher .wpml-ls-legacy-dropdown-click > ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.support-lang-switcher .wpml-ls-legacy-dropdown-click li.wpml-ls-current-language {
	position: relative;
}

/* Kill <p> wrapper margins inside WPML */
.support-lang-switcher .wpml-ls-legacy-dropdown-click li.wpml-ls-current-language > p {
	margin: 0;
	padding: 0;
	line-height: 1;
}

/* Hide current language text, show globe icon */
.support-lang-switcher .wpml-ls-legacy-dropdown-click a.wpml-ls-item-toggle {
	font-size: 0 !important;
	color: transparent !important;
	padding: 0 !important;
	border: none !important;
	background: none !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	text-decoration: none !important;
	overflow: hidden;
}

.support-lang-switcher .wpml-ls-legacy-dropdown-click a.wpml-ls-item-toggle::before {
	content: "";
	display: block;
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23333" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>');
	background-size: contain;
	background-repeat: no-repeat;
}

/* Hide language name text and br tags inside toggle */
.support-lang-switcher .wpml-ls-legacy-dropdown-click a.wpml-ls-item-toggle .wpml-ls-native,
.support-lang-switcher .wpml-ls-legacy-dropdown-click a.wpml-ls-item-toggle br {
	display: none !important;
}

/* Dropdown submenu */
.support-lang-switcher .wpml-ls-legacy-dropdown-click .wpml-ls-sub-menu {
	border: 1px solid var(--wp--preset--color--border, #e0e0e0);
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	min-width: 140px;
	right: 0;
	left: auto;
	padding: 4px 0;
	background: #fff;
	z-index: 100;
}

.support-lang-switcher .wpml-ls-legacy-dropdown-click .wpml-ls-sub-menu a {
	font-size: 14px;
	color: #333;
	padding: 8px 16px;
	text-decoration: none;
	display: block;
}

.support-lang-switcher .wpml-ls-legacy-dropdown-click .wpml-ls-sub-menu a:hover {
	background-color: #f5f5f5;
}

.support-lang-switcher .wpml-ls-legacy-dropdown-click .wpml-ls-sub-menu br {
	display: none;
}

/* ==========================================================================
   Footer: constrain image sizes
   ========================================================================== */

.support-footer-payments img {
	height: 24px;
	width: auto;
}

.support-footer-appstores img {
	height: 36px;
	width: auto;
}

footer .wp-block-image[style*="height"] img {
	height: 100%;
	width: auto;
}

/* ==========================================================================
   Contact Support Button — outline style
   ========================================================================== */

.wp-block-button__link.has-border-color:not(.has-background) {
    background: transparent;
    color: var(--wp--preset--color--primary);
}

.wp-block-button__link.has-border-color:not(.has-background):hover {
    background-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--background);
}

/* ==========================================================================
   BetterDocs Category Grid — minimalist style (Elementor original parity)
   Strips default BD chrome: card boxes, icons, count badges, "Explore More"
   buttons, file-icon SVGs and arrow chevrons on links.
   ========================================================================== */

/* Each category renders as a plain block, not a card */
.betterdocs-category-grid-wrapper .betterdocs-single-category-wrapper,
.betterdocs-category-grid-wrapper .betterdocs-single-category-wrapper.category-grid.default,
.betterdocs-category-grid-wrapper .betterdocs-single-category-inner {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

.betterdocs-category-grid-wrapper .betterdocs-single-category-wrapper {
    margin-bottom: 28px !important;
}

.betterdocs-category-grid-inner-wrapper {
    gap: 20px 40px;
}

/* Hide category icon (folder/document SVG) and count badge */
.betterdocs-category-grid-wrapper .betterdocs-category-icon,
.betterdocs-category-grid-wrapper .betterdocs-category-icon-img,
.betterdocs-category-grid-wrapper .betterdocs-category-items-counts {
    display: none !important;
}

/* Category header — no underline, tight spacing */
.betterdocs-category-grid-wrapper .betterdocs-category-header,
.betterdocs-category-grid-wrapper .betterdocs-category-header-inner {
    border: none !important;
    padding: 0 !important;
    margin: 0 0 8px !important;
    background: transparent !important;
    display: block !important;
}

.betterdocs-category-grid-wrapper .betterdocs-category-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--wp--preset--color--primary, #1F2937) !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.4 !important;
    text-transform: none !important;
}

/* Article list — clean, no bullets, no file icons, no chevrons */
.betterdocs-category-grid-wrapper .betterdocs-body {
    padding: 0 !important;
    background: transparent !important;
}

.betterdocs-category-grid-wrapper .betterdocs-articles-list,
.betterdocs-category-grid-wrapper .betterdocs-body ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.betterdocs-category-grid-wrapper .betterdocs-articles-list > li {
    list-style: none !important;
    padding: 4px 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    display: list-item;
}

.betterdocs-category-grid-wrapper .betterdocs-articles-list > li::before,
.betterdocs-category-grid-wrapper .betterdocs-articles-list > li::marker {
    display: none !important;
    content: none !important;
}

/* Subtle file icon before each article link (matches Elementor original).
   The native SVG from BetterDocs is colored — we tone it down and shrink it. */
.betterdocs-category-grid-wrapper .betterdocs-articles-list > li > svg {
    width: 13px !important;
    height: 13px !important;
    flex-shrink: 0;
    margin-right: 6px;
    vertical-align: middle;
    fill: #9CA3AF !important;
    opacity: 0.7;
}

.betterdocs-category-grid-wrapper .betterdocs-articles-list > li > svg .st0 {
    fill: #9CA3AF !important;
}

.betterdocs-category-grid-wrapper .betterdocs-articles-list > li {
    display: flex !important;
    align-items: center;
}

/* Article links — near-black like theme.json default; accent yellow on hover */
.betterdocs-category-grid-wrapper .betterdocs-articles-list > li > a,
.betterdocs-category-grid-wrapper .betterdocs-articles-list > li > a:visited,
.betterdocs-category-grid-wrapper .betterdocs-articles-list > li > a span {
    color: #000 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    display: inline;
}

.betterdocs-category-grid-wrapper .betterdocs-articles-list > li > a:hover,
.betterdocs-category-grid-wrapper .betterdocs-articles-list > li > a:hover span {
    color: var(--wp--preset--color--accent, #FFCB00) !important;
    text-decoration: none !important;
}

.betterdocs-category-grid-wrapper .betterdocs-articles-list > li > a::after {
    display: none !important;
    content: none !important;
}

/* Hide "Explore More" footer button */
.betterdocs-category-grid-wrapper .betterdocs-footer,
.betterdocs-category-grid-wrapper .docs-cat-link-btn,
.betterdocs-category-grid-wrapper .betterdocs-category-link-btn {
    display: none !important;
}

/* KB landing section h2 (e.g. "Altegio General materials") — subtle divider,
   not a primary heading. Original Elementor had no such grouping; ours is
   a softer rendering. */
main .wp-block-post-content > h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--wp--preset--color--primary, #2B3134);
    margin: 24px 0 12px;
    padding: 0 !important;
    line-height: 1.3;
    letter-spacing: -0.1px;
}

main .wp-block-post-content > h2:first-of-type {
    margin-top: 16px;
}

/* Tighten article list spacing for compact original-style layout */
.betterdocs-category-grid-wrapper .betterdocs-articles-list > li {
    padding: 2px 0 !important;
}

.betterdocs-category-grid-wrapper .betterdocs-single-category-wrapper {
    margin-bottom: 20px !important;
}

.betterdocs-category-grid-inner-wrapper {
    gap: 8px 40px;
}

/* Search box — slim, like Elementor original */
.betterdocs-searchform {
    padding: 6px 14px !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    background: #fff !important;
    align-items: center !important;
}

.betterdocs-searchform input[type="search"],
.betterdocs-searchform input[type="text"] {
    height: 40px !important;
    font-size: 14px !important;
    font-family: var(--wp--preset--font-family--roboto, Roboto, system-ui, sans-serif) !important;
    color: #1F2937 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 8px !important;
}

.betterdocs-searchform input::placeholder {
    color: #9CA3AF;
    opacity: 1;
}

/* Search icon */
.betterdocs-searchform .search-icon,
.betterdocs-searchform svg {
    width: 18px;
    height: 18px;
    color: #9CA3AF;
    flex-shrink: 0;
}

/* Constrain search to sensible width */
.betterdocs-searchform-input-wrap,
.betterdocs-shortcode .betterdocs-searchform {
    max-width: 100%;
}

/* ==========================================================================
   Archive page — drop "Archives:" prefix from default WP archive title
   ("Archives: Knowledge Base" → "Knowledge Base")
   ========================================================================== */

.wp-block-query-title {
    font-size: 32px;
    font-weight: 600;
    color: #000;
    line-height: 1.2;
    letter-spacing: -0.1px;
}

/* ==========================================================================
   Body content links (single doc) — preserve theme.json default but set hover
   accent so it matches the palette consistently
   ========================================================================== */

.wp-block-post-content a,
.betterdocs-content a {
    color: #000;
    text-decoration: underline;
    text-decoration-color: var(--wp--preset--color--accent, #FFCB00);
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
}

.wp-block-post-content a:hover,
.betterdocs-content a:hover {
    color: var(--wp--preset--color--accent, #FFCB00);
}
