/* ============================================================
   AI Parent — Theme CSS (blog, archive, single, 404)
   Brand: Blue #1B4FD8 | Orange #F97316 | Navy #1A1A2E | Cream #FFFBF7
   ============================================================ */

/* ---- Base & Screen Reader ---- */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  position: static;
  width: auto;
  height: auto;
  clip: auto;
  white-space: normal;
}

/* ---- Container ---- */
.ap-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Breadcrumbs ---- */
.ap-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
  padding: 16px 0 0;
}
.ap-breadcrumb a { color: var(--ap-blue); text-decoration: none; }
.ap-breadcrumb a:hover { text-decoration: underline; }
.ap-breadcrumb-sep { color: #94a3b8; }

/* ---- Pills / Chips ---- */
.ap-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  white-space: nowrap;
}
.ap-pill-blue { background: #EEF4FF; color: var(--ap-blue); }
.ap-pill-blue:hover { background: #dbeafe; }
.ap-pill-orange { background: #fff7ed; color: var(--ap-orange); }

/* ============================================================
   POSTS GRID
   ============================================================ */
.ap-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 48px 0;
}
@media (max-width: 1024px) {
  .ap-posts-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
@media (max-width: 640px) {
  .ap-posts-grid { grid-template-columns: 1fr; gap: 20px; padding: 32px 0; }
}

/* ---- Post Card ---- */
.ap-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: box-shadow 200ms ease, transform 200ms ease;
  display: flex;
  flex-direction: column;
}
.ap-card:hover {
  box-shadow: 0 8px 24px rgba(27,79,216,.12);
  transform: translateY(-3px);
}
@media (prefers-reduced-motion: reduce) {
  .ap-card { transition: none; }
  .ap-card:hover { transform: none; }
}

.ap-card-img-wrap {
  display: block;
  position: relative;
  aspect-ratio: 3/2;
  overflow: hidden;
}
.ap-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}
.ap-card:hover .ap-card-img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) {
  .ap-card:hover .ap-card-img { transform: none; }
}

.ap-card-cat-badge {
  position: absolute;
  top: 12px;
  left: 12px;
}

.ap-card-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.ap-card-cat {
  align-self: flex-start;
  font-size: 11px;
}

.ap-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ap-navy);
  margin: 0;
}
.ap-card-title a {
  color: inherit;
  text-decoration: none;
}
.ap-card-title a:hover { color: var(--ap-blue); }

.ap-card-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
  margin: 0;
  flex: 1;
}

.ap-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  margin-top: auto;
}

.ap-card-author {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ap-card-avatar {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50%;
  object-fit: cover;
}
.ap-card-author-name {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.ap-card-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #94a3b8;
}
.ap-card-sep { color: #cbd5e1; }

/* ============================================================
   PAGINATION
   ============================================================ */
.ap-pagination,
.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 24px 0 48px;
  flex-wrap: wrap;
}
.ap-pagination .page-numbers,
.nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: #334155;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  transition: all 150ms ease;
}
.ap-pagination .page-numbers:hover,
.nav-links .page-numbers:hover {
  border-color: var(--ap-blue);
  color: var(--ap-blue);
}
.ap-pagination .page-numbers.current,
.nav-links .page-numbers.current {
  background: var(--ap-blue);
  border-color: var(--ap-blue);
  color: #fff;
}
.ap-pagination .page-numbers.dots,
.nav-links .page-numbers.dots {
  border: none;
  background: none;
}

/* ============================================================
   ARCHIVE PAGE
   ============================================================ */
.ap-archive-hero {
  background: linear-gradient(135deg, #EEF4FF 0%, #fff 100%);
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 40px;
}
.ap-archive-hero-inner {
  padding-top: 12px;
}
.ap-archive-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ap-blue);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.ap-archive-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  color: var(--ap-navy);
  margin: 0 0 12px;
  line-height: 1.2;
}
.ap-archive-desc {
  font-size: 17px;
  color: #475569;
  max-width: 600px;
  line-height: 1.65;
  margin: 0;
}
.ap-archive-count {
  display: inline-block;
  margin-top: 16px;
  font-size: 13px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 4px 12px;
  border-radius: 100px;
}

.ap-archive-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 24px 0 0;
}
.ap-archive-showing {
  font-size: 13px;
  color: #64748b;
}
.ap-archive-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ap-cat-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: #f1f5f9;
  color: #475569;
  transition: all 150ms ease;
}
.ap-cat-chip:hover,
.ap-cat-chip.is-active {
  background: var(--ap-blue);
  color: #fff;
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.ap-single-hero {
  background: linear-gradient(180deg, #EEF4FF 0%, #fff 100%);
  padding-bottom: 0;
}
.ap-single-meta-top { padding-top: 12px; }
.ap-single-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(26px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--ap-navy);
  margin: 16px 0 20px;
  max-width: 800px;
}
.ap-single-byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 32px;
  font-size: 14px;
  color: #64748b;
}
.ap-single-author { display: flex; align-items: center; gap: 8px; }
.ap-author-avatar {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50%;
  object-fit: cover;
}
.ap-author-name { font-weight: 600; color: #1e293b; }
.ap-byline-sep { color: #cbd5e1; }
.ap-read-time { font-weight: 500; }

.ap-single-featured-img {
  margin-top: 8px;
}
.ap-featured-img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 20px 20px 0 0;
}

/* Single layout: content + sidebar */
.ap-single-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  padding: 48px 0 80px;
  align-items: start;
}
@media (max-width: 1024px) {
  .ap-single-layout { grid-template-columns: 1fr; gap: 40px; }
  .ap-single-sidebar { order: -1; }
}

/* Article body typography */
.ap-entry-content {
  font-family: 'Lora', Georgia, serif;
  font-size: 18px;
  line-height: 1.8;
  color: #1e293b;
}
.ap-entry-content h2,
.ap-entry-content h3,
.ap-entry-content h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: var(--ap-navy);
  margin-top: 2em;
  margin-bottom: .5em;
  line-height: 1.3;
}
.ap-entry-content h2 { font-size: 28px; }
.ap-entry-content h3 { font-size: 22px; }
.ap-entry-content h4 { font-size: 18px; }
.ap-entry-content p { margin: 0 0 1.4em; }
.ap-entry-content a { color: var(--ap-blue); text-decoration: underline; }
.ap-entry-content a:hover { color: #1544b8; }
.ap-entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 24px 0;
}
.ap-entry-content blockquote {
  border-left: 4px solid var(--ap-blue);
  padding: 16px 24px;
  margin: 32px 0;
  background: #EEF4FF;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: #334155;
}
.ap-entry-content ul,
.ap-entry-content ol {
  margin: 0 0 1.4em 1.2em;
}
.ap-entry-content li { margin-bottom: .4em; }
.ap-entry-content pre {
  background: var(--ap-navy);
  color: #e2e8f0;
  padding: 20px 24px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}
.ap-entry-content code {
  font-size: .875em;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ap-blue);
}
.ap-entry-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}
.ap-entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
}
.ap-entry-content th {
  background: var(--ap-navy);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  letter-spacing: .04em;
}
.ap-entry-content td {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.ap-entry-content tr:nth-child(even) td { background: #f8fafc; }

/* Tags */
.ap-tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid #e2e8f0;
}
.ap-tag-label { font-size: 13px; font-weight: 600; color: #64748b; }
.ap-tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  background: #f1f5f9;
  text-decoration: none;
  transition: all 150ms ease;
}
.ap-tag-pill:hover { background: var(--ap-blue); color: #fff; }

/* Author card */
.ap-author-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px;
  margin-top: 48px;
}
.ap-author-card-img {
  width: 72px !important;
  height: 72px !important;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.ap-author-card-body { flex: 1; }
.ap-author-card-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #94a3b8;
  margin-bottom: 4px;
}
.ap-author-card-name {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ap-navy);
  margin-bottom: 8px;
}
.ap-author-card-bio {
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
  margin: 0;
}
@media (max-width: 480px) {
  .ap-author-card { flex-direction: column; }
}

/* Post navigation */
.ap-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid #e2e8f0;
}
.ap-post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-decoration: none;
  transition: all 150ms ease;
}
.ap-post-nav-link:hover { border-color: var(--ap-blue); background: #EEF4FF; }
.ap-post-nav-next { text-align: right; }
.ap-post-nav-dir { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ap-blue); }
.ap-post-nav-ttl { font-size: 14px; font-weight: 600; color: var(--ap-navy); line-height: 1.4; }
@media (max-width: 600px) {
  .ap-post-nav { grid-template-columns: 1fr; }
  .ap-post-nav-next { text-align: left; }
}

/* Comments */
.ap-comments-wrap {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid #e2e8f0;
}

/* ---- Sidebar ---- */
.ap-single-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 100px;
}

.ap-sidebar-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
}
.ap-sidebar-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ap-navy);
  margin: 0 0 16px;
}

/* Newsletter sidebar */
.ap-sidebar-newsletter {
  background: linear-gradient(135deg, #EEF4FF 0%, #dbeafe 100%);
  border-color: #bfdbfe;
  text-align: center;
}
.ap-sidebar-newsletter-icon { font-size: 32px; margin-bottom: 8px; }
.ap-sidebar-newsletter h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ap-navy);
  margin: 0 0 8px;
}
.ap-sidebar-newsletter p {
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 16px;
}
.ap-sidebar-newsletter small {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-top: 10px;
}
.ap-sidebar-form { display: flex; flex-direction: column; gap: 8px; }
.ap-sidebar-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #bfdbfe;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: #fff;
  box-sizing: border-box;
}
.ap-sidebar-input:focus { border-color: var(--ap-blue); }
.ap-sidebar-btn {
  width: 100%;
  padding: 12px;
  background: var(--ap-blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease;
}
.ap-sidebar-btn:hover { background: #1544b8; }

/* Category list */
.ap-sidebar-cats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ap-sidebar-cats li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #334155;
  text-decoration: none;
  transition: all 150ms ease;
}
.ap-sidebar-cats li a:hover { background: #EEF4FF; color: var(--ap-blue); }
.ap-cat-count {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 100px;
}

/* Popular posts */
.ap-popular-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  transition: opacity 150ms ease;
}
.ap-popular-item:last-child { border-bottom: none; padding-bottom: 0; }
.ap-popular-item:hover { opacity: .8; }
.ap-popular-img {
  width: 64px !important;
  height: 64px !important;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.ap-popular-img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  font-size: 24px;
}
.ap-popular-body { flex: 1; }
.ap-popular-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ap-navy);
  line-height: 1.4;
  margin-bottom: 4px;
}
.ap-popular-date { font-size: 12px; color: #94a3b8; }

/* ============================================================
   404 PAGE
   ============================================================ */
.ap-404 {
  padding: 80px 0 120px;
}
.ap-404-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.ap-404-illustration { margin-bottom: 8px; }
.ap-404-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  color: var(--ap-navy);
  margin: 0;
}
.ap-404-desc {
  font-size: 17px;
  color: #475569;
  line-height: 1.65;
  max-width: 480px;
  margin: 0;
}
.ap-404-search {
  display: flex;
  width: 100%;
  max-width: 440px;
  gap: 0;
}
.ap-404-search-input {
  flex: 1;
  padding: 12px 18px;
  border: 2px solid #e2e8f0;
  border-right: none;
  border-radius: 12px 0 0 12px;
  font-size: 15px;
  outline: none;
}
.ap-404-search-input:focus { border-color: var(--ap-blue); }
.ap-404-search-btn {
  padding: 12px 18px;
  background: var(--ap-blue);
  color: #fff;
  border: 2px solid var(--ap-blue);
  border-radius: 0 12px 12px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 150ms ease;
}
.ap-404-search-btn:hover { background: #1544b8; border-color: #1544b8; }
.ap-404-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.ap-404-popular { width: 100%; text-align: left; margin-top: 16px; }
.ap-404-popular-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ap-navy);
  margin: 0 0 20px;
  text-align: center;
}
.ap-404-popular-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 640px) {
  .ap-404-popular-grid { grid-template-columns: 1fr; }
}
.ap-404-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: box-shadow 150ms ease;
}
.ap-404-card:hover { box-shadow: 0 4px 16px rgba(27,79,216,.1); }
.ap-404-card-img {
  width: 100% !important;
  height: 120px !important;
  object-fit: cover;
}
.ap-404-card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.ap-404-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ap-navy);
  margin: 0;
  line-height: 1.3;
}
.ap-404-card-date { font-size: 11px; color: #94a3b8; }

/* ============================================================
   NO RESULTS
   ============================================================ */
.ap-no-results {
  text-align: center;
  padding: 80px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.ap-no-results-icon { color: var(--ap-blue); }
.ap-no-results-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--ap-navy);
  margin: 0;
}
.ap-no-results-desc {
  font-size: 16px;
  color: #475569;
  max-width: 440px;
  line-height: 1.65;
  margin: 0;
}
.ap-no-results-search { display: flex; gap: 8px; }
.ap-no-results-input {
  padding: 12px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  width: 280px;
  outline: none;
}
.ap-no-results-input:focus { border-color: var(--ap-blue); }
.ap-no-results-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.ap-no-results-cats-label { font-size: 13px; font-weight: 600; color: #64748b; }

/* ============================================================
   BUTTONS (shared across templates)
   ============================================================ */
.ap-btn-primary,
.ap-btn-orange,
.ap-btn-outline,
.ap-btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: all 150ms ease;
  cursor: pointer;
  border: 2px solid transparent;
  white-space: nowrap;
  min-height: 44px;
}
.ap-btn-primary { background: var(--ap-blue); color: #fff; border-color: var(--ap-blue); }
.ap-btn-primary:hover { background: #1544b8; border-color: #1544b8; }
.ap-btn-orange { background: var(--ap-orange); color: #fff; border-color: var(--ap-orange); }
.ap-btn-orange:hover { background: #ea6a00; border-color: #ea6a00; }
.ap-btn-outline { background: transparent; color: var(--ap-blue); border-color: var(--ap-blue); }
.ap-btn-outline:hover { background: #EEF4FF; }
.ap-btn-dark { background: var(--ap-navy); color: #fff; border-color: var(--ap-navy); }
.ap-btn-dark:hover { background: #2d2d4a; }

/* ============================================================
   FALLBACK NAV / FOOTER (when no TB templates active)
   ============================================================ */
.ap-fallback-nav {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.ap-fallback-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.ap-fallback-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--ap-navy);
  text-decoration: none;
}
.ap-fallback-menu {
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ap-fallback-menu li a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  border-radius: 8px;
  transition: all 150ms ease;
}
.ap-fallback-menu li a:hover { background: #EEF4FF; color: var(--ap-blue); }

.ap-fallback-footer {
  background: var(--ap-navy);
  color: #fff;
  padding: 40px 0;
}
.ap-fallback-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ap-fallback-footer .ap-fallback-logo { color: #fff; }
.ap-fallback-copy { font-size: 13px; color: #94a3b8; margin: 0; }
.ap-fallback-footer-menu {
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ap-fallback-footer-menu li a {
  display: inline-flex;
  padding: 6px 12px;
  font-size: 13px;
  color: #94a3b8;
  text-decoration: none;
  transition: color 150ms ease;
}
.ap-fallback-footer-menu li a:hover { color: #fff; }

/* ============================================================
   PAGE HEADER (page.php / non-Elementor pages)
   ============================================================ */
.ap-content-wrap { padding: 48px 0 80px; }
.ap-page-header { margin-bottom: 32px; }
.ap-page-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  color: var(--ap-navy);
  margin: 0;
}
.ap-page-subtitle {
  font-size: 17px;
  color: #475569;
  margin: 12px 0 0;
}

/* ═══ Homepage mobile responsive fixes (overflow + hero) ═══ */
@media (max-width: 768px){
  html, body { overflow-x: hidden !important; }
  .ap-hero-wrap { overflow: hidden !important; }        /* 装饰圆圈不溢出 */
  .ap-ep-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .ap-ep-grid > * { min-width: 0 !important; }
  /* Elementor 容器/组件不超过视口 */
  .elementor .e-con, .elementor .e-con-inner,
  .elementor-widget-container { max-width: 100% !important; }
  .elementor img { max-width: 100% !important; height: auto; }
}

/* ═══ Mobile menu: remove from layout when closed (fix 864px overflow) ═══ */
.ap-mobile-menu:not(.open){ display: none !important; }
.ap-mobile-menu, .ap-mobile-panel, .ap-mobile-sub { max-width: 100vw; box-sizing: border-box; }

/* ═══ Homepage mobile: hide decorative spin rings + wrap stats row ═══ */
@media (max-width: 768px){
  /* 旋转虚线圆环/方块（装饰）溢出视口 → 手机隐藏 */
  .ap-arc-spin { display: none !important; }
  /* 数据条 flex 行：让父容器换行，取消竖分隔线 */
  div:has(> div[style*="border-right:1px solid rgba(255,255,255,.15)"]){
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  div[style*="border-right:1px solid rgba(255,255,255,.15)"]{
    border-right: none !important;
  }
}

/* ═══ Homepage mobile: stats bar is a 4-col GRID (no mobile override) → fix ═══ */
@media (max-width: 768px){
  div[style*="grid-template-columns:repeat(4,1fr)"]{
    grid-template-columns: repeat(2,1fr) !important;
  }
  div[style*="grid-template-columns:repeat(4,1fr)"] > div{
    flex-direction: column !important;
    text-align: center !important;
    gap: 10px !important;
    padding: 22px 12px !important;
    border-right: none !important;
    min-width: 0 !important;
  }
}
