/*
Theme Name: Allingly Ultra AI Content Engine
Theme URI: https://example.com/allingly-ultra-ai-content-engine
Author: Codex
Description: A modular, automation-driven WordPress content engine theme for large publishing sites.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: allingly-ultra
*/

:root {
  --au-color-bg: #f3f4f8;
  --au-color-surface: #ffffff;
  --au-color-surface-strong: #f5f7fb;
  --au-color-text: #263b6d;
  --au-color-muted: #5d6c8f;
  --au-color-primary: #1856d3;
  --au-color-secondary: #202f5b;
  --au-color-border: #e6e9ef;
  --au-color-accent: #edf2ff;
  --au-color-glow: rgba(19, 104, 206, 0.14);
  --au-radius: 10px;
  --au-shadow: 0 2px 18px rgba(29, 46, 80, 0.06);
  --au-content-width: 1240px;
  --au-reading-width: 780px;
  --au-font-body: "Josefin Sans", "Segoe UI", Arial, sans-serif;
  --au-font-heading: "Josefin Sans", "Segoe UI", Arial, sans-serif;
  --au-font-size: 17px;
  --au-line-height: 1.72;
  --au-space: 24px;
}

body {
  margin: 0;
  background: #f5f5f5;
  color: var(--au-color-text);
  font-family: var(--au-font-body);
  font-size: var(--au-font-size);
  line-height: var(--au-line-height);
}

body.au-dark {
  --au-color-bg: #09111d;
  --au-color-surface: #111c2b;
  --au-color-surface-strong: #0e1724;
  --au-color-text: #e8eef8;
  --au-color-muted: #9bacc1;
  --au-color-primary: #6cb6ff;
  --au-color-secondary: #ffffff;
  --au-color-border: #1e3147;
  --au-color-accent: #13263a;
  --au-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  background:
    radial-gradient(circle at top left, rgba(76, 157, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #09111d 0%, #0a1422 100%);
}

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

a {
  color: var(--au-color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--au-color-primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.au-site-wrap {
  min-height: 100vh;
  position: relative;
  overflow: clip;
}

.au-container {
  width: min(calc(100% - 32px), var(--au-content-width));
  margin: 0 auto;
}

.au-bg-orb {
  display: none;
}

.au-bg-orb-a {
  top: 80px;
  left: -120px;
  width: 320px;
  height: 320px;
  background: rgba(19, 104, 206, 0.08);
}

.au-bg-orb-b {
  top: 280px;
  right: -120px;
  width: 380px;
  height: 380px;
  background: rgba(19, 104, 206, 0.08);
}

.au-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 4px;
  background: transparent;
  z-index: 110;
}

.au-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--au-color-primary), #33d2ff);
  transition: width 0.15s linear;
}

.au-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 0;
}

.au-header-inner,
.au-header-top-inner,
.au-footer-inner,
.au-bottom-nav,
.au-home-grid,
.au-post-meta-row,
.au-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.au-header-inner {
  min-height: 70px;
}

.au-header-top {
  background: #fff;
}

.au-header-top-inner {
  justify-content: space-between;
  min-height: 110px;
}

.au-branding strong {
  display: block;
  font-family: var(--au-font-heading);
  font-size: clamp(2rem, 3vw, 3rem);
  color: var(--au-color-secondary);
  letter-spacing: -0.04em;
  text-align: center;
}

.au-branding span {
  display: none;
}

.au-branding {
  flex: 1;
  text-align: center;
}

.au-header-nav-wrap {
  background: var(--au-color-primary);
}

.au-nav {
  display: block;
  width: 100%;
}

.au-nav ul {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0 0 10px;
}

.au-nav li {
  list-style: none;
  margin: 0;
}

.au-nav a {
  color: #fff;
  padding: 16px 18px;
  border-radius: 0;
  font-size: 1.05rem;
  font-weight: 700;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.au-nav a:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: none;
  color: #fff;
}

.au-actions {
  gap: 18px;
}

.au-button,
button,
input[type="submit"] {
  border: 0;
  border-radius: 999px;
  padding: 12px 24px;
  background: var(--au-color-primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px var(--au-color-glow);
}

.au-shell {
  padding: 24px 0 100px;
}

.au-card,
.au-sidebar-card,
.au-footer-panels,
.au-search-results,
.au-focus-toggle,
.au-toc,
.au-faq,
.au-author-box,
.au-summary,
.au-takeaways {
  background: var(--au-color-surface);
  border: 1px solid var(--au-color-border);
  border-radius: var(--au-radius);
  box-shadow: var(--au-shadow);
}

.au-section-kicker {
  margin: 0 0 12px;
  color: var(--au-color-primary);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  font-weight: 700;
}

.au-post-card-footer,
.au-post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.au-home-layout {
  display: grid;
  gap: 24px;
}

.au-home-grid {
  align-items: stretch;
  justify-content: space-between;
  margin-bottom: 22px;
}

.au-posts {
  display: grid;
  gap: 18px;
}

.au-posts[data-view="grid"] {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.au-post-card {
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.au-post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(19, 104, 206, 0.24);
  box-shadow: 0 26px 70px rgba(17, 34, 58, 0.12);
}

.au-post-card-media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.au-post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.au-post-card:hover .au-post-card-media img {
  transform: scale(1.04);
}

.au-post-card-content {
  padding: 22px;
}

.au-post-card h2,
.au-post-card h3,
.au-single-main h1,
.au-entry-content h2,
.au-entry-content h3,
.au-entry-content h4 {
  font-family: var(--au-font-heading);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.au-post-card h2 {
  margin: 10px 0 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.au-post-card p {
  color: var(--au-color-muted);
}

.au-post-card-meta {
  color: var(--au-color-primary);
  letter-spacing: 0.02em;
  font-size: 0.9rem;
  font-weight: 700;
}

.au-post-card-footer {
  margin-top: 16px;
  color: var(--au-color-secondary);
  font-weight: 700;
}

.au-layout {
  display: grid;
  gap: 24px;
}

.au-single-main {
  min-width: 0;
}

.au-entry-header,
.au-entry-content,
.au-entry-footer {
  background: var(--au-color-surface);
  border: 1px solid var(--au-color-border);
  border-radius: var(--au-radius);
  box-shadow: var(--au-shadow);
  padding: 28px;
}

.au-entry-content {
  max-width: var(--au-reading-width);
}

.au-entry-header h1 {
  margin: 12px 0 0;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  max-width: 16ch;
}

.au-entry-kicker {
  margin-top: 14px;
}

.au-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--au-color-primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.au-featured-image {
  margin-top: 24px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--au-color-surface-strong);
  min-height: 260px;
}

.au-featured-image img {
  width: 100%;
  height: auto;
  min-height: 260px;
  object-fit: cover;
}

.au-breadcrumbs,
.au-post-meta,
.au-muted {
  color: var(--au-color-muted);
}

.au-live-search {
  position: relative;
}

.au-live-search input {
  width: min(100%, 320px);
  border-radius: 999px;
  border: 1px solid var(--au-color-border);
  padding: 13px 18px;
  background: #fff;
  color: var(--au-color-text);
  min-width: 210px;
}

.au-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(92vw, 360px);
  padding: 12px;
  display: none;
}

.au-search-results.is-active {
  display: block;
}

.au-search-results article + article {
  border-top: 1px solid var(--au-color-border);
  padding-top: 12px;
  margin-top: 12px;
}

.au-bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px 14px;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--au-color-border);
  border-radius: 999px;
  box-shadow: var(--au-shadow);
  z-index: 100;
}

.au-bottom-nav a {
  color: var(--au-color-secondary);
  font-size: 0.9rem;
}

.au-footer {
  padding: 48px 0 120px;
  border-top: 1px solid var(--au-color-border);
}

.au-footer-panels {
  padding: 28px;
  display: grid;
  gap: 24px;
}

.au-sidebar-card h3,
.au-footer-panels h2,
.au-footer-panels h3 {
  margin-top: 0;
}

.au-sidebar {
  position: sticky;
  top: 112px;
  align-self: start;
}

.au-sidebar ul,
.au-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.au-sidebar li,
.au-footer li {
  padding: 12px 0;
  border-top: 1px solid var(--au-color-border);
}

.au-sidebar li:first-child,
.au-footer li:first-child {
  border-top: 0;
}

.au-summary,
.au-takeaways,
.au-faq,
.au-toc,
.au-entry-footer {
  margin-top: 24px;
  padding: 24px;
}

.au-entry-toolbar {
  justify-content: space-between;
  margin-bottom: 22px;
}

.au-focus-toggle {
  padding: 8px;
}

.au-post-meta-row {
  flex-wrap: wrap;
  margin-top: 18px;
}

.au-focus-mode .au-header,
.au-focus-mode .au-footer,
.au-focus-mode .au-sidebar,
.au-focus-mode .au-bottom-nav {
  display: none;
}

.au-focus-mode .au-entry-content {
  margin-inline: auto;
}

.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;
}

@media (min-width: 768px) {
  .au-home-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .au-layout.au-has-sidebar-right {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .au-layout.au-has-sidebar-left {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .au-bottom-nav {
    display: none;
  }
}

@media (max-width: 767px) {
  .au-shell {
    padding-top: 20px;
  }

  .au-header-inner {
    min-height: 54px;
  }

  .au-header-top-inner {
    min-height: auto;
    padding: 18px 0;
    flex-direction: column;
    gap: 14px;
  }

  .au-branding strong {
    font-size: 2rem;
  }

  .au-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .au-home-grid {
    flex-direction: column;
    align-items: flex-start;
  }

  .au-nav ul {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0;
  }

  .au-nav a {
    white-space: nowrap;
    padding: 14px 16px;
  }

  .au-entry-header h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }
}
