/* Shared template responsive adjustments while preserving protected-workspace safeguards */
body.template-enhanced {
  overflow-x: hidden;
}

.template-enhanced main,
.template-enhanced .container,
.template-enhanced section,
.template-enhanced header,
.template-enhanced footer {
  max-width: 100%;
}

@media (max-width: 780px) {
  .template-integrity-bar {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    border-radius: 1rem;
    padding: 0.75rem 0.85rem;
  }

  .template-integrity-bar span {
    width: 100%;
    line-height: 1.5;
  }

  .template-nav-inner {
    min-height: 3.75rem;
    gap: 0.6rem;
    padding: 0.4rem 0;
  }

  .template-nav-brand {
    flex: 1 1 auto;
  }

  .template-nav-brand strong {
    font-size: 0.8rem;
  }

  .template-nav-brand small {
    display: none;
  }
}

@media (max-width: 560px) {
  .template-nav-inner {
    width: min(100% - 1rem, 1280px);
  }

  .template-nav-links {
    gap: 0.2rem;
  }

  .template-nav-links a {
    width: 100%;
    justify-content: flex-start;
    padding: 0.7rem 0.8rem;
    font-size: 0.75rem;
  }

  .template-nav-toggle {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
}

/* Shared page layout guardrails */
.template-enhanced {
  --template-content-gutter: clamp(1rem, 3vw, 2.5rem);
}

.template-enhanced main {
  width: min(100%, 1440px);
  margin-inline: auto;
  padding-inline: var(--template-content-gutter);
}

.template-enhanced table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-spacing: 0;
}

.template-enhanced pre,
.template-enhanced code {
  max-width: 100%;
}

.template-enhanced pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre;
}

.template-enhanced .grid,
.template-enhanced [class*="grid-cols-"] {
  min-width: 0;
}

.template-enhanced .flex > *,
.template-enhanced [class*="grid"] > * {
  min-width: 0;
}

.template-enhanced .template-site-nav,
.template-enhanced .template-integrity-bar {
  width: min(100% - 2rem, 1440px);
  margin-inline: auto;
}

@media (max-width: 900px) {
  .template-enhanced [class*="grid-cols-4"],
  .template-enhanced [class*="grid-cols-3"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .template-enhanced main {
    padding-inline: 0.875rem;
  }

  .template-enhanced [class*="grid-cols-4"],
  .template-enhanced [class*="grid-cols-3"],
  .template-enhanced [class*="grid-cols-2"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .template-enhanced h1 {
    font-size: clamp(1.65rem, 8vw, 2.25rem);
    line-height: 1.12;
  }

  .template-enhanced h2 {
    font-size: clamp(1.25rem, 6vw, 1.75rem);
  }

  .template-enhanced .template-site-nav,
  .template-enhanced .template-integrity-bar {
    width: min(100% - 1rem, 1440px);
  }
}

.template-page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 5rem) var(--template-content-gutter);
}

.template-hero {
  max-width: 780px;
  margin-bottom: 2rem;
}

.template-eyebrow {
  color: #0e7490;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.template-lede {
  color: #475569;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.75;
}

.template-content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.template-card {
  border: 1px solid #dbe4ee;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
  padding: 1.25rem;
}

.template-card h2,
.template-card p,
.template-callout h2,
.template-callout p {
  color: #172033;
}

.template-card p,
.template-callout p {
  line-height: 1.7;
}

.template-card-icon {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 0.75rem;
  background: #e0f2fe;
  color: #0369a1;
}

.template-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #0369a1;
  font-weight: 700;
  text-decoration: none;
}

.template-link:hover,
.template-link:focus-visible {
  color: #075985;
  text-decoration: underline;
}

.template-callout {
  margin-top: 1.5rem;
  border-left: 4px solid #0891b2;
  border-radius: 0 1rem 1rem 0;
  background: #ecfeff;
  padding: 1.25rem 1.5rem;
}

@media (max-width: 700px) {
  .template-content-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive layout guardrails for touch devices */
@media (pointer: coarse) {
  .template-enhanced button,
  .template-enhanced a,
  .template-enhanced input,
  .template-enhanced select,
  .template-enhanced textarea {
    min-height: 2.75rem;
  }

  .template-enhanced .template-nav-links a {
    min-height: 2.75rem;
  }
}
