/*
Theme Name: Ian Mellett
Theme URI: https://ianmellett.co.nz/
Author: Net Branding Limited
Author URI: https://ianmellett.co.nz/
Description: A custom WordPress theme for Ian Mellett – Cricketer and Lawyer. Fully compatible with Elementor Free. Replicates the original ianmellett.co.nz design: oak-palette, Archivo Black / Spectral / Archivo Narrow typography, honours-board panel, engraved rules and orchestrated scroll reveal.
Version: 1.0.1
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: ian-mellett
Tags: one-column, custom-logo, custom-menu, featured-images, editor-style, wide-blocks, full-width-template, translation-ready, accessibility-ready, blog
*/

/* ==========================================================================
   DESIGN TOKENS — mirror of ianmellett.co.nz
   ========================================================================== */
:root {
  --oak:        #e4e2d7;
  --oak-deep:   #cdc7b6;
  --oak-line:   #b9b2a0;
  --ink:        #2b2118;
  --ink-soft:   #57493c;
  --oxblood:    #6e2230;
  --oxblood-lo: #8d3543;
  --slate:      #49525a;
  --paper:      #f7f5ef;

  --display: "Archivo Black", "Arial Black", sans-serif;
  --body:    "Spectral", Georgia, serif;
  --data:    "Archivo Narrow", "Arial Narrow", sans-serif;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

/* ==========================================================================
   RESET / BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--oak);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem);
  line-height: 1.62;
  /* faint vertical grain — the only texture on the page */
  background-image: linear-gradient(90deg, rgba(0,0,0,.018) 1px, transparent 1px);
  background-size: 7px 100%;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--oxblood); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--ink); }
a:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 3px; }

/* ==========================================================================
   LAYOUT UTILITIES
   ========================================================================== */
.wrap {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Elementor inner-section override — keep max-width consistent */
.elementor-section.wrap,
.elementor-section > .elementor-container {
  max-width: 64rem;
}

/* ==========================================================================
   ENGRAVED RULE — routed double-line motif
   ========================================================================== */
.rule {
  border: 0;
  height: 0;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--oak-line);
  padding-top: 3px;
  margin: 0;
}

/* ==========================================================================
   MASTHEAD
   ========================================================================== */
.masthead {
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(1.75rem, 4vw, 2.75rem);
}

.eyebrow {
  font-family: var(--data);
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.4rem;
}

.masthead h1,
.ian-masthead-h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.4rem, 8.5vw, 5.25rem);
  line-height: .94;
  letter-spacing: -.015em;
  text-transform: uppercase;
  margin: 0;
  color: var(--ink);
}

.masthead h1 .and,
.ian-and {
  display: block;
  color: var(--oxblood);
}

.boardline {
  font-family: var(--data);
  font-weight: 600;
  font-size: clamp(.8rem, 1.6vw, 1rem);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin: 1.5rem 0 1.75rem;
}

.boardline .dot { color: var(--oak-line); padding: 0 .5em; }

.standfirst {
  font-family: var(--body);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.15rem, 1.6vw, 1.5rem);
  line-height: 1.42;
  max-width: 30rem;
  margin: 1.75rem 0 0;
  color: var(--ink-soft);
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section + .section { border-top: 1px solid var(--oak-line); }

.ian-section-label {
  font-family: var(--data);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin: 0 0 1.5rem;
}

.lede,
.ian-lede {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.18;
  letter-spacing: -.01em;
  margin: 0 0 1.5rem;
  max-width: 26rem;
  color: var(--ink);
}

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.15em; }
.prose p:last-child { margin-bottom: 0; }

.beat {
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  line-height: 1.25;
  color: var(--oxblood);
  margin: 1.75rem 0;
  max-width: 24rem;
}

/* ==========================================================================
   SPLIT LAYOUT — text + figure
   ========================================================================== */
.split {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.split > * { min-width: 0; }

@media (min-width: 56rem) {
  .split { grid-template-columns: minmax(0,1fr) minmax(0,20rem); }
}

figure { margin: 0; }
figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--oak-line);
  box-shadow: 0 1px 0 var(--paper);
}
figcaption {
  font-family: var(--data);
  font-size: .8125rem;
  line-height: 1.45;
  color: var(--slate);
  margin-top: .7rem;
}

/* ==========================================================================
   THE BOARD PANEL
   ========================================================================== */
.board {
  background: linear-gradient(180deg, var(--paper), var(--oak-deep));
  border: 1px solid var(--oak-line);
  padding: clamp(1.25rem, 3.5vw, 2.5rem);
}
.board-head {
  font-family: var(--data);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink);
  text-align: center;
  margin: 0 0 .35rem;
}
.board-sub {
  font-family: var(--data);
  font-size: .75rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  margin: 0 0 1.75rem;
}
.board dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 40rem) {
  .board dl { grid-template-columns: 13rem 1fr; }
}
.board dt {
  font-family: var(--data);
  font-weight: 700;
  font-size: .8125rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: .7rem 0 0;
  border-top: 1px solid var(--oak-line);
}
.board dd {
  margin: 0;
  font-family: var(--data);
  font-size: .95rem;
  line-height: 1.45;
  color: var(--oxblood);
  padding: .7rem 0 .9rem;
  border-top: 1px solid var(--oak-line);
}
@media (max-width: 39.999rem) {
  .board dt { border-top: 1px solid var(--oak-line); padding-bottom: .1rem; }
  .board dd { border-top: 0; padding-top: 0; }
}

/* ==========================================================================
   SOURCE CITATION BLOCK
   ========================================================================== */
.source {
  border-left: 3px solid var(--oxblood);
  background: var(--paper);
  padding: 1.1rem 1.35rem;
  margin: 1.75rem 0;
  max-width: var(--measure);
}
.source p {
  margin: 0;
  font-family: var(--data);
  font-size: .95rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.source .label {
  display: block;
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: .45rem;
}

/* ==========================================================================
   FOCUS / PRACTICE AREAS LIST
   ========================================================================== */
.focus {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  max-width: var(--measure);
}
.focus li {
  border-top: 1px solid var(--oak-line);
  padding: .9rem 0;
}
.focus li:last-child { border-bottom: 1px solid var(--oak-line); }
.focus b {
  display: block;
  font-family: var(--data);
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: .2rem;
}
.focus span { font-size: .98rem; color: var(--ink-soft); }

/* ==========================================================================
   CTA BUTTON
   ========================================================================== */
.contact-action { margin: 1.75rem 0 0; }

.cta-button,
.elementor-button.cta-button {
  display: inline-block;
  background: var(--oxblood);
  color: var(--paper) !important;
  border: 2px solid var(--oxblood);
  padding: .8rem 1.25rem;
  font-family: var(--data);
  font-weight: 700;
  font-size: .9rem;
  line-height: 1;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .2s, border-color .2s;
}
.cta-button:hover,
.elementor-button.cta-button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper) !important;
}
.cta-button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ==========================================================================
   FAQ / ACCORDION
   ========================================================================== */
.faq { max-width: var(--measure); }

.qa { border-top: 1px solid var(--oak-line); }
.qa:last-of-type { border-bottom: 1px solid var(--oak-line); }

.qa summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  padding: .9rem 0;
  color: var(--ink);
}
.qa summary h3 {
  margin: 0;
  font-family: var(--body);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.4;
  color: inherit;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+";
  flex: 0 0 auto;
  font-family: var(--data);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--oxblood);
  transform: translateY(.15em);
}
.qa[open] summary::after { content: "\2212"; }
.qa summary:hover { color: var(--oxblood); }
.qa summary:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 2px; }

.qa-body { padding: 0 0 1.1rem; }
.qa-body p { margin: 0; color: var(--ink-soft); max-width: 32rem; }

/* ==========================================================================
   FOOTER / FOOT
   ========================================================================== */
.foot {
  border-top: 2px solid var(--ink);
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(2.5rem, 6vw, 4rem);
}
.foot .prose p { color: var(--ink-soft); }
.foot .profiles {
  font-family: var(--data);
  font-size: .9rem;
  letter-spacing: .06em;
  margin-top: 1.5rem;
}
.foot .profiles a { margin-right: 1.25rem; white-space: nowrap; }

/* ==========================================================================
   HEADER / SITE NAVIGATION
   ========================================================================== */
#ian-header {
  background: var(--oak);
  border-bottom: 1px solid var(--oak-line);
  position: sticky;
  top: 0;
  z-index: 999;
}

.ian-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem var(--gutter);
  max-width: 64rem;
  margin: 0 auto;
}

.ian-site-logo a {
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: -.01em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}
.ian-site-logo a:hover { color: var(--oxblood); }

/* Custom logo image */
.ian-site-logo .custom-logo-link img {
  max-height: 2.5rem;
  width: auto;
}

/* Primary nav */
#ian-primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.75rem;
}
#ian-primary-nav ul li a {
  font-family: var(--data);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color .2s;
}
#ian-primary-nav ul li a:hover,
#ian-primary-nav ul li.current-menu-item a {
  color: var(--oxblood);
}

/* Mobile hamburger */
.ian-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
  color: var(--ink);
}
.ian-nav-toggle svg { width: 1.5rem; height: 1.5rem; display: block; }

@media (max-width: 55.999rem) {
  .ian-nav-toggle { display: block; }
  #ian-primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--oak);
    border-bottom: 2px solid var(--ink);
    padding: 1rem var(--gutter) 1.5rem;
    z-index: 998;
  }
  #ian-primary-nav.is-open { display: block; }
  #ian-primary-nav ul {
    flex-direction: column;
    gap: .25rem;
  }
  #ian-primary-nav ul li a {
    display: block;
    padding: .6rem 0;
    font-size: .9rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   SCROLL REVEAL ANIMATION
   ───────────────────────────────────────────────────────────────────────── */

/* ── EDITOR FIX: Force visibility in Elementor editor ── */
.elementor-editor-active .reveal,
.elementor-editor-active .reveal.in,
.elementor-editor-preview .reveal,
.elementor-editor-preview .reveal.in {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  /* Hide by default (unless overridden by editor fix) */
  body:not(.elementor-editor-active):not(.elementor-editor-preview) .reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .7s ease, transform .7s ease;
  }
  body:not(.elementor-editor-active):not(.elementor-editor-preview) .reveal.in {
    opacity: 1;
    transform: none;
  }
  .masthead h1,
  .ian-masthead-h1 {
    animation: rise .8s .05s both cubic-bezier(.2,.7,.3,1);
  }
  .boardline {
    animation: rise .8s .2s both cubic-bezier(.2,.7,.3,1);
  }
  .standfirst {
    animation: rise .8s .35s both cubic-bezier(.2,.7,.3,1);
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
}

/* ==========================================================================
   ELEMENTOR OVERRIDES — keep the oak aesthetic inside Elementor canvases
   ========================================================================== */
.elementor-page .elementor-section,
.elementor-page .e-con {
  background-color: transparent;
}

/* Elementor heading widget matches our tokens */
.elementor-widget-heading .elementor-heading-title {
  font-family: var(--display);
}

/* Elementor text-editor widget inherits body */
.elementor-widget-text-editor .elementor-widget-container {
  font-family: var(--body);
  font-weight: 300;
  color: var(--ink-soft);
}

/* Keep elementor dividers subtle */
.elementor-widget-divider .elementor-divider-separator {
  border-color: var(--oak-line);
}

/* Elementor button — make default look like our CTA */
.elementor-widget-button .elementor-button {
  border-radius: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
}

/* ==========================================================================
   SPLIT CONTENT WIDGET (widget-split-content)
   ========================================================================== */

/* Eyebrow — small caps oxblood label above heading */
.ian-sc-eyebrow {
  font-family: var(--data);
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin: 0 0 1.4rem;
}

/* Main heading — Archivo Black, large, ink coloured */
.ian-sc-heading {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.55rem, 3.5vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -.015em;
  color: var(--ink);
  margin: 0 0 1.5rem;
}

/* Body prose — inherits .prose rules */
.ian-sc-body p {
  font-family: var(--body);
  font-weight: 300;
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem);
  line-height: 1.62;
  color: var(--ink-soft);
  margin: 0 0 1.15em;
}
.ian-sc-body p:last-child { margin-bottom: 0; }

/* Subheading — bold italic oxblood */
.ian-sc-subheading {
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.25;
  color: var(--oxblood);
  margin: 1.75rem 0 1rem;
}

/* Figure / caption */
.ian-sc-figure {
  margin: 0;
}
.ian-sc-figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--oak-line);
  box-shadow: 0 1px 0 var(--paper);
}
.ian-sc-caption {
  font-family: var(--data);
  font-size: .8125rem;
  line-height: 1.45;
  color: var(--slate);
  margin-top: .7rem;
}

/* ==========================================================================
   PRINT
   ========================================================================== */
@media print {
  #ian-header, #ian-footer { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}
