/* KZ: home blocks + mobile layout for the WhiteLab theme. Loaded by mu-plugins/kz-home.php */

:root {
	--kz-accent: #3aa597;
	--kz-accent-dark: #2d8a7e;
	--kz-text: #2f3437;
	--kz-muted: #7b8387;
	--kz-card: #fff;
	--kz-line: #e6eaea;
	--kz-star: #f5a623;
	--kz-star-off: #d6dbdb;
	--kz-radius: 12px;
	--kz-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

/* ---------- Home: sections ---------- */
.kz-home { clear: both; padding-top: 8px; }
.kz-section { max-width: 1170px; margin: 0 auto 56px; padding: 0 15px; }
.kz-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.kz-home, .kz-home h2, .kz-home h3 { font-family: inherit; }
.kz-section-title { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 700; color: var(--kz-text); }
.kz-more { white-space: nowrap; font-size: 15px; font-weight: 600; color: var(--kz-accent); text-decoration: none; }
.kz-more:hover { color: var(--kz-accent-dark); }

/* Category tiles */
.kz-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 1170px; margin: 0 auto 48px; padding: 0 15px; }
.kz-cat { display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; border-radius: var(--kz-radius); background: var(--kz-card); box-shadow: 0 6px 24px rgba(0, 0, 0, .08); color: var(--kz-text); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.kz-cat:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, .12); color: var(--kz-text); }
.kz-cat-name { font-size: 24px; font-weight: 700; }
.kz-cat-count { color: var(--kz-muted); }
.kz-cat-go { margin-top: 4px; color: var(--kz-accent); font-weight: 600; }

/* Top cards */
.kz-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kz-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--kz-radius); background: var(--kz-card); box-shadow: var(--kz-shadow); color: var(--kz-text); text-decoration: none; transition: box-shadow .15s; }
.kz-card:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, .1); color: var(--kz-text); }
.kz-card-pos { position: absolute; top: 8px; left: 8px; z-index: 1; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--kz-accent); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.kz-card-media { flex: 0 0 76px; }
.kz-card-img { display: block; width: 76px; height: 76px; border-radius: 10px; object-fit: cover; background: #eef2f2; }
.kz-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kz-card-title { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 16px; font-weight: 700; line-height: 1.3; }
.kz-card-price { color: #555; font-size: 14px; }

/* Rating line (home + rating tables) */
.kz-rating { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; line-height: 1.3; }
.kz-rating b { color: var(--kz-text); }
.kz-rating-count, .kz-rating--none { color: var(--kz-muted); font-size: 13px; }
.kz-stars { display: inline-flex; gap: 1px; font-size: 15px; line-height: 1; letter-spacing: 0; }
.kz-star { color: var(--kz-star-off); }
.kz-star.is-on { color: var(--kz-star); }

/* Latest reviews */
.kz-reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kz-review { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--kz-radius); background: var(--kz-card); box-shadow: var(--kz-shadow); }
.kz-review-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #999; font-size: 13px; }
.kz-review-title { margin: 0; font-size: 16px; line-height: 1.35; }
.kz-review-title a { color: var(--kz-text); text-decoration: none; }
.kz-review-title a:hover { color: var(--kz-accent); }
.kz-review-text { margin: 0; color: #555; font-size: 14px; line-height: 1.55; }
.kz-review-meta { margin-top: auto; color: var(--kz-muted); font-size: 13px; }
.kz-review-meta a { color: var(--kz-accent); font-weight: 600; text-decoration: none; }
.kz-review-author { color: #555; font-weight: 600; }

/* The category tiles replace the theme's category bar over the home hero */
body.home .dt-header-categories { display: none; }
body.home .kz-cats { margin-top: 32px; }

/* Readable white text over photos: darken the hero and the rating-page banners */
body.home .dt-rs-container .wrap-img-header-front { position: relative; }
body.home .dt-rs-container .wrap-img-header-front::after,
.db-listing-featured-img-custom::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 20, 25, .62) 0%, rgba(10, 20, 25, .45) 60%, rgba(10, 20, 25, .55) 100%); pointer-events: none; }
.db-listing-featured-img-custom { overflow: hidden; }
body.home .wrap-text-front-header p,
.db-single-listing-left-custom h1.single-listing-title { text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.db-single-listing-left-custom h1.single-listing-title { position: relative; z-index: 2; color: #fff; }

/* Cookie notice: compact bar, button never cut */
body .cookie-pop { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px !important; font-size: 13px !important; line-height: 1.4 !important; }
body .cookie-pop .accept_button { flex: 0 0 auto; margin: 0 !important; padding: 8px 16px !important; border: 0 !important; border-radius: 6px; background: var(--kz-accent) !important; color: #fff !important; font-size: 14px !important; line-height: 1.2 !important; white-space: nowrap; cursor: pointer; }

/* Rating tables: cleaner logos (theme had a 3px grey frame) */
.row-gamblimg .table-logo-img img { border: 1px solid var(--kz-line) !important; border-radius: 10px; object-fit: cover; }
.owl-item .row-gamblimg.top .table-logo-img img { border-color: #e0c265 !important; }

@media (max-width: 991px) {
	.kz-cards, .kz-reviews { grid-template-columns: 1fr 1fr; }
}

/* ---------- Search ---------- */
.kz-search-form { display: flex; width: 100%; max-width: 560px; margin: 0 auto; border-radius: 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, .15); overflow: hidden; background: #fff; }
.kz-search-form input[type="search"] { flex: 1 1 auto; min-width: 0; height: 56px; margin: 0; padding: 0 18px; border: 0; border-radius: 0; background: #fff; color: var(--kz-text); font-size: 16px; outline: none; box-shadow: none; -webkit-appearance: none; }
.kz-search-form button { flex: 0 0 auto; height: 56px; margin: 0; padding: 0 26px; border: 0; border-radius: 0; background: #6cc1b3; color: #fff; font-size: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; cursor: pointer; }
.kz-search-form button:hover { background: var(--kz-accent); }
.dt-header-search-inner { display: block !important; width: 100%; max-width: 560px; margin: 0 auto; padding: 0 15px; }
.kz-search { max-width: 1170px; margin: 0 auto 48px; padding: 0 15px; }
.kz-search .kz-search-form { margin: 0 0 20px; max-width: none; box-shadow: var(--kz-shadow); border: 1px solid var(--kz-line); }
.kz-search-count, .kz-search-hint { margin: 0 0 16px; color: var(--kz-muted); font-size: 15px; }
.kz-search-hint a { color: var(--kz-accent); font-weight: 600; }
.kz-card-cat { color: var(--kz-accent); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Rating tables (/kursy/, /kouchery/) ---------- */
/* Empty forex-template columns ("Мин. ставка", "Бонус") are never filled for courses/coaches */
.row-gamblimg .table-min-stavka, .row-gamblimg .table-bonus { display: none !important; }
.table-comment .kz-rating { margin-bottom: 6px; }
.table-comment .kz-rating + .wrap-count-comment { display: none; }
@media (min-width: 768px) {
	/* the table overlapped the page title on the banner */
	.db-listing-category-custom-page h1.single-listing-title { transform: translateY(-30px); }
	.table-comment .kz-rating { flex-direction: column; align-items: flex-start; gap: 2px; }
	.table-comment .kz-rating-count { white-space: nowrap; }
}

/* ---------- Tablet & mobile: plain header links instead of the slide-out menu ---------- */
@media (max-width: 992px) {
	.dt-mobile-menu, .dt-show-mobile-menu { display: none !important; }
	.header-main .main-header-right-side { display: flex !important; align-items: center; position: absolute; top: 0; right: 15px; float: none; width: auto !important; max-width: none; height: 100px; margin: 0; z-index: 5; }
	.header-main #primary-navigation, .header-main #primary-navigation.collapse { display: block !important; height: auto !important; visibility: visible; }
	.main-header-right-side ul.nav-menu { display: flex; gap: 18px; margin: 0; padding: 0; }
	.main-header-right-side ul.nav-menu li { display: block; margin: 0 !important; padding: 0 !important; }
	.main-header-right-side ul.nav-menu li a { padding: 0 !important; }
	.main-header-right-side ul.nav-menu li a span { font-size: 17px !important; }
	header.site-header .header-main { min-height: inherit; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
	/* Header: smaller bar, bigger logo */
	header.site-header { min-height: 64px; }
	.header-main div.site-title { max-width: 55%; }
	.header-main div.site-title a { height: 64px; }
	.header-main div.site-title img { max-height: 44px; width: auto; }
	.header-main .main-header-right-side { height: 64px; }
	.main-header-right-side ul.nav-menu { gap: 16px; }
	.main-header-right-side ul.nav-menu li a span { font-size: 16px !important; }

	/* Home hero: half a screen instead of a full one */
	body.home .dt-rs-container .wrap-img-header-front { height: 470px !important; min-height: 0 !important; background-position: center; }
	body.home .dt-rs-container .dt-header-search { top: 84px; bottom: auto; padding: 0 16px; }
	body.home .wrap-text-front-header { margin-bottom: 18px; }
	body.home .wrap-text-front-header .img-title-front-header p { font-size: 30px !important; line-height: 1.2 !important; margin-bottom: 10px; }
	body.home .wrap-text-front-header .img-subtitle-front-header p { font-size: 16px !important; line-height: 1.4 !important; }
	body.home .dt-header-categories { display: none; }

	/* Home blocks */
	.kz-home { padding-top: 0; }
	.kz-section { margin-bottom: 36px; }
	.kz-section-title { font-size: 22px; }
	.kz-cats { gap: 10px; margin: 24px auto 32px; }
	.kz-cat { padding: 16px; }
	.kz-cat-name { font-size: 19px; }
	.kz-cat-count, .kz-cat-go { font-size: 13px; }
	.kz-cards, .kz-reviews { grid-template-columns: 1fr; gap: 10px; }
	.kz-card { padding: 12px; }
	.kz-card-media { flex-basis: 64px; }
	.kz-card-img { width: 64px; height: 64px; }

	/* Rating pages: title over the banner */
	.db-listing-featured-img-custom { height: 120px !important; }
	.db-single-listing-left-custom h1.single-listing-title { font-size: 30px !important; line-height: 1.15 !important; padding-bottom: 8px; }

	/* Rating rows: compact card — logo left, info right */
	.row-gamblimg .table-row { display: grid !important; grid-template-columns: 72px 1fr; column-gap: 12px; row-gap: 4px; align-items: start; padding: 12px !important; }
	.row-gamblimg .table-row > div { display: block !important; width: auto !important; max-width: none !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; text-align: left !important; }
	.row-gamblimg .table-row > div:before { display: none !important; }
	.row-gamblimg .table-row > div.table-min-stavka, .row-gamblimg .table-row > div.table-bonus { display: none !important; }
	.row-gamblimg, .row-gamblimg .table-row { height: auto !important; min-height: 0 !important; }
	.row-gamblimg .table-logo { grid-column: 1; grid-row: 1 / span 4; position: relative; }
	.row-gamblimg .table-logo > span { position: absolute; top: -6px; left: -6px; z-index: 1; min-width: 24px; height: 24px; padding: 0 6px; border: 2px solid #fff; border-radius: 12px; background: var(--kz-accent); color: #fff !important; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
	.row-gamblimg .table-logo-img { display: block !important; width: 72px !important; height: 72px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; }
	.row-gamblimg .table-logo-img img { display: block; width: 72px !important; height: 72px !important; margin: 0 !important; }
	.row-gamblimg .table-description { grid-column: 2; }
	.row-gamblimg .table-description h5 { margin: 0 !important; font-size: 16px !important; line-height: 1.3 !important; }
	.row-gamblimg .table-description span { display: none; }
	.row-gamblimg .table-comment { grid-column: 2; }
	.row-gamblimg .table-comment .kz-rating { margin: 0; }
	.row-gamblimg .table-min-dep { grid-column: 2; }
	.row-gamblimg .table-min-dep span { min-width: 0 !important; font-size: 15px !important; color: #555; }
	.row-gamblimg .table-min-dep span:not(:empty):before { content: 'Стоимость: '; color: var(--kz-muted); font-size: 13px; }
	.row-gamblimg .table-site { grid-column: 2; font-size: 13px; }
	.row-gamblimg .table-site span { min-width: 0 !important; }
}
