/*
Theme Name: Cambridge Internet Solutions
Theme URI: https://cambridgeinternetsolutions.co.uk
Author: Cambridge Internet Solutions
Author URI: https://cambridgeinternetsolutions.co.uk
Description: Bespoke theme for Cambridge Internet Solutions, a UK engineering-management consultancy. Navy brand system derived from the firm's logo, with custom page templates for Home, Services, Approach, About and Contact, block-editor patterns, and a pluggable contact-form shortcode.
Version: 1.1.1
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cis
*/

/* Cambridge Internet Solutions — theme styles
   Palette extracted from the firm's logo (brand navy #113f67).
   Webfonts (Inter + Newsreader) are enqueued in functions.php. */

:root {
  --brand: #113f67;
  --brand-deep: #0d3152;
  --ink: #13283a;
  --accent: #2f7bc0;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --muted: #5b6b7a;
  --border: #dde4ec;
  --shadow: 0 1px 2px rgba(17,63,103,.04), 0 12px 32px rgba(17,63,103,.07);

  --font-display: 'Newsreader', 'Iowan Old Style', Charter, Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'IBM Plex Mono', Menlo, monospace;

  --wrap: 1160px;
  --gut: clamp(20px, 5vw, 56px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---- layout helpers ---- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
.section { padding-block: clamp(56px, 9vw, 112px); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.eyebrow--light { color: #9ec3e6; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.08; letter-spacing: -0.01em; color: var(--brand); }
h1 { font-size: clamp(38px, 6vw, 66px); letter-spacing: -0.02em; }
h2 { font-size: clamp(28px, 4vw, 42px); }
h3 { font-size: clamp(20px, 2.4vw, 25px); line-height: 1.2; }
p { text-wrap: pretty; }
.lead { font-size: clamp(18px, 2.2vw, 22px); color: var(--ink); max-width: 56ch; line-height: 1.5; }
.measure { max-width: 64ch; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 15.5px; letter-spacing: .01em;
  padding: 14px 24px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; transition: background .18s, color .18s, border-color .18s, transform .12s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--brand); }
.btn--ghost { background: transparent; color: var(--brand); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--brand); }
.btn--onnavy { background: #fff; color: var(--brand); }
.btn--onnavy:hover { background: #eaf2fb; }
.btn--lineonnavy { background: transparent; color: #fff; border-color: rgba(255,255,255,.34); }
.btn--lineonnavy:hover { border-color: #fff; }
.btn svg { width: 17px; height: 17px; }

/* ---- logo lockups ---- */
.logo { display: inline-flex; align-items: center; gap: 13px; }
.logo__mark { width: 38px; height: 38px; flex: none; }
.logo__name {
  font-family: var(--font-display); font-weight: 500; line-height: 1.02;
  letter-spacing: -.005em; font-size: 18px; color: inherit;
}
.logo__name small { display: block; font-size: .68em; letter-spacing: .02em; color: inherit; opacity: .82; }
.logo--stacked { flex-direction: column; gap: 10px; text-align: center; }
.logo--stacked .logo__mark { width: 54px; height: 54px; }
.logo--stacked .logo__name { font-size: 17px; letter-spacing: .08em; text-transform: uppercase; }
.logo--stacked .logo__name small { letter-spacing: .08em; }

/* ---- header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246,248,251,.86); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.nav__links { display: flex; align-items: center; gap: 10px; }
.nav__menu { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav__menu li { list-style: none; }
.nav__links a {
  font-size: 15px; font-weight: 500; color: var(--ink);
  padding: 9px 14px; border-radius: 7px; transition: background .15s, color .15s;
}
.nav__menu a:hover { background: #fff; color: var(--brand); }
.nav__menu .current-menu-item > a,
.nav__menu .current_page_item > a,
.nav__menu .current-menu-ancestor > a,
.nav__menu .current-page-ancestor > a { color: var(--brand); }
.nav__menu .current-menu-item > a::after,
.nav__menu .current_page_item > a::after {
  content: ""; display: block; height: 2px; border-radius: 2px;
  background: var(--accent); margin-top: 4px;
}
.nav__cta { margin-left: 4px; }
.nav__toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; width: 44px; height: 44px; cursor: pointer; }
.nav__toggle span, .nav__toggle span::before, .nav__toggle span::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--brand); margin-inline: auto; position: relative; transition: .2s;
}
.nav__toggle span::before { position: absolute; top: -6px; }
.nav__toggle span::after { position: absolute; top: 6px; }

/* ---- hero ---- */
.hero { position: relative; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero .lead { margin-block: 22px 32px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__panel {
  background: var(--brand); border-radius: 16px; padding: 38px 36px; color: #fff;
  box-shadow: var(--shadow); position: relative;
}
.hero__panel h3 { color: #fff; }
.journey { display: grid; gap: 0; margin-top: 22px; }
.journey__step { display: grid; grid-template-columns: 40px 1fr; gap: 16px; padding-block: 14px; position: relative; }
.journey__step:not(:last-child)::before {
  content: ""; position: absolute; left: 19px; top: 44px; bottom: -10px; width: 0; border-left: 2px dotted rgba(255,255,255,.4);
}
.journey__icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); }
.journey__icon svg { width: 20px; height: 20px; }
.journey__step b { display: block; font-weight: 600; font-size: 15.5px; }
.journey__step span { font-size: 14px; color: #bcd3ea; }

/* ---- generic page header band ---- */
.pagehead { background: var(--brand); color: #fff; }
.pagehead h1 { color: #fff; }
.pagehead .lead { color: #cfe0f1; }
.pagehead .crumbs { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #8fb6dc; margin-bottom: 16px; }

/* ---- cards / grids ---- */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 30px; transition: border-color .18s, box-shadow .18s, transform .18s;
}
.card--link:hover { border-color: #c2d3e6; box-shadow: var(--shadow); transform: translateY(-2px); }
.card__num { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; color: var(--accent); }
.card h3 { margin-block: 14px 10px; }
.card p { color: var(--muted); font-size: 15.5px; }
.card__tag { display: inline-block; margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--brand); }
.card__tag svg { width: 14px; height: 14px; display: inline; vertical-align: -2px; margin-left: 4px; }

.feature-list { list-style: none; display: grid; gap: 14px; }
.feature-list li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; color: var(--ink); font-size: 16px; }
.feature-list svg { width: 22px; height: 22px; color: var(--accent); margin-top: 2px; }

/* ---- split band ---- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.panel-navy { background: var(--brand); color: #fff; border-radius: 16px; padding: clamp(30px,4vw,52px); }
.panel-navy h2, .panel-navy h3 { color: #fff; }
.panel-navy p { color: #cfe0f1; }
.divider { height: 1px; background: var(--border); border: 0; margin-block: 0; }

/* ---- step rail (approach) ---- */
.rail { display: grid; gap: 0; }
.rail__item { display: grid; grid-template-columns: 64px 1fr; gap: 28px; padding-block: 30px; border-top: 1px solid var(--border); }
.rail__item:last-child { border-bottom: 1px solid var(--border); }
.rail__badge { width: 56px; height: 56px; border-radius: 12px; background: #eaf2fb; color: var(--brand); display: grid; place-items: center; }
.rail__badge svg { width: 26px; height: 26px; }
.rail__item h3 { margin-bottom: 8px; }
.rail__item p { color: var(--muted); max-width: 60ch; }
.rail__num { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: .12em; }

/* ---- stat / fact band (qualitative, no invented metrics) ---- */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.facts > div { background: var(--surface); padding: 28px; }
.facts dt { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.facts dd { font-family: var(--font-display); font-size: clamp(19px,2.2vw,23px); color: var(--brand); line-height: 1.2; }

/* ---- CTA band ---- */
.cta-band { background: var(--brand); color: #fff; text-align: center; }
.cta-band h2 { color: #fff; max-width: 18ch; margin-inline: auto; }
.cta-band p { color: #cfe0f1; max-width: 52ch; margin: 16px auto 30px; }

/* ---- contact form ---- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field .req { color: var(--accent); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 15.5px; padding: 13px 14px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,123,192,.15);
}
.field--row { grid-template-columns: 1fr 1fr; gap: 18px; display: grid; }
.field .error { font-size: 12.5px; color: #c0392b; display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: #c0392b; }
.field.invalid .error { display: block; }
.form__note { font-size: 13px; color: var(--muted); }
.form__success { display: none; background: #eaf6ee; border: 1px solid #bfe3cb; color: #1d6b3a; padding: 16px 18px; border-radius: 10px; font-size: 15px; }
.form__success.show { display: block; }
.contact-aside dl { display: grid; gap: 22px; }
.contact-aside dt { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.contact-aside dd { color: var(--ink); font-size: 16px; }

/* ---- footer ---- */
.site-footer { background: var(--brand-deep); color: #cdddec; }
.site-footer .wrap { padding-block: 56px 30px; }
.footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-footer h4 { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: #8fb6dc; margin-bottom: 16px; font-weight: 500; }
.site-footer a { color: #cdddec; font-size: 15px; display: inline-block; padding-block: 5px; }
.site-footer a:hover { color: #fff; }
.site-footer .logo__name { color: #fff; }
.site-footer p { font-size: 14.5px; color: #9fbcd6; max-width: 38ch; margin-top: 14px; }
.footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 44px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; color: #8fb6dc; }

/* ---- reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---- responsive ---- */
@media (max-width: 920px) {
  .hero__grid, .split { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: 1fr 1fr; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .hero__panel { order: -1; }
}
@media (max-width: 760px) {
  .nav__links {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 12px var(--gut) 18px; box-shadow: var(--shadow);
    display: none;
  }
  .nav__links.open { display: flex; }
  .nav__menu { flex-direction: column; align-items: stretch; gap: 2px; width: 100%; }
  .nav__links a { padding: 13px 12px; }
  .nav__menu .current-menu-item > a::after,
  .nav__menu .current_page_item > a::after { display: none; }
  .nav__cta { margin: 6px 0 0; }
  .nav__toggle { display: grid; place-items: center; }
  .grid--2, .grid--3, .facts, .field--row { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr; gap: 30px; }
}

/* ===========================================================
   Contact form (plugin shortcode — Contact Form 7 / WPForms)
   =========================================================== */
.form-embed--setup {
  padding: 28px 30px; border: 1px dashed #c2d3e6; border-radius: 12px;
  background: #eef4fb; color: var(--brand);
}
.form-embed--setup p { margin: 0; font-size: 15px; }
.form-embed code { font-family: var(--font-mono); font-size: 13px; background: #fff; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); }

/* Style the plugin's generated fields to match the theme. Targets the common
   Contact Form 7 / WPForms markup; harmless if those plugins aren't used. */
.form-embed label { font-size: 13.5px; font-weight: 600; color: var(--ink); display: block; margin-bottom: 7px; }
.form-embed input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.form-embed select,
.form-embed textarea {
  font: inherit; font-size: 15.5px; width: 100%;
  padding: 13px 14px; margin-bottom: 16px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.form-embed textarea { resize: vertical; min-height: 130px; }
.form-embed input:focus, .form-embed select:focus, .form-embed textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,123,192,.15);
}
.form-embed input[type="submit"],
.form-embed button[type="submit"],
.form-embed .wpforms-submit {
  font: inherit; font-weight: 600; font-size: 15.5px; cursor: pointer;
  padding: 14px 24px; border: 0; border-radius: 8px;
  background: var(--accent); color: #fff; transition: background .18s;
}
.form-embed input[type="submit"]:hover,
.form-embed button[type="submit"]:hover,
.form-embed .wpforms-submit:hover { background: var(--brand); }
/* CF7 / WPForms validation + status messages */
.form-embed .wpcf7-not-valid-tip, .form-embed .wpforms-error { color: #c0392b; font-size: 12.5px; }
.form-embed .wpcf7-response-output, .form-embed .wpforms-confirmation-container-full {
  margin-top: 8px; padding: 14px 16px; border-radius: 10px; font-size: 15px;
  background: #eaf6ee; border: 1px solid #bfe3cb; color: #1d6b3a;
}

/* ===========================================================
   Block editor (Gutenberg) front-end compatibility
   Lets the registered patterns render with the design system.
   =========================================================== */
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.entry-content > .alignwide { max-width: var(--wrap); margin-inline: auto; }
.entry-content--canvas > *:not(.alignfull):not(.alignwide) { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }

/* ===========================================================
   Rich-text vertical rhythm for content-driven prose pages
   (page.php generic pages, single posts). The global `* { margin:0 }`
   reset strips spacing; restore it here. Scoped with :not() so the
   block Canvas template and the fixed page templates — which carry
   their own spacing — are left untouched.
   =========================================================== */
.entry-content:not(.entry-content--canvas) > :first-child { margin-top: 0; }
.entry-content:not(.entry-content--canvas) h1,
.entry-content:not(.entry-content--canvas) h2,
.entry-content:not(.entry-content--canvas) h3,
.entry-content:not(.entry-content--canvas) h4 { margin-top: 1.6em; margin-bottom: .55em; line-height: 1.18; }
.entry-content:not(.entry-content--canvas) p,
.entry-content:not(.entry-content--canvas) ul,
.entry-content:not(.entry-content--canvas) ol,
.entry-content:not(.entry-content--canvas) blockquote,
.entry-content:not(.entry-content--canvas) figure,
.entry-content:not(.entry-content--canvas) table,
.entry-content:not(.entry-content--canvas) pre { margin-bottom: 1.15em; }
.entry-content:not(.entry-content--canvas) ul,
.entry-content:not(.entry-content--canvas) ol { padding-left: 1.4em; }
.entry-content:not(.entry-content--canvas) ul { list-style: disc; }
.entry-content:not(.entry-content--canvas) ol { list-style: decimal; }
.entry-content:not(.entry-content--canvas) li { margin-bottom: .4em; }
.entry-content:not(.entry-content--canvas) li > ul,
.entry-content:not(.entry-content--canvas) li > ol { margin-top: .4em; margin-bottom: 0; }
.entry-content:not(.entry-content--canvas) > :last-child { margin-bottom: 0; }

/* core button blocks adopt the .btn look when tagged with a btn-- class */
.wp-block-button__link {
  border-radius: 8px; font-weight: 600; font-size: 15.5px; padding: 14px 24px;
  background: var(--accent); color: #fff; transition: background .18s, color .18s;
}
.btn--primary .wp-block-button__link:hover { background: var(--brand); }
.btn--ghost .wp-block-button__link { background: transparent; color: var(--brand); border: 1px solid var(--border); }
.btn--ghost .wp-block-button__link:hover { border-color: var(--brand); }
.btn--onnavy .wp-block-button__link { background: #fff; color: var(--brand); }

/* pattern blocks reuse the card / panel / hero classes */
.wp-block-column.card { padding: 30px; }
.wp-block-column.hero__panel { padding: 38px 36px; }
.hero__grid.wp-block-columns { gap: clamp(32px, 5vw, 72px); align-items: center; }
.facts-strip .wp-block-columns { gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.facts-strip .wp-block-column.card { border: 0; border-radius: 0; }
.section.cta-band .wp-block-buttons { justify-content: center; display: flex; }
