/*
Theme Name: MyAITheme
Theme URI: https://xilxil.com
Author: AI Studio
Author URI: https://ai.studio
Description: MyAITheme — a complete, production-ready AI-automation agency theme carrying the full XILXIL BSE engine, Elementor-compatible (free Elementor; bundled XILXIL Elementor Toolkit v1.2.0 companion plugin with 21 XILXIL widgets + 12-page starter importer): 18 reorderable homepage sections with per-section enable/disable, 4 native mega menus (Services, Demo Projects, Top Picks, Company), announcement bar, sticky header, floating bot dock, animated counters, blog/single/page/search/404 templates, widget areas and a pro-grade Customizer with 11 panels / 40 sections / 1108+ controls. Ships the bundled XILXIL AutoPilot v2.0.0 plugin (multi-provider AI model selector, 12 news niches & RSS sources, geographic filters, 3 SEO-optimized images per article, rich components, flexible scheduling, and endpoint directory). Standalone theme, no child theme required.
Version: 1.6.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: myaitheme
Tags: blog, one-column, custom-colors, custom-menu, custom-logo, featured-images, full-width-template, theme-options, threaded-comments, translation-ready
*/

/* ==========================================================================
   1. Core Viewport, Typography & Accessibility Foundation (WCAG 2.2)
   ========================================================================== */
html,
body {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

/* Neutralize WordPress 6.7+ sizes="auto" intrinsic aspect-ratio distortion on flex/grid cards */
img:is([sizes="auto" i], [sizes^="auto," i]) {
  contain-intrinsic-size: none !important;
}

/* Preserve XILXIL dotted-grid and motion backgrounds inside Elementor 4.x lazy-loaded containers */
.e-con.e-parent:not(.e-lazyloaded) .xilxil-dotted-grid {
  background-image: radial-gradient(circle, rgba(53, 118, 224, 0.28) 1px, transparent 1px) !important;
}

/* Blog & Archive Pagination (.xilxil-pagination) */
.xilxil-pagination .nav-links,
.xilxil-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.xilxil-pagination .page-numbers {
  display: inline-flex;
  min-height: 2.5rem;
  min-width: 2.5rem;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.875rem;
  border-radius: 0.625rem;
  border: 1px solid var(--border, #1e293b);
  background: var(--card, #0b1322);
  color: var(--ink, #f8fafc);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.xilxil-pagination a.page-numbers:hover {
  border-color: rgba(53, 118, 224, 0.65);
  color: var(--color-brand, #3576e0);
}

.xilxil-pagination .page-numbers.current {
  border-color: var(--color-brand, #3576e0);
  background: var(--color-brand, #3576e0);
  color: #ffffff;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

[data-counter],
[data-section="stats"],
[data-section="pricing"],
.xap-table-wrap table {
  font-variant-numeric: tabular-nums;
}

/* Consistent WCAG 2.2 2.4.7 / 2.4.11 keyboard focus indicator */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ring, #3576e0);
  outline-offset: 2px;
}

/* ==========================================================================
   2. Header, Mega Menu & Mobile Navigation Drawer Polish
   ========================================================================== */
header[data-cx-entry="header.root"][data-scrolled="true"] {
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}

#site-mega-panel [data-cx-entry="mega.panel"] {
  max-height: calc(100vh - 5.25rem);
  overflow-y: auto;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 32px 80px -20px rgba(0, 3, 12, 0.78);
}

#site-mega-panel a {
  transition: background-color 160ms ease, transform 160ms ease;
}

/* Mobile Sheet Accordion Chevron & Active State */
details.xilxil-sheet-details > summary .sheet-chevron {
  display: inline-flex;
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

details.xilxil-sheet-details[open] > summary {
  color: var(--color-brand, #3576e0);
}

details.xilxil-sheet-details[open] > summary .sheet-chevron {
  transform: rotate(180deg);
}

/* ==========================================================================
   3. Surface Luminance & Tactile Card Micro-Interactions
   ========================================================================== */
[data-card],
[data-cx-entry^="services.card"],
[data-cx-entry^="projects.card"],
[data-cx-entry^="pricing.card"],
[data-cx-entry^="why.card"],
[data-cx-entry^="blog.card"] {
  transition:
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 240ms ease,
    box-shadow 240ms ease;
}

@media (hover: hover) and (pointer: fine) {
  [data-cx-entry^="services.card"]:hover,
  [data-cx-entry^="projects.card"]:hover,
  [data-cx-entry^="why.card"]:hover,
  [data-cx-entry^="blog.card"]:hover {
    transform: translateY(-2px);
    border-color: rgba(53, 118, 224, 0.42);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      0 18px 40px -18px rgba(2, 6, 23, 0.65);
  }
}

/* ==========================================================================
   4. Floating Bot Dock, Cookie Offset & Mobile Ergonomics
   ========================================================================== */
[data-bot-dock],
[data-floating-rail] {
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-cookie-open] [data-bot-dock],
html[data-cookie-open] [data-floating-rail] {
  transform: translateY(calc(-1 * var(--xilxil-cookie-h, 72px) - 0.5rem));
}

@keyframes xilxil-dock-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#xilxil-bot-actions:not([hidden]) {
  animation: xilxil-dock-pop 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ==========================================================================
   5. Responsive Breakpoints (Tablet, Mobile & Ultra-Narrow Viewports)
   ========================================================================== */
@media (max-width: 1024px) {
  [data-section="hero"] h1 {
    font-size: clamp(2.1rem, 5.2vw, 3.25rem);
    line-height: 1.12;
  }

  [data-section] h2 {
    font-size: clamp(1.65rem, 4.2vw, 2.35rem);
    line-height: 1.18;
  }
}

@media (max-width: 639px) {
  [data-section="hero"] h1 {
    font-size: clamp(1.8rem, 7vw, 2.35rem);
    line-height: 1.15;
  }

  /* Compact floating controls on mobile so primary CTAs stay unobstructed */
  [data-bot-dock] {
    right: 0.75rem;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    padding: 0.375rem;
    border-radius: 1.5rem;
  }

  [data-bot-dock] [data-bot-fab="main"] {
    width: 3.25rem;
    height: 3.25rem;
  }

  [data-floating-rail] {
    left: 0.75rem;
    bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  /* Keep hero CTAs full-width and easy to tap on phones */
  [data-section="hero"] [data-cx-entry="hero.ctaPrimary"],
  [data-section="hero"] [data-cx-entry="hero.ctaSecondary"] {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  [data-container] {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }

  /* Prevent WhatsApp workflow demo badges from overflowing narrow 360px screens */
  [data-section="hero"] [data-cx-entry^="hero.workflow"] {
    max-width: 100%;
  }
}

/* ==========================================================================
   6. XILXIL AutoPilot v2.0 & Editorial Rich Article Components
   ========================================================================== */
.xilxil-ap-article .xap-table-wrap,
.entry-content .xap-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.75rem 0;
  border-radius: 0.875rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(11, 19, 34, 0.55);
  box-shadow: 0 12px 32px -16px rgba(2, 6, 23, 0.5);
}

.xilxil-ap-article table,
.entry-content table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.925rem;
}

.xilxil-ap-article th,
.entry-content th {
  background: rgba(53, 118, 224, 0.14);
  font-weight: 600;
  text-align: left;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  white-space: nowrap;
}

.xilxil-ap-article td,
.entry-content td {
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  vertical-align: top;
}

.xilxil-ap-article tbody tr:hover,
.entry-content tbody tr:hover {
  background: rgba(53, 118, 224, 0.05);
}

.xilxil-ap-article .xap-pros-cons,
.entry-content .xap-pros-cons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.15rem;
  margin: 1.75rem 0;
}

.xilxil-ap-article .xap-pros-box,
.entry-content .xap-pros-box {
  border: 1px solid rgba(43, 185, 132, 0.35);
  background: linear-gradient(180deg, rgba(43, 185, 132, 0.09) 0%, rgba(43, 185, 132, 0.03) 100%);
  border-radius: 0.875rem;
  padding: 1.25rem 1.35rem;
}

.xilxil-ap-article .xap-cons-box,
.entry-content .xap-cons-box {
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.09) 0%, rgba(245, 158, 11, 0.03) 100%);
  border-radius: 0.875rem;
  padding: 1.25rem 1.35rem;
}

.xilxil-ap-article .xap-timeline,
.entry-content .xap-timeline {
  display: grid;
  gap: 1rem;
  margin: 1.75rem 0;
  border-left: 2px solid #3576e0;
  padding-left: 1.35rem;
}

.xilxil-ap-article .xap-figure,
.entry-content .xap-figure,
.xilxil-ap-article .xap-video,
.entry-content .xap-video {
  margin: 2rem 0;
  border-radius: 0.95rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(11, 19, 34, 0.65);
  box-shadow: 0 18px 40px -20px rgba(2, 6, 23, 0.65);
}

.xilxil-ap-article .xap-figure img,
.entry-content .xap-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.xilxil-ap-article .xap-figure figcaption,
.entry-content .xap-figure figcaption,
.xilxil-ap-article .xap-video figcaption,
.entry-content .xap-video figcaption {
  padding: 0.75rem 1.1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  opacity: 0.85;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

/* ==========================================================================
   7. Reduced Motion Respect (WCAG 2.2 2.3.3)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   8. Global Design & Typography System (Phase 3 Standards)
   Standardizes H1-H6, paragraphs, lists, blockquotes, inline links, captions,
   labels, definition lists, and code blocks across .entry-content,
   .xilxil-article, and .xilxil-ap-article where Tailwind Preflight resets
   browser defaults and WP core block CSS is isolated.
   ========================================================================== */
:root {
  --xilxil-prose-line-height: 1.75;
  --xilxil-prose-link: var(--color-brand, #3576e0);
  --xilxil-prose-link-hover: #60a5fa;
  --xilxil-prose-code-bg: rgba(11, 19, 34, 0.82);
  --xilxil-prose-border: var(--color-border, rgba(148, 163, 184, 0.22));
}

.entry-content,
.xilxil-ap-article {
  font-size: 1rem;
  line-height: var(--xilxil-prose-line-height);
  overflow-wrap: break-word;
}

.entry-content > * + *,
.xilxil-ap-article > * + * {
  margin-top: 1.15rem;
}

.entry-content :is(h1, h2, h3, h4, h5, h6),
.xilxil-ap-article :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--font-heading, var(--font-poppins, sans-serif));
  color: var(--color-ink, #f8fafc);
  letter-spacing: -0.02em;
  scroll-margin-top: 5.5rem;
}

.entry-content h1,
.xilxil-ap-article h1 {
  font-size: clamp(1.875rem, 3vw, 2.375rem);
  font-weight: 700;
  line-height: 1.2;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.entry-content h2,
.xilxil-ap-article h2 {
  font-size: clamp(1.45rem, 2.3vw, 1.85rem);
  font-weight: 700;
  line-height: 1.28;
  margin-top: 2.25rem;
  margin-bottom: 0.85rem;
}

.entry-content h3,
.xilxil-ap-article h3 {
  font-size: clamp(1.225rem, 1.8vw, 1.425rem);
  font-weight: 600;
  line-height: 1.35;
  margin-top: 1.85rem;
  margin-bottom: 0.65rem;
}

.entry-content h4,
.xilxil-ap-article h4 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.entry-content h5,
.xilxil-ap-article h5 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

.entry-content h6,
.xilxil-ap-article h6 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted-foreground, #94a3b8);
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

.entry-content p,
.xilxil-ap-article p {
  line-height: var(--xilxil-prose-line-height);
}

.entry-content ul:not([class]),
.xilxil-ap-article ul:not([class]) {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.entry-content ol:not([class]),
.xilxil-ap-article ol:not([class]) {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.entry-content li,
.xilxil-ap-article li {
  margin: 0.4rem 0;
  line-height: 1.68;
}

.entry-content ul:not([class]) > li::marker,
.entry-content ol:not([class]) > li::marker,
.xilxil-ap-article ul:not([class]) > li::marker,
.xilxil-ap-article ol:not([class]) > li::marker {
  color: var(--color-brand, #3576e0);
  font-weight: 600;
}

.entry-content a:not([class]),
.xilxil-ap-article a:not([class]) {
  color: var(--xilxil-prose-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.entry-content a:not([class]):hover,
.xilxil-ap-article a:not([class]):hover {
  color: var(--xilxil-prose-link-hover);
}

.entry-content blockquote,
.xilxil-ap-article blockquote {
  margin: 1.75rem 0;
  padding: 1.1rem 1.35rem;
  border-left: 3px solid var(--color-brand, #3576e0);
  background: rgba(53, 118, 224, 0.07);
  border-radius: 0 0.75rem 0.75rem 0;
  font-style: italic;
}

.entry-content :is(code, kbd, samp),
.xilxil-ap-article :is(code, kbd, samp) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875em;
  background: rgba(53, 118, 224, 0.12);
  border: 1px solid rgba(53, 118, 224, 0.25);
  border-radius: 0.375rem;
  padding: 0.15em 0.4em;
}

.entry-content pre,
.xilxil-ap-article pre {
  margin: 1.5rem 0;
  padding: 1.15rem 1.35rem;
  overflow-x: auto;
  border-radius: 0.875rem;
  border: 1px solid var(--xilxil-prose-border);
  background: var(--xilxil-prose-code-bg);
  color: #e2e8f0;
  font-size: 0.875rem;
  line-height: 1.65;
}

.entry-content pre code,
.xilxil-ap-article pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.entry-content hr,
.xilxil-ap-article hr {
  margin: 2.25rem 0;
  border: 0;
  border-top: 1px solid var(--xilxil-prose-border);
}

.entry-content dt,
.xilxil-ap-article dt {
  font-weight: 600;
  color: var(--color-ink, #f8fafc);
  margin-top: 1rem;
}

.entry-content dd,
.xilxil-ap-article dd {
  margin-left: 1.25rem;
  color: var(--color-muted-foreground, #94a3b8);
}

