/* ==========================================================
   K9 Paw – Filter Gallery + CTA widget
   ========================================================== */
.k9gl {
	--k9-gold: #DCA54A;
	--k9-ggap: 12px;
	--k9-rowh: 230px;
	--k9-gcols: 3;
	position: relative;
	overflow: hidden;
	padding: 40px 40px 60px;
	background: #f8f5ef;
	font-family: var(--k9-font, 'Roboto', sans-serif);
	color: #555;
}
.k9gl *, .k9gl *::before, .k9gl *::after { box-sizing: border-box; }
.k9gl__inner { position: relative; z-index: 2; max-width: 1420px; margin: 0 auto; }

/* Decorations */
.k9gl__shape { position: absolute; z-index: 0; pointer-events: none; }
.k9gl__shape--l {
	left: -20px; top: 160px; width: 90px; height: 140px;
	background: linear-gradient(150deg, #f0cf8c, var(--k9-gold));
	clip-path: polygon(0 0, 100% 55%, 30% 100%, 0 80%);
}
.k9gl__shape--r {
	right: -10px; bottom: 140px; width: 70px; height: 200px;
	background: linear-gradient(200deg, #f0cf8c, var(--k9-gold));
	clip-path: polygon(30% 0, 100% 0, 100% 100%, 60% 100%, 0 40%);
	opacity: .9;
}
.k9gl__wm {
	position: absolute; top: 10px; right: 30px; z-index: 0; pointer-events: none;
	font-size: 260px; line-height: 1; color: rgba(220,165,74,.07);
}
.k9gl__wm svg { width: 260px; height: 260px; fill: currentColor; }

/* ---------- Heading ---------- */
.k9gl__head { text-align: center; max-width: 820px; margin: 0 auto 26px; }
.k9gl__sub { font-size: 15px; font-weight: 500; letter-spacing: 2.5px; text-transform: uppercase; color: #8a6a2a; margin-bottom: 12px; }
.k9gl__sub--lines span { display: inline-flex; align-items: center; gap: 22px; }
.k9gl__sub--lines span::before, .k9gl__sub--lines span::after { content: ""; width: 66px; height: 1.5px; background: var(--k9-gold); }
.k9gl__title {
	font-family: var(--k9-font, 'Roboto', sans-serif);
	font-size: 50px; font-weight: 800; line-height: 1.12; color: #171717; margin: 0 0 14px;
}
.k9gl__title em, .k9gl__cta-title em { font-style: normal; color: var(--k9-gold); }
.k9gl__desc { font-size: 17px; line-height: 1.55; color: #666; }
.k9gl__desc p { margin: 0 0 8px; color: inherit; font: inherit; }
.k9gl__desc p:last-child { margin: 0; }

/* ---------- Filter ---------- */
.k9gl__filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 20px; }
.k9gl__tab {
	appearance: none; cursor: pointer;
	padding: 13px 30px; border: 0; border-radius: 3px;
	font-family: var(--k9-font, 'Roboto', sans-serif) !important; font-size: 15px; font-weight: 500; line-height: 1.2;
	color: #222; background-color: #f1ece3;
	transition: background-color .3s ease, color .3s ease, transform .3s ease, box-shadow .3s ease;
}
.k9gl__tab:hover { background-color: #e9dfcc; transform: translateY(-2px); }
.k9gl__tab.is-active { background-color: var(--k9-gold); color: #171717; font-weight: 600; box-shadow: 0 6px 14px rgba(220,165,74,.3); }
.k9gl__tab:focus-visible { outline: 2px solid var(--k9-gold); outline-offset: 2px; }

/* ---------- Grid ---------- */
.k9gl__grid { display: grid; gap: var(--k9-ggap); grid-auto-flow: dense; }

/* Mosaic: 24-column pattern, repeats every 6 images */
.k9gl--mosaic:not(.is-filtered) .k9gl__grid { grid-template-columns: repeat(24, minmax(0, 1fr)); grid-auto-rows: var(--k9-rowh); }
.k9gl--mosaic:not(.is-filtered) .k9gl__item:nth-child(6n+1) { grid-column: span 8; grid-row: span 2; }
.k9gl--mosaic:not(.is-filtered) .k9gl__item:nth-child(6n+2) { grid-column: span 9; }
.k9gl--mosaic:not(.is-filtered) .k9gl__item:nth-child(6n+3) { grid-column: span 7; }
.k9gl--mosaic:not(.is-filtered) .k9gl__item:nth-child(6n+4) { grid-column: span 5; }
.k9gl--mosaic:not(.is-filtered) .k9gl__item:nth-child(6n+5) { grid-column: span 6; }
.k9gl--mosaic:not(.is-filtered) .k9gl__item:nth-child(6n+6) { grid-column: span 5; }

/* Equal grid (also used after filtering) */
.k9gl--grid .k9gl__grid,
.k9gl.is-filtered .k9gl__grid { grid-template-columns: repeat(var(--k9-gcols), minmax(0, 1fr)); grid-auto-rows: var(--k9-rowh); }

.k9gl__item {
	position: relative; display: block; overflow: hidden;
	border-radius: 6px; background: #ddd; cursor: zoom-in;
	text-decoration: none !important;
}
div.k9gl__item { cursor: default; }
.k9gl__item.is-hidden { display: none; }
.k9gl__item.is-show { animation: k9glIn .5s ease both; }
@keyframes k9glIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.k9gl__item img {
	display: block; width: 100%; height: 100% !important; max-width: none;
	object-fit: cover; transition: transform .8s ease;
}
.k9gl__item::after {
	content: ""; position: absolute; inset: 0; z-index: 1;
	background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.75) 100%);
	opacity: 0; transition: opacity .4s ease;
}
.k9gl__item::before {
	content: ""; position: absolute; inset: 10px; z-index: 2;
	border: 1px solid rgba(220,165,74,.8); border-radius: 4px;
	opacity: 0; transform: scale(1.05); transition: opacity .4s ease, transform .4s ease;
	pointer-events: none;
}
.k9gl__item:hover img { transform: scale(1.08); }
.k9gl__item:hover::after, .k9gl__item:focus-visible::after { opacity: 1; }
.k9gl__item:hover::before, .k9gl__item:focus-visible::before { opacity: 1; transform: none; }

.k9gl__hover {
	position: absolute; inset: 0; z-index: 3;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
	opacity: 0; transition: opacity .4s ease;
}
.k9gl__item:hover .k9gl__hover, .k9gl__item:focus-visible .k9gl__hover { opacity: 1; }
.k9gl__zoom {
	width: 54px; height: 54px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--k9-gold); color: #171717; font-size: 18px;
	transform: translateY(14px) scale(.8); transition: transform .4s ease;
}
.k9gl__zoom svg { width: 18px; height: 18px; fill: currentColor; }
.k9gl__item:hover .k9gl__zoom { transform: none; }
.k9gl__cap {
	position: absolute; left: 20px; right: 20px; bottom: 18px;
	font-size: 16px; font-weight: 600; color: #fff; text-align: left;
	transform: translateY(10px); transition: transform .4s ease;
}
.k9gl__item:hover .k9gl__cap { transform: none; }

/* ---------- CTA bar ---------- */
.k9gl__cta {
	position: relative; overflow: hidden;
	display: flex; align-items: center; gap: 28px;
	margin-top: 20px; padding: 30px 54px 30px 50px;
	background: linear-gradient(110deg, #1d1a15 0%, #111 45%, #141210 100%);
	border: 1px solid rgba(220,165,74,.45); border-radius: 8px;
	box-shadow: 0 18px 40px rgba(0,0,0,.18);
	color: #fff;
}
.k9gl__cta::before {
	content: ""; position: absolute; left: -60px; top: -60px; width: 260px; height: 260px; pointer-events: none;
	background: radial-gradient(circle, rgba(220,165,74,.14) 0%, transparent 65%);
}
.k9gl__cta > * { position: relative; z-index: 1; }
.k9gl__cta-ic {
	flex: 0 0 auto; width: 92px; height: 92px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: rgba(255,255,255,.04); color: var(--k9-gold); font-size: 44px;
}
.k9gl__cta-ic svg { width: 44px; height: 44px; fill: currentColor; }
.k9gl__cta-sep { flex: none; width: 1px; align-self: stretch; min-height: 70px; background: rgba(220,165,74,.45); }
.k9gl__cta-sep:first-of-type { margin-left: -12px; }
.k9gl__cta-title {
	flex: 0 1 auto; margin: 0;
	font-family: var(--k9-font, 'Roboto', sans-serif);
	font-size: 32px; font-weight: 800; line-height: 1.2; color: #fff;
}
.k9gl__cta-text { flex: 1 1 260px; font-size: 16px; line-height: 1.65; color: rgba(255,255,255,.85); }
.k9gl__cta-text p { margin: 0; color: inherit; font: inherit; }
.k9gl__btn { flex: none; margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
	.k9gl__item img, .k9gl__item::before, .k9gl__item::after, .k9gl__hover, .k9gl__zoom, .k9gl__cap { transition: none !important; }
	.k9gl__item.is-show { animation: none; }
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1366px) {
	.k9gl { --k9-rowh: 200px; }
	.k9gl__title { font-size: 44px; }
	.k9gl__cta { padding: 26px 32px; gap: 22px; }
	.k9gl__cta-title { font-size: 27px; }
	.k9gl__cta-ic { width: 76px; height: 76px; font-size: 36px; }
}

@media (max-width: 1024px) {
	.k9gl { padding: 50px 30px; --k9-rowh: 190px; }
	.k9gl__title { font-size: 38px; }
	.k9gl__filter { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
	.k9gl__tab { flex: none; padding: 12px 22px; }
	/* Mosaic → 2 cols, first image full width */
	.k9gl--mosaic:not(.is-filtered) .k9gl__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.k9gl--mosaic:not(.is-filtered) .k9gl__item:nth-child(n) { grid-column: span 1; grid-row: span 1; }
	.k9gl--mosaic:not(.is-filtered) .k9gl__item:nth-child(6n+1) { grid-column: span 2; grid-row: span 2; }
	.k9gl__cta { flex-wrap: wrap; padding: 30px; }
	.k9gl__cta-sep--2 { display: none; }
	.k9gl__cta-text { flex-basis: 100%; }
	.k9gl__btn { margin-left: 0; }
	.k9gl__shape, .k9gl__wm { display: none; }
}

@media (max-width: 767px) {
	.k9gl { padding: 44px 16px; --k9-rowh: 220px; --k9-ggap: 10px; }
	.k9gl__sub { font-size: 12px; }
	.k9gl__sub--lines span { gap: 12px; }
	.k9gl__sub--lines span::before, .k9gl__sub--lines span::after { width: 30px; }
	.k9gl__title { font-size: 30px; }
	.k9gl__desc { font-size: 15px; }
	.k9gl__tab { font-size: 14px; padding: 11px 18px; }
	.k9gl--mosaic:not(.is-filtered) .k9gl__grid { grid-template-columns: 1fr; }
	.k9gl--mosaic:not(.is-filtered) .k9gl__item:nth-child(6n+1) { grid-column: span 1; grid-row: span 1; }
	/* touch devices: show caption without hover */
	.k9gl__item::after { opacity: .9; }
	.k9gl__hover { opacity: 1; }
	.k9gl__zoom { display: none; }
	.k9gl__cap { transform: none; font-size: 15px; }
	.k9gl__cta { flex-direction: column; align-items: flex-start; gap: 16px; padding: 26px 20px; }
	.k9gl__cta-sep { display: none; }
	.k9gl__cta-ic { width: 64px; height: 64px; font-size: 30px; }
	.k9gl__cta-title { font-size: 24px; }
	.k9gl__cta-text { flex-basis: auto; font-size: 15px; }
	.k9gl__btn { width: 100%; }
}
