/* ==========================================================================
   NO-JS FALLBACKS (Progressive Enhancement)
   ==========================================================================
   Styles for when JavaScript is disabled or before custom elements are defined.
   Uses :not(:defined) to style Web Component light DOM content.
   With JS enabled, fallback content (e.g., .nojs-header) is hidden via
   visibility: hidden to prevent flash, while keeping reserved space.
   ========================================================================== */

/* --------------------------------------------------------------------------
   FAQ Accordion (from core.css — js/components/faq-accordion.js)
   -------------------------------------------------------------------------- */

faq-accordion:not(:defined) {
  display: block;
  border: 1px solid var(--color-gray-200);
  border-radius: 0.5rem;
  overflow: hidden;
}

@media (max-width: 767px) {
  faq-accordion:not(:defined) {
    border-radius: 0;
  }
}

faq-accordion:not(:defined) faq-item {
  display: block;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-gray-200);
}

faq-accordion:not(:defined) faq-item:last-child {
  border-bottom: none;
}

faq-accordion:not(:defined) [slot="question"] {
  display: block;
  font-weight: 600;
  color: var(--color-gray-800);
  margin-bottom: var(--space-2);
}

faq-accordion:not(:defined) [slot="answer"] {
  display: block;
  color: var(--color-gray-600);
  line-height: 1.625;
}

/* --------------------------------------------------------------------------
   Service Card (js/components/service-card.js)
   Shadow DOM with named slots. Without JS, slot content renders as plain
   spans — these rules style them as card-like blocks.
   -------------------------------------------------------------------------- */

service-card:not(:defined) {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--service-card-bg, var(--color-background-alt));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

service-card:not(:defined) [slot="title"] {
  display: block;
  font-size: 28px;
  font-weight: 600;
  color: var(--color-black);
  line-height: 1.4;
}

service-card:not(:defined) [slot="description"] {
  display: block;
  font-size: 16px;
  color: var(--color-black);
  line-height: 1.6;
}

service-card:not(:defined) [slot="cta"] {
  display: none;
}

service-card:not(:defined) .nojs-card-link {
  display: inline-block;
  margin-top: 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-hero-accent);
  text-decoration: none;
}

service-card:not(:defined) .nojs-card-link:hover {
  text-decoration: underline;
}

service-card:defined .nojs-card-link {
  display: none;
}

/* --------------------------------------------------------------------------
   Testimonial Block (js/components/testimonial-block.js)
   Shadow DOM with default slot. Without JS, text content renders directly.
   -------------------------------------------------------------------------- */

testimonial-block:not(:defined) {
  display: block;
  font-size: 16px;
  line-height: 26px;
  color: var(--color-black);
}

@media (min-width: 768px) {
  testimonial-block:not(:defined) { font-size: 17px; line-height: 27px; }
}

@media (min-width: 1024px) {
  testimonial-block:not(:defined) { font-size: 18px; line-height: 28px; }
}

/* --------------------------------------------------------------------------
   Link Components (js/components/calendly-link.js, linkedin-link.js)
   Light DOM components. Without JS, display:contents lets the inner
   fallback <a> tag (added in HTML) inherit layout context.
   -------------------------------------------------------------------------- */

calendly-link:not(:defined),
linkedin-link:not(:defined) {
  display: contents;
}

/* --------------------------------------------------------------------------
   CTA Block (js/components/cta-block.js)
   Shadow DOM, no slots. Fallback HTML as light DOM inside the element.
   Shadow DOM hides light DOM when component defines; these rules style
   the fallback when it hasn't defined yet.
   -------------------------------------------------------------------------- */

cta-block:not(:defined) {
  display: block;
  text-align: center;
  background-color: var(--color-background-alt);
  padding: 56px var(--padding-section) 64px;
}

@media (min-width: 768px) {
  cta-block:not(:defined) { padding: 64px var(--padding-section) 72px; }
}

@media (min-width: 1024px) {
  cta-block:not(:defined) { padding: 72px var(--padding-section) 80px; }
}

cta-block:not(:defined) .nojs-separator {
  width: 80px;
  height: 2px;
  background-color: var(--color-hero-accent);
  margin: 0 auto 32px;
}

cta-block:not(:defined) h2 {
  font-weight: 600;
  font-size: 28px;
  line-height: 40px;
  color: var(--color-black);
  margin: 0 0 24px;
}

@media (min-width: 768px) {
  cta-block:not(:defined) h2 { font-size: 32px; line-height: 46px; }
}

@media (min-width: 1024px) {
  cta-block:not(:defined) h2 { font-size: 36px; line-height: 52px; }
}

cta-block:not(:defined) p {
  font-size: 16px;
  line-height: 26px;
  color: var(--color-black);
  margin: 0 auto 32px;
  max-width: 600px;
}

/* --------------------------------------------------------------------------
   Site Header (js/components/site-header.js)
   Shadow DOM, no slots. Fallback HTML as light DOM inside the element.
   Shadow DOM hides light DOM when component defines; these rules style
   the fallback when it hasn't defined yet.
   -------------------------------------------------------------------------- */

/* Hide fallback content when JS is ready to prevent flash before component renders */
.js-ready site-header:not(:defined) > .nojs-header {
  visibility: hidden;
}

site-header:not(:defined) {
  position: sticky;
  top: 0;
  z-index: 200;
  background-color: var(--color-white);
  border-bottom: 0.5px solid var(--color-border);
}

site-header:not(:defined) .nojs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width-site);
  margin: 0 auto;
  padding: 0 var(--padding-section);
  height: 4rem;
}

@media (min-width: 768px) {
  site-header:not(:defined) .nojs-header { height: 76px; }
}

site-header:not(:defined) .nojs-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--color-black);
  font-weight: 600;
  font-variant: small-caps;
  letter-spacing: 0.06em;
}

site-header:not(:defined) .nojs-logo img {
  height: 2rem;
  width: auto;
}

site-header:not(:defined) .nojs-nav {
  display: none;
  align-items: center;
  gap: 16px;
}

@media (min-width: 768px) {
  site-header:not(:defined) .nojs-nav { display: flex; }
}

site-header:not(:defined) .nojs-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
}

site-header:not(:defined) .nojs-nav a:hover {
  color: var(--color-black);
}

site-header:not(:defined) .nojs-cta-btn {
  display: none;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-black);
  background-color: var(--color-accent);
  border-radius: var(--radius-lg);
  text-decoration: none;
}

@media (min-width: 768px) {
  site-header:not(:defined) .nojs-cta-btn {
    display: inline-flex;
    align-items: center;
  }
}

site-header:not(:defined) .nojs-cta-btn:hover {
  background-color: var(--color-accent-hover);
}

site-header:not(:defined) .nojs-lang {
  display: flex;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

site-header:not(:defined) .nojs-lang a {
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 4px 8px;
}

site-header:not(:defined) .nojs-lang a:hover {
  color: var(--color-black);
}

/* --------------------------------------------------------------------------
   Hide light DOM fallback once the component is defined (belt & suspenders —
   Shadow DOM already hides light DOM, but this avoids any edge-case flash).
   -------------------------------------------------------------------------- */

site-header:defined > .nojs-header,
site-footer:defined > .nojs-footer,
cta-block:defined > .nojs-cta {
  display: none;
}

/* --------------------------------------------------------------------------
   Site Footer (js/components/site-footer.js)
   Shadow DOM, no slots. Fallback HTML as light DOM inside the element.
   Shadow DOM hides light DOM when component defines; these rules style
   the fallback when it hasn't defined yet.
   -------------------------------------------------------------------------- */

site-footer:not(:defined) {
  background-color: var(--color-black);
  color: var(--color-white);
}

site-footer:not(:defined) .nojs-footer {
  max-width: var(--max-width-site);
  margin: 0 auto;
  padding: 48px var(--padding-section);
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  site-footer:not(:defined) .nojs-footer {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

site-footer:not(:defined) .nojs-footer p {
  margin: 0;
  font-size: 14px;
}

site-footer:not(:defined) .nojs-footer nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

site-footer:not(:defined) .nojs-footer a {
  color: var(--color-white);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

site-footer:not(:defined) .nojs-footer a:hover {
  color: #949494;
}

/* --------------------------------------------------------------------------
   Client Logos (js/components/client-logos.js)
   Dynamically loaded only when showClientLogos feature flag is enabled.
   Hidden when not defined (flag disabled or no JS).
   -------------------------------------------------------------------------- */

client-logos:not(:defined) {
  display: none;
}
