/* CommentGPT — knowledge-base (support) styles.
   Self-contained, replacing the ~2.2MB Freshdesk template (theme.css + vendor.js + fonts).
   Brand: blue (#0c7abf), matching the landing; type: Inter (matching the landing/upgrade flow). */

:root {
  --brand: #0c7abf;
  --brand-dark: #0a5e94;
  --brand-tint: #eaf4fb;
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --page: #f7fafc;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --focus: 0 0 0 3px rgba(12, 122, 191, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--body);
  background: var(--page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 820px;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.25;
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Header ---- */
.site-header {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
}

.brand .brand-sub {
  color: var(--muted);
  font-weight: 500;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  color: var(--body);
  font-weight: 500;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--brand);
  text-decoration: none;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-outline {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ---- Hero + search (index) ---- */
.hero {
  text-align: center;
  padding: 72px 0 60px;
  background: linear-gradient(180deg, var(--brand-tint), var(--page));
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero p {
  max-width: 600px;
  margin: 14px auto 0;
  font-size: 1.1rem;
  color: var(--muted);
}

.search {
  position: relative;
  max-width: 620px;
  margin: 30px auto 0;
  text-align: left;
}

.search input {
  width: 100%;
  height: 56px;
  padding: 0 20px 0 52px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus);
}

.search .search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--muted);
  pointer-events: none;
}

.search-results {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 10;
}

.search-results.show {
  display: block;
}

.search-results a {
  display: block;
  padding: 12px 20px;
  color: var(--ink);
  border-top: 1px solid var(--line);
}

.search-results a:first-child {
  border-top: none;
}

.search-results a:hover,
.search-results a.active {
  background: var(--brand-tint);
  text-decoration: none;
}

.search-results .no-results {
  padding: 14px 20px;
  color: var(--muted);
}

/* ---- Section / cards ---- */
.section {
  padding: 56px 0;
}

.section-head {
  margin: 0 0 28px;
}

.section-head h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

a.card:hover {
  text-decoration: none;
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card .card-icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-tint);
  color: var(--brand);
}

.card h3 {
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  padding: 22px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.breadcrumb li::after {
  content: "/";
  margin-left: 8px;
  color: var(--line);
}

.breadcrumb li:last-child::after {
  content: none;
}

.breadcrumb li:last-child {
  color: var(--body);
}

/* ---- Folder / article lists ---- */
.list-page {
  padding: 20px 0 64px;
}

.list-page > h1 {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 18px 0 6px;
}

.list-page > .lead {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 1.05rem;
}

.folder-block {
  margin-bottom: 34px;
}

.folder-block h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.article-list li + li {
  border-top: 1px solid var(--line);
}

.article-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  color: var(--ink);
  font-weight: 500;
}

.article-list a:hover {
  background: var(--brand-tint);
  text-decoration: none;
  color: var(--brand);
}

.article-list a::after {
  content: "›";
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
}

/* ---- Article ---- */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 44px;
  padding: 20px 0 72px;
  align-items: start;
}

.article h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 16px 0 24px;
}

.article-body h1,
.article-body h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 32px 0 12px;
}

.article-body h3 {
  font-size: 1.12rem;
  font-weight: 700;
  margin: 26px 0 10px;
}

.article-body p {
  margin: 0 0 16px;
  font-size: 1.02rem;
}

.article-body a {
  font-weight: 500;
}

.article-body ul,
.article-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.article-body li {
  margin: 6px 0;
}

.article-body img {
  display: block;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.article-sidebar {
  position: sticky;
  top: 88px;
}

.article-sidebar .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.article-sidebar h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 12px;
}

.article-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-sidebar li {
  margin: 0 0 10px;
}

.article-sidebar li:last-child {
  margin-bottom: 0;
}

.article-sidebar a {
  font-weight: 500;
}

.article-sidebar a.current {
  color: var(--body);
  font-weight: 700;
}

.print-link {
  margin-top: 18px;
  font-size: 0.9rem;
}

/* ---- Ticket form ---- */
.form-page {
  padding: 20px 0 72px;
}

.form-page h1 {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 18px 0 6px;
}

.form-page .lead {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 1.05rem;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  max-width: 680px;
}

.field {
  margin-bottom: 20px;
}

.field:last-of-type {
  margin-bottom: 24px;
}

.field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.field .req {
  color: var(--brand);
}

.control {
  width: 100%;
  padding: 0 16px;
  height: 50px;
  font: inherit;
  font-size: 1.02rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea.control {
  height: auto;
  min-height: 160px;
  padding: 12px 16px;
  resize: vertical;
}

.control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus);
}

.form-status {
  display: none;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.form-status.show {
  display: block;
}

.form-status.success {
  color: #14532d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.form-status.error {
  color: #7f1d1d;
  background: #fef2f2;
  border-color: #fecaca;
}

/* ---- Footer ---- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.site-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--brand);
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .article-sidebar {
    position: static;
    order: -1;
    margin-bottom: 8px;
  }
}

@media (max-width: 640px) {
  .site-nav {
    gap: 14px;
  }

  .site-nav .nav-text {
    display: none;
  }

  .brand .brand-sub {
    display: none;
  }

  .hero {
    padding: 52px 0 44px;
  }

  .section {
    padding: 40px 0;
  }

  .form-card {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  a.card:hover {
    transform: none;
  }

  .btn:active {
    transform: none;
  }
}
