/* ============================================================
   SquareOps v4 design layer
   Shared by the v4 homepage and the product pages (/atmosly/,
   /alert6/, /verity/, /spendzero/). Loaded after ds.css.

   The page markup comes from the Claude Design project and keeps
   the design's inline styles, so the rules here are deliberately
   small: shared animation/texture classes, the interaction states
   v4.js toggles, and a responsive layer. The design itself is
   desktop-only; the r-* classes are added at import time to the
   grids, rows and type that need to adapt (see
   scripts/v4-import/README.md).
   ============================================================ */

html { overflow-x: clip; scroll-behavior: smooth; }
body.v4-page { margin: 0; background: #fff; font-family: var(--so-font-sans); color: var(--so-fg); }
.v4-page a { color: var(--so-teal-alt); text-decoration: none; }
.v4-page a:hover { color: var(--so-teal); }
.v4-page [id] { scroll-margin-top: 84px; }
.v4-page button { font: inherit; }

/* Hidden interaction states (inactive tab panels, collapsed strips, form states) */
.v4-off { display: none !important; }

/* Shared design classes */
@keyframes h3rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.h3-rise { animation: h3rise .8s cubic-bezier(.23,1,.32,1) both; }
.h3-rise2 { animation: h3rise .8s .15s cubic-bezier(.23,1,.32,1) both; }
.grid-light { background-image: linear-gradient(rgba(23,199,153,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(23,199,153,.07) 1px, transparent 1px); background-size: 48px 48px; }
.grid-dark { background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 48px 48px; }

/* FAQ accordions open/close smoothly whichever page they are on */
.v4-page [data-v4="faq"] > button { cursor: pointer; }

/* SquareOps logo in the header: 20% larger than the design's 28px (owner
   request, Oct 2026). Applies to the v4 pages and, through chrome.css, to every
   other page. */
header img[src*="squareops-logo"] { height: 33.6px !important; width: auto; }

/* The shared header (header.html) is fixed on the older pages, whose heroes are padded for it.
   v4 pages, product pages included, are designed around a header in the page flow: keep it sticky. */
body.v4-page .v4-chrome-header { position: sticky !important; }

/* Mobile menu button, injected into the header at import time */
.v4-menu-btn { display: none; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--so-border); background: #fff; color: var(--so-navy); font-size: 17px; cursor: pointer; align-items: center; justify-content: center; flex: none; }

/* Testimonial cards are clickable to move the carousel */
.v4-page [data-v4="t-prev"], .v4-page [data-v4="t-next"] { cursor: pointer; }

/* Case-study thumbnails replace the design's image slots */
.v4-page [data-v4="case-img"] { width: 100%; height: 100%; object-fit: contain; padding: 28px 36px; box-sizing: border-box; background: #fff; display: block; }

/* Reduced motion: keep the layout, drop the movement */
@media (prefers-reduced-motion: reduce) {
  .v4-page *, .v4-page *::before, .v4-page *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Responsive layer
   ============================================================ */
@media (max-width: 1100px) {
  .r-g[data-rc="5"], .r-g[data-rc="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 960px) {
  .r-g { grid-template-columns: minmax(0, 1fr) !important; }
  .r-g[data-rc="4"], .r-g[data-rc="5"], .r-g[data-rc="6"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .r-f { flex-wrap: wrap !important; }
  .r-w { width: auto !important; min-width: 0 !important; max-width: 100% !important; }
  .r-p { padding-top: 64px !important; padding-bottom: 64px !important; }
  .r-t1 { font-size: 40px !important; }
  .r-t2 { font-size: 30px !important; }

}

@media (max-width: 640px) {
  .r-g, .r-g[data-rc="4"], .r-g[data-rc="5"], .r-g[data-rc="6"] { grid-template-columns: minmax(0, 1fr) !important; }
  .r-p { padding-top: 56px !important; padding-bottom: 56px !important; }
  .r-t1 { font-size: 34px !important; line-height: 1.12 !important; }
  .r-t2 { font-size: 27px !important; line-height: 1.2 !important; }
  .r-t3 { font-size: 22px !important; }
}


/* Homepage service strips: a stacked, tap-to-expand list below desktop width */
@media (max-width: 960px) {
  [data-v4="strips"] { flex-direction: column !important; flex-wrap: nowrap !important; height: auto !important; }
  [data-v4="strips"] > [data-strip] { flex: none !important; min-width: 0 !important; width: 100%; }
  [data-v4="strips"] [data-part="off"] { position: static !important; flex-direction: row !important; justify-content: flex-start !important; gap: 14px; padding: 16px 18px !important; }
  [data-v4="strips"] [data-part="off"] > span:nth-child(2) { writing-mode: horizontal-tb !important; transform: none !important; flex: 1; white-space: normal !important; }
  [data-v4="strips"] [data-part="on"] { position: static !important; padding: 22px !important; }
}

@media (max-width: 640px) {
  [data-v4="hdr-cta"] { display: none !important; }
  /* the 3D scenes are decorative and unreadable at phone width */
  [data-v4="iso-col"] { display: none !important; }
  /* testimonials: just the current card; arrows and dots still work */
  [data-v4="t-prev"], [data-v4="t-next"] { display: none !important; }
}


/* Grids of small cells (pipeline steps, badge rows): fewer columns, never one */
@media (max-width: 640px) {
  .r-gs { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

/* Grid-built tables (header row + data rows) scroll sideways instead of stacking */
@media (max-width: 640px) {
  .r-tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .r-tscroll > .r-trow { min-width: 560px; }
}

/* Testimonials: each rotation slides the cards in from the direction of travel */
@keyframes v4TInNext { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes v4TInPrev { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.v4-page .v4-t-in-next > blockquote, .v4-page .v4-t-in-next > figcaption { animation: v4TInNext .55s var(--so-ease-out) both; }
.v4-page .v4-t-in-prev > blockquote, .v4-page .v4-t-in-prev > figcaption { animation: v4TInPrev .55s var(--so-ease-out) both; }

/* ============================================================
   Mega menu (partials/nav-menu.html, shared with the site header)
   Hover or keyboard focus opens a panel on desktop; below 961px the
   nav becomes the mobile menu and each item expands in place.
   ============================================================ */
.v4-page header [data-v4="nav"] { display: flex; align-items: center; justify-content: flex-end; }
.v4-mega { display: flex; align-items: center; gap: 4px 24px; list-style: none; margin: 0; padding: 0; }
.v4-mega > .nav-item { position: relative; }
/* the full Services menu is centred on the header, not on its trigger */
.v4-mega > .nav-item:has(> .megamenu-dropdown:not(.megamenu-compact):not(.megamenu-2col)) { position: static; }
.v4-mega .nav-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 23px 0;
  color: var(--so-fg) !important; font-size: 14.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: color var(--so-dur-fast) var(--so-ease-out);
}
.v4-mega .nav-link i { font-size: 9px; opacity: .55; transition: transform var(--so-dur-base) var(--so-ease-out); }
.v4-mega > .nav-item:hover > .nav-link, .v4-mega > .nav-item.open > .nav-link { color: var(--so-teal-alt) !important; }
.v4-mega > .nav-item:hover > .nav-link i, .v4-mega > .nav-item.open > .nav-link i { transform: rotate(180deg); opacity: 1; }

.v4-mega .megamenu-dropdown {
  position: absolute; top: 100%; left: 50%; transform: translate(-50%, -6px);
  min-width: 1000px; display: flex; gap: 32px; padding: 26px 28px;
  background: #fff; border: 1px solid var(--so-border); border-radius: 16px; box-shadow: var(--so-shadow-2xl);
  opacity: 0; visibility: hidden; z-index: 60;
  transition: opacity .2s var(--so-ease-out), transform .2s var(--so-ease-out), visibility .2s;
}
.v4-mega .megamenu-dropdown.megamenu-2col { min-width: 540px; }
.v4-mega .megamenu-dropdown.megamenu-compact { min-width: 290px; }
.v4-mega > .nav-item:hover > .megamenu-dropdown,
.v4-mega > .nav-item:focus-within > .megamenu-dropdown,
.v4-mega > .nav-item.open > .megamenu-dropdown { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.v4-mega .megamenu-column { flex: 1; min-width: 0; }
.v4-mega .megamenu-title {
  margin: 0 0 10px; padding: 0 12px 10px; border-bottom: 1px solid var(--so-border);
  font: 700 12px/1.2 var(--so-font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--so-teal-alt);
}
.v4-mega .megamenu-column ul { list-style: none; margin: 0; padding: 0; }
.v4-mega .megamenu-column a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--so-fg) !important; font-size: 14px; font-weight: 500; line-height: 1.35;
  transition: background var(--so-dur-fast) var(--so-ease-out), color var(--so-dur-fast) var(--so-ease-out);
}
.v4-mega .megamenu-column a i { width: 18px; flex: none; text-align: center; color: var(--so-teal-alt); font-size: 14px; }
.v4-mega .megamenu-column a:hover { background: var(--so-success-soft); color: var(--so-navy) !important; }
.v4-mega .v4-nav-extra { display: none; }

/* Narrow desktops: tighten the bar */
@media (max-width: 1320px) and (min-width: 1201px) {
  .v4-mega { gap: 4px 16px; }
  .v4-mega .nav-link { font-size: 14px; }
}

/* The header collapses to the menu button below 1201px: product pages carry a
   product logo and two CTAs, and six menu items no longer fit beside them. */
@media (max-width: 1200px) {
  [data-v4="nav"] { display: none !important; }
  .v4-menu-btn { display: inline-flex; margin-left: 0; }
  header.v4-nav-open [data-v4="nav"] {
    display: block !important; position: absolute; top: 100%; left: 0; right: 0;
    max-height: calc(100vh - 68px); overflow-y: auto; margin: 0 !important;
    background: #fff; border-bottom: 1px solid var(--so-border); box-shadow: 0 12px 24px rgba(5,51,75,.08);
    padding: 6px 20px 18px; z-index: 50;
  }
  .v4-mega { display: block; }
  .v4-mega > .nav-item, .v4-mega > .nav-item:has(> .megamenu-dropdown) { position: static; border-bottom: 1px solid var(--so-border); }
  .v4-mega .nav-link { display: flex; justify-content: space-between; width: 100%; padding: 14px 0; font-size: 16px; }
  .v4-mega .megamenu-dropdown {
    position: static; transform: none !important; min-width: 0 !important; display: none;
    flex-direction: column; gap: 14px; padding: 4px 0 14px; border: 0; box-shadow: none; border-radius: 0;
    opacity: 1; visibility: visible;
  }
  .v4-mega > .nav-item:hover > .megamenu-dropdown, .v4-mega > .nav-item:focus-within > .megamenu-dropdown { display: none; }
  .v4-mega > .nav-item.open > .megamenu-dropdown { display: flex; }
  .v4-mega .megamenu-title { padding-left: 0; font-size: 11px; }
  .v4-mega .megamenu-column a { padding: 9px 0; }
  .v4-mega .v4-nav-extra { display: block; padding: 14px 0 0; }
  .v4-mega .v4-nav-extra a { font-weight: 700; color: var(--so-teal-alt) !important; font-size: 16px; }
}

/* Phones: the header CTA is hidden, so the menu button takes the right edge */
@media (max-width: 640px) { .v4-menu-btn { margin-left: auto; } }

/* The product header row keeps its 28px side padding and 36px gap at any width,
   so the lockup plus the menu button ran past the edge: SpendZero at every phone
   width, the other products at 375px and below, and all of them at 641-700px. */
@media (max-width: 800px) {
  header > div:has(> .v4-menu-btn) { padding-left: 16px !important; padding-right: 16px !important; gap: 12px !important; }
  header > div:has(> .v4-menu-btn) > div:first-child { gap: 10px !important; min-width: 0; }
  header > div:has(> .v4-menu-btn) > div:first-child > a:last-child { gap: 8px !important; }
  header > div:has(> .v4-menu-btn) > div:first-child > a:first-child img { height: 20px !important; }
  header > div:has(> .v4-menu-btn) > div:first-child > a:last-child > span:first-child { width: 28px !important; height: 28px !important; }
  header > div:has(> .v4-menu-btn) > div:first-child > a:last-child > span:last-child { font-size: 17px !important; }
}
@media (max-width: 360px) {
  header > div:has(> .v4-menu-btn) > div:first-child > a:last-child > span:first-child { display: none !important; }
}

/* Alternative pages: the comparison filter tabs are one unbroken row, wider than
   the phone column once a competitor name is long ("Komodor leads 4"). */
@media (max-width: 640px) { [data-v4="cmp-filter"] { flex-wrap: wrap; } }

/* Atmosly alternative and IDP pages: the FAQ intro column sits beside the
   list on desktop (sticky on alternative pages). Once the grid is one column
   it would slide over the questions, and the list's span-2 would add an
   implicit second column. */
@media (max-width: 1200px) {
  #al-faq > div > div:first-child { position: static !important; }
  #al-faq > div > div:nth-child(2), #id-faq > div > div:nth-child(2) { grid-column: auto !important; }
}

body.v4-page .related-success-stories {
    padding: 60px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
    margin-top: 40px;
}

body.v4-page .related-success-stories .container {
    max-width: 1200px;
    margin: 0 auto;
}

body.v4-page .related-success-stories .section-header {
    text-align: center;
    margin-bottom: 42px;
}

body.v4-page .related-success-stories .section-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(23, 199, 153, 0.1);
    color: var(--so-teal);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

body.v4-page .related-success-stories .section-subtitle {
    max-width: 700px;
    margin: 12px auto 0;
    font-size: 15px;
    color: var(--so-fg-2);
    line-height: 1.7;
}

body.v4-page .related-success-stories .success-stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 22px;
    margin-bottom: 34px;
}

body.v4-page .related-success-stories .success-story-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

body.v4-page .related-success-stories .success-story-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(23, 199, 153, 0.15);
    border-color: var(--so-teal);
}

body.v4-page .related-success-stories .success-story-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

body.v4-page .related-success-stories .success-story-image-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

body.v4-page .related-success-stories .success-story-image-fallback i {
    font-size: 56px;
    color: rgba(255, 255, 255, 0.9);
}

body.v4-page .related-success-stories .success-story-image-fallback .fallback-text {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
    letter-spacing: 1px;
}

body.v4-page .related-success-stories .success-story-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

body.v4-page .related-success-stories .success-story-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

body.v4-page .related-success-stories .company-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px;
}

body.v4-page .related-success-stories .company-info {
    flex: 1;
}

body.v4-page .related-success-stories .company-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--so-navy);
    margin: 0 0 4px 0;
}

body.v4-page .related-success-stories .industry-tag {
    display: inline-block;
    font-size: 13px;
    padding: 4px 12px;
    background: rgba(23, 199, 153, 0.1);
    color: var(--so-teal);
    border-radius: 20px;
    font-weight: 600;
}

body.v4-page .related-success-stories .success-story-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--so-navy);
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.v4-page .related-success-stories .success-story-description {
    font-size: 14px;
    color: var(--so-fg-2);
    line-height: 1.6;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

body.v4-page .related-success-stories .success-story-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

body.v4-page .related-success-stories .read-more-link {
    color: var(--so-teal);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

body.v4-page .related-success-stories .read-more-link i {
    transition: transform 0.3s ease;
}

body.v4-page .related-success-stories .success-story-card:hover .read-more-link i {
    transform: translateX(4px);
}

body.v4-page .related-success-stories .success-stories-cta {
    text-align: center;
}

body.v4-page .related-success-stories .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: white;
    border: 2px solid var(--so-teal);
    color: var(--so-teal);
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
}

body.v4-page .related-success-stories .btn-secondary:hover {
    background: var(--so-teal);
    color: white;
}

@media (max-width: 768px) {
    body.v4-page .related-success-stories {
        padding: 48px 16px;
    }

    body.v4-page .related-success-stories .success-stories-grid {
        grid-template-columns: 1fr;
    }
}

/* Technology chips on case study cards. The homepage partial ships its own
   copy of these; this scoped version is what the SSR curated block uses. */
body.v4-page .related-success-stories .success-story-techs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

body.v4-page .related-success-stories .tech-badge {
    font-size: 12px;
    padding: 4px 10px;
    background: #f1f5f9;
    color: var(--so-navy);
    border-radius: 4px;
    font-weight: 500;
}

/* Case studies pulled by product: <!-- CASE_STUDIES product="Atmosly" -->.
   Same markup as the services pages (services/relatedCaseStudies.js), restyled
   with the v4 tokens. Copied from pages-styles.css; keep the two in step. */
body.v4-page .related-success-stories { font-family: var(--so-font-sans); margin-top: 0; border-top: 1px solid var(--so-border); background: var(--so-bg-soft); }
body.v4-page .related-success-stories h2 { font-family: var(--so-font-display); font-size: 34px; color: var(--so-navy); margin: 0; letter-spacing: -0.02em; }
body.v4-page .related-success-stories h3.success-story-title { font-family: var(--so-font-display); }
body.v4-page .related-success-stories .success-story-card { border: 1px solid var(--so-border); box-shadow: var(--so-shadow-sm); }
body.v4-page .related-success-stories .success-story-card:hover { transform: translateY(-4px); box-shadow: var(--so-shadow-lg); }
