/*
Theme Name: WillPhin
Theme URI: https://willphin.co.za
Author: Code Orbit
Author URI: https://codeorbit.co.za
Description: Custom, lightweight theme for WillPhin — Bookkeeping / Accounting & Data Analytics. Hand-coded (no page builder). Custom post types for Portfolio & Testimonials, scroll-in animations, accessible and fast.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: willphin
*/

/* =========================================================
   1. DESIGN TOKENS (colours, fonts, spacing)
   ========================================================= */
:root {
  --navy:      #14213d;   /* primary brand */
  --navy-700:  #1f2f54;
  --gold:      #c9a227;   /* accent */
  --gold-600:  #b08e1d;
  --ink:       #1d2433;   /* body text */
  --muted:     #5b6472;   /* secondary text */
  --line:      #e4e8ef;   /* borders */
  --bg:        #ffffff;
  --bg-soft:   #f6f8fb;   /* section alt background */
  --white:     #ffffff;
  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 10px 30px rgba(20,33,61,.08);
  --shadow-lg: 0 18px 50px rgba(20,33,61,.14);
  --maxw:      1140px;
  --gap:       clamp(1rem, 2.5vw, 2rem);
  --font-head: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* =========================================================
   2. RESET / BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold-600); }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }
p  { margin: 0 0 1rem; }
ul { line-height: 1.7; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* =========================================================
   3. LAYOUT HELPERS
   ========================================================= */
.container { width: min(var(--maxw), 92%); margin-inline: auto; }
.section { padding: clamp(3rem, 7vw, 6rem) 0; }
.section--soft { background: var(--bg-soft); }
.section__head { max-width: 720px; margin: 0 auto 2.5rem; text-align: center; }
.eyebrow {
  display: inline-block; font-family: var(--font-head); font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; font-size: .78rem;
  color: var(--gold-600); margin-bottom: .6rem;
}
.lead { font-size: 1.15rem; color: var(--muted); }
.text-center { text-align: center; }
.grid { display: grid; gap: var(--gap); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

/* =========================================================
   4. BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 600; font-size: 1rem;
  padding: .85rem 1.6rem; border-radius: 999px; cursor: pointer;
  border: 2px solid transparent; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn--primary { background: var(--gold); color: var(--navy); }
.btn--primary:hover { background: var(--gold-600); color: var(--navy); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.5); }
.btn--ghost:hover { background: rgba(255,255,255,.12); color: var(--white); transform: translateY(-2px); }
.btn--outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--outline:hover { background: var(--navy); color: var(--white); transform: translateY(-2px); }

/* =========================================================
   5. HEADER / NAV
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100; background: var(--navy);
  border-bottom: none;
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 2rem; color: #fff; }
.brand span { color: var(--gold); }
.nav { display: flex; align-items: center; gap: .25rem; }
.nav a { font-family: var(--font-head); font-weight: 500; padding: .5rem .8rem; border-radius: 8px; color: #fff; }
.nav a:hover, .nav .current-menu-item > a { color: var(--gold); background: rgba(255,255,255,.10); }
.nav .menu { list-style: none; display: flex; gap: .15rem; margin: 0; padding: 0; align-items: center; }
.nav .sub-menu { display: none; }
.header__cta { margin-left: .5rem; }
.header__cta:hover { color: var(--navy); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .4rem; }
.nav-toggle span { display: block; width: 26px; height: 3px; background: #fff; margin: 5px 0; border-radius: 2px; transition: .3s; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav { position: fixed; inset: 72px 0 auto 0; background: var(--navy-700); flex-direction: column;
         align-items: stretch; padding: 1rem 6%; gap: .25rem; border-bottom: 1px solid rgba(255,255,255,.12);
         box-shadow: var(--shadow); transform: translateY(-130%); transition: transform .3s ease; }
  .nav.is-open { transform: translateY(0); }
  .nav .menu { flex-direction: column; align-items: stretch; }
  .header__cta { margin: .5rem 0 0; }
  .nav-toggle.is-active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle.is-active span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* =========================================================
   6. HERO
   ========================================================= */
.hero { background: var(--navy); color: var(--white); position: relative; overflow: hidden; }
.hero__inner {
  padding: clamp(2.5rem, 7vw, 5.5rem) 0; position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
}
.hero__content { order: 2; }   /* text on the RIGHT (desktop) */
.hero__media   { order: 1; }   /* image on the LEFT (desktop) */
.hero__media img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-lg); object-fit: cover; }
.hero__placeholder { aspect-ratio: 4/3; border-radius: var(--radius); background: rgba(255,255,255,.06);
  border: 1px dashed rgba(255,255,255,.3); display: grid; place-items: center; text-align: center;
  color: #aeb8cc; padding: 1rem; font-family: var(--font-head); }
.hero h1 { color: var(--white); }
.hero p { font-size: 1.2rem; color: #d8deeb; margin-bottom: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* MOBILE ONLY: image becomes a full-width background behind the content */
@media (max-width: 860px) {
  .hero { display: flex; align-items: center; min-height: 78vh; }
  .hero__inner {
    grid-template-columns: 1fr; width: 100%;
    position: static;                         /* let the image size to .hero, not .hero__inner */
    padding: clamp(3rem, 12vw, 5rem) 6%;
  }
  .hero__media { position: absolute; inset: 0; z-index: 0; }
  .hero__media img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; box-shadow: none; }
  .hero__placeholder { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
  .hero__media::after { content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(20,33,61,.72) 0%, rgba(20,33,61,.90) 100%); }
  .hero__content {
    position: relative; z-index: 2;
    max-width: 560px; margin: 0 auto;         
    text-align: center;                        
  }
  .hero__actions { justify-content: center; }  
}

/* =========================================================
   7. CARDS (services, portfolio, testimonials, blog)
   ========================================================= */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow); transition: transform .22s ease, box-shadow .22s ease;
  height: 100%; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card__icon { width: 52px; height: 52px; border-radius: 12px; background: var(--bg-soft);
  display: grid; place-items: center; color: var(--gold-600); margin-bottom: 1rem; font-size: 1.5rem; }
.card__media { margin: -1.75rem -1.75rem 1.25rem; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; aspect-ratio: 16/10; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card__media img { transform: scale(1.05); }
.card h3 a { color: var(--navy); }
.card__meta { font-size: .82rem; color: var(--gold-600); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.card__more { margin-top: auto; padding-top: 1rem; font-family: var(--font-head); font-weight: 600; color: var(--gold-600); }

/* Tools / tags */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: .75rem 0 0; }
.tags li { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px;
  padding: .25rem .7rem; font-size: .78rem; color: var(--muted); }

/* Stars */
.stars { color: var(--gold); letter-spacing: 2px; }

/* =========================================================
   8. TESTIMONIALS
   ========================================================= */
.quote { font-size: 1.05rem; color: var(--ink); }
.quote::before { content: "\201C"; font-family: Georgia, serif; font-size: 3rem; color: var(--gold); line-height: 0; vertical-align: -.4em; margin-right: .15rem; }
.testimonial__author { display: flex; align-items: center; gap: .8rem; margin-top: 1rem; }
.testimonial__author img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.testimonial__name { font-family: var(--font-head); font-weight: 600; color: var(--navy); }
.testimonial__role { font-size: .85rem; color: var(--muted); }

/* =========================================================
   9. STATS / COUNTERS
   ========================================================= */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--gap); }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2,1fr); } }
.stat { text-align: center; }
.stat__num { font-family: var(--font-head); font-weight: 700; font-size: clamp(2rem,5vw,2.8rem); color: var(--gold-600); }
.stat__label { color: var(--muted); font-size: .95rem; }

/* =========================================================
   10. SINGLE / ARTICLE CONTENT
   ========================================================= */
.page-hero { background: var(--navy); color: var(--white); padding: clamp(2.5rem,6vw,4.5rem) 0; }
.page-hero h1 { color: var(--white); margin: 0; }
.page-hero p { color: #d8deeb; margin: .5rem 0 0; }
.breadcrumbs { font-size: .85rem; color: #aeb8cc; margin-bottom: .75rem; }
.breadcrumbs a { color: #d8deeb; }
.prose { max-width: 760px; margin-inline: auto; }
.prose img { border-radius: var(--radius); margin: 1.5rem 0; }
.prose h2 { margin-top: 2rem; }
.prose blockquote { border-left: 4px solid var(--gold); margin: 1.5rem 0; padding: .5rem 0 .5rem 1.25rem; color: var(--muted); font-style: italic; }
.casestudy__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin: 1.5rem 0; }
@media (max-width: 700px){ .casestudy__grid { grid-template-columns: 1fr; } }
.casestudy__block { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.casestudy__block h3 { color: var(--gold-600); font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; }

/* =========================================================
   11. CONTACT FORM
   ========================================================= */
.form-grid { display: grid; gap: 1.1rem; }
.field label { display: block; font-family: var(--font-head); font-weight: 500; margin-bottom: .35rem; color: var(--navy); }
.field input, .field textarea, .field select {
  width: 100%; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 1rem; background: var(--white); transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.18); outline: none; }
.field textarea { min-height: 150px; resize: vertical; }
.form-note { font-size: .85rem; color: var(--muted); }
.alert { padding: 1rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; }
.alert--ok { background: #e7f6ed; border: 1px solid #b7e2c6; color: #1c6b3a; }
.alert--err { background: #fdecec; border: 1px solid #f5c2c2; color: #9b2222; }
/* honeypot */
.hp-field { position: absolute; left: -9999px; }

.contact-split { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(1.5rem,4vw,3rem); align-items: start; }
@media (max-width: 820px){ .contact-split { grid-template-columns: 1fr; } }
.contact-info li { list-style: none; margin: 0 0 1rem; padding-left: 1.8rem; position: relative; }
.contact-info { padding: 0; }
.contact-info strong { display: block; color: var(--navy); font-family: var(--font-head); }

/* =========================================================
   12. CTA BANNER
   ========================================================= */
.cta-banner { background: linear-gradient(135deg, var(--navy), var(--navy-700)); color: var(--white); border-radius: var(--radius); padding: clamp(2rem,5vw,3.5rem); text-align: center; }
.cta-banner h2 { color: var(--white); }
.cta-banner p { color: #d8deeb; max-width: 560px; margin: 0 auto 1.5rem; }

/* =========================================================
   13. FOOTER
   ========================================================= */
.site-footer { background: var(--navy); color: #c7d0e2; padding: 3.5rem 0 1.5rem; margin-top: 0; }
.site-footer a { color: #c7d0e2; }
.site-footer a:hover { color: var(--gold); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--gap); margin-bottom: 2rem; }
@media (max-width: 760px){ .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--white); margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .5rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.25rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; font-size: .85rem; }

/* WhatsApp float */
.wa-float { position: fixed; right: 18px; bottom: 18px; z-index: 200; width: 56px; height: 56px; border-radius: 50%;
  background: #25d366; color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.wa-float:hover { color: #fff; transform: scale(1.06); }

/* =========================================================
   14. PAGINATION
   ========================================================= */
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2.5rem; flex-wrap: wrap; }
.pagination .page-numbers { padding: .55rem .9rem; border: 1px solid var(--line); border-radius: 8px; color: var(--navy); }
.pagination .current { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* =========================================================
   15. SCROLL-IN ANIMATIONS (respect reduced motion)
   ========================================================= */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .btn, .card__media img { transition: none; }
}

/* skip link */
.skip-link { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--navy); padding: .6rem 1rem; z-index: 999; }
.skip-link:focus { left: 8px; top: 8px; }
