/* ===========================================================================
   astro-ui.css — shared foundation for Template4 / Template5 / Template6
   ---------------------------------------------------------------------------
   Every class is prefixed `au-` and every rule is scoped under `.au-theme`
   (set on <body> by the Template4/5/6 layouts) so this sheet cannot alter the
   legacy templates, the search results page, or the ad units.

   Per-template sheets (template4.css / template5.css / template6.css) only
   re-declare the tokens below plus a handful of signature rules; the layout
   and component code lives here once.
   =========================================================================== */

.au-theme {
  /* palette ------------------------------------------------------------- */
  --au-bg: #ffffff;
  --au-surface: #f6f8f9;
  --au-surface-2: #eef1f4;
  --au-border: #e2e6ea;
  --au-border-strong: #cdd4db;
  --au-text: #12161c;
  --au-text-soft: #48525f;
  --au-muted: #6b7480;
  --au-accent: var(--theme-tag-color, #2563eb);
  /* accent darkened to clear 4.5:1 both as text on white and behind white
     labels; the flat value is the fallback for engines without color-mix */
  --au-accent-strong: #1b4fb8;
  --au-accent-strong: color-mix(in srgb, var(--au-accent) 72%, #000);
  --au-accent-ink: #ffffff;
  --au-footer-bg: var(--theme-footer-color, #16191d);
  --au-footer-text: rgba(255, 255, 255, 0.72);

  /* shape & depth -------------------------------------------------------- */
  --au-radius: 16px;
  --au-radius-sm: 10px;
  --au-radius-pill: 999px;
  --au-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.05);
  --au-shadow-lift: 0 2px 4px rgba(16, 24, 40, 0.05), 0 12px 28px rgba(16, 24, 40, 0.09);
  --au-hairline: 1px solid var(--au-border);

  /* rhythm --------------------------------------------------------------- */
  --au-maxw: 1240px;
  --au-gutter: 24px;
  --au-gap: 24px;
  --au-section-gap: 64px;

  /* type ----------------------------------------------------------------- */
  --au-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --au-font-display: var(--au-font);
  --au-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --au-display-weight: 700;
  --au-display-tracking: -0.022em;
  --au-kicker-tracking: 0.08em;

  background-color: var(--au-bg);
  color: var(--au-text);
  font-family: var(--au-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------------------------------------------------------------------
   primitives
   --------------------------------------------------------------------------- */

.au-theme .au-wrap {
  width: 100%;
  max-width: var(--au-maxw);
  margin-inline: auto;
  padding-inline: var(--au-gutter);
}

.au-theme .au-main {
  display: block;
  width: 100%;
  padding-block: 40px 72px;
}

.au-theme .au-section + .au-section,
.au-theme .au-split + .au-section {
  margin-top: var(--au-section-gap);
}

.au-theme .au-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.au-theme .au-section-title {
  margin: 0;
  font-family: var(--au-font-display);
  font-size: clamp(1.15rem, 0.9rem + 0.8vw, 1.5rem);
  font-weight: var(--au-display-weight);
  letter-spacing: var(--au-display-tracking);
  color: var(--au-text);
}

.au-theme .au-section-link {
  flex: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--au-accent-strong);
  text-decoration: none;
  white-space: nowrap;
}

.au-theme .au-section-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.au-theme .au-kicker {
  margin: 0 0 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: var(--au-kicker-tracking);
  text-transform: uppercase;
  color: var(--au-accent-strong);
}

.au-theme .au-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--au-muted);
}

.au-theme .au-meta > * + *::before {
  content: "·";
  margin-inline: 8px;
  color: var(--au-border-strong);
}

/* ---------------------------------------------------------------------------
   header / nav
   --------------------------------------------------------------------------- */

.au-theme .au-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background-color: color-mix(in srgb, var(--theme-navbar-color, #fff) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: var(--au-hairline);
}

.au-theme .au-header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 68px;
  padding-block: 12px;
}

.au-theme .au-brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.au-theme .au-brand img {
  height: 34px;
  width: auto;
  max-width: 220px;
}

.au-theme .au-header-search {
  flex: 1 1 auto;
  max-width: 460px;
  margin-left: auto;
}

.au-theme .au-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 6px 0 14px;
  background: var(--au-bg);
  border: 1px solid var(--au-border-strong);
  border-radius: var(--au-radius-pill);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.au-theme .au-field:focus-within {
  border-color: var(--au-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--au-accent) 18%, transparent);
}

.au-theme .au-field input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--au-text);
}

.au-theme .au-field button {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--au-radius-pill);
  background: var(--au-accent-strong);
  color: var(--au-accent-ink);
  cursor: pointer;
  transition: filter 0.15s ease;
}

.au-theme .au-field button:hover {
  filter: brightness(0.92);
}

.au-theme .au-field button svg {
  width: 15px;
  height: 15px;
}

.au-theme .au-navbar {
  border-bottom: var(--au-hairline);
  background: var(--au-bg);
}

.au-theme .au-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-block: 8px;
}

.au-theme .au-nav::-webkit-scrollbar {
  display: none;
}

.au-theme .au-nav a {
  flex: none;
  padding: 7px 14px;
  border-radius: var(--au-radius-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--au-text-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.au-theme .au-nav a:hover {
  background: var(--au-surface-2);
  color: var(--au-text);
}

/* ---------------------------------------------------------------------------
   cards & grids
   --------------------------------------------------------------------------- */

.au-theme .au-grid {
  display: grid;
  gap: var(--au-gap);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

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

.au-theme .au-grid-3 {
  display: grid;
  gap: var(--au-gap);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.au-theme .au-split {
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
}

.au-theme .au-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--au-bg);
  border: var(--au-hairline);
  border-radius: var(--au-radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.au-theme .au-card:hover {
  transform: translateY(-2px);
  border-color: var(--au-border-strong);
  box-shadow: var(--au-shadow-lift);
  color: inherit;
}

.au-theme .au-card-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--au-surface-2);
}

.au-theme .au-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
}

.au-theme .au-card-title {
  margin: 0;
  font-family: var(--au-font-display);
  font-size: 1.0625rem;
  font-weight: var(--au-display-weight);
  line-height: 1.32;
  letter-spacing: var(--au-display-tracking);
  color: var(--au-text);
}

.au-theme .au-card-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--au-text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.au-theme .au-card-body .au-meta {
  margin-top: auto;
  padding-top: 4px;
}

/* feature card ------------------------------------------------------------ */

.au-theme .au-feature {
  position: relative;
  display: block;
  border-radius: var(--au-radius);
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: var(--au-surface-2);
}

.au-theme .au-feature img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.au-theme .au-feature:hover img {
  transform: scale(1.03);
}

.au-theme .au-feature-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px 24px 22px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.15) 65%, transparent);
}

.au-theme .au-feature-overlay .au-kicker {
  color: #fff;
  opacity: 0.85;
}

.au-theme .au-feature-title {
  margin: 0;
  font-family: var(--au-font-display);
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.9rem);
  font-weight: var(--au-display-weight);
  line-height: 1.22;
  letter-spacing: var(--au-display-tracking);
  color: #fff;
}

/* compact list ------------------------------------------------------------ */

.au-theme .au-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.au-theme .au-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  margin-inline: -12px;
  border-radius: var(--au-radius-sm);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.au-theme .au-list-item:hover {
  background: var(--au-surface);
  color: inherit;
}

.au-theme .au-list-item img {
  flex: none;
  width: 76px;
  height: 62px;
  object-fit: cover;
  border-radius: var(--au-radius-sm);
  background: var(--au-surface-2);
}

.au-theme .au-list-item h3 {
  margin: 4px 0 0;
  font-family: var(--au-font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: var(--au-display-tracking);
  color: var(--au-text);
}

.au-theme .au-list-item .au-kicker {
  margin-bottom: 0;
  font-size: 0.625rem;
}

/* chips / badges ---------------------------------------------------------- */

.au-theme .au-chip {
  display: inline-block;
  padding: 5px 11px;
  border: var(--au-hairline);
  border-radius: var(--au-radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--au-text-soft);
  text-decoration: none;
  background: var(--au-bg);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.au-theme .au-chip:hover {
  border-color: var(--au-accent-strong);
  color: var(--au-accent-strong);
}

.au-theme .au-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: var(--au-radius-pill);
  background: var(--au-accent-strong);
  color: var(--au-accent-ink);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.au-theme .au-badge-float {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
}

/* ---------------------------------------------------------------------------
   article
   --------------------------------------------------------------------------- */

.au-theme .au-article {
  max-width: 760px;
  margin-inline: auto;
}

.au-theme .au-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  color: var(--au-muted);
}

.au-theme .au-breadcrumb a {
  color: var(--au-muted);
  text-decoration: none;
}

.au-theme .au-breadcrumb a:hover {
  color: var(--au-accent-strong);
}

.au-theme .au-breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--au-border-strong);
}

.au-theme .au-breadcrumb .au-current {
  color: var(--au-text-soft);
  max-width: 42ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.au-theme .au-article-title {
  margin: 0 0 16px;
  font-family: var(--au-font-display);
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
  font-weight: var(--au-display-weight);
  line-height: 1.15;
  letter-spacing: var(--au-display-tracking);
  color: var(--au-text);
}

.au-theme .au-article-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--au-radius);
  margin: 28px 0 8px;
  background: var(--au-surface-2);
}

.au-theme .au-prose {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--au-text-soft);
}

.au-theme .au-prose > * {
  margin-block: 0 1.15em;
}

.au-theme .au-prose h2,
.au-theme .au-prose h3,
.au-theme .au-prose h4 {
  margin-top: 1.9em;
  margin-bottom: 0.6em;
  font-family: var(--au-font-display);
  font-weight: var(--au-display-weight);
  line-height: 1.3;
  letter-spacing: var(--au-display-tracking);
  color: var(--au-text);
}

.au-theme .au-prose h2 { font-size: 1.5rem; }
.au-theme .au-prose h3 { font-size: 1.25rem; }
.au-theme .au-prose h4 { font-size: 1.0625rem; }

.au-theme .au-prose img {
  width: 100%;
  height: auto;
  border-radius: var(--au-radius);
}

.au-theme .au-prose a {
  color: var(--au-accent-strong);
  text-underline-offset: 2px;
}

.au-theme .au-prose ul,
.au-theme .au-prose ol {
  padding-left: 1.35em;
}

.au-theme .au-prose li {
  margin-bottom: 0.5em;
}

.au-theme .au-prose blockquote {
  margin-inline: 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--au-accent);
  color: var(--au-text);
  font-style: italic;
}

.au-theme .au-author {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  padding: 22px;
  background: var(--au-surface);
  border: var(--au-hairline);
  border-radius: var(--au-radius);
}

.au-theme .au-author img {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: var(--au-radius-pill);
  object-fit: cover;
}

.au-theme .au-author h3 {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--au-text);
}

.au-theme .au-author p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--au-muted);
}

.au-theme .au-notice {
  max-width: 560px;
  margin: 72px auto;
  padding: 40px 32px;
  text-align: center;
  background: var(--au-surface);
  border: var(--au-hairline);
  border-radius: var(--au-radius);
}

.au-theme .au-notice h1 {
  margin: 0 0 10px;
  font-family: var(--au-font-display);
  font-size: 1.375rem;
  font-weight: var(--au-display-weight);
  letter-spacing: var(--au-display-tracking);
}

.au-theme .au-notice p {
  margin: 0;
  color: var(--au-muted);
}

.au-theme .au-spinner {
  width: 26px;
  height: 26px;
  margin: 22px auto 0;
  border: 2px solid var(--au-border-strong);
  border-top-color: var(--au-accent);
  border-radius: 50%;
  animation: au-spin 0.8s linear infinite;
}

@keyframes au-spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------------------
   page header + pagination
   --------------------------------------------------------------------------- */

.au-theme .au-page-head {
  padding-block: 44px 8px;
  border-bottom: var(--au-hairline);
  margin-bottom: 40px;
}

.au-theme .au-page-title {
  margin: 0 0 10px;
  font-family: var(--au-font-display);
  font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem);
  font-weight: var(--au-display-weight);
  letter-spacing: var(--au-display-tracking);
  line-height: 1.15;
}

.au-theme .au-page-lead {
  margin: 0 0 24px;
  max-width: 62ch;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--au-muted);
}

.au-theme .au-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 24px;
}

.au-theme .au-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 56px;
}

.au-theme .au-pagination a,
.au-theme .au-pagination span {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 12px;
  border: var(--au-hairline);
  border-radius: var(--au-radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--au-text-soft);
  text-decoration: none;
  background: var(--au-bg);
}

.au-theme .au-pagination a:hover {
  border-color: var(--au-accent-strong);
  color: var(--au-accent-strong);
}

.au-theme .au-pagination .au-page-current {
  background: var(--au-accent-strong);
  border-color: var(--au-accent-strong);
  color: var(--au-accent-ink);
}

.au-theme .au-pagination .au-page-disabled {
  opacity: 0.45;
}

/* ---------------------------------------------------------------------------
   newsletter panel
   --------------------------------------------------------------------------- */

.au-theme .au-panel {
  padding: 44px 32px;
  text-align: center;
  background: var(--au-surface);
  border: var(--au-hairline);
  border-radius: var(--au-radius);
}

.au-theme .au-panel h2 {
  margin: 0 0 8px;
  font-family: var(--au-font-display);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.65rem);
  font-weight: var(--au-display-weight);
  letter-spacing: var(--au-display-tracking);
}

.au-theme .au-panel p {
  margin: 0 auto 24px;
  max-width: 52ch;
  color: var(--au-muted);
}

.au-theme .au-panel form {
  display: flex;
  gap: 8px;
  max-width: 420px;
  margin-inline: auto;
}

.au-theme .au-panel input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding-inline: 16px;
  border: 1px solid var(--au-border-strong);
  border-radius: var(--au-radius-pill);
  background: var(--au-bg);
  font: inherit;
  font-size: 0.9375rem;
  color: var(--au-text);
}

.au-theme .au-panel input:focus {
  outline: 0;
  border-color: var(--au-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--au-accent) 18%, transparent);
}

.au-theme .au-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding-inline: 22px;
  border: 0;
  border-radius: var(--au-radius-pill);
  background: var(--au-accent-strong);
  color: var(--au-accent-ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease;
}

.au-theme .au-btn:hover {
  filter: brightness(0.92);
  color: var(--au-accent-ink);
}

/* ---------------------------------------------------------------------------
   footer
   --------------------------------------------------------------------------- */

.au-theme .au-footer {
  margin-top: 0;
  padding-block: 48px 36px;
  background: var(--au-footer-bg);
  color: var(--au-footer-text);
}

.au-theme .au-footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* the wordmarks are dark-on-transparent, so the footer gives them a light
   plate instead of letting them disappear into the dark background */
.au-theme .au-footer-brand {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  background: #fff;
  border-radius: var(--au-radius-sm);
  line-height: 0;
}

.au-theme .au-footer-brand img {
  height: 28px;
  width: auto;
}

.au-theme .au-footer-nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.au-theme .au-footer-nav a {
  font-size: 0.875rem;
  color: var(--au-footer-text);
  text-decoration: none;
}

.au-theme .au-footer-nav a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.au-theme .au-footer-fine {
  margin: 0;
  padding-top: 26px;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.55);
}

.au-theme .au-footer-fine + .au-footer-fine {
  padding-top: 8px;
  max-width: 78ch;
}

/* ---------------------------------------------------------------------------
   responsive
   --------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
  .au-theme .au-split {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .au-theme .au-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .au-theme {
    --au-gutter: 16px;
    --au-gap: 18px;
    --au-section-gap: 48px;
  }

  .au-theme .au-header-inner {
    flex-wrap: wrap;
    min-height: 0;
    gap: 12px;
  }

  .au-theme .au-header-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    margin-left: 0;
  }

  .au-theme .au-brand img {
    height: 28px;
  }

  .au-theme .au-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .au-theme .au-grid-2,
  .au-theme .au-grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .au-theme .au-main {
    padding-block: 28px 56px;
  }

  .au-theme .au-panel {
    padding: 32px 20px;
  }

  .au-theme .au-panel form {
    flex-direction: column;
  }

  .au-theme .au-panel input,
  .au-theme .au-panel .au-btn {
    width: 100%;
  }

  .au-theme .au-author {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 479.98px) {
  .au-theme .au-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .au-theme .au-list-item img {
    width: 64px;
    height: 54px;
  }
}
