/*
Theme Name: Experia
Theme URI: https://experia.systems
Author: Experia Systems
Author URI: https://experia.systems
Description: Experia Systems design system v2 (Carbon marketing discipline · Experia soft-light) as a WordPress block theme.
Version: 0.3.0
Requires at least: 6.5
Requires PHP: 8.1
License: Proprietary
Text Domain: experia
*/

/* ============================================================
   EXPERIA DS v2, blog skin.
   Tokens mirror the marketing site's site.css; palette and type
   presets live in theme.json, hairlines and idiom live here.
   Deliberate rules carried over: radius 0 everywhere, default
   surface = 1px hairline (no shadow), sentence-case headings,
   uppercase only in § eyebrows, arrow idiom on links.
   ============================================================ */

/* Match the marketing site's box model: max-width + padding must resolve to
   the same outer width there and here, or the masthead shifts between tabs. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --line-1: rgba(26, 29, 31, 0.06);
  --line-2: rgba(26, 29, 31, 0.12);
  --line-3: rgba(26, 29, 31, 0.22);
  --line-dark-1: rgba(254, 253, 235, 0.08);
  --line-dark-2: rgba(254, 253, 235, 0.14);
  --tint: rgba(195, 181, 146, 0.1);
  --chip-fill: rgba(195, 181, 146, 0.16);
  --chip-border: rgba(195, 181, 146, 0.45);
  --focus-ring: 0 0 0 3px rgba(195, 181, 146, 0.35);
  --shadow-feature: 4px 4px 0 0 rgba(26, 29, 31, 0.1);
  --ease: cubic-bezier(0.2, 0, 0.38, 0.9);
  --dur-fast: 70ms;
  --dur-base: 150ms;
  --masthead-h: 64px;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}
::selection {
  background: var(--wp--preset--color--tan-500);
  color: var(--wp--preset--color--ink-900);
}
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
img,
svg {
  max-width: 100%;
  height: auto;
}

/* ---------- § eyebrow ---------- */
.eyebrow {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wp--preset--color--tan-600);
}
.eyebrow a {
  color: inherit;
  text-decoration: none;
}
.eyebrow a:hover {
  color: var(--wp--preset--color--tan-700);
  text-decoration: underline;
  text-underline-position: under;
}

/* ---------- Arrow idiom ---------- */
.link-arrow {
  color: var(--wp--preset--color--tan-600);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.link-arrow .arrow {
  display: inline-block;
  transition: transform var(--dur-base) var(--ease);
}
.link-arrow:hover {
  color: var(--wp--preset--color--tan-700);
  text-decoration: underline;
  text-underline-position: under;
}
.link-arrow:hover .arrow {
  transform: translateX(4px);
}

/* ---------- Masthead (mirrors the marketing site's) ----------
   Sticky lives on the template-part <header> wrapper: the inner div's
   parent is exactly its own height, so sticky on the div is a no-op. */
header:has(> .site-masthead) {
  position: sticky;
  top: 0;
  z-index: 50;
}
/* Keep the sticky masthead below the wp-admin toolbar when logged in. */
body.admin-bar header:has(> .site-masthead) {
  top: 32px;
}
@media (max-width: 782px) {
  body.admin-bar header:has(> .site-masthead) {
    top: 46px;
  }
}
.site-masthead {
  background: var(--wp--preset--color--ink-900);
  border-bottom: 1px solid var(--wp--preset--color--tan-600);
}
.site-masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--masthead-h);
  max-width: 1584px;
  margin-inline: auto;
  padding-inline: 16px;
}
.site-masthead__brand img {
  display: block;
  height: 22px;
  width: auto;
}
.site-masthead__links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-masthead__links a:not(.site-masthead__cta) {
  color: var(--wp--preset--color--ink-200);
  font-size: 14px;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.site-masthead__links a:not(.site-masthead__cta):hover,
.site-masthead__links a[aria-current="page"] {
  color: var(--wp--preset--color--bone-100);
}
.site-masthead__links a[aria-current="page"] {
  box-shadow: inset 0 -1px 0 0 var(--wp--preset--color--tan-500);
  padding-bottom: 4px;
}
/* Masthead CTA: the marketing masthead's small flat primary button
   (.btn .btn--primary .btn--sm type styles, matched exactly). */
.site-masthead__links a.site-masthead__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--wp--preset--color--tan-500);
  color: var(--wp--preset--color--ink-900);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.16px;
  text-decoration: none;
  transition: background-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.site-masthead__links a.site-masthead__cta:hover {
  background: var(--wp--preset--color--tan-400);
  color: var(--wp--preset--color--ink-900);
}
.site-masthead__toggle {
  display: none;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  color: var(--wp--preset--color--bone-100);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 0;
}
.site-masthead__toggle-bars,
.site-masthead__toggle-bars::before,
.site-masthead__toggle-bars::after {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--wp--preset--color--bone-100);
  content: "";
  transition: transform var(--dur-base) var(--ease);
}
.site-masthead__toggle-bars {
  position: relative;
}
.site-masthead__toggle-bars::before {
  position: absolute;
  top: -6px;
}
.site-masthead__toggle-bars::after {
  position: absolute;
  top: 6px;
}
@media (max-width: 847px) {
  .site-masthead__toggle {
    display: inline-flex;
  }
  /* Dropdown panel: absolute against the sticky <header> wrapper. */
  .site-masthead__links {
    display: none;
    position: absolute;
    top: var(--masthead-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--wp--preset--color--ink-900);
    border-bottom: 1px solid var(--wp--preset--color--tan-600);
    padding: 16px 16px 24px;
  }
  body.nav-open .site-masthead__links {
    display: flex;
  }
  .site-masthead__links li {
    border-bottom: 1px solid var(--line-dark-1);
  }
  .site-masthead__links li:last-child {
    border-bottom: 0;
  }
  .site-masthead__links a:not(.site-masthead__cta) {
    display: block;
    padding: 14px 0;
    font-size: 16px;
  }
  .site-masthead__links a[aria-current="page"] {
    box-shadow: inset 3px 0 0 0 var(--wp--preset--color--tan-500);
    padding-left: 12px;
    padding-bottom: 14px;
  }
  .site-masthead__cta-item {
    padding-top: 16px;
  }
  .site-masthead__links a.site-masthead__cta {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- CTA band + footer (mirrors the marketing site) ---------- */
.cta-band {
  /* Lighter charcoal than the footer so the two dark blocks read separately */
  background: var(--wp--preset--color--ink-700);
  color: var(--wp--preset--color--bone-100);
  border-top: 1px solid var(--wp--preset--color--tan-600);
  margin-top: 96px;
}
.cta-band__grid,
.site-footer__grid {
  max-width: 1584px;
  margin-inline: auto;
  padding-inline: 16px;
}
.cta-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding-block: 64px;
}
.cta-band__title {
  font-size: 28px;
  line-height: 1.286;
  font-weight: 300;
  flex: 1 1 100%;
  margin: 0;
}
.cta-band__title em {
  font-style: normal;
  color: var(--wp--preset--color--tan-600);
}
@media (min-width: 1056px) {
  .cta-band__title {
    font-size: 32px;
    line-height: 1.25;
    flex: 1 1 auto;
  }
}
.cta-band__meta {
  color: var(--wp--preset--color--ink-300);
  font-size: 14px;
  margin: 0;
}
.cta-band__btn {
  background: var(--wp--preset--color--tan-500);
  color: var(--wp--preset--color--ink-900);
  padding: 12px 20px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 0.5);
  transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.cta-band__btn:hover {
  background: var(--wp--preset--color--tan-400);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 0 rgba(0, 0, 0, 0.5);
}
.cta-band__btn:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 0 rgba(0, 0, 0, 0.5);
}

.site-footer {
  background: var(--wp--preset--color--ink-900);
  color: var(--wp--preset--color--ink-200);
}
.site-footer a {
  color: var(--wp--preset--color--ink-200);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.site-footer a:hover {
  color: var(--wp--preset--color--bone-100);
}
.site-footer__top {
  display: grid;
  gap: 48px;
  padding-block: 64px 48px;
}
@media (min-width: 1056px) {
  .site-footer__top {
    grid-template-columns: 2fr 4fr;
  }
}
/* Tablet band: the brand block eats a full row for one logo; drop it. */
@media (min-width: 672px) and (max-width: 1055px) {
  .site-footer__brand {
    display: none;
  }
}
@media (min-width: 1056px) {
  .site-footer__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
}
.site-footer__brand img {
  height: 52px;
  width: auto;
  margin-bottom: 16px;
}
.site-footer__strap {
  font-size: 13px;
  color: var(--wp--preset--color--ink-300);
  margin: 0;
}
.site-footer__cols {
  display: grid;
  gap: 32px;
}
@media (min-width: 672px) {
  .site-footer__cols {
    grid-template-columns: repeat(4, 1fr);
  }
}
.site-footer__col .eyebrow {
  color: var(--wp--preset--color--tan-500);
  margin-bottom: 16px;
}
.site-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.site-footer__col a,
.site-footer__col span {
  font-size: 14px;
}
.site-footer__col span {
  color: var(--wp--preset--color--ink-200);
}
.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-block: 24px;
  border-top: 1px solid var(--line-dark-2);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--wp--preset--color--ink-300);
}
.site-footer__bar p {
  margin: 0;
}
.site-footer__bar a {
  color: var(--wp--preset--color--ink-300);
}
.site-footer__legal {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
}

/* ---------- Post list (index / archive) ----------
   Carbon editorial rows: date in a left rail, content in the body
   column, hairline separators. 2x-grid proportions at wide widths. */
.post-list .wp-block-post {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 32px;
  border-top: 1px solid var(--line-2);
  padding-block: 32px;
  margin: 0;
}
@media (min-width: 672px) {
  .post-list .wp-block-post {
    grid-template-columns: 176px 1fr;
  }
  .post-list .wp-block-post-date {
    grid-column: 1;
  }
  .post-list .wp-block-post-title,
  .post-list .wp-block-post-excerpt {
    grid-column: 2;
  }
}
.post-list .wp-block-post:last-child {
  border-bottom: 1px solid var(--line-2);
}
.post-list .wp-block-post-date {
  font-size: 14px;
  line-height: 1.75;
  color: var(--wp--preset--color--ink-400);
  margin: 0;
}
.post-list .wp-block-post-title {
  font-size: 28px;
  font-weight: 300;
  line-height: 1.286;
  margin: 0 0 4px;
}

/* Latest post as feature surface, home page one only: the one place
   the hard-offset shadow is allowed on the blog. */
body.blog:not(.paged) .post-list .wp-block-post:first-child {
  display: block;
  background: #ffffff;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-feature);
  padding: 32px;
  margin-bottom: 48px;
}
body.blog:not(.paged) .post-list .wp-block-post:first-child::before {
  content: "§ Latest";
  display: block;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wp--preset--color--tan-600);
  margin-bottom: 16px;
}
body.blog:not(.paged) .post-list .wp-block-post:first-child .wp-block-post-date {
  margin-bottom: 8px;
}
body.blog:not(.paged) .post-list .wp-block-post:first-child .wp-block-post-title {
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.22;
  margin-bottom: 12px;
}
.post-list .wp-block-post-title a {
  color: var(--wp--preset--color--ink-900);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.post-list .wp-block-post-title a:hover {
  color: var(--wp--preset--color--tan-700);
}
.post-list .wp-block-post-excerpt {
  color: var(--wp--preset--color--ink-500);
  max-width: 66ch;
}
.post-list .wp-block-post-excerpt__more-link {
  display: inline-block;
  margin-top: 8px;
}

/* Pagination */
.wp-block-query-pagination {
  border-top: 1px solid var(--line-1);
  padding-top: 24px;
  margin-top: 48px;
  font-size: 14px;
}
.wp-block-query-pagination a {
  color: var(--wp--preset--color--tan-600);
  text-decoration: none;
}
.wp-block-query-pagination a:hover {
  color: var(--wp--preset--color--tan-700);
  text-decoration: underline;
  text-underline-position: under;
}

/* ---------- Single post ---------- */
.post-header {
  padding-block: 64px 32px;
}
.post-header .wp-block-post-title {
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 300;
  line-height: 1.19;
  margin: 16px 0 0;
}
.post-header__meta {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}
.post-header__meta .wp-block-post-date {
  font-size: 14px;
  color: var(--wp--preset--color--ink-400);
}
.post-header__meta .wp-block-post-terms {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.post-header__meta .wp-block-post-terms a {
  color: var(--wp--preset--color--tan-600);
  text-decoration: none;
}
.post-header__meta .wp-block-post-terms a:hover {
  color: var(--wp--preset--color--tan-700);
}

/* ---------- Prose ---------- */
.wp-block-post-content {
  line-height: 1.6;
}
.wp-block-post-content > * + * {
  margin-block-start: 20px;
}
.wp-block-post-content > h2 {
  margin-block-start: 48px;
}
.wp-block-post-content > h3 {
  margin-block-start: 32px;
}
.wp-block-post-content a {
  color: var(--wp--preset--color--tan-600);
  text-decoration: underline;
  text-underline-position: under;
  transition: color var(--dur-fast) var(--ease);
}
.wp-block-post-content a:hover {
  color: var(--wp--preset--color--tan-700);
}
.wp-block-post-content blockquote {
  border-left: 2px solid var(--wp--preset--color--tan-500);
  background: var(--tint);
  padding: 16px 24px;
  margin-inline: 0;
  font-weight: 300;
  font-size: 20px;
  line-height: 1.4;
}
.wp-block-post-content blockquote cite {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  font-style: normal;
  color: var(--wp--preset--color--ink-400);
}
.wp-block-post-content code {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--wp--preset--color--bone-200);
  border: 1px solid var(--line-1);
  padding: 1px 5px;
}
.wp-block-post-content pre {
  background: var(--wp--preset--color--ink-900);
  color: var(--wp--preset--color--bone-100);
  border: 0;
  padding: 24px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 0;
}
.wp-block-post-content pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.wp-block-post-content hr {
  border: 0;
  border-top: 1px solid var(--line-2);
  margin-block: 48px;
}
.wp-block-post-content ul,
.wp-block-post-content ol {
  padding-inline-start: 24px;
}
.wp-block-post-content li + li {
  margin-block-start: 8px;
}
.wp-block-post-content figcaption {
  font-size: 14px;
  color: var(--wp--preset--color--ink-400);
  margin-top: 8px;
}
.wp-block-post-content .wp-block-table table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
.wp-block-post-content .wp-block-table th,
.wp-block-post-content .wp-block-table td {
  border: 0;
  border-bottom: 1px solid var(--line-2);
  padding: 12px 16px 12px 0;
  text-align: left;
}
.wp-block-post-content .wp-block-table th {
  font-weight: 600;
  border-bottom-color: var(--line-3);
}

/* Feature surface: the one place the hard-offset shadow is allowed */
.is-style-feature,
.wp-block-post-content .is-style-feature {
  background: #ffffff;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-feature);
  padding: 24px;
}

/* ---------- Post footer nav ---------- */
.post-nav {
  border-top: 1px solid var(--line-2);
  margin-top: 64px;
  padding-block: 24px 64px;
  font-size: 14px;
}

/* ---------- Buttons ---------- */
.wp-block-button__link {
  border-radius: 0;
  transition: background var(--dur-fast) var(--ease);
}
.wp-block-button__link:hover {
  background: var(--wp--preset--color--ink-700);
}

/* ---------- Search ---------- */
.wp-block-search__input {
  border: 1px solid var(--line-3);
  border-radius: 0;
  background: #ffffff;
  font: inherit;
  padding: 8px 12px;
}
.wp-block-search__input:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}
.wp-block-search__button {
  border-radius: 0;
  border: 0;
  background: var(--wp--preset--color--ink-900);
  color: var(--wp--preset--color--bone-100);
  padding: 8px 16px;
  cursor: pointer;
}
.wp-block-search__button:hover {
  background: var(--wp--preset--color--ink-700);
}

/* ---------- Page headers (home, archive, search, 404) ---------- */
.page-header {
  padding-block: 64px 16px;
}
.page-header .wp-block-query-title,
.page-header h1 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 300;
  line-height: 1.22;
  margin: 16px 0 0;
}
.page-header--home {
  padding-block: 96px 48px;
}
.page-header--home h1 {
  font-size: clamp(36px, 5vw, 54px);
  line-height: 1.17;
}
.page-header--home .lead {
  font-size: 20px;
  font-weight: 300;
  line-height: 1.4;
  color: var(--wp--preset--color--ink-500);
  max-width: 46ch;
  margin-top: 16px;
}
