/*
=========================================================
KOB Tech Tools
File: ktt-theme.css (KTT Theme plugin)
Version: 1.2.1
Last Updated: 2026-11-16

Changelog:
- 1.2.1 (2026-11-16): Sticky header 1.1.0: the header shrinks with the
  first 40px of scrolling instead of snapping (no jump from the top).
- 1.2.0 (2026-11-06): Sticky header (logo, menu, Dark mode toggle, phone
  menu button stay at the top while scrolling; compact once scrolled).
- 1.1.3 (2026-10-29): Initial version.

Purpose:
- Role tokens (light values = today's colours) for new pages and tools.
- Dark mode for the shared styles. Every dark rule starts with
  html[data-ktt-theme="dark"], so it out-ranks the light rule it overrides
  wherever it loads; light mode is unchanged.
- Sources: Global Theme CSS #24 (rules 10 read from #24 1.1.7), Tool Page
  Framework CSS #101, Account Billing Styles #133, Theme toggle styles,
  Sticky header (both themes).
=========================================================
*/

:root {
  /* Role tokens (1.2.0): what a colour is for. Light values are today's colours.
     Page blocks, shared snippets and tools use these, with today's colour as
     the fallback, e.g. var(--ktt-surface, #FFFFFF). */
  --ktt-page: #FAFAFA;
  --ktt-surface: #FFFFFF;
  --ktt-surface-2: #FAFAFA;
  --ktt-text: #171717;
  --ktt-text-muted: #404040;
  --ktt-text-subtle: #595959;
  --ktt-line: #D4D4D4;
  --ktt-line-soft: #E5E5E5;
  --ktt-link: #D97706;
  --ktt-link-hover: #F59E0B;
  --ktt-accent-text: #8A4B00;
  --ktt-focus: #1659A0;
  --ktt-focus-halo: #FFFFFF;
  --ktt-field: #FFFFFF;
  --ktt-field-text: #171717;
  --ktt-field-line: #D4D4D4;
  --ktt-shadow: rgba(0, 0, 0, 0.08);
}

/* ===== #24 Global Theme CSS: rules that use fixed colours, in dark ===== */

:where(html[data-ktt-theme="dark"]) body {
  background: var(--ktt-page);
  color: var(--ktt-text);
}

:where(html[data-ktt-theme="dark"]) body a {
  color: var(--ktt-link);
}

:where(html[data-ktt-theme="dark"]) body a:hover,
:where(html[data-ktt-theme="dark"]) body a:focus {
  color: var(--ktt-link-hover);
}

:where(html[data-ktt-theme="dark"]) input[type="text"],
:where(html[data-ktt-theme="dark"]) input[type="email"],
:where(html[data-ktt-theme="dark"]) input[type="url"],
:where(html[data-ktt-theme="dark"]) input[type="password"],
:where(html[data-ktt-theme="dark"]) input[type="search"],
:where(html[data-ktt-theme="dark"]) input[type="number"],
:where(html[data-ktt-theme="dark"]) input[type="tel"],
:where(html[data-ktt-theme="dark"]) input[type="date"],
:where(html[data-ktt-theme="dark"]) input[type="time"],
:where(html[data-ktt-theme="dark"]) textarea,
:where(html[data-ktt-theme="dark"]) select {
  background: var(--ktt-field);
  color: var(--ktt-field-text);
  border-color: var(--ktt-field-line);
}

:where(html[data-ktt-theme="dark"]) .ktt-home-section-head .ktt-home-eyebrow,
:where(html[data-ktt-theme="dark"]) .ktt-home-pricing .ktt-home-eyebrow,
:where(html[data-ktt-theme="dark"]) .ktt-tools-filter-copy .ktt-tools-eyebrow,
:where(html[data-ktt-theme="dark"]) .ktt-about-section-head .ktt-about-eyebrow,
:where(html[data-ktt-theme="dark"]) .ktt-about-founder-copy .ktt-about-eyebrow,
:where(html[data-ktt-theme="dark"]) .ktt-about-ecosystem-grid .ktt-about-eyebrow,
:where(html[data-ktt-theme="dark"]) .ktt-contact-sidebar .ktt-contact-eyebrow,
:where(html[data-ktt-theme="dark"]) .ktt-contact-form-head .ktt-contact-eyebrow,
:where(html[data-ktt-theme="dark"]) .ktt-contact-privacy-card .ktt-contact-eyebrow,
:where(html[data-ktt-theme="dark"]) .ktt-signin-card-kicker,
:where(html[data-ktt-theme="dark"]) .ktt-signin-info-card .ktt-signin-eyebrow,
:where(html[data-ktt-theme="dark"]) .ktt-privacy-block .ktt-privacy-eyebrow,
:where(html[data-ktt-theme="dark"]) .ktt-terms-block .ktt-terms-eyebrow,
:where(html[data-ktt-theme="dark"]) .ktt-security-section-light .ktt-security-eyebrow,
:where(html[data-ktt-theme="dark"]) .ktt-security-section-white .ktt-security-eyebrow,
:where(html[data-ktt-theme="dark"]) .ktt-about-value-number,
:where(html[data-ktt-theme="dark"]) .ktt-about-founder-role,
:where(html[data-ktt-theme="dark"]) .ktt-about-details-label,
:where(html[data-ktt-theme="dark"]) .ktt-security-feature-number,
:where(html[data-ktt-theme="dark"]) .ktt-security-provider-label,
:where(html[data-ktt-theme="dark"]) .ktt-security-checklist > div > span,
:where(html[data-ktt-theme="dark"]) .ktt-pdf-kicker,
:where(html[data-ktt-theme="dark"]) .ktt-pdf-accepted-types,
:where(html[data-ktt-theme="dark"]) .ktt-pdf-price-card:not(.is-featured) .ktt-pdf-price-label {
  color: var(--ktt-accent-text) !important;
}

:where(html[data-ktt-theme="dark"]) .ktt-home-text-link,
:where(html[data-ktt-theme="dark"]) .ktt-home-text-link:hover,
:where(html[data-ktt-theme="dark"]) .ktt-home-text-link:focus,
:where(html[data-ktt-theme="dark"]) .ktt-signin-card a,
:where(html[data-ktt-theme="dark"]) .ktt-signin-card a:hover,
:where(html[data-ktt-theme="dark"]) .ktt-signin-card a:focus,
:where(html[data-ktt-theme="dark"]) .ktt-signin-info-card a,
:where(html[data-ktt-theme="dark"]) .ktt-signin-info-card a:hover,
:where(html[data-ktt-theme="dark"]) .ktt-signin-info-card a:focus,
:where(html[data-ktt-theme="dark"]) .ktt-privacy-content a:not([class*="button"]),
:where(html[data-ktt-theme="dark"]) .ktt-terms-content a:not([class*="button"]),
:where(html[data-ktt-theme="dark"]) .ktt-security-section-white a:not([class*="button"]),
:where(html[data-ktt-theme="dark"]) .ktt-security-section-light a:not([class*="button"]) {
  color: var(--ktt-accent-text) !important;
}

:where(html[data-ktt-theme="dark"]) .ktt-signin-legal,
:where(html[data-ktt-theme="dark"]) .ktt-tools-loading,
:where(html[data-ktt-theme="dark"]) .ktt-home-card-status:not(.ktt-home-card-status-live),
:where(html[data-ktt-theme="dark"]) .ktt-home-coming-chip,
:where(html[data-ktt-theme="dark"]) .ktt-home-local-chip,
:where(html[data-ktt-theme="dark"]) .ktt-contact-policy-links span,
:where(html[data-ktt-theme="dark"]) .ktt-pdf-pricing-footnote {
  color: var(--ktt-text-subtle) !important;
}

:where(html[data-ktt-theme="dark"]) .ktt-pdf-main-advanced .ktt-pdf-paid-tool.is-paid-locked > strong,
:where(html[data-ktt-theme="dark"]) .ktt-pdf-main-advanced .ktt-pdf-paid-tool.is-paid-locked > p,
:where(html[data-ktt-theme="dark"]) .ktt-pdf-main-advanced .ktt-pdf-paid-tool.is-paid-locked .ktt-pdf-field > span {
  color: var(--ktt-text-subtle) !important;
}

:where(html[data-ktt-theme="dark"]) #main :is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline-color: var(--ktt-focus) !important;
  box-shadow: 0 0 0 6px var(--ktt-focus-halo) !important;
}

:where(html[data-ktt-theme="dark"]) #main .ktt-home-text-link,
:where(html[data-ktt-theme="dark"]) #main .ktt-pdf-accepted-types {
  color: var(--ktt-accent-text) !important;
}

/* ===== #24 Global Theme CSS: dark tokens, GeneratePress names, toggle ===== */

/* =========================================================
   1.2.0 DARK MODE
   Applies only when the Theme start snippet sets
   html[data-ktt-theme="dark"]. Light mode is unchanged.
   Contrast on the dark page (#0F0F0F): text ~17:1, links ~11:1,
   muted text ~8:1, focus ring ~10:1 (WCAG AA: 4.5:1 text, 3:1 UI).
   ========================================================= */

html[data-ktt-theme="dark"] {
  color-scheme: dark;

  --ktt-page: #0F0F0F;
  --ktt-surface: #171717;
  --ktt-surface-2: #1F1F1F;
  --ktt-text: #EDEDED;
  --ktt-text-muted: #C7C7C7;
  --ktt-text-subtle: #A8A8A8;
  --ktt-line: #3A3A3A;
  --ktt-line-soft: #2A2A2A;
  --ktt-link: #FBBF24;
  --ktt-link-hover: #FCD34D;
  --ktt-accent-text: #FBBF24;
  --ktt-focus: #93C5FD;
  --ktt-focus-halo: #0F0F0F;
  --ktt-field: #121212;
  --ktt-field-text: #EDEDED;
  --ktt-field-line: #4A4A4A;
  --ktt-shadow: rgba(0, 0, 0, 0.5);

  /* GeneratePress's Customizer CSS uses these names, but this site never
     defines them (its palette is --global-color-1..8, unused). Defining them
     in dark only lets GeneratePress's own rules (content boxes, sub-menus,
     search, form fields) follow dark mode while light stays as it is. */
  --contrast: var(--ktt-text);
  --contrast-2: var(--ktt-text-muted);
  --contrast-3: var(--ktt-text-subtle);
  --base: var(--ktt-line);
  --base-2: var(--ktt-page);
  --base-3: var(--ktt-surface);
  --accent: var(--ktt-link);
}

/* GeneratePress paints the site container (#page) with --base-3. In light that
   is undefined, so the container is transparent; keep it transparent in dark
   too, or it shows as a lighter band where it peeks out (e.g. 40px under tool
   pages). */
html[data-ktt-theme="dark"] .site.grid-container.container {
  background-color: transparent;
}

html[data-ktt-theme="dark"] ::placeholder {
  color: #8C8C8C;
  opacity: 1;
}

html[data-ktt-theme="dark"] .skip-link:focus {
  color: #EDEDED !important;
  background: #171717 !important;
  outline-color: var(--ktt-focus);
}


/* =========================================================
   1.2.0 THEME TOGGLE
   Built by the Theme toggle snippet once dark mode is live (or in the
   ?ktt-theme preview). Desktop: the last item of the main menu. Phones:
   next to the menu button. The header is dark in both themes.
   ========================================================= */

.ktt-theme-toggle {
  display: inline-flex;

  width: 38px;
  height: 38px;

  flex: 0 0 38px;

  align-items: center;
  justify-content: center;

  margin: 0;
  padding: 0;

  border: 1px solid #3A3A3A;
  border-radius: 999px;

  background: transparent;
  color: var(--ktt-white);

  cursor: pointer;
  line-height: 1;
}

.ktt-theme-toggle:hover,
.ktt-theme-toggle:focus {
  border-color: var(--ktt-yellow);
  background: transparent;
  color: var(--ktt-yellow);
}

.ktt-theme-toggle:focus-visible {
  outline: 2px solid var(--ktt-yellow);
  outline-offset: 2px;
}

.ktt-theme-toggle svg {
  display: block;

  width: 18px;
  height: 18px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Desktop: a menu item at the end of the main menu. */
.main-navigation .main-nav ul li.ktt-theme-item {
  display: flex;

  align-items: center;

  padding-left: 10px;
}

/* Phones: the button sits beside the menu button; the desktop item is hidden
   inside the opened phone menu. */
.mobile-menu-control-wrapper .ktt-theme-toggle {
  margin-right: 8px;
}

@media (max-width: 768px) {

  .main-navigation .main-nav ul li.ktt-theme-item {
    display: none;
  }

  .mobile-menu-control-wrapper {
    align-items: center;
  }

}

/* END 1.2.0 */

/* ===== #101 Tool Page Framework CSS ===== */

/* =========================================================
   1.6.0 DARK MODE
   Only under html[data-ktt-theme="dark"] (set by the Theme start snippet).
   Tool content (PDF pages, images, QR codes) is styled by each tool and
   keeps its own colours.
   ========================================================= */

html[data-ktt-theme="dark"] .ktt-tool-page {
  background: var(--ktt-page, #0F0F0F);
  color: var(--ktt-text, #EDEDED);
}

html[data-ktt-theme="dark"] .ktt-tool-main {
  background:
    radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.06), transparent 30%),
    var(--ktt-page, #0F0F0F);
  border-top-color: rgba(255, 255, 255, 0.06);
}

html[data-ktt-theme="dark"] .ktt-tool-panel,
html[data-ktt-theme="dark"] .ktt-tool-sidebar-card {
  border-color: var(--ktt-line-soft, #2A2A2A);
  background: var(--ktt-surface, #171717);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

html[data-ktt-theme="dark"] .ktt-tool-panel-header {
  border-bottom-color: var(--ktt-line-soft, #2A2A2A);
}

html[data-ktt-theme="dark"] .ktt-tool-panel-header h2,
html[data-ktt-theme="dark"] .ktt-tool-access-gate strong,
html[data-ktt-theme="dark"] .ktt-tool-workspace-placeholder strong,
html[data-ktt-theme="dark"] .ktt-tool-capability-name {
  color: var(--ktt-text, #EDEDED);
}

html[data-ktt-theme="dark"] .ktt-tool-panel-header p,
html[data-ktt-theme="dark"] .ktt-tool-access-gate p,
html[data-ktt-theme="dark"] .ktt-tool-workspace-placeholder span,
html[data-ktt-theme="dark"] .ktt-tool-capability-note {
  color: var(--ktt-text-subtle, #A8A8A8);
}

html[data-ktt-theme="dark"] .ktt-tool-access-gate {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}

html[data-ktt-theme="dark"] .ktt-tool-button-secondary {
  border-color: var(--ktt-line, #3A3A3A);
  background: var(--ktt-surface-2, #1F1F1F);
  color: var(--ktt-text, #EDEDED) !important;
}

html[data-ktt-theme="dark"] .ktt-tool-button-secondary:hover,
html[data-ktt-theme="dark"] .ktt-tool-button-secondary:focus {
  border-color: var(--ktt-yellow, #FBBF24);
  background: var(--ktt-surface-2, #1F1F1F);
  color: var(--ktt-yellow, #FBBF24) !important;
}

html[data-ktt-theme="dark"] .ktt-tool-workspace-placeholder {
  border-color: var(--ktt-line, #3A3A3A);
}

html[data-ktt-theme="dark"] .ktt-tool-capabilities {
  border-color: var(--ktt-line-soft, #2A2A2A);
}

html[data-ktt-theme="dark"] .ktt-tool-capability-head {
  background: var(--ktt-surface-2, #1F1F1F);
  color: var(--ktt-text-subtle, #A8A8A8);
}

html[data-ktt-theme="dark"] .ktt-tool-capability-row {
  border-top-color: var(--ktt-line-soft, #2A2A2A);
  color: var(--ktt-text-muted, #C7C7C7);
}

/* END 1.6.0 */

/* ===== #133 Account Billing Styles ===== */

/* 2.1.0 DARK MODE: only under html[data-ktt-theme="dark"]; role tokens from Global Theme CSS 1.2.0. */
html[data-ktt-theme="dark"] .ktt-account-billing-card{border-color:var(--ktt-line-soft,#2A2A2A)}
html[data-ktt-theme="dark"] .ktt-billing-sub{border-color:var(--ktt-line-soft,#2A2A2A);background:var(--ktt-surface-2,#1F1F1F)}
html[data-ktt-theme="dark"] .ktt-billing-row{color:var(--ktt-text-subtle,#A8A8A8)}
html[data-ktt-theme="dark"] .ktt-billing-row strong{color:var(--ktt-text,#EDEDED)}
html[data-ktt-theme="dark"] .ktt-billing-pill{background:rgba(251,191,36,.14);color:#FCD34D}
html[data-ktt-theme="dark"] .ktt-billing-note{color:var(--ktt-text-subtle,#A8A8A8)}
html[data-ktt-theme="dark"] .ktt-billing-cancel{color:#FBBF24}
html[data-ktt-theme="dark"] #ktt-billing-message{color:#FCA5A5}
html[data-ktt-theme="dark"] #ktt-account-app .ktt-account-primary-button:focus-visible{outline-color:var(--ktt-focus,#93C5FD)}

/* ===== Sticky header (both themes) ===== */

/* =========================================================
   KOB Tech Tools
   File: sticky-header-1.1.0.css (KTT Theme plugin, appended to ktt-theme.css)
   Version: 1.1.0
   Last Updated: 2026-11-16
   Author: Kevin (with Claude)

   Changelog:
   - 1.1.0 (2026-11-16): Smooth scroll from the top. The header shrinks with
     the first 40px of scrolling (.ktt-header-shrinking, sized by
     --ktt-header-shrink) instead of snapping from 100px to 60px in one
     frame, which made the page look like it jumped. The header is never
     used as a scroll anchor.
   - 1.0.0 (2026-11-06): Initial version. The header (logo, menu, Dark mode
     toggle, phone menu button) stays at the top while the page scrolls.

   Purpose:
   - GeneratePress header (#masthead) is position: sticky in both themes.
   - As the page scrolls from the top, sticky-header.js shrinks the header
     with the scroll: .ktt-header-shrinking and --ktt-header-shrink (0 to 1)
     over the first ~40px, then .ktt-header-compact: less padding, a smaller
     logo and shorter menu rows (about 60px instead of 100px). It also gives
     the header a margin-bottom equal to the height it lost, so the page
     below never jumps.
   - sticky-header.js sets --ktt-sticky-offset on <html> (admin bar + compact
     header height). In-page links such as #pricing stop below the header
     (scroll-padding-top), and KOB PDF's sticky action column sits below it.
   - Signed-in admins: the header sticks below the WordPress admin bar (32px,
     46px at 782px and below; at 600px and below the admin bar scrolls away,
     so the header goes to the very top).
   - Colours: the header is dark (#171717) in both themes, so only a 1px line
     is added under the compact header; light and dark read the same.
   ========================================================= */

/* ----- The header sticks (both themes, every page) ----- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000; /* above page content and tool panels; below the admin bar (99999) and the KOB PDF preview modal */
  overflow-anchor: none; /* its size changes while scrolling: never a scroll anchor */
}

/* Signed-in admins: stay below the fixed WordPress admin bar. */
body.admin-bar .site-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

/* At 600px and below WordPress makes the admin bar scroll with the page. */
@media screen and (max-width: 600px) {
  body.admin-bar .site-header {
    top: 0;
  }
}

/* In-page links (#pricing, #kob-pdf-workspace, skip link) land below the
   header. sticky-header.js keeps --ktt-sticky-offset exact; 60px is the
   compact header without JS. */
html {
  scroll-padding-top: calc(var(--ktt-sticky-offset, 60px) + 12px);
}

/* ----- Compact header after scrolling (class set by sticky-header.js) ----- */

.site-header.ktt-header-compact {
  box-shadow: 0 1px 0 #2A2A2A;
}

.site-header.ktt-header-compact .inside-header {
  padding-top: 8px;
  padding-bottom: 8px;
}

.site-header.ktt-header-compact .site-logo .header-image {
  width: auto;
  max-height: 40px;
}

/* Phones: the Dark mode toggle and menu button row. The opened phone menu's
   rows keep their full height (easy to tap). */
.site-header.ktt-header-compact .menu-toggle {
  line-height: 44px;
}

@media (min-width: 769px) {
  .site-header.ktt-header-compact .main-navigation .main-nav > ul > li > a {
    line-height: 44px;
  }
}

/* ----- Part way, while scrolling the first ~40px (sticky-header.js) -----
   --ktt-header-shrink goes from 0 (full) to 1 (compact). Each size runs from
   the GeneratePress value (padding 20px, logo 56.625px, menu rows 60px) to the
   compact value above, in a straight line, so the header loses exactly as
   much height as the page has scrolled. If those GeneratePress values change,
   change them here too. */

.site-header.ktt-header-shrinking .inside-header {
  padding-top: calc(20px - 12px * var(--ktt-header-shrink, 0));
  padding-bottom: calc(20px - 12px * var(--ktt-header-shrink, 0));
}

.site-header.ktt-header-shrinking .site-logo .header-image {
  width: auto;
  max-height: calc(56.625px - 16.625px * var(--ktt-header-shrink, 0));
}

.site-header.ktt-header-shrinking .menu-toggle {
  line-height: calc(60px - 16px * var(--ktt-header-shrink, 0));
}

@media (min-width: 769px) {
  .site-header.ktt-header-shrinking .main-navigation .main-nav > ul > li > a {
    line-height: calc(60px - 16px * var(--ktt-header-shrink, 0));
  }
}

/* The opened phone menu scrolls inside the screen (e.g. a phone held
   sideways) instead of running past the bottom of the pinned header. */
@media (max-width: 768px) {
  .site-header .main-navigation.toggled .main-nav > ul {
    max-height: calc(100vh - var(--ktt-sticky-offset, 60px));
    max-height: calc(100dvh - var(--ktt-sticky-offset, 60px));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* ----- KOB PDF: the sticky action column sits below the header ----- */

@media (min-width: 1280px) {
  html .ktt-kob-pdf .ktt-pdf-actions {
    top: calc(var(--ktt-sticky-offset, 60px) + 16px);
    max-height: calc(100vh - var(--ktt-sticky-offset, 60px) - 32px);
  }
}

/* ----- Print: the header prints once, at the top ----- */

@media print {
  .site-header {
    position: static;
    box-shadow: none;
  }
}
