/* ==========================================================================
   altScope v2 layout
   Replaces the Astra container, header and footer chrome the existing
   Spectra / SureForms pages were built against. Component colour and type
   stay in theme.css. Lengths below match the live Astra settings:
   content 1200px, container cap 1240px, header break 921px, root 15px.
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 15px; }

body {
  margin: 0;
  background: var(--surface-page, #fff);
}

img, svg, video { max-width: 100%; height: auto; }

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-content { flex: 1 0 auto; }

/* ---- Container (Astra .ast-container) ---- */
.ast-container {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}
@media (min-width: 922px) {
  .ast-container { max-width: 1240px; }
}

#primary,
.content-area,
.site-main { width: 100%; max-width: none; margin: 0; padding: 0; }

article { margin: 0; }

.entry-content { overflow-wrap: break-word; }

.entry-content > *:first-child { margin-top: 0; }

/* Full-bleed and wide blocks. Inside an .as-section page the container is
   already edge-to-edge (theme.css), so this calc resolves to zero. */
.entry-content > .alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.entry-content > .alignwide {
  width: min(1240px, calc(100% - 40px));
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Header ---- */
.site-header { position: relative; z-index: 40; background: rgba(255, 255, 255, 0.92); }

.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 8px;
  min-height: 56px;
}

.site-branding { flex: 0 0 auto; }
.site-branding .custom-logo-link { display: inline-flex; line-height: 0; }
.site-branding .custom-logo { width: auto; max-height: 40px; }

.site-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.main-header-menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-header-menu .menu-item { position: relative; }
.main-header-menu .menu-link {
  display: inline-block;
  padding: 0 14px;
  line-height: 56px;
  text-decoration: none;
  white-space: nowrap;
}
.main-header-menu .sub-menu {
  display: none;
  position: absolute;
  top: calc(100% - 4px);
  left: 0;
  min-width: 220px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: #fff;
  z-index: 30;
}
.main-header-menu .sub-menu .menu-link { display: block; padding: 8px 16px; }
.main-header-menu .menu-item:hover > .sub-menu,
.main-header-menu .menu-item:focus-within > .sub-menu { display: block; }

.ast-header-button-1 { flex: none; }
.ast-header-button-1 .ast-custom-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius, 4px);
  background: transparent;
  color: var(--text-primary, #0f172a);
  cursor: pointer;
}
.menu-toggle-box {
  position: relative;
  width: 16px;
  height: 12px;
}
.menu-toggle-box span,
.menu-toggle-box::before,
.menu-toggle-box::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1.5px;
  background: currentColor;
}
.menu-toggle-box span { top: 5px; }
.menu-toggle-box::before { top: 0; }
.menu-toggle-box::after { top: 10px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-box span { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle-box::before { top: 5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-box::after { top: 5px; transform: rotate(-45deg); }

@media (max-width: 921px) {
  .header-inner { min-height: 64px; }
  .main-header-menu .menu-link { line-height: 1.4; padding: 12px 4px; }
  html.js .menu-toggle { display: inline-flex; }
  .site-navigation {
    flex: 1 0 100%;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    padding: 4px 0 16px;
  }
  html.js .site-navigation { display: none; }
  html.js .site-navigation.is-open { display: flex; }
  .main-header-menu { flex-direction: column; align-items: stretch; }
  .main-header-menu .menu-link { padding: 12px 4px; }
  .main-header-menu .sub-menu {
    position: static;
    display: block;
    min-width: 0;
    border: 0;
    box-shadow: none;
    padding: 0 0 4px 12px;
  }
  .ast-header-button-1 { margin-top: 8px; }
  .ast-header-button-1 .ast-custom-button { width: 100%; justify-content: center; }
}

/* ---- Footer ---- */
.site-primary-footer-inner-wrap,
.site-below-footer-inner-wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 28px 48px;
}
.site-footer .as-footer-heading { margin: 0 0 10px; }
.footer-brand p:last-child { margin-bottom: 0; }

.footer-below {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 16px 24px;
}
@media (min-width: 922px) {
  .ast-footer-copyright p { white-space: nowrap; }
}
.footer-below .ast-footer-copyright p { margin: 0; }

.footer-social {
  display: flex;
  align-items: center;
  gap: 2px;
}
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--slate-300, #cbd5e1);
}
.footer-social svg { width: 18px; height: 18px; fill: currentColor; display: block; }

@media (max-width: 781px) {
  .footer-grid { grid-template-columns: 1fr; padding-top: 40px; }
  .footer-below { grid-template-columns: 1fr; justify-items: start; }
}

/* ---- Interior templates (posts, archives, search, 404) ---- */
.page-intro { padding-block: clamp(48px, 7vw, 88px) 8px; }
.page-intro .as-hero-title { max-width: 22ch; }

.entry-list { padding-bottom: clamp(48px, 8vw, 96px); }
.entry-list article {
  padding: 28px 0;
  border-top: 1px solid var(--border-subtle, #e2e8f0);
}
.entry-list article:last-child { border-bottom: 1px solid var(--border-subtle, #e2e8f0); }
.entry-list h2 { margin: 0 0 8px; font-size: var(--text-2xl, 26px); }
.entry-list h2 a { color: inherit; text-decoration: none; }
.entry-list h2 a:hover { color: var(--accent-strong, #087f63); }
.entry-meta {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
  margin: 0 0 12px;
}
.single-entry { padding-bottom: clamp(48px, 8vw, 96px); }
.single-entry .entry-content { max-width: 760px; }
.single-entry .post-thumbnail { margin: 0 0 28px; }
.single-entry .post-thumbnail img { border-radius: var(--radius, 4px); }

.navigation.pagination,
.post-navigation { padding: 8px 0 48px; }
.navigation.pagination .nav-links,
.post-navigation .nav-links { display: flex; gap: 16px; flex-wrap: wrap; }
.nav-links a { color: var(--text-link, #087f63); }

.search-form { display: flex; gap: 8px; flex-wrap: wrap; max-width: 520px; margin-top: 8px; }
.search-form .search-field { flex: 1 1 220px; padding: 12px 14px; }
.search-form .search-submit { padding: 12px 18px; cursor: pointer; }

.comments-area { max-width: 760px; margin: 8px auto 64px; padding: 0 24px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment { padding: 16px 0; border-top: 1px solid var(--border-subtle, #e2e8f0); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea { width: 100%; padding: 12px 14px; }
.comment-form textarea { min-height: 140px; }

/* ---- Accessible utilities ---- */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100000;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  padding: 12px 16px;
  background: var(--accent, #0ba37f);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius, 4px);
}
