/* =============================================================================
   theme.css — Design tokens + base + component helpers (ported to WordPress)
   -----------------------------------------------------------------------------
   Holds design tokens (CSS custom properties), self-hosted Inter @font-face
   declarations, and a few small component helpers Tailwind utilities cannot
   express cleanly. Tokens map to the Customizer (accent + colour mode); the
   compiled Tailwind stylesheet is enqueued alongside this file.
   ========================================================================== */

/* ---------- Self-hosted Inter (replaces Google Fonts CDN) ----------------- */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/inter-700.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("../fonts/inter-800.woff2") format("woff2");
}

/* ---------- Design tokens: light theme (default) -------------------------- */
:root {
  /* Colours are stored as space-separated RGB channels so Tailwind's
     "rgb(var(--c-accent) / <alpha-value>)" pattern can apply opacity. */
  --c-accent: 20 184 166;        /* teal-500-ish accent */
  --c-accent-strong: 13 148 136; /* hover/active accent */

  /* Typography */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  --font-display: var(--font-sans);

  /* Shape */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.5rem;
  --radius-pill: 9999px;

  /* Layout rhythm */
  --container-max: 80rem; /* 1280px, mirrors max-w-7xl */
  --content-max: 42rem;   /* the readable inner rail */
}

/* ---------- Base ---------------------------------------------------------- */
html {
  font-family: var(--font-sans);
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Smooth, accessible focus rings driven by the accent token. */
/* Focus ring follows each element's own border-radius (so grouped inputs with
   a square right edge stay square on focus — the outline isn't forced round). */
:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid rgb(var(--c-accent));
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Primary navigation -------------------------------------------
   wp_nav_menu() renders every depth assigned to the "primary" location.
   Top-level items are laid out by the Tailwind classes coming from the
   chosen header style; submenus are positioned and themed here. */
.oz-menu,
.oz-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.oz-menu li {
  position: relative;
}

/* Gradient underline under the current item (styles that opt into it). */
.oz-menu--underline > li > a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.25rem;
  right: 0.25rem;
  bottom: -1px;
  height: 1px;
  background-image: linear-gradient(
    to right,
    rgb(var(--c-accent) / 0),
    rgb(var(--c-accent) / 0.6),
    rgb(var(--c-accent) / 0)
  );
}

/* Dropdown panels. :where() keeps specificity at zero for the dark variants so
   the flat "stacked"/"inline" overrides further down can still reset them. */
.oz-menu .oz-submenu,
.oz-menu .children {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 60;
  min-width: 13rem;
  margin-top: 0.5rem;
  padding: 0.375rem;
  border-radius: var(--radius-md);
  background-color: rgb(255 255 255);
  box-shadow: 0 10px 30px rgb(24 24 27 / 0.12);
  outline: 1px solid rgb(24 24 27 / 0.05);
  outline-offset: -1px;
  display: none;
  text-align: left;
}
:where(.dark) .oz-menu .oz-submenu,
:where(.dark) .oz-menu .children {
  background-color: rgb(39 39 42);
  outline-color: rgb(255 255 255 / 0.1);
}
/* Second level and deeper open to the side. */
.oz-menu .oz-submenu .oz-submenu,
.oz-menu .children .children {
  top: -0.375rem;
  left: 100%;
  margin-top: 0;
  margin-left: 0.25rem;
}
.oz-menu li:hover > .oz-submenu,
.oz-menu li:hover > .children,
.oz-menu li:focus-within > .oz-submenu,
.oz-menu li:focus-within > .children,
.oz-menu li.oz-submenu-open > .oz-submenu,
.oz-menu li.oz-submenu-open > .children {
  display: block;
}

.oz-submenu-link,
.oz-menu .children a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(63 63 70);
  transition: background-color 0.15s ease, color 0.15s ease;
}
:where(.dark) .oz-submenu-link,
:where(.dark) .oz-menu .children a {
  color: rgb(212 212 216);
}
.oz-submenu-link:hover,
.oz-menu .children a:hover,
.oz-submenu-link[aria-current="page"],
.oz-menu .children a[aria-current="page"] {
  background-color: rgb(244 244 245);
  color: rgb(var(--c-accent-strong));
}
:where(.dark) .oz-submenu-link:hover,
:where(.dark) .oz-menu .children a:hover,
:where(.dark) .oz-submenu-link[aria-current="page"],
:where(.dark) .oz-menu .children a[aria-current="page"] {
  background-color: rgb(63 63 70);
  color: rgb(var(--c-accent));
}

/* Toggle button that opens a submenu for pointer and keyboard users. */
.oz-submenu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-left: -0.25rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.oz-submenu-toggle svg {
  width: 0.875rem;
  height: 0.875rem;
  transition: transform 0.2s ease;
}
.oz-submenu-open > .oz-submenu-toggle svg {
  transform: rotate(180deg);
}
.oz-menu > li {
  display: flex;
  align-items: center;
}

/* Stacked variant (mobile menu): every depth is rendered in flow. */
.oz-menu--stacked > li,
.oz-menu--stacked li {
  display: block;
}
.oz-menu--stacked .oz-submenu,
.oz-menu--stacked .children {
  position: static;
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: none;
  box-shadow: none;
  outline: none;
  text-align: inherit;
}
.oz-menu--stacked .oz-submenu-link,
.oz-menu--stacked .children a {
  background: none;
}

/* Inline variant (footer): children follow their parent on the same row. */
.oz-menu--inline li {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
}
.oz-menu--inline .oz-submenu,
.oz-menu--inline .children {
  position: static;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  min-width: 0;
  margin: 0 0 0 1.5rem;
  padding: 0;
  background: none;
  box-shadow: none;
  outline: none;
}
.oz-menu--inline .oz-submenu-link,
.oz-menu--inline .children a {
  display: inline;
  padding: 0;
  background: none;
  font-size: inherit;
}

/* ---------- Footer widgets ------------------------------------------------ */
.oz-footer-widgets {
  display: grid;
  gap: 2rem;
  padding-bottom: 2.5rem;
}
@media (min-width: 640px) {
  .oz-footer-widgets {
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  }
}
.oz-widget-title {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(39 39 42);
}
.dark .oz-widget-title {
  color: rgb(244 244 245);
}
.oz-widget {
  font-size: 0.875rem;
  color: rgb(82 82 91);
}
.dark .oz-widget {
  color: rgb(161 161 170);
}
.oz-widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.oz-widget li {
  margin: 0.35rem 0;
}
.oz-widget a:hover {
  color: rgb(var(--c-accent-strong));
}

/* ---------- Decorative background rail ------------------------------------
   Recreates the "white content column floating on a tinted page" look using
   our own markup and tokens. */
.bg-rail {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}
.bg-rail > div {
  width: 100%;
  max-width: var(--container-max);
  background-color: rgb(255 255 255);
  box-shadow: inset 1px 0 0 rgb(244 244 245), inset -1px 0 0 rgb(244 244 245);
}
.dark .bg-rail > div {
  background-color: rgb(24 24 27);
  box-shadow: inset 1px 0 0 rgb(39 39 42), inset -1px 0 0 rgb(39 39 42);
}

/* ---------- Avatar / photo placeholders ----------------------------------
   Gradient placeholders so the template looks complete with zero image
   assets. Replaced by real featured images where available. */
.ph {
  background-image: linear-gradient(
    135deg,
    rgb(var(--c-accent) / 0.9),
    rgb(99 102 241 / 0.85)
  );
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Tilted photo strip on the home page. */
.photo-strip { gap: 1.25rem; }
.photo-strip > * { rotate: 2deg; }
.photo-strip > *:nth-child(even) { rotate: -2deg; }
.photo-strip > *:nth-child(3n) { rotate: 3deg; }

/* ---------- Long-form prose tweaks --------------------------------------- */
.prose-body :where(p, ul, ol):not(:last-child) { margin-bottom: 1.25rem; }
.prose-body a {
  color: rgb(var(--c-accent-strong));
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* scroll-margin keeps anchor jumps (TOC) clear of the sticky header. */
.prose-body h2 { font-weight: 700; font-size: 1.5rem; margin: 2rem 0 0.75rem; scroll-margin-top: 6rem; }
.prose-body h3 { font-weight: 600; font-size: 1.125rem; margin: 1.5rem 0 0.5rem; scroll-margin-top: 6rem; }
/* Tailwind preflight strips list styling — restore it inside prose. */
.prose-body ul { list-style: disc; padding-left: 1.25rem; }
.prose-body ol { list-style: decimal; padding-left: 1.25rem; }
.prose-body li { margin: 0.35rem 0; }
.prose-body li::marker { color: rgb(var(--c-accent)); }
.prose-body figure:not(:last-child),
.prose-body pre:not(:last-child),
.prose-body .table-wrap:not(:last-child) { margin-bottom: 1.5rem; }
/* Inline code (not inside a <pre> block). */
.prose-body :not(pre) > code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: rgb(244 244 245);
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
}
.dark .prose-body :not(pre) > code { background: rgb(39 39 42); }

/* Fenced code blocks (editor "Code" block / <pre><code>). Mirrors the
   prototype's dark, rounded code panel — applied via CSS so authored content
   doesn't need utility-class wrappers. */
.prose-body pre {
  position: relative;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border-radius: 0.75rem;
  background: rgb(24 24 27);
  color: rgb(244 244 245);
  font-size: 0.875rem;
  line-height: 1.65;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08);
}
.prose-body pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* Hide the native disclosure triangle on FAQ <summary> (Safari/Chrome). */
summary::-webkit-details-marker { display: none; }
summary { list-style: none; }

/* Utility: clamp a paragraph to N lines (used by article/portfolio cards). */
.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- WordPress core classes ---------------------------------------- */
/* Accessible hidden text that becomes visible on keyboard focus. */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  background-color: #fff;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: rgb(var(--c-accent-strong));
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* ---------- Skip link -----------------------------------------------------
   Built on .screen-reader-text (see below) so it is hidden until focused.
   The admin bar is fixed at the top of the viewport, so the focused link is
   pushed below it — otherwise the two overlap for logged-in users. */
.oz-skip-link:focus {
  top: 5px;
  left: 5px;
}
body.admin-bar .oz-skip-link:focus {
  top: calc(32px + 5px);
}
@media screen and (max-width: 782px) {
  body.admin-bar .oz-skip-link:focus {
    top: calc(46px + 5px);
  }
}

/* Content alignment (images, blocks, etc.). */
.alignleft { float: left; margin: 0.5rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.5rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide { max-width: 1100px; }
.alignfull { max-width: 100%; }
.prose-body img,
.wp-caption { max-width: 100%; height: auto; }

/* Captions. */
.wp-caption { margin-bottom: 1.5rem; }
.wp-caption img { display: block; }
.wp-caption-text,
.gallery-caption {
  font-size: 0.85rem;
  color: rgb(113 113 122);
  text-align: center;
  margin-top: 0.5rem;
}
.dark .wp-caption-text,
.dark .gallery-caption { color: rgb(161 161 170); }

/* Sticky + by-post-author markers (required hooks for core/comments). */
.bypostauthor > article { box-shadow: inset 3px 0 0 rgb(var(--c-accent)); }
.sticky { /* sticky posts are surfaced in the loop */ }

/* Long titles / unbroken strings shouldn't overflow the content area. */
h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* Nested comment replies. */
.oz-comment-list .children {
  margin-top: 1rem;
  padding-left: 1.25rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 640px) { .oz-comment-list .children { padding-left: 2.5rem; } }
.oz-comment-list .comment-reply-link { font-weight: 500; color: rgb(var(--c-accent-strong)); }
.oz-comment-list .comment-reply-link:hover { color: rgb(var(--c-accent)); }
