/* Native WordPress blog and article templates. */

/* Licensed Qurova carries display type. Mont remains the reading and numeric
   face, with Montserrat as the web-safe fallback. Shared @font-face rules live
   in assets/site/tokens/font-faces.css. */
body.ag-native-page {
  --font-display: 'Qurova', 'Mont', 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Mont', 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --font-numeric: 'Mont', 'Montserrat', 'Segoe UI', system-ui, sans-serif;
}

body.ag-native-page {
  min-height: 100vh;
  background: #fff;
  color: var(--ink);
}

body.ag-native-page,
body.ag-native-page button,
body.ag-native-page input {
  font-family: var(--font-body);
}

.ag-native-page * {
  box-sizing: border-box;
}

.ag-native-page a {
  color: inherit;
}

.ag-skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 6px;
  transform: translateY(-150%);
}

.ag-skip-link:focus {
  transform: translateY(0);
}

.ag-blog-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(150%) blur(12px);
}

.ag-blog-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(100% - 48px, 1120px);
  min-height: 88px;
  margin: 0 auto;
}

.ag-blog-brand {
  display: flex;
  flex: 0 0 auto;
}

.ag-blog-brand img {
  display: block;
  width: 216px;
  height: auto;
}

.ag-blog-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 10px;
}

.ag-blog-nav a {
  padding: 9px 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
}

.ag-blog-nav a:hover,
.ag-blog-nav a:focus-visible,
.ag-blog-nav a[aria-current="page"] {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.ag-blog-contact,
.ag-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 17px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  background: var(--accent);
  border-radius: 8px;
}

.ag-blog-contact {
  margin-left: auto;
  white-space: nowrap;
}

.ag-blog-contact:hover,
.ag-blog-contact:focus-visible,
.ag-primary-link:hover,
.ag-primary-link:focus-visible {
  color: #fff;
  background: var(--accent-strong);
}

.ag-blog-menu {
  display: none;
  margin-left: auto;
}

.ag-blog-menu summary {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  cursor: pointer;
  list-style: none;
}

.ag-blog-menu summary::-webkit-details-marker {
  display: none;
}

.ag-blog-menu summary svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.ag-blog-menu nav {
  position: absolute;
  top: 88px;
  right: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 24px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 16px 30px rgba(13, 13, 13, 0.1);
}

.ag-blog-menu nav a {
  padding: 12px 4px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.ag-blog-shell {
  width: min(100% - 48px, 1120px);
  margin: 0 auto;
}

.ag-blog-intro {
  padding: 70px 0 58px;
  background: #f7f8fb;
  border-bottom: 1px solid var(--line);
}

.ag-eyebrow {
  margin: 0 0 12px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ag-blog-intro h1,
.ag-article-header h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.ag-blog-intro__copy {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.ag-blog-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: min(100%, 620px);
  margin-top: 28px;
}

.ag-blog-search input {
  min-width: 0;
  height: 48px;
  padding: 0 15px;
  color: var(--ink);
  font-size: 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  outline: none;
}

.ag-blog-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.ag-blog-search button {
  min-width: 104px;
  padding: 0 18px;
  color: #fff;
  font-weight: 700;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0 8px 8px 0;
  cursor: pointer;
}

.ag-blog-search button:hover,
.ag-blog-search button:focus-visible {
  background: var(--accent-strong);
}

.ag-blog-list {
  padding: 54px 0 78px;
}

.ag-blog-list__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.ag-blog-list__header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: 0;
}

.ag-blog-list__header a {
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 600;
}

.ag-post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.ag-post-card {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--secondary);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(13, 13, 13, 0.06);
}

.ag-post-card__image {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f3f0f9;
}

.ag-post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.ag-post-card:hover .ag-post-card__image img {
  transform: scale(1.02);
}

.ag-post-card__body {
  padding: 24px;
}

.ag-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-family: var(--font-numeric);
  font-size: 12.5px;
  line-height: 1.45;
}

.ag-post-meta a {
  color: var(--secondary);
  font-weight: 700;
  text-decoration: none;
}

.ag-post-card h2 {
  margin: 14px 0 10px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.ag-post-card h2 a {
  text-decoration: none;
}

.ag-post-card h2 a:hover,
.ag-post-card h2 a:focus-visible {
  color: var(--accent-strong);
}

.ag-post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.ag-read-link {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin-top: 18px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.ag-read-link:hover,
.ag-read-link:focus-visible {
  text-decoration: underline;
}

.ag-blog-empty {
  padding: 42px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ag-blog-empty h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0;
}

.ag-blog-empty p {
  margin: 0;
  color: var(--muted);
}

.navigation.pagination {
  margin-top: 34px;
}

.navigation.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.navigation.pagination .page-numbers {
  display: grid;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  place-items: center;
  font-family: var(--font-numeric);
  font-size: 14px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.navigation.pagination .current,
.navigation.pagination a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.ag-article-header {
  padding: 66px 0 54px;
  background: #f7f8fb;
  border-bottom: 1px solid var(--line);
}

.ag-article-shell {
  width: min(100% - 48px, 780px);
  margin: 0 auto;
}

.ag-back-link {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.ag-back-link:hover,
.ag-back-link:focus-visible {
  text-decoration: underline;
}

.ag-article-header .ag-post-meta {
  margin-bottom: 16px;
}

.ag-article-header h1 {
  max-width: 16ch;
}

.ag-article-deck {
  max-width: 720px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.6;
}

.ag-article-byline {
  margin: 22px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.ag-article-featured {
  width: min(100% - 48px, 1120px);
  margin: 48px auto 0;
}

.ag-article-featured img {
  display: block;
  width: 100%;
  max-height: 680px;
  object-fit: cover;
  border-radius: 8px;
}

.ag-article-content {
  padding: 54px 0 34px;
  color: #271a45;
  font-size: 17px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.ag-article-content > :first-child {
  margin-top: 0;
}

.ag-article-content h2,
.ag-article-content h3,
.ag-article-content h4 {
  margin: 2em 0 0.7em;
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: 0;
}

.ag-article-content h2 {
  font-size: 2rem;
}

.ag-article-content h3 {
  font-size: 1.5rem;
}

.ag-article-content h4 {
  font-size: 1.2rem;
}

.ag-article-content p,
.ag-article-content ul,
.ag-article-content ol,
.ag-article-content blockquote,
.ag-article-content pre,
.ag-article-content table,
.ag-article-content figure {
  margin-top: 0;
  margin-bottom: 1.5em;
}

.ag-article-content a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.ag-article-content blockquote {
  margin-left: 0;
  padding: 8px 0 8px 22px;
  color: #3a2a5c;
  border-left: 4px solid var(--secondary);
}

.ag-article-content pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 20px;
  color: #f7f8fb;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  background: #1a1130;
  border-radius: 8px;
}

.ag-article-content code {
  font-family: var(--font-mono);
}

.ag-article-content :not(pre) > code {
  padding: 2px 5px;
  font-size: 0.9em;
  background: #f3f0f9;
  border-radius: 4px;
}

.ag-article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.ag-article-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.ag-article-content th,
.ag-article-content td {
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--line);
}

.ag-article-footer {
  padding: 24px 0;
  color: var(--muted);
  font-family: var(--font-numeric);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

.ag-article-footer p {
  margin: 12px 0 0;
}

.ag-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ag-article-tags a {
  padding: 6px 9px;
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: none;
  background: var(--accent-soft);
  border-radius: 6px;
}

.post-navigation {
  margin: 18px 0 72px;
}

.post-navigation .nav-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.post-navigation a {
  display: flex;
  min-height: 104px;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.post-navigation a:hover,
.post-navigation a:focus-visible {
  border-color: var(--accent);
}

.post-navigation span {
  color: var(--muted);
  font-size: 12px;
}

.post-navigation strong {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
}

.ag-page .ag-article-content {
  min-height: 260px;
}

.ag-not-found {
  min-height: 60vh;
}

.ag-not-found__actions {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 28px;
}

.ag-not-found__actions > a:not(.ag-primary-link) {
  color: var(--accent-strong);
  font-weight: 700;
}

.ag-blog-footer {
  padding: 38px 0;
  color: rgba(255, 255, 255, 0.78);
  background: #1a1130;
}

.ag-blog-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  width: min(100% - 48px, 1120px);
  margin: 0 auto;
}

.ag-blog-footer__inner > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ag-blog-footer strong {
  color: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0;
}

.ag-blog-footer span,
.ag-blog-footer p,
.ag-blog-footer a {
  font-size: 13px;
}

.ag-blog-footer nav {
  display: flex;
  gap: 18px;
}

.ag-blog-footer a {
  color: #fff;
}

.ag-blog-footer p {
  grid-column: 1 / -1;
  margin: 0;
}

.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 (max-width: 980px) {
  .ag-blog-header__inner {
    width: min(100% - 32px, 1120px);
  }

  .ag-blog-nav,
  .ag-blog-contact {
    display: none;
  }

  .ag-blog-menu {
    display: block;
  }
}

@media (max-width: 700px) {
  .ag-blog-brand img {
    width: 190px;
  }

  .ag-blog-shell,
  .ag-article-shell,
  .ag-article-featured,
  .ag-blog-footer__inner {
    width: min(100% - 32px, 1120px);
  }

  .ag-blog-intro,
  .ag-article-header {
    padding: 48px 0 42px;
  }

  .ag-blog-intro h1,
  .ag-article-header h1 {
    font-size: 2.35rem;
  }

  .ag-blog-intro__copy,
  .ag-article-deck {
    font-size: 17px;
  }

  .ag-blog-search {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ag-blog-search input,
  .ag-blog-search button {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .ag-blog-search button {
    height: 46px;
    border-color: var(--accent);
  }

  .ag-post-grid,
  .post-navigation .nav-links {
    grid-template-columns: 1fr;
  }

  .ag-post-card__body {
    padding: 20px;
  }

  .ag-article-content {
    padding-top: 42px;
    font-size: 16px;
  }

  .ag-article-content h2 {
    font-size: 1.7rem;
  }

  .ag-not-found__actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .ag-blog-footer__inner {
    grid-template-columns: 1fr;
  }

  .ag-blog-footer p {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ag-post-card__image img {
    transition: none;
  }
}
