/* =====================================================
   ConfigServer.cloud — design-system layer v1
   Source of truth: design-system/configserver-cloud/MASTER.md (ui-ux-pro-max)
   Loaded after Customizer "Additional CSS"; corrects, never restyles wholesale.
   ===================================================== */

:root {
  --cs-system-version: 2;
  --cs-surface: #0f1d2e;
  --cs-focus: #48d8ff;
  --cs-header-h-desktop: 84px;
}

/* -----------------------------------------------------
   Palette sync — Blocksy's leftover sage palette (#84a98c / #52796f …) mapped to brand tokens.
   Every pair in use was contrast-checked: all ≥ 5.4:1 (see MASTER.md §4).
   ----------------------------------------------------- */

:root {
  --theme-palette-color-1: #48d8ff; /* accent: links, titles, buttons */
  --theme-palette-color-2: #52ffa8; /* accent hover */
  --theme-palette-color-3: #aabcca; /* body text */
  --theme-palette-color-4: #f3fbff; /* headings */
  --theme-palette-color-5: #1f3347; /* borders, module background */
  --theme-palette-color-6: #0b1729; /* alternate surface, code */
  --theme-palette-color-7: #07111f; /* page */
  --theme-palette-color-8: #314149; /* header */

  /* White on the cyan accent is 1.67:1 — theme buttons use dark text instead (11.3:1). */
  --theme-button-text-initial-color: #06111e;
  --theme-button-text-hover-color: #06111e;
}

.comment-form .submit,
.comment-form input[type="submit"] {
  color: #06111e !important;
}

/* Inline-styled download buttons in post content: #0284c7 gave white text 4.10:1, #0369a1 gives 5.93:1. */
.entry-content a[style*="#0284c7"],
.entry-content a[style*="rgb(2, 132, 199)"] {
  background-color: #0369a1 !important;
}

/* -----------------------------------------------------
   Header — compact, sticky, menu beside the logo (RTL start)
   Blocksy writes its header sizes to uploads/blocksy/css/global.css,
   so sizes are overridden through its own CSS variables.
   ----------------------------------------------------- */

@media (min-width: 1000px) {
  [data-header*="type-1"] {
    --header-height: var(--cs-header-h-desktop);
  }

  [data-header*="type-1"] .ct-header [data-row*="middle"] {
    --height: var(--cs-header-h-desktop);
  }

  [data-header*="type-1"] .ct-header [data-id="logo"] .site-logo-container {
    --logo-max-height: 56px;
  }

  #header [data-row="middle"] [data-column="start"] > [data-items] {
    column-gap: clamp(24px, 3vw, 48px);
  }
}

#header {
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-bar #header {
  top: var(--wp-admin--admin-bar--height, 32px);
}

/* Keep anchored sections and keyboard focus clear of the sticky header (focus-not-obscured). */
html {
  scroll-padding-top: calc(var(--header-height, 84px) + 16px);
}

/* -----------------------------------------------------
   Accessibility baseline
   ----------------------------------------------------- */

:where(a, button, input, select, textarea, summary, [role="button"], [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 2px solid var(--cs-focus) !important;
  outline-offset: 3px;
}

.skip-link:focus {
  position: fixed !important;
  top: 16px;
  inset-inline-start: 16px;
  z-index: 100000;
  width: auto !important;
  height: auto !important;
  clip: auto !important;
  clip-path: none !important;
  padding: 12px 20px !important;
  border: 2px solid var(--cs-focus);
  border-radius: 12px;
  background: #07111f !important;
  color: #f3fbff !important;
  font-weight: 700;
}

summary,
button,
[role="button"] {
  cursor: pointer;
}

.mobile-menu .ct-menu-link {
  min-height: 44px;
}

/* Commands and code stay left-to-right inside Persian text. */
pre,
code,
kbd,
samp {
  direction: ltr;
  unicode-bidi: isolate;
}

pre {
  text-align: left;
}

/* Short English parentheticals inside Persian headings stay together (functions.php wraps them). */
.cs-ltr-group {
  unicode-bidi: isolate;
  white-space: nowrap;
}

/* -----------------------------------------------------
   Typography — Vazirmatn tops out at 900; heavy weights hurt Persian legibility.
   Scale: 400 body · 600 labels · 700 strong/buttons · 800 display
   ----------------------------------------------------- */

#header .ct-menu-link {
  font-weight: 600 !important;
}

#header .ct-button-ghost,
.ct-header-cta .ct-button-ghost,
.wp-block-button__link,
.wp-element-button,
.stk-block-button .stk-button,
.stk-link.stk-button,
.cs-btn,
.wp-block-button.is-style-outline .wp-block-button__link,
.cs-btn-outline {
  font-weight: 700 !important;
}

.cs-eyebrow,
.cs-feature-number,
.cs-step::before,
.cs-blog-card small,
.cs-faq summary {
  font-weight: 700;
}

body.page-template-ultp_page_template:not(.home) .ultp-template-container > .wp-block-group.alignfull:first-child p:first-child,
body.page-template-ultp_page_template:not(.home) .stk-block-tabs__tab {
  font-weight: 700 !important;
}

body.page-template-ultp_page_template:not(.home) .stk-block-tab-content [role="tabpanel"] .wp-block-column p.has-xx-large-font-size,
body.page-template-ultp_page_template:not(.home) .stk-block-tab-content [role="tabpanel"] .wp-block-column p.has-x-large-font-size {
  font-weight: 800 !important;
}

/* -----------------------------------------------------
   Service-page components (content/COMPONENTS.md, pages/service-page.md)
   ----------------------------------------------------- */

.cs-hero--page {
  min-height: 0;
  padding: clamp(48px, 7vw, 88px) 0 clamp(36px, 5vw, 56px);
}

.cs-hero--page::before {
  inset: 16px 0 0 0;
  height: 100%;
}

.cs-hero--page .cs-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 820px;
}

.cs-icon--svg {
  display: grid;
  place-items: center;
  color: var(--cs-cyan);
}

.cs-icon--svg::before,
.cs-icon--svg::after {
  content: none;
}

.cs-icon--svg svg {
  width: 26px;
  height: 26px;
}

.cs-problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2.5vw, 26px);
}

.cs-problem-card,
.cs-scope {
  padding: clamp(22px, 3vw, 30px);
  border-radius: var(--cs-radius-md);
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(105, 221, 255, .14);
}

.cs-problem-card .cs-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 14px;
}

.cs-problem-card h3,
.cs-scope h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 19px;
  line-height: 1.6;
}

.cs-problem-card p {
  margin: 0;
  color: var(--cs-muted);
  line-height: 1.9;
}

.cs-alert {
  padding: clamp(24px, 3.5vw, 36px);
  border-radius: var(--cs-radius-lg);
  background: rgba(255, 230, 107, .06);
  border: 1px solid rgba(255, 230, 107, .35);
}

.cs-alert .cs-section-title {
  color: var(--cs-yellow);
}

.cs-alert-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding-inline-start: 1.4em;
  color: var(--cs-text);
  line-height: 1.9;
}

.cs-scope ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cs-scope li {
  position: relative;
  padding-inline-start: 28px;
  color: var(--cs-muted);
  line-height: 1.9;
}

.cs-scope li::before {
  content: "";
  position: absolute;
  top: .6em;
  inset-inline-start: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.cs-scope--in li::before {
  background: var(--cs-green);
}

.cs-scope--out li::before {
  border: 2px solid var(--cs-muted);
}

.cs-table-wrap {
  overflow-x: auto;
  border-radius: var(--cs-radius-md);
  border: 1px solid rgba(105, 221, 255, .14);
}

.cs-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.cs-table caption {
  padding: 14px 16px;
  caption-side: top;
  color: var(--cs-muted);
  text-align: start;
}

.cs-table th,
.cs-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(105, 221, 255, .12);
  text-align: start;
}

.cs-table thead th {
  background: rgba(72, 216, 255, .08);
  color: #fff;
  font-weight: 700;
}

.cs-table tbody th {
  color: #fff;
  font-weight: 600;
}

.cs-table td {
  color: var(--cs-muted);
}

.cs-svc .cs-link-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Homepage VPS locations: آلمان · فرانسه · فنلاند · ایران */
@media (min-width: 1025px) {
  .cs-home:not(.cs-svc) .cs-link-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* -----------------------------------------------------
   Top navigation tabs (design-system pages/navigation.md)
   Items built with `cs-ico-{name}` render as icon tile + title + one-line description (functions.php).
   cs-mega: panel with small group labels. cs-dd: dropdown, 2 columns when cs-dd--2. Panels open under their tab.
   Blocksy boxes every nested .sub-menu (background, border, radius, shadow), so those are reset inside the tabs.
   ui-ux-pro-max has no dropdown/icon-tile entry; general rules applied: SVG icons, ≥44px targets, ≥4.5:1 text contrast,
   visible hover and focus states.
   ----------------------------------------------------- */

@media (min-width: 1000px) {
  /* Panel shell */
  /* The legacy Customizer CSS styles every #header .sub-menu with !important, so the tab panels must too. */
  #header-menu-1 .menu > li.cs-nav-tab > .sub-menu {
    max-height: none;
    padding: 12px !important;
    overflow: visible;
    border: 1px solid rgba(105, 221, 255, .16) !important;
    border-radius: 20px !important;
    background: rgba(10, 21, 34, .98) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .5) !important;
  }

  /* Panels hang under their own tab (RTL: right edges aligned), so the pointer moves straight down into them.
     The footer script in functions.php sets --cs-shift to pull a wide panel back inside the viewport. */
  #header-menu-1 .menu > li.cs-nav-tab {
    position: relative;
  }

  #header-menu-1 .menu > li.cs-nav-tab > .sub-menu {
    left: auto;
    right: 0;
    transform: translate3d(var(--cs-shift, 0px), 10px, 0);
  }

  #header-menu-1 .menu > li.cs-mega > .sub-menu,
  #header-menu-1 .menu > li.cs-dd--2 > .sub-menu {
    display: grid;
  }

  #header-menu-1 .menu > li.cs-nav-tab.ct-active > .sub-menu,
  #header-menu-1 .menu > li.cs-nav-tab.cs-hold > .sub-menu {
    transform: translate3d(var(--cs-shift, 0px), 0, 0);
  }

  /* Grace period after the pointer leaves a tab (class set by the footer script for 300ms). */
  #header-menu-1 .menu > li.cs-nav-tab.cs-hold > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Hover bridge over the gap between the tab and its panel (Blocksy draws it with ::before). */
  #header-menu-1 .menu > li.cs-nav-tab > .sub-menu::before {
    height: 26px !important;
  }

  #header-menu-1 .menu > li.cs-mega > .sub-menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 18px;
    width: min(1060px, calc(100vw - 48px));
    padding: 22px 18px 16px !important;
  }

  #header-menu-1 .menu > li.cs-mega--2 > .sub-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(740px, calc(100vw - 48px));
  }

  #header-menu-1 .menu > li.cs-dd > .sub-menu {
    width: 350px;
  }

  #header-menu-1 .menu > li.cs-dd--2 > .sub-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 8px;
    width: min(720px, calc(100vw - 48px));
  }

  /* Group labels inside mega panels */
  #header-menu-1 li.cs-mega > .sub-menu > li {
    display: block;
    border-top: 0;
  }

  #header-menu-1 li.cs-mega > .sub-menu > li > .ct-menu-link {
    display: flex;
    margin: 0 10px 6px;
    padding: 0 0 10px;
    border: 0;
    border-bottom: 1px solid rgba(105, 221, 255, .14);
    border-radius: 0;
    background: transparent;
    color: var(--cs-cyan) !important;
    font-size: 13px;
    font-weight: 700 !important;
    line-height: 1.6;
  }

  #header-menu-1 li.cs-mega > .sub-menu > li > .ct-menu-link .ct-toggle-dropdown-desktop,
  #header-menu-1 li.cs-mega > .sub-menu > li > .ct-toggle-dropdown-desktop-ghost {
    display: none;
  }

  #header-menu-1 li.cs-mega > .sub-menu > li > .sub-menu {
    display: block;
    position: static;
    width: auto;
    min-width: 0;
    max-height: none;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    opacity: 1;
    visibility: inherit;
    pointer-events: inherit;
    transform: none;
  }

  #header-menu-1 li.cs-mega > .sub-menu > li > .sub-menu::before {
    display: none;
  }

  /* Rich items: icon tile + title + description */
  #header-menu-1 li.cs-nav-tab .sub-menu li[class*="cs-ico-"] {
    display: block;
    border-top: 0;
  }

  #header-menu-1 li.cs-nav-tab .sub-menu li[class*="cs-ico-"] > .ct-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 8px 10px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #f3fbff !important;
    font-weight: 400 !important;
    line-height: 1.5;
    transition: background-color .15s ease;
  }

  #header-menu-1 li.cs-nav-tab .sub-menu li[class*="cs-ico-"] > .ct-menu-link:hover,
  #header-menu-1 li.cs-nav-tab .sub-menu li[class*="cs-ico-"] > .ct-menu-link:focus-visible,
  #header-menu-1 li.cs-nav-tab .sub-menu li[class*="cs-ico-"].current-menu-item > .ct-menu-link {
    background: rgba(72, 216, 255, .08);
  }

  #header-menu-1 .cs-mi-icon {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    background: rgba(72, 216, 255, .12);
    color: var(--cs-cyan);
    transition: background-color .15s ease;
  }

  #header-menu-1 .cs-mi-icon svg {
    width: 22px;
    height: 22px;
  }

  #header-menu-1 .ct-menu-link:hover .cs-mi-icon,
  #header-menu-1 .ct-menu-link:focus-visible .cs-mi-icon {
    background: rgba(72, 216, 255, .22);
  }

  #header-menu-1 .cs-mi-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
  }

  #header-menu-1 .cs-mi-title {
    color: #f3fbff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
  }

  #header-menu-1 .cs-mi-desc {
    color: #aabcca;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
  }
}

@media (min-width: 1000px) and (prefers-reduced-motion: reduce) {
  #header-menu-1 li.cs-nav-tab .ct-menu-link,
  #header-menu-1 .cs-mi-icon {
    transition: none;
  }
}

/* The parent theme upper-cases menu links; Persian has no case and «DevOps» must keep its spelling. */
.ct-header .ct-menu-link,
#offcanvas .ct-menu-link {
  text-transform: none;
}

/* Nine top tabs: tighten spacing on narrower desktops so the row never wraps. */
@media (min-width: 1000px) and (max-width: 1279px) {
  #header-menu-1 .menu > li > .ct-menu-link {
    padding-inline: 7px;
    font-size: 14px;
  }
}

/* -----------------------------------------------------
   Guide section: long-form explanatory prose (content/COMPONENTS.md §3b)
   ui-ux-pro-max: line length 65–75 characters (max-w-prose) and body line height 1.5–1.75. Vazirmatn's Persian
   glyphs sit taller than Latin, so paragraphs use 1.85, matching the site's other Persian body copy.
   Text #cfdbe5 on the #07111f page is well above 4.5:1.
   ----------------------------------------------------- */

.cs-guide .cs-prose {
  max-width: 46rem;
  margin-inline: auto;
  text-align: start;
}

.cs-guide .cs-prose > .cs-section-title {
  margin: 8px 0 20px;
}

.cs-guide .cs-prose p,
.cs-guide .cs-prose ul,
.cs-guide .cs-prose ol {
  margin: 0 0 18px;
  color: #cfdbe5;
  font-size: 17px;
  line-height: 1.85;
}

.cs-guide .cs-prose ul,
.cs-guide .cs-prose ol {
  padding-inline-start: 1.4em;
}

.cs-guide .cs-prose li + li {
  margin-top: 6px;
}

.cs-guide .cs-prose h3 {
  margin: 34px 0 12px;
  color: #f3fbff;
  font-size: 21px;
  line-height: 1.6;
}

.cs-guide .cs-prose a {
  color: var(--cs-cyan);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.cs-guide .cs-prose strong {
  color: #f3fbff;
}

.cs-guide .cs-prose .cs-note {
  padding: 16px 20px;
  border-inline-start: 3px solid var(--cs-cyan);
  border-radius: 12px;
  background: rgba(72, 216, 255, .06);
}

@media (max-width: 689px) {
  .cs-guide .cs-prose p,
  .cs-guide .cs-prose ul,
  .cs-guide .cs-prose ol {
    font-size: 16px;
  }

  .cs-guide .cs-prose h3 {
    font-size: 19px;
  }
}

/* Article CTA box (content/articles) */
.cs-post-cta {
  margin: 36px 0;
  padding: clamp(22px, 3vw, 30px);
  border-radius: var(--cs-radius-md);
  background: linear-gradient(135deg, rgba(72, 216, 255, .10), rgba(82, 255, 168, .05));
  border: 1px solid rgba(105, 221, 255, .28);
}

.cs-post-cta .cs-post-cta__title {
  margin: 0 0 8px !important;
  color: #fff !important;
  font-size: 20px !important;
  font-weight: 700 !important;
}

.cs-post-cta p {
  color: var(--cs-muted);
}

.cs-post-cta .cs-btn {
  margin-top: 8px;
  text-decoration: none;
}

/* Whole-card links (homepage hosting cards) */
a.cs-feature {
  text-decoration: none;
}

@media (max-width: 1024px) {
  .cs-problem-grid,
  .cs-svc .cs-link-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .cs-problem-grid,
  .cs-svc .cs-link-grid {
    grid-template-columns: 1fr;
  }
}

/* -----------------------------------------------------
   Motion — hover lift capped at 2px (legacy cards used 6px)
   ----------------------------------------------------- */

.cs-lift:hover,
.cs-service-card:hover,
.cs-link-card:hover,
.cs-blog-card:hover {
  transform: translateY(-2px);
}

@media (hover: hover) {
  .cs-btn:hover,
  .cs-btn-outline:hover,
  .wp-block-button__link:hover,
  #header .ct-button-ghost:hover {
    transform: translateY(-2px);
  }
}

/* Homepage trust strip (replaced the four boxed Fast/Secure/Root/Docs cards, owner feedback 2026-09-16).
   One row of icon + label + short line, separated by hairlines instead of full card borders. */
.cs-pillars-section {
  padding: clamp(26px, 4vw, 44px) 0;
}

.cs-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2.2vw, 30px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cs-pillars li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-inline-end: clamp(14px, 2vw, 30px);
  border-inline-end: 1px solid rgba(105, 221, 255, .18);
}

.cs-pillars li:last-child {
  padding-inline-end: 0;
  border-inline-end: 0;
}

.cs-pillars__icon {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
}

.cs-pillars__icon .cs-icon--svg svg {
  width: 22px;
  height: 22px;
}

.cs-pillars strong {
  display: block;
  font-size: 17px;
  line-height: 1.6;
}

.cs-pillars__desc {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--cs-muted);
}

@media (max-width: 1024px) {
  .cs-pillars {
    grid-template-columns: repeat(2, 1fr);
  }

  .cs-pillars li:nth-child(2n) {
    padding-inline-end: 0;
    border-inline-end: 0;
  }
}

@media (max-width: 600px) {
  .cs-pillars {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .cs-pillars li {
    padding-inline-end: 0;
    border-inline-end: 0;
  }
}

/* Tap targets (technical SEO audit 2026-09-17): the mobile menu trigger was 18×18 and card category links 18px tall.
   Padding with an equal negative margin enlarges the hit area without moving anything. */
#header .ct-header-trigger {
  box-sizing: content-box !important;
  padding: 13px !important;
  margin: -13px !important;
}

.entry-card .meta-categories a,
.entries .meta-categories a {
  display: inline-block;
  padding-block: 4px;
  margin-block: -4px;
}

/* -----------------------------------------------------
   Mobile legibility and wide tables (SEO / visual audit 2026-09-24)
   Reading text and buttons stay at 14px or more on phones; wide post tables scroll inside their figure instead of
   being clipped past the left edge (RTL overflow is otherwise cut off by the page).
   ----------------------------------------------------- */
.entry-content .wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 689px) {
  .cs-service-list li,
  .cs-chip,
  .cs-hint,
  .cs-blog-card small,
  .cs-metric small,
  .entry-meta .ct-meta-element-date,
  .entry-meta .ct-meta-element-author span,
  .entry-meta .meta-categories a,
  .ct-pagination .page-numbers,
  .lwptoc .lwptoc_toggle_label,
  .ct-breadcrumbs,
  .ct-breadcrumbs a {
    font-size: 14px;
  }

  /* Card kicker labels match the 13px section eyebrows. */
  .cs-link-card span {
    font-size: 13px;
  }

  /* Legacy page templates render core blocks outside .entry-content. */
  .wp-block-list li,
  .wp-block-column > p {
    font-size: max(14px, 1em);
  }

  /* The legacy Customizer CSS forces `.wp-block-buttons .wp-block-button__link{font-size:12px!important}` on phones. */
  .wp-block-buttons .wp-block-button .wp-block-button__link {
    font-size: 15px !important;
  }

  /* VPS plan cards: the legacy Customizer CSS sets their spec lists to 13px !important with this same selector. */
  body.page-template-ultp_page_template:not(.home) .stk-block-tab-content [role="tabpanel"] .wp-block-column li {
    font-size: 14px !important;
  }
}
