/* ==========================================================================
   WordPress integration layer
   Loaded after the core design system. Keeps native menus, blog cards,
   single templates, forms, and editor content aligned with XO.
   ========================================================================== */

/* ---------- Header / navigation ------------------------------------------ */
.nav__list {
  display: flex;
  align-items: center;
  gap: inherit;
}

.nav__list li {
  display: flex;
}

.mobile-menu__list {
  display: grid;
  gap: 0.15rem;
}

.mobile-menu__list li {
  display: block;
}

.footer__links li {
  display: block;
}

.footer__links a {
  display: inline-block;
}

.brand__logo {
  width: auto;
  background: transparent;
}

.admin-bar .site-header {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}

/* ---------- Small additions to the home hero ----------------------------- */
.hero__note {
  margin-top: 0.9rem;
  font-size: 0.76rem;
  color: var(--muted-light);
}

.page-hero__note {
  max-width: 30ch;
  font-size: 0.84rem;
  line-height: 1.8;
  color: var(--muted);
}

.page-hero--ink .page-hero__note,
.page-hero--red .page-hero__note {
  color: rgba(255, 255, 255, 0.62);
}

.role__tag {
  display: inline-block;
  margin-bottom: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}

/* ---------- Service single ---------------------------------------------- */
.page-hero--service {
  background: var(--paper);
}

.service-hero__icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 1.2rem;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
}

.service-hero__icon svg {
  width: 34px;
  height: 34px;
}

.service-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}

.service-detail__aside,
.project-single__aside,
.article-aside {
  position: sticky;
  top: 104px;
}

.service-outcome {
  margin: 2rem 0;
  padding: 1.2rem 1.35rem;
  border-inline-start: 4px solid var(--red);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--paper);
}

.service-outcome p {
  margin-top: 0.35rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.service-deliverables h2,
.service-process h2,
.project-scope h2 {
  margin-bottom: 0.9rem;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
}

.timeline--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.timeline--compact .step {
  padding-top: 1rem;
}

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

/* ---------- Blog archive cards ------------------------------------------ */
.post-card {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.post-card:hover {
  border-color: var(--red);
  box-shadow: var(--shadow);
}

.post-card--featured {
  grid-column: 1 / -1;
  grid-template-columns: 1.05fr 0.95fr;
}

.post-card__thumb {
  display: block;
  min-height: 215px;
  overflow: hidden;
  background: var(--paper);
}

.post-card--featured .post-card__thumb {
  min-height: 390px;
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

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

.post-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
}

.post-card__body h2 {
  font-size: clamp(1.45rem, 2.6vw, 2.1rem);
  line-height: 1.35;
}

.post-card__body h3 {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.45;
}

.post-card__body h2 a:hover,
.post-card__body h3 a:hover {
  color: var(--red);
}

.post-card__body p {
  font-size: 0.84rem;
  line-height: 1.8;
  color: var(--muted);
}

.post-card .post__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
}

.post-card .post__more svg {
  width: 15px;
  height: 15px;
}

/* ---------- Single article ---------------------------------------------- */
.article-hero {
  padding-block: clamp(2.2rem, 5vw, 4.2rem) clamp(1.8rem, 3vw, 2.8rem);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.article-hero__inner {
  max-width: 920px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
  font-size: 0.7rem;
  line-height: 1.6;
  color: var(--muted-light);
}

.breadcrumbs a:hover {
  color: var(--red);
}

.breadcrumbs span[aria-current="page"] {
  color: var(--muted);
}

.article-hero h1 {
  max-width: 22ch;
  margin: 0.5rem 0 0.75rem;
  font-size: var(--fs-h1);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.25rem;
  font-size: 0.72rem;
  color: var(--muted-light);
}

.article-meta span + span::before {
  content: "·";
  margin-inline-end: 0.7rem;
  color: var(--line);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
  padding-block: clamp(2rem, 5vw, 4rem);
}

.article-main {
  min-width: 0;
}

.article-media {
  overflow: hidden;
  margin-bottom: clamp(1.5rem, 3vw, 2.2rem);
  border-radius: var(--radius);
  background: var(--paper);
}

.article-media img {
  width: 100%;
  max-height: 540px;
  object-fit: cover;
}

.article-body {
  max-width: 78ch;
}

.article-body > * + * {
  margin-top: 1rem;
}

.article-body h2 {
  margin-top: 2.2rem;
  font-size: clamp(1.45rem, 2.8vw, 2rem);
}

.article-body h3 {
  margin-top: 1.8rem;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
}

.article-body h4 {
  margin-top: 1.4rem;
  font-size: 1.05rem;
}

.article-body p,
.article-body li {
  line-height: 2;
  color: var(--muted);
}

.article-body ul {
  padding-inline-start: 1.35rem;
  list-style: disc;
}

.article-body ol {
  padding-inline-start: 1.35rem;
  list-style: decimal;
}

.article-body li + li {
  margin-top: 0.35rem;
}

.article-body a {
  color: var(--red);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-body a:hover {
  color: var(--red-dark);
}

.article-body blockquote {
  margin-block: 1.6rem;
  padding: 1.2rem 1.35rem;
  border-inline-start: 4px solid var(--red);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.article-body img {
  height: auto;
  margin-block: 1.4rem;
  border-radius: var(--radius-sm);
}

.article-body table {
  width: 100%;
  margin-block: 1.4rem;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.article-body th,
.article-body td {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  text-align: start;
}

.article-body th {
  background: var(--paper);
  font-weight: 700;
}

.article-body .wp-block-quote {
  margin-inline: 0;
}

.article-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1rem;
  margin-top: 2.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.article-share span {
  color: var(--muted-light);
}

.article-share a {
  color: var(--red);
  font-weight: 700;
}

.post-navigation {
  margin-top: 2.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

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

.post-navigation a {
  display: block;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.post-navigation a:hover {
  border-color: var(--red);
  background: var(--paper);
}

.post-navigation span {
  display: block;
  font-size: 0.66rem;
  color: var(--muted-light);
}

.post-navigation strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.aside-card {
  margin-bottom: 1rem;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.aside-card h2 {
  margin: 0.55rem 0 0.65rem;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
}

.aside-card p {
  font-size: 0.84rem;
  line-height: 1.85;
  color: var(--muted);
}

.aside-card .btn {
  margin-top: 1rem;
}

.aside-card--related {
  background: transparent;
}

.related-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.related-list li {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.related-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.related-list a {
  display: grid;
  gap: 0.15rem;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.6;
}

.related-list a:hover {
  color: var(--red);
}

.related-list a span {
  font-size: 0.66rem;
  font-weight: 400;
  color: var(--muted-light);
}

/* ---------- Project single ---------------------------------------------- */
.project-single__hero {
  padding-block: clamp(2rem, 4vw, 3.4rem) clamp(1.8rem, 4vw, 3rem);
  background: var(--paper);
}

.project-single__head {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.55fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: end;
  margin-bottom: clamp(1.5rem, 3vw, 2.2rem);
}

.project-single__head h1 {
  margin-top: 0.45rem;
  font-size: var(--fs-h1);
}

.project-single__meta {
  display: grid;
  gap: 0.9rem;
  padding-inline-start: 1.2rem;
  border-inline-start: 1px solid var(--line);
}

.project-single__meta span {
  display: grid;
  gap: 0.15rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.project-single__meta small {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-light);
}

.project-single__media {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper);
}

.project-single__media img {
  width: 100%;
  max-height: 640px;
  object-fit: cover;
}

.project-single__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}

.project-note {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.8;
}

.project-brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.project-brief {
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.project-brief p {
  margin-top: 0.4rem;
  font-size: 0.86rem;
  line-height: 1.9;
  color: var(--muted);
}

.project-scope {
  margin-top: 2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

/* ---------- Generic page content ---------------------------------------- */
.page-content {
  max-width: 920px;
}

.page-content .article-body {
  max-width: none;
}

/* ---------- Search / pagination / empty state --------------------------- */
.search-form {
  display: flex;
  gap: 0.45rem;
  width: 100%;
}

.search-form label {
  flex: 1;
}

.search-field {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.86rem;
}

.search-field:focus {
  border-color: var(--red);
  outline: none;
  box-shadow: 0 0 0 3px var(--red-soft);
}

.search-submit {
  min-height: 46px;
  padding: 0.65rem 1.1rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--red);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 0.2s var(--ease);
}

.search-submit:hover {
  background: var(--red-dark);
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100000;
  width: auto;
  height: auto;
  padding: 0.7rem 1rem;
  clip: auto;
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.xo-pagination {
  margin-top: clamp(1.5rem, 3vw, 2.4rem);
}

.xo-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.xo-pagination .page-numbers {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding-inline: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 600;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

.xo-pagination .page-numbers:hover,
.xo-pagination .current {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.xo-pagination .dots {
  border-color: transparent;
}

.empty-state {
  max-width: 620px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.empty-state h2 {
  margin: 0.5rem 0 0.7rem;
  font-size: var(--fs-h2);
}

.empty-state p {
  margin-bottom: 1rem;
  color: var(--muted);
}

.empty-state .search-form {
  max-width: 420px;
}

/* ---------- Forms -------------------------------------------------------- */
.form-status {
  display: none;
}

.form-status--success,
.form-status--error {
  display: block;
  margin-bottom: 1.1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  line-height: 1.8;
}

.form-status--success {
  border: 1px solid #b7e4c7;
  background: #edf8f1;
  color: #14532d;
}

.form-status--error {
  border: 1px solid #f2c2c6;
  background: var(--red-soft);
  color: var(--red-dark);
}

.form-status strong {
  display: block;
  margin-bottom: 0.2rem;
}

.hp-field {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field__hint {
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--muted-light);
}

/* ---------- WP content alignment ---------------------------------------- */
.entry-content > .alignwide {
  width: min(100%, 1100px);
  max-width: none;
  margin-inline: auto;
}

.entry-content > .alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-inline: calc(50% - 50vw);
}

.entry-content .wp-block-image img {
  border-radius: var(--radius-sm);
}

.entry-content .wp-block-quote {
  padding: 1.2rem 1.35rem;
  border-inline-start: 4px solid var(--red);
  background: var(--paper);
}

.entry-content .wp-block-button__link {
  border-radius: var(--radius-sm);
  background: var(--red);
}

.entry-content .gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.page-links {
  margin-top: 1.5rem;
  font-size: 0.85rem;
}

.page-links a,
.page-links > span {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  margin-inline: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 50%;
}

/* ---------- Responsive -------------------------------------------------- */
@media (max-width: 1080px) {
  .article-layout,
  .project-single__grid,
  .service-detail {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 2rem;
  }
}

@media (max-width: 900px) {
  .post-grid {
    grid-template-columns: 1fr;
  }

  .post-card--featured {
    grid-template-columns: 1fr;
  }

  .post-card--featured .post-card__thumb {
    min-height: 280px;
  }

  .article-layout,
  .project-single__grid,
  .service-detail {
    grid-template-columns: 1fr;
  }

  .article-aside,
  .project-single__aside,
  .service-detail__aside {
    position: static;
  }

  .project-single__head {
    grid-template-columns: 1fr;
  }

  .project-single__meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline-start: 0;
    padding-top: 1rem;
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }

  .timeline--compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .post-card {
    grid-template-columns: 1fr;
  }

  .post-card__thumb {
    min-height: 220px;
  }

  .post-card--featured .post-card__thumb {
    min-height: 230px;
  }

  .article-hero h1 {
    max-width: none;
  }

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

  .article-meta span + span::before {
    display: none;
  }

  .search-form {
    flex-direction: column;
  }

  .search-submit {
    width: 100%;
  }

  .xo-pagination .page-numbers {
    min-width: 38px;
    height: 38px;
    font-size: 0.75rem;
  }
}

#contact-form {
  scroll-margin-top: 110px;
}
