/*
Theme Name: Blocksy Child
Theme URI: https://creativethemes.com/blocksy/
Description: Blocksy Child Theme
Author: CreativeThemes
Author URI: https://creativethemes.com/
Template: blocksy
Version: 1.0.1
Text Domain: blocksy-child
*/

/* ===== Arch3dHub Global Variables ===== */
:root {
	--wp-admin--admin-bar--height: 32px;
	--admin-bar: 32px;
	--header-height: 120px;
	--theme-content-vertical-spacing: 60px;
	--sidebar-helper-top: calc(var(--theme-content-vertical-spacing) * -1);
	--sidebar-helper-height: calc(100% + var(--theme-content-vertical-spacing) * 2);

	/* Minimalist Color Palette */
	--color-primary: #1a1a1a;
	--color-secondary: #4a4a4a;
	--color-accent: #1a1a1a;
	--color-accent-dark: #000000;
	--color-surface: #ffffff;
	--color-panel: #fafafa;
	--color-ink: #1a1a1a;
	--color-ink-invert: #ffffff;
	--color-muted: #6b7280;
	--color-soft: #9ca3af;
	--color-line: #e5e7eb;
	--color-bg-page: #f9fafb;

	/* Neutral Palette */
	--main-bg-color-dark: #1a1a1a;
	--main-color-dark: #e5e5e5;
	--main-bg-color-light: #f5f5f5;
	--main-color-light: #1a1a1a;
	--accent-color: #1a1a1a;
	--accent-color-1: #f5f5f5;
	--primary: #1a1a1a;
	--primary-hover: #333333;
	--primary-pressed: #4a4a4a;
	--secondary: #f3f4f6;
	--bg: #111;

	/* Grayscale System */
	--grayscale-gs-primary: #1a1a1a;
	--primary-2: #374151;
	--grayscale-gs-secondary-1: #6b7280;
	--grayscale-gs-secondary-2: #9ca3af;
	--grayscale-gs-tetriary-1: #d1d5db;
	--grayscale-gs-tetriary-2: #e5e7eb;
	--grayscale-gs-quarterly-1: #f3f4f6;
	--grayscale-gs-background-darker: #f9fafb;
	--grayscale-gs-background: #fafafa;
	--grayscale-gs-quarterly-2: #fdfdfd;
	--grayscale-gs-white: #fff;

	/* Typography */
	--font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--font-heading: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--theme-font-stack-default: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
	--theme-font-family: var(--theme-font-stack-default);

	/* Radius & Shadows */
	--radius-lg: 12px;
	--radius-sm: 4px;
	--radius-md: 8px;
	--shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.06);
	--shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);

	/* Sidebar Metrics */
	--sidebar-font-size: 13px;
	--sidebar-heading-size: 11px;
	--sidebar-spacing: 16px;
	--sidebar-padding: 18px;
	--sidebar-bg: #ffffff;
	--sidebar-border: #e5e7eb;
	--sidebar-separator: #e5e7eb;
	--sidebar-width: 27%;
	--sidebar-gap: 4%;

	/* Model Gallery Specifics */
	--mgb-lightbox-max-w: 96vw;
	--mgb-lightbox-max-h: 96vh;
	--mgb-download-radius: 6px;
	--mgb-download-font: 11px;
	--mgb-taglist-pad-y: 16px;
	--mgb-taglist-pad-x: 0px;
	--mgb-taglist-radius: 0px;

	/* WordPress Presets (Colors) */
	--wp--preset--color--black: #000000;
	--wp--preset--color--white: #ffffff;
	--wp--preset--color--palette-color-1: var(--theme-palette-color-1, #1a1a1a);
	--wp--preset--color--palette-color-2: var(--theme-palette-color-2, #333333);
	--wp--preset--color--palette-color-3: var(--theme-palette-color-3, #6b7280);
	--wp--preset--color--palette-color-4: var(--theme-palette-color-4, #1a1a1a);
	--wp--preset--color--palette-color-5: var(--theme-palette-color-5, #e5e7eb);
	--wp--preset--color--palette-color-6: var(--theme-palette-color-6, #f9fafb);
	--wp--preset--color--palette-color-7: var(--theme-palette-color-7, #fafafa);
	--wp--preset--color--palette-color-8: var(--theme-palette-color-8, #ffffff);

	/* Layout & Sizing */
	--max-width: 1140px;
	--theme-container-width-base: calc(var(--theme-container-edge-spacing, 90vw) - var(--theme-frame-size, 0px) * 2);
	--theme-container-width: min(100%, var(--theme-container-width-base));
	--theme-container-edge-spacing: 90vw;
	--theme-normal-container-max-width: 1290px;
	--theme-narrow-container-max-width: 750px;
	--grid-template-columns: minmax(100px, 1fr) var(--sidebar-width, 27%);
}

/* ===== Models Catalog Layout ===== */
.catalog-layout {
	display: grid;
	grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
	gap: 24px;
	margin-top: 30px;
}

.catalog-sidebar {
}

/* ===== Sidebar Filters ===== */
.sidebar-filter {
	background: var(--sidebar-bg);
	border-radius: 8px;
	padding: var(--sidebar-padding);
	border: 1px solid var(--sidebar-border);
	font-size: var(--sidebar-font-size);
}

.sidebar-group {
	padding-bottom: var(--sidebar-spacing);
	border-bottom: 1px solid var(--sidebar-separator);
	margin-bottom: var(--sidebar-spacing);
}

.sidebar-group:last-of-type {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.sidebar-group h4 {
	font-size: var(--sidebar-heading-size);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--color-soft);
	margin: 0 0 10px;
	font-family: var(--font-primary);
}

/* ===== Model Grid ===== */
.model-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 28px;
}

/* ===== Model Card ===== */
.model-card {
	background: var(--color-surface);
	border-radius: var(--radius-md);
	overflow: hidden;
	box-shadow: none;
	border: 1px solid var(--color-line);
	display: flex;
	flex-direction: column;
	transition: border-color 0.2s ease;
}

.model-card:hover {
	border-color: #d1d5db;
}

.model-thumbnail-wrapper {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #f3f4f6;
	overflow: hidden;
}

.model-thumbnail {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.model-card:hover .model-thumbnail {
	transform: scale(1.03);
}

.model-info {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.model-title {
	font-family: var(--font-heading);
	font-size: 17px;
	line-height: 1.35;
	margin: 0;
	color: var(--color-ink);
}

.model-meta {
	margin-top: auto;
	font-size: 12px;
	color: var(--color-soft);
	display: flex;
	gap: 12px;
	font-family: var(--font-primary);
}

/* ===== Search Bar ===== */
.catalog-search {
	display: flex;
	gap: 10px;
	background: var(--color-surface);
	border: 1px solid var(--color-line);
	padding: 10px;
	border-radius: 8px;
	box-shadow: none;
	max-width: 600px;
	margin-bottom: 20px;
}

.catalog-search input {
	flex: 1;
	border: none;
	outline: none;
	padding: 0 15px;
	font-size: 14px;
	background: transparent;
	font-family: var(--font-primary);
}

.catalog-search button {
	border: none;
	background: #1a1a1a;
	color: #fff;
	padding: 8px 24px;
	border-radius: 6px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s;
}

.catalog-search button:hover {
	background: #333333;
}

/* ===== Model Hotspot Popup (Responsive) ===== */
.model-hotspot-popup-overlay {
	padding: 0;
}

.model-hotspot-popup {
	width: min(720px, 92vw);
	height: auto;
	max-width: min(720px, 92vw);
	max-height: 90vh;
}

@media (max-width: 768px) {
	.model-hotspot-popup-overlay {
		padding: 8px;
	}

	.model-hotspot-popup {
		width: calc(100vw - 16px);
		height: auto;
		max-width: calc(100vw - 16px);
		max-height: calc(100dvh - 16px);
		border-radius: 14px 14px 10px 10px;
	}
}

/* ===== Filter Chips ===== */
.filter-group-items {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.chip {
	display: inline-flex;
	align-items: center;
	padding: 5px 12px;
	border-radius: 4px;
	background: transparent;
	border: 1px solid #e5e7eb;
	font-size: 12px;
	color: var(--color-muted);
	cursor: pointer;
	transition: all 0.15s;
}

.chip:hover {
	border-color: #d1d5db;
	color: var(--color-ink);
}

.chip.active {
	background: #1a1a1a;
	border-color: #1a1a1a;
	color: #fff;
	font-weight: 600;
}

/* ===== Model Taxonomies (Single Post) ===== */
.model-taxonomies {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 12px 0;
	align-items: flex-start;
	justify-content: flex-start;
	text-align: left;
	font-size: 13px;
	line-height: 1.4;
	font-weight: 400;
	--tag-bg: transparent;
	--tag-text: #6b7280;
	--tag-border: #e5e7eb;
	--tag-hover-bg: #f3f4f6;
	--tag-hover-border: #d1d5db;
	--tag-hover-text: #1a1a1a;
}

.mgb-meta-divider {
	color: var(--color-line);
	font-weight: 400;
	margin: 0 4px;
}

.model-taxonomies .mgb-term-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: 4px;
	background: var(--tag-bg);
	border: 1px solid var(--tag-border);
	font-size: 12px;
	font-weight: 500;
	color: var(--tag-text);
	text-decoration: none;
	transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
	font-family: var(--font-primary);
	cursor: pointer;
	line-height: 1.4;
}

.model-taxonomies .mgb-term-badge:hover {
	border-color: var(--tag-hover-border);
	background: var(--tag-hover-bg);
	color: var(--tag-hover-text);
}

.model-taxonomies .mgb-term-badge:focus-visible {
	outline: 2px solid #1a1a1a;
	outline-offset: 2px;
}

.model-taxonomies .mgb-term-link {
	--has-link-decoration: var(--false);

	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: 4px;
	background: var(--tag-bg);
	border: 1px solid var(--tag-border);
	font-size: 12px;
	font-weight: 500;
	color: var(--tag-text);
	text-decoration: none;
	line-height: 1.4;
	transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

/* Simple style: no underline at all */
.model-taxonomies .mgb-term-link[data-style="simple"] {
	border-bottom: none;
}

/* Underline style: show border-bottom underline */
.model-taxonomies .mgb-term-link[data-style="underline"] {
	border-bottom-color: transparent;
}

/* Hover: color change + border-bottom underline */
.model-taxonomies .mgb-term-link:hover {
	border-color: var(--tag-hover-border);
	background: var(--tag-hover-bg);
	color: var(--tag-hover-text);
}

/* Keep simple style clean on hover */
.model-taxonomies .mgb-term-link[data-style="simple"]:hover {
	border-bottom: none;
}

/* ===== STATIC SINGLE CPT TAXONOMY (2026-02-11) ===== */
.single-model3d .model-taxonomies,
.single-asset2d .model-taxonomies,
.single-tutorial .model-taxonomies {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
	justify-content: flex-start;
	text-align: left;
	font-size: 12px !important;
	line-height: 1.4 !important;
	font-weight: 400 !important;
}

.single-model3d .model-taxonomies .mgb-term-badge,
.single-asset2d .model-taxonomies .mgb-term-badge,
.single-tutorial .model-taxonomies .mgb-term-badge {
	display: inline-flex;
	align-items: center;
	font-size: 12px !important;
	background: transparent !important;
	color: #6b7280 !important;
	border-radius: 4px !important;
	border: 1px solid #e5e7eb !important;
	padding: 4px 10px !important;
	line-height: 1.4 !important;
	text-decoration: none !important;
	transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease !important;
}

.single-model3d .model-taxonomies .mgb-term-badge:hover,
.single-asset2d .model-taxonomies .mgb-term-badge:hover,
.single-tutorial .model-taxonomies .mgb-term-badge:hover {
	background: #f3f4f6 !important;
	color: #1a1a1a !important;
	border-color: #d1d5db !important;
	text-decoration: none !important;
}

.single-model3d .model-taxonomies .mgb-term-link,
.single-asset2d .model-taxonomies .mgb-term-link,
.single-tutorial .model-taxonomies .mgb-term-link {
	color: #6b7280 !important;
	background: transparent !important;
	border: 1px solid #e5e7eb !important;
	border-radius: 4px !important;
	padding: 4px 10px !important;
	line-height: 1.4 !important;
}

/* ===== END STATIC SINGLE CPT TAXONOMY (2026-02-11) ===== */

/* Distinguish Gallery Tags from Model Taxonomies */
.model-gallery-block__tags.is-inline {
	background: transparent !important;
	padding: 0 !important;
	justify-content: center !important;
	margin-bottom: 24px !important;
}

.model-gallery-block__tags.is-inline a {
	background: transparent !important;
	color: #6b7280 !important;
	border: 1px solid #e5e7eb !important;
	padding: 4px 10px !important;
	border-radius: 4px !important;
	font-size: 12px !important;
	font-weight: 500 !important;
	transition: all 0.15s ease;
	box-shadow: none !important;
}

.model-gallery-block__tags.is-inline a:hover {
	background: #f3f4f6 !important;
	color: #1a1a1a !important;
	border-color: #d1d5db !important;
}

/* ===== Mobile Sidebar Toggle Button (matched from models.css) ===== */
@media (max-width: 767px) {
	.btn-toggle-sidebar {
		display: inline-flex;
	}
}

/* ===== Minimalist Global Overrides ===== */

/* Gallery block - neutral text and hotspot vars */
.model-gallery-block {
	color: #1a1a1a !important;
	--mgb-spot-color: #1a1a1a;
	--mgb-spot-border: #ffffff;
	--mgb-spot-pulse-color: #1a1a1a;
}

/* Gallery slide frame */
.model-gallery-slides,
.model-gallery-slide,
.model-gallery-slide__media,
.model-gallery-slide img {
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
}

/* Footer - neutral */
.ct-footer {
	background-color: #fafafa !important;
	color: #6b7280 !important;
	border-top: 1px solid #e5e7eb;
}

.ct-footer a {
	color: #6b7280 !important;
}

.ct-footer a:hover {
	color: #1a1a1a !important;
}

[data-footer*="type-1"] .ct-footer {
	background-color: #fafafa !important;
}

/* Sidebar links - neutral */
.ct-sidebar a {
	color: #6b7280 !important;
}

.ct-sidebar a:hover {
	color: #1a1a1a !important;
}

.ct-sidebar .widget-title {
	color: #1a1a1a !important;
}

.ct-sidebar .widget {
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
}

@media (min-width: 1000px) {
	#sidebar.ct-hidden-sm.ct-hidden-md {
		align-self: stretch;
		height: auto;
	}

	#sidebar.ct-hidden-sm.ct-hidden-md > .ct-sidebar {
		position: static;
	}

	body.admin-bar #sidebar.ct-hidden-sm.ct-hidden-md > .ct-sidebar {
		position: static;
	}
}

/* Breadcrumbs - subtle */
.ct-breadcrumbs {
	color: #9ca3af !important;
}

.ct-breadcrumbs a {
	color: #6b7280 !important;
}

.ct-breadcrumbs a:hover {
	color: #1a1a1a !important;
}

.archive-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	margin-bottom: 14px;
	color: #6b7280;
	font-size: 13px;
	line-height: 1.5;
}

.archive-breadcrumb a {
	color: #4b5563;
	text-decoration: none;
}

.archive-breadcrumb a:hover {
	color: #111827;
	text-decoration: underline;
}

.archive-breadcrumb__separator {
	color: #c5ccd6;
}

.archive-related-terms {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 18px;
}

.archive-related-terms__item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 34px;
	padding: 7px 10px;
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	color: #374151;
	background: #fff;
	font-size: 13px;
	line-height: 1.25;
	text-decoration: none;
}

.archive-related-terms__item:hover {
	border-color: #cbd5e1;
	color: #111827;
}

/* Asset details icons - neutral */
.mgb-asset-details__title svg,
.model-info-section__heading svg {
	color: #9ca3af !important;
}

/* Report button - subtle */
.n-report-trigger-wrap button {
	color: #9ca3af !important;
	border-color: #e5e7eb !important;
	background: transparent !important;
}

.n-report-trigger-wrap button:hover {
	color: #1a1a1a !important;
	border-color: #d1d5db !important;
}

/* Lightbox overlay */
.mgb-lightbox-overlay {
	background: rgba(0, 0, 0, 0.9) !important;
}

/* Gallery navigation - subtle */
.model-gallery-block__nav {
	background: rgba(255, 255, 255, 0.9) !important;
	border: 1px solid #e5e7eb !important;
	color: #1a1a1a !important;
}

.model-gallery-block__nav:hover {
	background: #ffffff !important;
	border-color: #d1d5db !important;
}

/* Dots navigation */
.model-gallery-block__dot {
	background: #d1d5db !important;
}

.model-gallery-block__dot.is-active {
	background: #1a1a1a !important;
}

/* Scroll to top button */
.ct-back-to-top {
	background: #1a1a1a !important;
	color: #ffffff !important;
}

/* Slide counter */
.model-gallery-block__slide-counter {
	color: #9ca3af !important;
}

/* ===== Download Buttons: sync style with Change Server button (theme primary blue) ===== */
.mgb-hotspot-download__btn,
.model-hotspot__download {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: #167aed !important;
	color: #fff !important;
	border: none !important;
	padding: 12px 20px !important;
	border-radius: 999px !important;
	cursor: pointer !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	text-decoration: none !important;
	line-height: 1.2 !important;
	white-space: nowrap !important;
	opacity: 1 !important;
	transition: opacity 0.2s ease, background 0.2s ease !important;
}

.mgb-hotspot-download__action-buttons > .mgb-hotspot-download__btn {
	border-radius: 0 !important;
}

.mgb-hotspot-download__btn:hover,
.model-hotspot__download:hover {
	background: #125fbf !important;
	color: #fff !important;
}

.mgb-hotspot-download__btn.is-disabled {
	opacity: 0.6 !important;
	pointer-events: none !important;
}

/* ===== Task 7: Header polish (Archpoly) ===== */
[data-id="type-1"] .ct-header {
	--header-height: 96px;
	background: #ffffff;
	border-bottom: 1px solid #e5e9f0;
	box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
[data-id="type-1"] .ct-header [data-id="logo"] .site-title {
	--theme-font-weight: 700;
	--theme-font-size: 22px;
	--theme-link-initial-color: #0b1220;
	letter-spacing: -0.01em;
}
[data-id="type-1"] .ct-header [data-id="menu-secondary"] > ul {
	gap: 28px;
}
[data-id="type-1"] .ct-header [data-id="menu-secondary"] > ul > li > a {
	--theme-font-weight: 600;
	--theme-font-size: 14px;
	--theme-text-transform: none;
	--theme-link-initial-color: #1f2937;
	transition: color 0.15s ease;
}
[data-id="type-1"] .ct-header [data-id="menu-secondary"] > ul > li > a:hover {
	--theme-link-initial-color: #2872fa;
}
@media (max-width: 800px) {
	[data-id="type-1"] .ct-header { --header-height: 72px; }
}

/* ===== Task 7: Footer polish (Archpoly) ===== */
.ct-footer { background: #0b1220; color: #cbd5e1; padding: 56px 0 24px; }
.ct-footer .ct-footer-copyright p { color: #94a3b8; font-size: 14px; }
.ct-footer #footer-menu a { color: #cbd5e1; transition: color 0.15s ease; }
.ct-footer #footer-menu a:hover { color: #ffffff; }
.ct-footer-socials a { transition: transform 0.15s ease; }
.ct-footer-socials a:hover { transform: translateY(-1px); }
@media (max-width: 800px) {
	.ct-footer { padding: 40px 0 20px; }
}

/* ===== Task 8: Archpoly Design Tokens (2026-08-29) ===== */
:root {
    --ap-color-accent:       #2872fa;
    --ap-color-accent-hover: #1559ed;
    --ap-color-accent-soft:  rgba(40, 114, 250, 0.10);
    --ap-space-1: 4px;
    --ap-space-2: 8px;
    --ap-space-3: 12px;
    --ap-space-4: 16px;
    --ap-space-5: 24px;
    --ap-space-6: 32px;
    --ap-space-7: 48px;
    --ap-space-8: 64px;
    --ap-font-display: clamp(32px, 4.5vw, 56px);
    --ap-font-h2:      clamp(24px, 3vw, 32px);
    --ap-ease:     cubic-bezier(0.4, 0, 0.2, 1);
    --ap-dur-fast: 120ms;
    --ap-dur:      200ms;
}

/* ===== Task 8: Hero Banner Section (Archpoly) ===== */
.hero-banner {
    background: var(--color-bg-page);
    padding: var(--ap-space-8) var(--ap-space-5);
}
.hero-banner__container { max-width: 1200px; margin: 0 auto; }
.hero-banner__static {
    display: flex; align-items: center; justify-content: center;
    padding: var(--ap-space-8) var(--ap-space-7);
    border-radius: var(--ap-space-3);
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.hero-slide__content {
    max-width: 960px; margin: 0 auto;
    text-align: center; width: 100%;
}
.homepage-3dsketchup .page-heading {
    font-size: var(--ap-font-display);
    line-height: 1.15;
    margin: 0 auto var(--ap-space-4);
    color: var(--color-ink);
    font-weight: 600;
    text-align: center;
    max-width: 960px;
    letter-spacing: -0.02em;
}
.hero-banner__actions {
    display: flex; gap: var(--ap-space-3);
    justify-content: center; flex-wrap: wrap;
    margin-top: var(--ap-space-6);
}
.hero-banner__actions .btn {
    padding: 12px 22px;
    border-radius: var(--ap-space-2);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex; align-items: center;
    transition: all var(--ap-dur) var(--ap-ease);
}
.hero-banner__actions .btn--primary {
    background: var(--ap-color-accent);
    color: #ffffff;
}
.hero-banner__actions .btn--primary:hover {
    background: var(--ap-color-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 114, 250, 0.25);
}
.hero-banner__actions .btn--ghost {
    background: transparent;
    color: var(--color-ink);
    border: 1px solid var(--color-line);
}
.hero-banner__actions .btn--ghost:hover {
    border-color: var(--color-ink);
}

/* ===== Task 8: Section spacing + card grid + chips (Archpoly) ===== */
.homepage-3dsketchup section.featured-models,
.homepage-3dsketchup section.homepage-search,
.homepage-3dsketchup section.category-directory,
.homepage-3dsketchup section.homepage-tutorials {
    padding: var(--ap-space-8) var(--ap-space-5);
}
.homepage-3dsketchup section + section { border-top: 1px solid var(--color-line); }
.homepage-3dsketchup .section-title {
    font-size: var(--ap-font-h2);
    line-height: 1.2;
    color: var(--color-ink);
    font-weight: 600;
    margin: 0 0 var(--ap-space-5);
    letter-spacing: -0.01em;
}

/* Section title override: Archpoly owns catalog title (higher specificity than .category-directory .section-title in homepage.css) */
.homepage-3dsketchup .category-directory .section-title {
    font-size: var(--ap-font-h2);
    color: var(--color-ink);
    line-height: 1.2;
    font-weight: 600;
    margin: 0 0 var(--ap-space-5);
    letter-spacing: -0.01em;
}

/* Directory surface: Archpoly owns section background and font-size (kill legacy #e7e7ea + 14px) */
.homepage-3dsketchup section.category-directory {
    background: var(--color-surface, transparent);
    font-size: 15px;
}
.homepage-3dsketchup .model-grid { gap: var(--ap-space-5); }
.homepage-3dsketchup .model-card-premium {
    border-radius: var(--ap-space-2);
    border: 1px solid var(--color-line);
    background: var(--color-surface);
    transition: transform var(--ap-dur) var(--ap-ease),
                box-shadow var(--ap-dur) var(--ap-ease);
    overflow: hidden;
}
.homepage-3dsketchup .model-card-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.homepage-3dsketchup .card-title {
    font-size: 16px;
    line-height: 1.4;
    color: var(--color-ink);
    font-weight: 600;
    margin: var(--ap-space-3) var(--ap-space-4) var(--ap-space-2);
}
.homepage-3dsketchup .card-title a { color: inherit; text-decoration: none; }
.homepage-3dsketchup .card-title a:hover { color: var(--ap-color-accent); }
.homepage-3dsketchup .card-meta { color: var(--color-soft); font-size: 14px; }

/* Search bar + chips */
.homepage-3dsketchup .homepage-search__form { width: 100%; }
.homepage-3dsketchup .catalog-search-bar {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--ap-space-2);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color var(--ap-dur) var(--ap-ease),
                box-shadow var(--ap-dur) var(--ap-ease);
}
.homepage-3dsketchup .catalog-search-bar:focus-within {
    border-color: var(--ap-color-accent);
    box-shadow: 0 0 0 3px rgba(40, 114, 250, 0.15);
}
.homepage-3dsketchup .search-input-wrapper input {
    font-size: 16px;
    padding: var(--ap-space-3) var(--ap-space-4);
}
.homepage-3dsketchup .filter-chips {
    display: flex; flex-wrap: wrap; gap: var(--ap-space-2);
    margin-top: var(--ap-space-4);
}
.homepage-3dsketchup .chip {
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    color: var(--color-muted);
    font-size: 14px;
    text-decoration: none;
    transition: all var(--ap-dur-fast) var(--ap-ease);
}
.homepage-3dsketchup .chip:hover {
    background: var(--ap-color-accent);
    color: #ffffff;
    border-color: var(--ap-color-accent);
}

/* Mobile */
@media (max-width: 800px) {
    .homepage-3dsketchup .hero-banner { padding: var(--ap-space-6) var(--ap-space-4); }
    .homepage-3dsketchup .hero-banner__static { padding: var(--ap-space-6) var(--ap-space-4); }
    .homepage-3dsketchup .model-grid { gap: var(--ap-space-3) !important; }
    .homepage-3dsketchup section.featured-models,
    .homepage-3dsketchup section.homepage-search,
    .homepage-3dsketchup section.category-directory,
    .homepage-3dsketchup section.homepage-tutorials {
        padding: var(--ap-space-6) var(--ap-space-4);
    }
    .homepage-3dsketchup .filter-chips { gap: 6px; }
    .homepage-3dsketchup .chip { padding: 4px 10px; font-size: 13px; }
}
@media (max-width: 480px) {
    .homepage-3dsketchup .page-heading { font-size: 28px; }
}

/* ===== Category directory board (CSS Grid 5-col, 5 wrappers thật) ===== */
.homepage-3dsketchup .category-directory-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--ap-space-6);
    align-items: start; /* Mỗi col tự co giãn theo nội dung (cân bằng theo grid auto-flow) */
}
.homepage-3dsketchup .category-directory-col {
    /* Mỗi wrapper là 1 grid item (col thật) */
    display: block;
    min-width: 0; /* Cho phép text wrap trong grid item */
}
.homepage-3dsketchup .category-group {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: var(--ap-space-6);
}
.homepage-3dsketchup .category-group:last-child {
    margin-bottom: 0; /* Bỏ margin bottom cho article cuối mỗi col */
}

/* Defensive horizontal-text reset: kill any inherited writing-mode/word-break that would split text 1-word-per-line */
.homepage-3dsketchup .category-directory-board,
.homepage-3dsketchup .category-directory-col,
.homepage-3dsketchup .category-group,
.homepage-3dsketchup .category-group__title,
.homepage-3dsketchup .category-group__list,
.homepage-3dsketchup .category-group__item,
.homepage-3dsketchup .category-group__title-link,
.homepage-3dsketchup .category-group__title-text,
.homepage-3dsketchup .category-group__link {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    word-break: normal;
    word-spacing: normal;
    letter-spacing: normal;
    white-space: normal;
    width: auto;
    max-width: 100%;
    min-width: 0;
    column-count: auto;
    column-width: auto;
    columns: auto;
}

/* Empty-term count badge: hidden by request — the "(0)" marker is no longer
   displayed on the homepage. The span stays in the DOM so the :has() rule
   below can keep muting links of empty terms. */
.homepage-3dsketchup .category-term-count {
    display: none;
}
.homepage-3dsketchup .category-group__item:has(.category-term-count) > .category-group__link {
    color: var(--color-muted, #666);
}

/* Responsive: 3 col tablet, 2 col small tablet, 1 col mobile */
@media (max-width: 1200px) {
    .homepage-3dsketchup .category-directory-board {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 800px) {
    .homepage-3dsketchup .category-directory-board {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .homepage-3dsketchup .category-directory-board {
        grid-template-columns: 1fr;
    }
}

/* Fix jitter on tag hover */
.model-gallery-block__tags--cloud .model-gallery-block__tag-item {
    position: relative;
    z-index: 1;
    transform: translateZ(0);
    transition: transform 0.3s 0.3s;
}
.model-gallery-block__tags--cloud .model-gallery-block__tag-item:hover {
    transform: translateZ(0) scale(1.05);
}
