/*
Theme Name: Ninth Prime
Theme URI: https://example.com/ninth-prime
Author: 9th Prime Information
Description: A clean, trustworthy theme for an information-management and standards consultancy. Includes a services section, blog, and contact page. Palette drawn from the 9th Prime Information brand (slate navy, blue, teal, orange).
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ninth-prime
Tags: blog, business, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, accessibility-ready, editor-style
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  --np-navy: #1e3350;
  --np-slate: #3a4f66;
  --np-blue: #5285b5;
  --np-blue-dark: #3d6c99;
  --np-teal: #6fc0a8;
  --np-orange: #f28c42;
  --np-bg: #ffffff;
  --np-bg-soft: #f4f7fa;
  --np-line: #dde4eb;
  --np-text: #22303f;
  --np-muted: #5b6b7c;

  --np-font-head: "Jost", "Avenir Next", "Century Gothic", "Segoe UI", system-ui, sans-serif;
  --np-font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --np-radius: 10px;
  --np-shadow: 0 1px 2px rgba(30, 51, 80, .06), 0 8px 24px rgba(30, 51, 80, .08);
  --np-wrap: 1180px;
  --np-narrow: 740px;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--np-font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--np-text);
  background: var(--np-bg);
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--np-blue-dark); text-underline-offset: 3px; }
a:hover { color: var(--np-navy); }
:focus-visible { outline: 3px solid var(--np-orange); outline-offset: 2px; border-radius: 3px; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--np-font-head);
  color: var(--np-navy);
  line-height: 1.2;
  margin: 0 0 .6em;
  font-weight: 600;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.2em; }

.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal;
}
.skip-link:focus {
  clip: auto; clip-path: none; height: auto; width: auto; margin: 0;
  background: var(--np-navy); color: #fff; padding: .75rem 1rem; z-index: 1000; left: 1rem; top: 1rem;
}
.wrap { width: min(100% - 2.5rem, var(--np-wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2.5rem, var(--np-narrow)); margin-inline: auto; }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--soft { background: var(--np-bg-soft); }
.section--dark { background: var(--np-navy); color: #dbe5ef; }
.section--dark h2, .section--dark h3 { color: #fff; }
.eyebrow {
  font-family: var(--np-font-head);
  text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; font-weight: 600;
  color: var(--np-blue-dark); margin-bottom: .8rem; display: flex; align-items: center; gap: .7rem;
}
.eyebrow::before { content: ""; width: 28px; height: 3px; background: var(--np-teal); border-radius: 2px; }
.section--dark .eyebrow { color: var(--np-teal); }
.section-head { max-width: 640px; margin-bottom: 2.5rem; }
.section-head p { color: var(--np-muted); }

/* ==========================================================================
   3. Buttons
   ========================================================================== */
.btn, .wp-block-button__link, input[type="submit"], button[type="submit"] {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--np-font-head); font-weight: 600; font-size: 1rem; letter-spacing: .02em;
  padding: .8rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  background: var(--np-navy); color: #fff; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.btn:hover, .wp-block-button__link:hover, input[type="submit"]:hover, button[type="submit"]:hover {
  background: var(--np-slate); color: #fff; transform: translateY(-1px);
}
.btn--accent { background: var(--np-orange); color: var(--np-navy); }
.btn--accent:hover { background: #ffa05c; color: var(--np-navy); }
.btn--ghost { background: transparent; color: var(--np-navy); border-color: var(--np-navy); }
.btn--ghost:hover { background: var(--np-navy); color: #fff; }
.section--dark .btn--ghost { color: #fff; border-color: rgba(255,255,255,.6); }
.section--dark .btn--ghost:hover { background: #fff; color: var(--np-navy); }

/* ==========================================================================
   4. Header
   ========================================================================== */
.site-header { background: #fff; border-bottom: 1px solid var(--np-line); position: sticky; top: 0; z-index: 50; }
.admin-bar .site-header { top: 32px; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 78px; }
.site-branding { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--np-navy); }
.site-branding .custom-logo { max-height: 54px; width: auto; }
.site-branding__mark { width: 48px; height: 48px; flex: none; }
.site-branding__text { display: flex; flex-direction: column; line-height: 1.1; }
.site-title { font-family: var(--np-font-head); font-weight: 700; font-size: 1.35rem; letter-spacing: .04em; text-transform: uppercase; color: var(--np-slate); margin: 0; }
.site-title span { color: var(--np-blue); }
.site-tagline { font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--np-blue-dark); margin-top: .25rem; }

.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; align-items: center; }
.primary-nav a {
  display: block; padding: .6rem .9rem; text-decoration: none; color: var(--np-slate);
  font-family: var(--np-font-head); font-weight: 500; font-size: 1rem; border-radius: 6px; position: relative;
}
.primary-nav a:hover { color: var(--np-navy); background: var(--np-bg-soft); }
.primary-nav .current-menu-item > a, .primary-nav .current_page_item > a { color: var(--np-navy); }
.primary-nav .current-menu-item > a::after, .primary-nav .current_page_item > a::after {
  content: ""; position: absolute; left: .9rem; right: .9rem; bottom: .2rem; height: 3px; background: var(--np-orange); border-radius: 2px;
}
.primary-nav .menu-item-has-children { position: relative; }
.primary-nav .sub-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 240px; flex-direction: column; align-items: stretch;
  background: #fff; border: 1px solid var(--np-line); border-radius: var(--np-radius); box-shadow: var(--np-shadow); padding: .5rem; gap: 0;
}
.primary-nav .menu-item-has-children:hover > .sub-menu,
.primary-nav .menu-item-has-children:focus-within > .sub-menu { display: flex; }
.header-cta { margin-left: .5rem; }
.nav-toggle { display: none; background: none; border: 2px solid var(--np-navy); color: var(--np-navy); border-radius: 8px; padding: .45rem .7rem; font-family: var(--np-font-head); font-weight: 600; cursor: pointer; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }
  .primary-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--np-line); padding: 1rem 1.25rem 1.5rem; }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; align-items: stretch; }
  .primary-nav .sub-menu { display: flex; position: static; border: 0; box-shadow: none; padding: 0 0 0 1rem; min-width: 0; }
  .header-cta { margin: .75rem 0 0; }
  .admin-bar .site-header { top: 46px; }
}

/* ==========================================================================
   5. Hero
   ========================================================================== */
.hero {
  background:
    radial-gradient(1200px 500px at 90% -10%, rgba(82,133,181,.35), transparent 60%),
    linear-gradient(160deg, var(--np-navy) 0%, var(--np-slate) 100%);
  color: #dbe5ef; padding: clamp(3.5rem, 8vw, 6.5rem) 0; overflow: hidden;
}
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.hero h1 { color: #fff; margin-bottom: .5em; }
.hero h1 em { font-style: normal; color: var(--np-teal); }
.hero__lead { font-size: 1.2rem; max-width: 36em; color: #c9d7e5; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero .eyebrow { color: var(--np-teal); }
.hero__art { display: flex; justify-content: center; }
.hero__art svg { width: min(100%, 400px); }
.dots { display: flex; gap: .5rem; margin-top: 2rem; }
.dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.dots i:nth-child(1) { background: var(--np-blue); }
.dots i:nth-child(2) { background: var(--np-teal); }
.dots i:nth-child(3) { background: var(--np-orange); }
@media (max-width: 860px) { .hero__grid { grid-template-columns: 1fr; } .hero__art { order: -1; } .hero__art svg { width: 220px; } }

/* ==========================================================================
   6. Cards / services
   ========================================================================== */
.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--np-line); border-radius: var(--np-radius);
  padding: 1.75rem; display: flex; flex-direction: column; height: 100%;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; position: relative;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; height: 4px; width: 56px; background: var(--c, var(--np-blue)); border-radius: var(--np-radius) 0 0 0; }
.card:hover { box-shadow: var(--np-shadow); transform: translateY(-3px); border-color: transparent; }
.card:nth-child(3n+2) { --c: var(--np-teal); }
.card:nth-child(3n+3) { --c: var(--np-orange); }
.card__icon { width: 44px; height: 44px; color: var(--c, var(--np-blue)); margin-bottom: 1rem; }
.card h3 { margin-bottom: .4em; }
.card h3 a { text-decoration: none; color: inherit; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card p { color: var(--np-muted); font-size: .98rem; margin-bottom: 0; }
.card__more { margin-top: auto; padding-top: 1rem; font-family: var(--np-font-head); font-weight: 600; font-size: .95rem; color: var(--np-blue-dark); }
.card__thumb { margin: -1.75rem -1.75rem 1.25rem; border-radius: var(--np-radius) var(--np-radius) 0 0; overflow: hidden; aspect-ratio: 16/9; background: var(--np-bg-soft); }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meta { font-size: .85rem; color: var(--np-muted); display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-bottom: .6rem; }
.meta a { color: var(--np-blue-dark); text-decoration: none; font-weight: 600; }

/* Audience strip */
.audience { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.audience li { border: 1px solid rgba(255,255,255,.25); padding: .45rem 1rem; border-radius: 999px; font-family: var(--np-font-head); font-size: .95rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; gap: 1.5rem; } }

/* CTA band */
.cta-band { text-align: center; }
.cta-band .section-head { margin-inline: auto; }
.cta-band .hero__actions { justify-content: center; }

/* ==========================================================================
   7. Page, posts, blog
   ========================================================================== */
.page-header { background: var(--np-bg-soft); border-bottom: 1px solid var(--np-line); padding: clamp(2.5rem, 5vw, 4rem) 0; }
.page-header h1 { margin-bottom: .3em; }
.page-header p { color: var(--np-muted); max-width: 40em; margin: 0; font-size: 1.1rem; }
.page-header .meta { margin: 1rem 0 0; }

.entry-content > * { max-width: var(--np-narrow); margin-inline: auto; }
.entry-content > .alignwide { max-width: var(--np-wrap); }
.entry-content > .alignfull { max-width: none; }
.entry-content h2 { margin-top: 2em; }
.entry-content h3 { margin-top: 1.6em; }
.entry-content blockquote {
  border-left: 4px solid var(--np-teal); margin-block: 2em; padding: .3em 0 .3em 1.5rem;
  font-family: var(--np-font-head); font-size: 1.3rem; color: var(--np-slate);
}
.entry-content blockquote cite { display: block; font-size: .9rem; color: var(--np-muted); margin-top: .6rem; font-style: normal; }
.entry-content table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.entry-content th, .entry-content td { padding: .7rem .9rem; border-bottom: 1px solid var(--np-line); text-align: left; }
.entry-content th { background: var(--np-bg-soft); color: var(--np-navy); font-family: var(--np-font-head); }
.entry-content pre, .entry-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.entry-content pre { background: var(--np-navy); color: #e8eef5; padding: 1.2rem; border-radius: var(--np-radius); overflow-x: auto; }
.entry-content :not(pre) > code { background: var(--np-bg-soft); padding: .15em .4em; border-radius: 4px; }
.entry-content img { border-radius: var(--np-radius); }
.entry-content figcaption { font-size: .85rem; color: var(--np-muted); text-align: center; margin-top: .5rem; }
.post-featured { margin: 0 auto 2.5rem; max-width: var(--np-wrap); }
.post-featured img { width: 100%; border-radius: var(--np-radius); display: block; }

.cat-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.cat-pills a { padding: .35rem .9rem; border: 1px solid var(--np-line); border-radius: 999px; text-decoration: none; font-size: .9rem; color: var(--np-slate); font-family: var(--np-font-head); }
.cat-pills a:hover, .cat-pills a.is-active { background: var(--np-navy); color: #fff; border-color: var(--np-navy); }

.pagination, .post-navigation .nav-links { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; flex-wrap: wrap; }
.pagination .nav-links { display: flex; gap: .4rem; flex-wrap: wrap; }
.page-numbers { padding: .5rem .9rem; border: 1px solid var(--np-line); border-radius: 8px; text-decoration: none; color: var(--np-slate); }
.page-numbers.current { background: var(--np-navy); color: #fff; border-color: var(--np-navy); }
.post-navigation { max-width: var(--np-narrow); margin-inline: auto; }
.post-navigation a { text-decoration: none; font-family: var(--np-font-head); font-weight: 600; }
.tag-list { max-width: var(--np-narrow); margin: 2rem auto 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.tag-list a { background: var(--np-bg-soft); padding: .2rem .7rem; border-radius: 6px; font-size: .85rem; text-decoration: none; }

.author-box { max-width: var(--np-narrow); margin: 3rem auto 0; padding: 1.5rem; background: var(--np-bg-soft); border-radius: var(--np-radius); display: flex; gap: 1.2rem; align-items: center; }
.author-box img { border-radius: 50%; }
.author-box h4 { margin: 0 0 .2rem; }
.author-box p { margin: 0; color: var(--np-muted); font-size: .95rem; }

/* Comments */
.comments-area { max-width: var(--np-narrow); margin: 4rem auto 0; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; border-left: 2px solid var(--np-line); }
.comment-body { padding: 1.2rem 0; border-bottom: 1px solid var(--np-line); }
.comment-author img { border-radius: 50%; vertical-align: middle; margin-right: .5rem; }
.comment-metadata { font-size: .8rem; color: var(--np-muted); }

/* ==========================================================================
   8. Forms & contact
   ========================================================================== */
label { display: block; font-family: var(--np-font-head); font-weight: 600; font-size: .95rem; color: var(--np-navy); margin-bottom: .35rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="search"], input[type="password"], select, textarea {
  width: 100%; font: inherit; color: inherit; padding: .75rem .9rem; border: 1.5px solid #b9c5d1; border-radius: 8px; background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--np-blue); outline: 3px solid rgba(82,133,181,.3); outline-offset: 0; }
textarea { min-height: 160px; resize: vertical; }
.field { margin-bottom: 1.2rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.hp-field { position: absolute !important; left: -9999px; height: 0; overflow: hidden; }

.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card { background: var(--np-navy); color: #dbe5ef; border-radius: var(--np-radius); padding: 2rem; position: sticky; top: 110px; }
.contact-card h2 { color: #fff; font-size: 1.4rem; }
.contact-card ul { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.contact-card li { display: flex; gap: .8rem; margin-bottom: 1rem; align-items: flex-start; }
.contact-card svg { width: 22px; height: 22px; flex: none; color: var(--np-teal); margin-top: .2rem; }
.contact-card a { color: #fff; }
.notice { padding: 1rem 1.2rem; border-radius: 8px; margin-bottom: 1.5rem; border-left: 4px solid; }
.notice--ok { background: #e9f7f2; border-color: var(--np-teal); color: #1f5a47; }
.notice--err { background: #fff1e6; border-color: var(--np-orange); color: #7a3a07; }

.search-form { display: flex; gap: .5rem; }
.search-form label { flex: 1; margin: 0; }

/* ==========================================================================
   9. Footer
   ========================================================================== */
.site-footer { background: var(--np-navy); color: #b9c8d8; padding: 4rem 0 0; margin-top: 0; }
.site-footer a { color: #e8eef5; text-decoration: none; }
.site-footer a:hover { color: var(--np-teal); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 2.5rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h3 { color: #fff; font-size: 1rem; letter-spacing: .12em; text-transform: uppercase; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .5rem; }
.footer-tag { font-family: var(--np-font-head); letter-spacing: .2em; text-transform: uppercase; font-size: .78rem; color: #fff; }
.footer-tag b { color: var(--np-teal); } .footer-tag b:last-child { color: var(--np-orange); } .footer-tag b:nth-child(2) { color: var(--np-blue); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 3rem; padding: 1.5rem 0; font-size: .88rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem; }

/* WP core alignment helpers */
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption { max-width: 100%; }
.sticky .card { border-color: var(--np-orange); }
.bypostauthor { }
.gallery-caption { }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .nav-toggle { display: none; } }
