/*
Theme Name: Esset Support
Theme URI: https://esset.io/
Author: Esset
Description: A lightweight Echo Knowledge Base theme for Esset support.
Version: 2.0.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: esset-support
*/

:root {
  --dark: #0c0e13;
  --elevated: #111318;
  --gold: #bc9558;
  --gold-hover: #cda76d;
  --off-white: #eceae2;
  --paper: #f7f5ef;
  --white: #fff;
  --muted: #8a8c9e;
  --ink-muted: #60616b;
  --line: #dedcd5;
  --line-dark: #272a32;
  --danger-soft: #f8e8e4;
  --max-brand: 960px;
  --max-prose: 520px;
  --max-narrow: 700px;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--dark);
  background: var(--paper);
  font-family: "Public Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a, button { transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease; }
img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.container { width: min(calc(100% - 40px), var(--max-brand)); margin-inline: auto; }
.section { padding: 88px 0; }
.kicker { margin: 0 0 12px; color: var(--gold); font-size: 11px; line-height: 1.2; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.h2-light, .h2-dark { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.05; letter-spacing: -.045em; }
.h2-light { color: var(--off-white); }
.h2-dark { color: var(--dark); }
.btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid transparent; border-radius: 6px; font-size: 13px; font-weight: 700; }
.btn-gold { color: var(--dark); background: var(--gold); }
.btn-gold:hover { color: var(--dark); background: var(--gold-hover); transform: translateY(-1px); }
.btn-ghost { color: var(--off-white); border-color: var(--line-dark); background: transparent; }
.card-dark { color: var(--off-white); background: var(--elevated); border: 1px solid var(--line-dark); border-radius: var(--radius); }
.badge-gold { padding: 4px 7px; color: var(--dark); background: var(--gold); border-radius: 999px; font-size: 10px; font-weight: 800; }

.site-header { position: relative; z-index: 20; color: var(--off-white); background: var(--dark); border-bottom: 1px solid var(--line-dark); }
.header-inner { width: min(calc(100% - 40px), var(--max-brand)); min-height: 70px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.site-brand { display: inline-flex; align-items: center; color: var(--off-white); font-size: 17px; font-weight: 800; letter-spacing: -.025em; }
.site-brand:hover { color: var(--off-white); }
.brand-logo { width: 27px; height: 27px; margin-right: 9px; object-fit: contain; }
.brand-domain { color: var(--gold); }
.brand-context { margin-left: 7px; padding-left: 8px; border-left: 1px solid #373943; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav ul { display: flex; align-items: center; gap: 23px; list-style: none; padding: 0; margin: 0; }
.site-nav a { color: #b8b8c0; font-size: 12px; font-weight: 600; }
.site-nav a:hover { color: var(--off-white); }
.site-nav .contact-link { min-height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; color: var(--dark); background: var(--gold); border-radius: 5px; font-weight: 750; }
.site-nav .contact-link:hover { color: var(--dark); background: var(--gold-hover); }

.help-hero { padding: 74px 20px 76px; color: var(--off-white); background: var(--dark); border-bottom: 1px solid var(--line-dark); }
.hero-inner { width: min(100%, var(--max-brand)); margin: 0 auto; }
.hero-kicker { margin-bottom: 15px; }
.help-hero h1 { max-width: 780px; margin: 0; font-size: 38px; line-height: 1.04; font-weight: 800; letter-spacing: -.05em; }
.hero-copy { max-width: var(--max-prose); margin: 19px 0 31px; color: #a8a8b2; font-size: 16px; }
.support-search { position: relative; width: min(100%, 820px); }
.support-search svg { position: absolute; z-index: 2; left: 20px; top: 50%; width: 20px; transform: translateY(-50%); color: var(--gold); pointer-events: none; }
.support-search input[type="search"] { width: 100%; height: 60px; padding: 0 112px 0 54px; border: 1px solid #343741; border-radius: 7px; outline: 0; color: var(--off-white); background: var(--elevated); box-shadow: 0 18px 55px rgba(0,0,0,.22); }
.support-search input[type="search"]::placeholder { color: #777985; }
.support-search input[type="search"]:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(188,149,88,.13); }
.support-search button { position: absolute; inset: 8px 8px 8px auto; min-width: 88px; padding: 0 14px; border: 0; border-radius: 5px; color: var(--dark); background: var(--gold); font-size: 12px; font-weight: 750; cursor: pointer; }
.support-search button:hover { background: var(--gold-hover); }

.support-main { width: min(calc(100% - 40px), var(--max-brand)); margin: 0 auto; padding: 76px 0 96px; }
.collection-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 50px; margin-bottom: 42px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.collection-heading h2 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -.04em; }
.collection-heading > p { max-width: 360px; margin: 0; color: var(--ink-muted); }
.collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 52px; row-gap: 60px; }
.collection-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 17px; padding: 4px; border-radius: var(--radius); }
.collection-card:hover { transform: translateY(-2px); }
.collection-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--gold); background: rgba(188,149,88,.1); border: 1px solid rgba(188,149,88,.26); border-radius: 7px; }
.collection-icon svg { width: 21px; }
.collection-icon .epkbfa { font-size: 21px; line-height: 1; }
.collection-icon img { width: 23px; height: 23px; object-fit: contain; }
.collection-copy { min-width: 0; display: flex; flex-direction: column; height: 100%; }
.collection-copy strong { font-size: 16px; line-height: 1.3; letter-spacing: -.018em; }
.collection-description { display: -webkit-box; margin-top: 9px; overflow: hidden; color: var(--ink-muted); font-size: 13px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.collection-meta { margin-top: 14px; color: var(--muted); font-size: 12px; font-weight: 600; }
.collection-meta span { margin-left: 4px; color: var(--gold); }
.collection-card:hover strong { color: #89672f; }

.compact-hero { padding: 34px 0 37px; color: var(--off-white); background: var(--dark); border-bottom: 1px solid var(--line-dark); }
.compact-hero .support-search { max-width: 760px; }
.compact-hero .support-search input[type="search"] { height: 52px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 11px; }
.breadcrumbs a:hover { color: var(--gold); }
.collection-page { padding-top: 39px; padding-bottom: 100px; }
.collection-page-header { max-width: 760px; padding: 45px 0 48px; }
.collection-icon-large { width: 46px; height: 46px; margin-bottom: 22px; }
.collection-page-header h1, .search-page h1 { max-width: 850px; margin: 0; font-size: clamp(34px, 5vw, 52px); line-height: 1.05; letter-spacing: -.05em; }
.collection-page-header > p:not(.kicker) { max-width: 670px; margin: 17px 0 12px; color: var(--ink-muted); font-size: 16px; }
.collection-count { color: var(--muted); font-size: 12px; }
.subcollections { max-width: 860px; margin-bottom: 52px; }
.subcollections > h2 { margin: 0 0 15px; font-size: 20px; letter-spacing: -.025em; }
.subcollection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.subcollection-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: start; gap: 14px; padding: 18px; background: var(--off-white); border: 1px solid var(--line); border-radius: 8px; }
.subcollection-card > span:nth-child(2) { display: grid; gap: 5px; }
.subcollection-card strong { font-size: 14px; line-height: 1.3; }
.subcollection-card small { display: -webkit-box; overflow: hidden; color: var(--ink-muted); font-size: 11px; font-style: normal; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.subcollection-card em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 600; }
.subcollection-card:hover { border-color: rgba(188,149,88,.65); transform: translateY(-1px); }
.subcollection-card:hover strong { color: #89672f; }
.article-list { max-width: 860px; }
.article-list > h2 { margin: 0 0 13px; padding-bottom: 18px; border-bottom: 1px solid var(--line); font-size: 20px; letter-spacing: -.025em; }
.article-row { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 22px 4px; border-bottom: 1px solid var(--line); }
.article-row > span:first-child { display: grid; gap: 4px; }
.article-row strong { font-size: 14px; line-height: 1.35; }
.article-row > span > span { display: -webkit-box; overflow: hidden; color: var(--ink-muted); font-size: 12px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.row-arrow { color: var(--gold); font-size: 18px; }
.article-row:hover strong { color: #89672f; }
.article-row:hover .row-arrow { transform: translateX(3px); }

.article-layout { display: grid; grid-template-columns: minmax(0, var(--max-narrow)) 210px; justify-content: space-between; gap: 80px; padding-top: 38px; padding-bottom: 100px; }
.support-article { min-width: 0; }
.article-header { padding: 45px 0 34px; border-bottom: 1px solid var(--line); }
.article-header h1 { margin: 0; font-size: clamp(34px, 5vw, 50px); line-height: 1.05; letter-spacing: -.05em; }
.article-header > p:not(.kicker) { margin: 17px 0 11px; color: var(--ink-muted); font-size: 16px; }
.article-header > span { color: var(--muted); font-size: 11px; }
.article-content { padding: 33px 0 55px; color: #313238; font-size: 15px; }
.article-content > * { max-width: var(--max-narrow); }
.article-content h2, .article-content h3 { scroll-margin-top: 25px; color: var(--dark); line-height: 1.2; letter-spacing: -.03em; }
.article-content h2 { margin: 2.2em 0 .65em; font-size: 25px; }
.article-content h3 { margin: 1.9em 0 .55em; font-size: 19px; }
.article-content p { margin: 0 0 1.3em; }
.article-content a { color: #8b672f; text-decoration: underline; text-underline-offset: 3px; }
.article-content ol, .article-content ul { padding-left: 23px; }
.article-content li { margin-bottom: 8px; }
.article-content blockquote { margin: 28px 0; padding: 17px 20px; color: #6b4e20; background: #f3eadb; border-left: 3px solid var(--gold); border-radius: 0 6px 6px 0; }
.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content pre { overflow: auto; padding: 20px; color: var(--off-white); background: var(--elevated); border-radius: 7px; }
.article-content img { margin: 16px 0; border: 1px solid var(--line); border-radius: 7px; }
.article-toc { position: sticky; top: 28px; align-self: start; margin-top: 92px; padding-left: 18px; border-left: 1px solid var(--line); }
.article-toc > strong { display: block; margin-bottom: 12px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.article-toc nav { display: grid; gap: 10px; }
.article-toc a { color: var(--ink-muted); font-size: 11px; line-height: 1.35; }
.article-toc a:hover { color: #89672f; }
.article-toc .toc-subitem { padding-left: 10px; }
.article-feedback { margin-top: 8px; padding: 38px 24px 30px; text-align: center; background: #ececec; border-radius: 16px; }
.article-feedback h2 { margin: 0; color: #5d5e63; font-size: 20px; font-weight: 400; letter-spacing: -.02em; }
.feedback-options { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 21px; }
.feedback-options button { width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.feedback-options button span { font-size: 36px; line-height: 1; filter: saturate(.9); transition: transform .16s ease; }
.feedback-options button:hover:not(:disabled) { background: rgba(255,255,255,.7); }
.feedback-options button:hover:not(:disabled) span { transform: translateY(-2px) scale(1.08); }
.feedback-options button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.feedback-options button.is-selected { background: rgba(188,149,88,.18); box-shadow: 0 0 0 2px var(--gold); }
.feedback-options button:disabled { cursor: default; opacity: .55; }
.feedback-options button.is-selected:disabled { opacity: 1; }
.feedback-message { min-height: 18px; margin: 12px 0 0; color: var(--ink-muted); font-size: 11px; }

.search-page { min-height: 55vh; padding-top: 70px; padding-bottom: 100px; }
.search-page h1 { margin-bottom: 44px; }
.empty-state { padding: 35px; background: var(--off-white); border: 1px solid var(--line); border-radius: var(--radius); }
.empty-state h2 { margin-top: 0; }
.empty-state .btn { margin-top: 10px; }

.content-wrap { width: min(calc(100% - 40px), var(--max-narrow)); min-height: 55vh; margin: 65px auto 95px; }
.content-wrap h1 { font-size: clamp(34px, 4vw, 48px); line-height: 1.08; letter-spacing: -.045em; }

.site-footer { padding: 68px 20px 25px; color: #a9aab2; background: var(--dark); border-top: 1px solid var(--line-dark); }
.footer-inner { width: min(100%, var(--max-brand)); margin: 0 auto; display: grid; grid-template-columns: minmax(250px, 1fr) 1.4fr; gap: 100px; }
.footer-brand p { max-width: 350px; margin: 18px 0 14px; color: var(--muted); font-size: 12px; }
.footer-logo { width: max-content; }
.footer-email { color: var(--gold); font-size: 12px; }
.footer-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.footer-columns nav { display: flex; flex-direction: column; align-items: flex-start; }
.footer-columns strong { margin-bottom: 5px; color: var(--off-white); font-size: 11px; }
.footer-columns ul { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin: 5px 0 0; padding: 0; list-style: none; }
.footer-columns a { color: var(--muted); font-size: 11px; }
.footer-columns a:hover { color: var(--off-white); }
.footer-bottom { width: min(100%, var(--max-brand)); margin: 52px auto 0; padding-top: 22px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line-dark); color: #62646e; font-size: 10px; }

/* Prevent Echo's template UI from leaking into theme-native views. */
.single-epkb_post_type_1 .epkb-doc-search-container,
.tax-epkb_post_type_1_category .epkb-doc-search-container { display: none !important; }

@media (max-width: 900px) {
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, var(--max-narrow)); justify-content: center; }
  .article-toc { display: none; }
  .footer-inner { gap: 55px; }
}

@media (max-width: 680px) {
  .container, .header-inner, .support-main { width: min(calc(100% - 28px), var(--max-brand)); }
  .header-inner { min-height: 64px; }
  .site-nav ul { display: none; }
  .site-nav .contact-link { min-height: 33px; padding: 0 10px; }
  .brand-context { display: none; }
  .help-hero { padding: 57px 14px 58px; }
  .hero-copy { font-size: 14px; }
  .support-search input[type="search"] { height: 56px; padding-right: 56px; }
  .support-search button { min-width: 40px; width: 40px; overflow: hidden; color: transparent; }
  .support-search button::after { content: "→"; color: var(--dark); position: absolute; inset: 0; display: grid; place-items: center; }
  .support-main { padding: 58px 0 75px; }
  .collection-heading { display: block; }
  .collection-heading > p { margin-top: 14px; }
  .collection-grid { grid-template-columns: 1fr; row-gap: 34px; }
  .subcollection-grid { grid-template-columns: 1fr; }
  .compact-hero { padding: 25px 0; }
  .collection-page-header { padding: 36px 0; }
  .article-layout { width: min(calc(100% - 28px), var(--max-brand)); padding-top: 28px; }
  .article-header { padding-top: 36px; }
  .article-feedback { padding-inline: 18px; }
  .footer-inner { grid-template-columns: 1fr; gap: 45px; }
  .footer-columns { gap: 25px; }
  .footer-bottom { flex-direction: column; }
}
