/*
Theme Name: WP Coupon Child (Kube.promo)
Description: Child of WP Coupon. Uses the Kube.promo header and footer on every theme page and restyles the coupon, provider, category, search and page templates to match the Kube.promo design. The parent theme, its options, coupons and popups are unchanged.
Template: wp-coupon
Version: 1.0.0
Author: Kube.promo
Text Domain: wp-coupon-child
*/

/*
 * Every rule below is scoped to body.kp-theme-page, a class added by functions.php only on pages drawn by the
 * parent theme. Kube.promo's own Home, Events and Course Providers pages are not affected.
 * Palette: blue #0675ed (dark #0558b8), ink #111, muted #546380, border #dfe5ee, white surfaces.
 */

/* Page surface and type */
body.kp-theme-page { background: #fff; }
body.kp-theme-page .site-content { font-family: "Open Sans", Helvetica, Arial, sans-serif; color: #546380; }
body.kp-theme-page .site-content h1,
body.kp-theme-page .site-content h2,
body.kp-theme-page .site-content h3,
body.kp-theme-page .site-content h4,
body.kp-theme-page .site-content .widget-title { font-family: "Open Sans", Helvetica, Arial, sans-serif; color: #111; }

/* The theme's header/footer are replaced, so let its own containers set the page width */
body.kp-theme-page main#kp-main { width: auto; max-width: none; margin: 0; padding: 0; }

/* White bordered cards, 12px corners, soft shadow */
body.kp-theme-page .shadow-box,
body.kp-theme-page .store-listing-item,
body.kp-theme-page .coupon-listing-item,
body.kp-theme-page .coupon-filter .ui.menu {
  background: #fff;
  border: 1px solid #dfe5ee;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(32, 54, 81, .05);
}

/* Links (teal to blue, orange hover to dark blue) */
body.kp-theme-page .entry-content a,
body.kp-theme-page .ui.breadcrumb a,
body.kp-theme-page .site-breadcrumb .ui.breadcrumb a.section,
body.kp-theme-page .store-listing-item .latest-coupon .coupon-title a,
body.kp-theme-page .store-listing-item .coupon-saved,
body.kp-theme-page .coupon-listing-item .coupon-listing-footer ul li a,
body.kp-theme-page .coupon-listing-item .coupon-exclusive strong i,
body.kp-theme-page .cate-az .cate-parent > a,
body.kp-theme-page .coupon-modal .coupon-content .show-detail .show-detail-on,
body.kp-theme-page .primary-color { color: #0675ed; }
body.kp-theme-page .entry-content a:hover,
body.kp-theme-page .ui.breadcrumb a:hover,
body.kp-theme-page .store-listing-item .latest-coupon .coupon-title a:hover,
body.kp-theme-page .single-store-header .add-favorite:hover,
body.kp-theme-page .coupon-listing-item .coupon-listing-footer ul li a:hover,
body.kp-theme-page .cate-az a:hover { color: #0558b8; }

/* Buttons, badges and the GET CODE ribbon (teal/orange to blue). The code area keeps the theme's own hatched background. */
body.kp-theme-page .coupon-button-type .coupon-deal,
body.kp-theme-page .coupon-button-type .coupon-print,
body.kp-theme-page .coupon-button-type .coupon-code .get-code,
body.kp-theme-page .ui.btn,
body.kp-theme-page .ui.btn:hover,
body.kp-theme-page .ui.btn.btn_primary,
body.kp-theme-page .ui.button.btn_primary,
body.kp-theme-page .ui.btn.btn_secondary,
body.kp-theme-page .coupon-filter .ui.menu .item .offer-count,
body.kp-theme-page .coupon-filter .filter-coupons-buttons .store-filter-button .offer-count,
body.kp-theme-page .coupon-filter .filter-coupons-buttons .submit-coupon-button:hover,
body.kp-theme-page input[type="reset"],
body.kp-theme-page input[type="submit"] { background: #0675ed; }
body.kp-theme-page .coupon-button-type .coupon-code .get-code:after { border-left-color: #0675ed; }
body.kp-theme-page .ui.btn { border-radius: 7px; }

/* Revealed code in the popup, and form focus */
body.kp-theme-page .coupon-modal .coupon-content .modal-code .code-text { border-color: #0675ed; }
body.kp-theme-page .no-copy-cmd .coupon-code .ui.action.input:not([class*="left action"]) > input.code-text { border-right-color: #0675ed !important; }
body.kp-theme-page textarea:focus,
body.kp-theme-page input[type="text"]:focus,
body.kp-theme-page input[type="email"]:focus,
body.kp-theme-page input[type="search"]:focus { border-color: #0675ed; outline: 0; }
body.kp-theme-page .store-thumb:hover,
body.kp-theme-page .single-store-header .header-thumb .header-store-thumb a:hover { border-color: #0675ed; }

/* Layout: theme pages use the same 1170px container as the Kube.promo header and footer */
body.kp-theme-page .container { width: min(100% - 40px, 1170px); max-width: none; padding-left: 0; padding-right: 0; }
@media (max-width: 600px) { body.kp-theme-page .container { width: calc(100% - 32px); } }

/* Pages with an empty sidebar use the full width (the theme reserves a right sidebar by default) */
body.kp-theme-page .container-page:not(:has(#secondary > *)) .content-area { width: 100%; float: none; }
body.kp-theme-page .container-page:not(:has(#secondary > *)) #secondary { display: none; }

/* Tighter vertical spacing above the footer (the theme adds 40px + 40px) */
body.kp-theme-page .site-content #content-wrap { padding-top: 32px; padding-bottom: 16px; }
body.kp-theme-page .content-area { padding-bottom: 16px; }

/* Short pages: the footer sits at the bottom of the window instead of leaving a blank area below it */
body.kp-theme-page { display: flex; flex-direction: column; min-height: 100vh; height: auto; }
body.kp-theme-page main#kp-main { flex: 1 0 auto; }

/* Banner pages (About, Terms, Privacy, Affiliate Disclosure): body text at 18px */
/* The theme prints page content directly inside main.site-main (or inside div.post-entry): there is no .entry-content wrapper. */
body.kp-theme-page.kp-banner-page .site-main p,
body.kp-theme-page.kp-banner-page .site-main li,
body.kp-theme-page.kp-banner-page .site-main td { font-size: 18px; line-height: 1.7; }


/* Banner pages: a tighter gap between the banner and the content box (was 40px + 32px = 72px, now 24px). */
body.kp-theme-page.kp-banner-page .kp-about-hero-wrap .kp-hero { margin-bottom: 0; }
body.kp-theme-page.kp-banner-page #content-wrap { padding-top: 24px; }

/* Heading for theme pages that print no title: kept for screen readers and search engines, not shown. */
body.kp-theme-page .kpc-page-title { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* With the WordPress admin bar showing (logged-in editors), the page is shorter by the bar's height.
   The theme also makes <html> exactly one window tall, so with the bar's 32px margin the page scrolled by 32px: let <html> size to its content. */
body.kp-theme-page.admin-bar { min-height: calc(100vh - 32px); }
html:has(body.kp-theme-page.admin-bar) { height: auto; min-height: 0; }
@media (max-width: 782px) { body.kp-theme-page.admin-bar { min-height: calc(100vh - 46px); } }

/* Tap targets: small links and icon buttons get at least 32px of touch area. */
body.kp-theme-page a.add-favorite { display: inline-flex; align-items: center; min-height: 32px; }
body.kp-theme-page a.post-edit-link,
body.kp-theme-page a.add-coupon-favorite { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; }
body.kp-theme-page .coupon-title a.coupon-link { display: inline-block; padding-block: 4px; }
body.kp-theme-page a.category-name { display: inline-block; padding-block: 6px; }
body.kp-theme-page .cat-item > a { display: inline-block; padding-block: 2px; }
body.kp-theme-page p > a:only-child { display: inline-block; padding-block: 4px; }

/* Smallest text: the coupon count badge was 10-11px. (!important because the theme sets it with a longer selector.) */
body.kp-theme-page .coupon-filter .offer-count { font-size: 12px !important; }

/* "More" links in coupon descriptions, and the category filter labels (the checkbox sits inside the label): bigger touch area. */
body.kp-theme-page a.more { display: inline-block; padding-block: 4px; }
body.kp-theme-page .store-cat-filter label { display: block; padding-block: 5px; }
