/* ==========================================================================
   Tera Help Center — brand layer
   Matches the Tera web app (teracloud-web-apps) design tokens.
   Source of truth: apps/main-portal/src/styles.css

   Deploy: append this to the Copenhagen theme's style.css (or paste into
   Guide > Customize design > Edit code > style.css, at the end). It overrides
   Copenhagen's defaults; it does not replace its layout.
   ========================================================================== */

:root {
  /* Brand / accent */
  --tera-accent: #2fb5b5;
  --tera-accent-hover: #1e7a7a;
  --tera-accent-muted: rgba(47, 181, 181, 0.10);
  --tera-on-accent: #ffffff;
  --tera-focus-ring: rgba(47, 181, 181, 0.24);

  /* Surfaces */
  --tera-page: #fbfcfd;
  --tera-card: #ffffff;
  --tera-elevated: #f3f7f8;
  --tera-rail: #e3e9ef;

  /* Text */
  --tera-heading: #14293b;
  --tera-body: #42596d;
  --tera-label: #6d8295;
  --tera-muted: #8ca0b2;

  /* Borders */
  --tera-edge: #d6e0e7;
  --tera-edge-subtle: #e9eef2;
  --tera-edge-strong: #c3d1dc;

  /* Status */
  --tera-success: #1f9d84;
  --tera-warning: #b9852c;
  --tera-danger: #c05040;
  --tera-info: #3a6f91;

  /* Radius */
  --tera-radius-control: 6px;
  --tera-radius-panel: 8px;
  --tera-radius-overlay: 12px;
  --tera-radius-pill: 9999px;

  /* Shadow */
  --tera-shadow-card: 0 1px 2px rgba(20, 41, 59, 0.03), 0 10px 24px rgba(20, 41, 59, 0.04);
}

/* ---- Base typography ---------------------------------------------------- */
body,
.article-body,
input,
button,
select,
textarea {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--tera-body);
}

body {
  background: var(--tera-page);
  font-size: 0.9375rem;   /* 15px — slightly larger than the app's 14px for reading */
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6,
.article-title,
.blocks-item-title,
.section-tree-title {
  color: var(--tera-heading);
  font-weight: 700;
  letter-spacing: -0.01em;
}

a { color: var(--tera-accent); }
a:hover { color: var(--tera-accent-hover); }

/* ---- Header ------------------------------------------------------------- */
/* Full-width bar; content centered to ~1160px. Copenhagen caps .header at
   1160px, which left white gaps — span the viewport and pad instead. */
header.header {
  max-width: none;
  width: 100%;
  padding-left: max(5%, calc((100% - 1160px) / 2));
  padding-right: max(5%, calc((100% - 1160px) / 2));
}
.header .logo img,
.header .brand img { max-height: 28px; width: auto; }

/* Dark header on ALL pages so the white Tera logo is visible everywhere */
header.header {
  background: #0c222d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header .nav-wrapper-desktop .user-nav-list a,
.header .nav-wrapper-desktop .ask-ai,
.header .nav-wrapper-desktop .sign-in,
.header .nav-wrapper-desktop .dropdown-toggle,
.header .nav-wrapper-desktop .dropdown-toggle span,
.header .menu-button-mobile { color: rgba(255, 255, 255, 0.88); }
.header .nav-wrapper-desktop .user-nav-list a:hover,
.header .nav-wrapper-desktop .ask-ai:hover,
.header .nav-wrapper-desktop .sign-in:hover { color: #ffffff; }
.header .ask-ai-icon,
.header .dropdown-chevron-icon,
.header .icon-menu { color: rgba(255, 255, 255, 0.88); }

/* HOME PAGE: dark header, flush with the banner (no border), white logo */
html.tera-home header.header {
  /* transparent so the hero banner's background shows through behind it */
  background: transparent;
  border-bottom: none;
  position: relative;
  z-index: 2;
}
html.tera-home .tera-logo-dark { display: none; }
html.tera-home .tera-logo-light { display: inline-block; }
html.tera-home .header .nav-wrapper-desktop .user-nav-list a,
html.tera-home .header .nav-wrapper-desktop .ask-ai,
html.tera-home .header .nav-wrapper-desktop .sign-in,
html.tera-home .header .nav-wrapper-desktop .dropdown-toggle,
html.tera-home .header .nav-wrapper-desktop .dropdown-toggle span,
html.tera-home .header .menu-button-mobile { color: rgba(255, 255, 255, 0.88); }
html.tera-home .header .nav-wrapper-desktop .user-nav-list a:hover,
html.tera-home .header .nav-wrapper-desktop .ask-ai:hover,
html.tera-home .header .nav-wrapper-desktop .sign-in:hover { color: #ffffff; }
html.tera-home .header .ask-ai-icon,
html.tera-home .header .dropdown-chevron-icon,
html.tera-home .header .icon-menu { color: rgba(255, 255, 255, 0.88); }

/* Account/profile popover stays a white card with dark text on every page */
.header .dropdown-menu { background: var(--tera-card); }
.header .dropdown-menu a,
.header .dropdown-menu [role="menuitem"] { color: var(--tera-body); }
.header .dropdown-menu a:hover,
.header .dropdown-menu [role="menuitem"]:hover { color: var(--tera-heading); }

/* ---- Search hero -------------------------------------------------------- */
.hero,
.search-hero {
  background: linear-gradient(180deg, var(--tera-elevated) 0%, var(--tera-page) 100%);
  border-bottom: 1px solid var(--tera-edge-subtle);
}
.search .search-input,
input.search-input,
input[type="search"] {
  border: 1px solid var(--tera-edge);
  border-radius: var(--tera-radius-control);
  background: var(--tera-card);
  padding: 12px 16px;
}
.search .search-input:focus,
input[type="search"]:focus {
  outline: none;
  border-color: var(--tera-accent);
  box-shadow: 0 0 0 3px var(--tera-focus-ring);
}

/* ---- Buttons ------------------------------------------------------------ */
.button,
.btn,
button[type="submit"],
a.button {
  background: var(--tera-accent);
  color: var(--tera-on-accent);
  border: 1px solid var(--tera-accent);
  border-radius: var(--tera-radius-control);
  font-weight: 600;
  transition: background 150ms cubic-bezier(0.2, 0, 0, 1);
}
.button:hover,
.btn:hover,
a.button:hover {
  background: var(--tera-accent-hover);
  border-color: var(--tera-accent-hover);
  color: var(--tera-on-accent);
}
.button-secondary,
.btn-secondary {
  background: var(--tera-card);
  color: var(--tera-heading);
  border: 1px solid var(--tera-edge);
}

/* ---- Home category blocks (Tabs-style cards: icon + name + count) ------- */
.blocks-item,
.block {
  background: var(--tera-card);
  border: 1px solid var(--tera-edge);
  border-radius: var(--tera-radius-panel);
  box-shadow: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.blocks-item:hover,
.block:hover {
  border-color: var(--tera-accent);
  box-shadow: 0 4px 16px rgba(47, 181, 181, 0.10);
}
.blocks-item-description,
.block-description { color: var(--tera-label); }

/* Card interior */
.tera-cat .blocks-item-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 24px 24px 26px;
  min-height: 132px;
  text-decoration: none;
}
.tera-cat-icon {
  color: var(--tera-label);
  margin-bottom: 14px;
  line-height: 0;
}
.tera-cat .blocks-item-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--tera-heading);
  margin: 0;
}
.tera-cat-count {
  color: var(--tera-label);
  font-size: 0.9rem;
}
/* roomy 3-up grid like Tabs */
.blocks-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 900px) { .blocks-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .blocks-list { grid-template-columns: 1fr; } }

/* ---- Breadcrumbs / nav -------------------------------------------------- */
.breadcrumbs { color: var(--tera-muted); }
.breadcrumbs a { color: var(--tera-label); }
.breadcrumbs li:not(:first-child)::before { color: var(--tera-faint, #b8c7d3); }

/* ---- Article ------------------------------------------------------------ */
.article-container,
.article {
  background: var(--tera-card);
  border: 1px solid var(--tera-edge-subtle);
  border-radius: var(--tera-radius-panel);
}
.article-body { color: var(--tera-body); }
.article-body h2 {
  margin-top: 1.75em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--tera-edge-subtle);
}
.article-body code {
  background: var(--tera-elevated);
  border: 1px solid var(--tera-edge-subtle);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.85em;
}
.article-body table {
  border: 1px solid var(--tera-edge);
  border-radius: var(--tera-radius-panel);
}
.article-body th {
  background: var(--tera-elevated);
  color: var(--tera-heading);
}
.article-body td, .article-body th { border-color: var(--tera-edge-subtle); }

/* ---- Region callout blocks (from the publisher) ------------------------- */
.tera-callout {
  border-radius: var(--tera-radius-control);
  color: var(--tera-body);
}
.tera-callout-in { border-left-color: #128807 !important; }
.tera-callout-us { border-left-color: #0b6bcb !important; }

/* ---- Footer ------------------------------------------------------------- */
.footer {
  background: var(--tera-card);
  border-top: 1px solid var(--tera-edge-subtle);
  color: var(--tera-label);
}

/* ---- Home hero banner (matches tera.cloud footer background) ------------ */
.section.hero.tera-hero {
  /* dark teal glow + fine white dot-grid, like the tera.cloud footer.
     Base starts at the header color (#0c222d) so the header sits flush. */
  background-color: #0c222d;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.15) 1px, transparent 0),
    radial-gradient(80% 100% at 50% 0%, rgba(47, 181, 181, 0.22) 0%, rgba(47, 181, 181, 0) 62%),
    linear-gradient(180deg, #0c222d 0%, #0e2a37 58%, #0b2029 100%);
  background-size: 22px 22px, 100% 100%, 100% 100%;
  background-repeat: repeat, no-repeat, no-repeat;
  height: auto;               /* override Copenhagen's fixed 300px */
  margin-top: -72px;          /* pull the banner up behind the transparent header */
  padding: 128px 20px 64px;   /* clear the header (~72px) + breathing room */
  text-align: center;
}
/* Put the search into normal flow (Copenhagen centers it with translateY,
   which pushed it out of the banner once we added a heading). */
.tera-hero .hero-inner {
  position: static;
  top: auto;
  transform: none;
  max-width: 620px;
  margin: 0 auto;
}
.tera-hero-heading {
  max-width: 720px;
  margin: 0 auto 28px;
}
.tera-hero-title {
  color: #ffffff;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.tera-hero-subtitle {
  color: rgba(255, 255, 255, 0.72);
  font-size: 1rem;
  margin: 0;
}
/* Search field styling on the dark banner */
.tera-hero .search input,
.tera-hero input[type="search"] {
  width: 100%;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: var(--tera-radius-control);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  padding: 14px 16px 14px 40px;
  font-size: 1rem;
}
.tera-hero .search input:focus,
.tera-hero input[type="search"]:focus {
  outline: none;
  border-color: var(--tera-accent);
  box-shadow: 0 0 0 3px var(--tera-focus-ring), 0 10px 30px rgba(0, 0, 0, 0.22);
}
.tera-hero .search-icon {
  color: var(--tera-label);
  z-index: 1;
}

/* ==========================================================================
   Inner pages — Brex-style light banner + article list + "In this article" TOC
   Applies to category_page, section_page, article_page (home keeps its dark hero)
   ========================================================================== */

.tera-inner-banner {
  background: var(--tera-elevated);
  border-bottom: 1px solid var(--tera-edge-subtle);
  padding: 30px 0 36px;
}
.tera-inner-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.tera-inner-banner .breadcrumbs {
  margin: 0 0 18px;
  font-size: 0.85rem;
  color: var(--tera-muted);
}
.tera-inner-banner .breadcrumbs a { color: var(--tera-label); }
.tera-inner-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.tera-inner-title {
  font-size: clamp(1.9rem, 3.5vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--tera-heading);
}
.tera-inner-desc {
  margin: 14px 0 0;
  color: var(--tera-label);
  max-width: 680px;
}
.tera-inner-search { flex: 0 0 auto; width: min(440px, 100%); }
.tera-inner-search form,
.tera-inner-search .search { width: 100%; margin: 0; }
.tera-inner-search input[type="search"],
.tera-inner-search .search-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--tera-edge);
  border-radius: var(--tera-radius-control);
  padding: 12px 16px;
  box-shadow: 0 1px 2px rgba(20, 41, 59, 0.04);
}
.tera-inner-search input[type="search"]:focus {
  outline: none;
  border-color: var(--tera-accent);
  box-shadow: 0 0 0 3px var(--tera-focus-ring);
}
.tera-inner-body { padding: 44px 0 72px; }

/* ---- Category / section article list (2-column, Brex style) ------------- */
.tera-section-group { margin-bottom: 44px; }
.tera-section-group:last-child { margin-bottom: 0; }
.tera-section-group-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tera-label);
  margin: 0 0 8px;
}
.tera-section-group-title a { color: var(--tera-label); text-decoration: none; }
.tera-article-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 64px;
}
.tera-article-card { border-bottom: 1px solid var(--tera-edge-subtle); }
.tera-article-link { display: block; padding: 22px 0; text-decoration: none; }
.tera-article-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--tera-heading);
}
.tera-article-title .tera-arrow { color: var(--tera-heading); transition: transform 150ms; display: inline-block; }
.tera-article-link:hover .tera-article-title,
.tera-article-link:hover .tera-arrow { color: var(--tera-accent); }
.tera-article-link:hover .tera-arrow { transform: translateX(3px); }
.tera-article-desc {
  display: block;
  margin-top: 6px;
  color: var(--tera-label);
  font-size: 0.9rem;
  line-height: 1.5;
}
/* subsection chips (section page with child sections) */
.tera-subsection-list { list-style: none; margin: 0 0 32px; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tera-subsection-item a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border: 1px solid var(--tera-edge); border-radius: var(--tera-radius-panel);
  color: var(--tera-heading); text-decoration: none; font-weight: 600;
}
.tera-subsection-item a:hover { border-color: var(--tera-accent); color: var(--tera-accent); }
@media (max-width: 760px) {
  .tera-article-grid, .tera-subsection-list { grid-template-columns: 1fr; gap: 0; }
}

/* ---- Article page: content + "In this article" TOC --------------------- */
.tera-article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 56px;
  align-items: start;
}
.tera-article-main { min-width: 0; }
.tera-article-main .article-body { color: var(--tera-body); }
.tera-toc {
  position: sticky;
  top: 24px;
  background: var(--tera-elevated);
  border: 1px solid var(--tera-edge-subtle);
  border-radius: var(--tera-radius-panel);
  padding: 20px 22px;
}
.tera-toc-title { font-weight: 700; color: var(--tera-heading); margin-bottom: 12px; font-size: 1rem; }
.tera-toc-list { list-style: none; margin: 0; padding: 0; }
.tera-toc-item a {
  display: block; padding: 6px 0;
  color: var(--tera-body); text-decoration: none;
  font-size: 0.9rem; line-height: 1.4;
  border-left: 2px solid transparent; padding-left: 12px; margin-left: -12px;
}
.tera-toc-item a:hover { color: var(--tera-accent); }
.tera-toc-h3 a { padding-left: 24px; font-size: 0.85rem; color: var(--tera-label); }
.tera-toc-item.is-active a { color: var(--tera-accent); font-weight: 600; border-left-color: var(--tera-accent); }
@media (max-width: 900px) {
  .tera-article-layout { grid-template-columns: 1fr; }
  .tera-toc { position: static; order: -1; margin-bottom: 28px; }
}

/* ---- Inner-page fixes -------------------------------------------------- */
/* Copenhagen caps .article at max-width:66% (old 3-col layout). Our article
   main carries .article — make it fill the content column, no card box. */
.tera-article-layout .article,
.tera-article-main {
  max-width: none;
  min-width: 0;
  flex: initial;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}
/* No underline on article-list links (esp. the preview text) on hover */
.tera-article-link,
.tera-article-link:hover,
.tera-article-link:focus,
.tera-article-title,
.tera-article-desc { text-decoration: none; }

/* ---- Search box: kill native search-field corners + double border ------ */
.tera-inner-search .search {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0;
}
.tera-inner-search input[type="search"],
.tera-inner-search .search-input,
.tera-hero input[type="search"],
.tera-hero .search-input {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

/* ---- Home: Popular articles grid (3x2 cards) --------------------------- */
.tera-popular { margin-top: 8px; }
.tera-popular-title {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 8px 0 28px;
}
.tera-popular-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.tera-pop-card {
  display: flex;
  flex-direction: column;
  background: var(--tera-elevated);
  border: 1px solid var(--tera-edge-subtle);
  border-radius: var(--tera-radius-panel);
  padding: 28px;
  text-decoration: none;
  min-height: 200px;
  transition: box-shadow 150ms, border-color 150ms;
}
.tera-pop-card:hover {
  border-color: var(--tera-accent);
  box-shadow: 0 4px 16px rgba(47, 181, 181, 0.10);
}
.tera-pop-heading { font-size: 1.15rem; font-weight: 700; color: var(--tera-heading); }
.tera-pop-desc { margin-top: 12px; color: var(--tera-label); font-size: 0.9rem; line-height: 1.55; flex: 1; }
.tera-pop-read { margin-top: 18px; color: var(--tera-accent); font-weight: 600; font-size: 0.9rem; }
.tera-pop-read .tera-arrow { display: inline-block; transition: transform 150ms; }
.tera-pop-card:hover .tera-pop-read .tera-arrow { transform: translateX(3px); }
@media (max-width: 900px) { .tera-popular-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .tera-popular-grid { grid-template-columns: 1fr; } }

/* No hover underline on Popular article cards (esp. the preview text) */
.tera-pop-card,
.tera-pop-card:hover,
.tera-pop-card:focus,
.tera-pop-heading,
.tera-pop-desc,
.tera-pop-read { text-decoration: none; }

/* ---- Home: Get help section (replaces recent activity) ----------------- */
.tera-gethelp { margin-top: 16px; }
.tera-gethelp .tera-section-group { margin-bottom: 32px; }

/* Get help section: full-width single-column list (no grid, no subheadings) */
.tera-gethelp-grid { grid-template-columns: 1fr; gap: 0; }

/* Get help: bordered chip rows (icon + title + chevron) */
.tera-gethelp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tera-gethelp-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid var(--tera-edge);
  border-radius: var(--tera-radius-panel);
  background: var(--tera-card);
  text-decoration: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.tera-gethelp-link:hover { border-color: var(--tera-accent); box-shadow: 0 4px 16px rgba(47, 181, 181, 0.08); }
.tera-gethelp-icon { color: var(--tera-muted); line-height: 0; flex: 0 0 auto; }
.tera-gethelp-name { flex: 1 1 auto; color: var(--tera-heading); font-weight: 600; font-size: 1rem; }
.tera-gethelp-chevron { color: var(--tera-muted); line-height: 0; flex: 0 0 auto; }
.tera-gethelp-link:hover .tera-gethelp-name,
.tera-gethelp-link:hover .tera-gethelp-chevron { color: var(--tera-accent); }
