/*
Theme Name: Robert Charles Attorneys
Theme URI: https://rcharles.co.za/
Author: Source Matrix Website Solutions
Author URI: https://www.sourcematrix.co.za/
Description: Bespoke WordPress theme for Robert Charles Attorneys & Conveyancers.
Version: 1.4.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: robert-charles
*/

:root {
  --rc-red: #9F0901;
  --rc-charcoal: #282828;
  --rc-ink: #121212;
  --rc-paper: #ffffff;
  --rc-soft: #f5f2ef;
}

/* Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--rc-paper);
  color: var(--rc-ink);
  font-family: var(--rc-body-font, Arial, Helvetica, sans-serif);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--rc-red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--rc-red); outline-offset: 3px; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.55em;
  color: var(--rc-charcoal);
  font-family: var(--rc-heading-font, Georgia, "Times New Roman", serif);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
h1 { font-size: clamp(2.7rem, 7vw, 5.4rem); }
h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.8rem); }
p { margin: 0 0 1.25rem; }

.container { width: min(1220px, calc(100% - 40px)); margin-inline: auto; }
.section-shell { padding: clamp(70px, 9vw, 120px) 0; }
.section-shell-sm { padding: clamp(48px, 7vw, 80px) 0; }
.section-soft { background: var(--rc-soft); }
.section-dark { background: var(--rc-charcoal); color: #fff; }
.section-heading { max-width: 760px; margin-bottom: 42px; }
.section-heading p { color: #686868; max-width: 690px; }
.section-dark .section-heading h2, .section-dark .section-heading p { color: #fff; }
.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--rc-red);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.prose { max-width: 790px; }
.prose > * + * { margin-top: 1.25em; }
.prose h2, .prose h3 { margin-top: 1.7em; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.78rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}
.button:hover { transform: translateY(-1px); text-decoration: none; }
.button-primary { background: var(--rc-red); color: #fff; }
.button-primary:hover { background: #7f0701; color: #fff; }
.button-ghost { border-color: rgba(255,255,255,0.55); color: #fff; background: transparent; }
.button-ghost:hover { border-color: #fff; background: #fff; color: var(--rc-charcoal); }
.button-outline { border-color: var(--rc-charcoal); color: var(--rc-charcoal); background: transparent; }
.button-outline:hover { background: var(--rc-charcoal); color: #fff; }

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  clip: auto !important;
  width: auto;
  height: auto;
  top: 10px;
  left: 10px;
  padding: 12px 16px;
  margin: 0;
  overflow: visible;
  z-index: 100000;
  background: #fff;
  color: #000;
}

/* Header */
.site-header {
  position: relative;
  z-index: 50;
  border-bottom: 1px solid rgba(18,18,18,0.09);
  background: rgba(255,255,255,0.98);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 92px;
  gap: 28px;
}
.site-branding img { width: min(290px, 38vw); height: auto; }
.fallback-logo { display: inline-block; }
.primary-navigation { justify-self: end; }
.primary-menu,
.primary-navigation .menu { display: flex; align-items: center; gap: 28px; margin: 0; padding: 0; list-style: none; }
.primary-menu a,
.primary-navigation .menu a {
  color: var(--rc-charcoal);
  font-size: 0.87rem;
  font-weight: 700;
  text-decoration: none;
}
.primary-menu a:hover,
.primary-navigation .menu a:hover,
.current-menu-item > a { color: var(--rc-red); }
.header-cta { white-space: nowrap; }
.nav-toggle {
  display: none;
  justify-self: end;
  width: 46px;
  height: 42px;
  padding: 9px;
  border: 1px solid rgba(18,18,18,0.16);
  background: #fff;
}
.nav-toggle-lines { display: grid; gap: 5px; }
.nav-toggle-lines span { display: block; height: 2px; background: var(--rc-charcoal); }

/* Cards and reusable grids */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.service-card,
.team-card,
.office-card {
  background: #fff;
  border: 1px solid rgba(18,18,18,0.09);
  box-shadow: 0 12px 35px rgba(18,18,18,0.045);
}
.service-card { position: relative; padding: 30px; overflow: hidden; }
.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--rc-red);
  transition: width 180ms ease;
}
.service-card:hover::before { width: 100%; }
.service-card h3 { font-size: 1.45rem; }
.service-card p { color: #666; }
.card-link { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; }
.team-card { display: grid; grid-template-columns: minmax(180px, 0.78fr) minmax(0, 1.22fr); overflow: hidden; min-height: 350px; }
.team-card-media { min-height: 100%; overflow: hidden; background: #e9e6e2; }
.team-card-media img { width: 100%; height: 100%; min-height: 350px; object-fit: cover; object-position: center top; transition: transform 300ms ease; }
.team-card:hover .team-card-media img { transform: scale(1.012); }
.team-card-body { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 4vw, 42px); }
.team-card-body h3 { margin-bottom: 8px; font-size: clamp(1.65rem, 2.5vw, 2.15rem); }
.team-position { margin-bottom: 10px; color: var(--rc-red); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.team-qualifications { margin-bottom: 14px; color: #6d6965; font-size: 0.9rem; line-height: 1.45; }
.team-summary { margin-bottom: 20px; color: #555; font-size: 0.96rem; line-height: 1.62; }
.team-card .card-link { align-self: flex-start; margin-top: auto; }
.office-card { padding: 30px; }
.office-card address { font-style: normal; }
.office-card .office-label { color: #777; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }

/* Footer */
.site-footer { padding: 72px 0 0; background: #181818; color: rgba(255,255,255,0.72); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 0.8fr; gap: 44px; padding-bottom: 55px; }
.footer-logo img { width: min(320px, 100%); height: auto; opacity: 1; }
.footer-brand p { max-width: 330px; margin-top: 22px; }
.site-footer h2 { color: #fff; font-family: var(--rc-body-font, Arial, Helvetica, sans-serif); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: #efb4b0; }
.site-footer address { font-style: normal; }
.footer-menu { margin: 0; padding: 0; list-style: none; }
.footer-menu li + li { margin-top: 8px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0; border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.78rem; }
.footer-bottom p { margin: 0; }
.site-credit { text-align: right; }

@media (max-width: 1024px) {
  .header-inner { gap: 18px; }
  .primary-menu, .primary-navigation .menu { gap: 18px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .header-inner { grid-template-columns: 1fr auto; min-height: 78px; }
  .site-branding img { width: min(280px, 64vw); }
  .nav-toggle { display: block; }
  .primary-navigation {
    display: none;
    grid-column: 1 / -1;
    justify-self: stretch;
    padding: 5px 0 20px;
  }
  .nav-open .primary-navigation { display: block; }
  .primary-menu, .primary-navigation .menu { flex-direction: column; align-items: stretch; gap: 0; }
  .primary-menu a, .primary-navigation .menu a { display: block; padding: 12px 0; border-bottom: 1px solid rgba(18,18,18,0.08); }
  .header-cta { display: none; }
  .footer-grid { gap: 30px; }
}

@media (max-width: 600px) {
  .container { width: min(100% - 28px, 1220px); }
  .section-shell { padding: 64px 0; }
  .card-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .site-credit { text-align: left; }
}

/* Home */
.home-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(159,9,1,0.07), transparent 32%),
    linear-gradient(135deg, #171717 0%, #282828 62%, #1d1d1d 100%);
}
.home-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  background: var(--rc-red);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.96fr);
  min-height: min(620px, calc(100vh - 92px));
  align-items: stretch;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(62px, 7vw, 94px) clamp(20px, 5vw, 68px) clamp(62px, 7vw, 94px) 0;
  position: relative;
  z-index: 2;
}
.hero-copy h1 { max-width: 680px; color: #fff; font-size: clamp(2.9rem, 5vw, 4.7rem); }
.hero-eyebrow { color: #efb4b0; }
.hero-supporting { max-width: 650px; margin: 14px 0 0; color: rgba(255,255,255,0.78); font-size: clamp(1.05rem, 1.8vw, 1.26rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-visual { position: relative; min-height: 440px; overflow: hidden; }
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, #282828 0%, rgba(40,40,40,0.38) 18%, rgba(40,40,40,0.06) 62%, rgba(40,40,40,0.16) 100%);
}
.hero-image { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.88) contrast(1.02); }
.hero-visual-mark {
  position: absolute;
  right: 32px;
  bottom: 34px;
  z-index: 2;
  width: 78px;
  height: 78px;
  border-right: 2px solid rgba(255,255,255,0.6);
  border-bottom: 2px solid rgba(255,255,255,0.6);
}
.intro-grid { display: grid; grid-template-columns: 1fr 0.8fr; gap: clamp(38px, 8vw, 110px); align-items: end; }
.intro-grid h2 { max-width: 760px; margin-bottom: 0; }
.intro-copy { padding-left: 30px; border-left: 1px solid rgba(18,18,18,0.14); font-size: 1.05rem; }
.intro-copy p:last-child { margin-bottom: 0; }
.section-action { margin-top: 34px; }
.service-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 24px; color: var(--rc-red); }
.service-icon svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.service-card h3 a, .team-card h3 a { color: inherit; text-decoration: none; }
.about-grid { display: grid; grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr); gap: clamp(40px, 8vw, 110px); align-items: center; }
.about-media { margin: 0; position: relative; }
.about-media::before { content: ""; position: absolute; left: -18px; top: 20px; bottom: -18px; width: 4px; background: var(--rc-red); }
.about-media img { width: 100%; min-height: 460px; object-fit: cover; filter: saturate(0.94) contrast(1.01); }
.about-copy p:not(.eyebrow) { color: #575757; font-size: 1.02rem; }
.office-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.office-card h3 { font-size: 1.9rem; }
.office-card p { color: #555; }
.office-card a { font-weight: 700; }
.closing-cta { padding: clamp(66px, 9vw, 105px) 0; }
.closing-cta-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 42px; align-items: center; }
.closing-cta h2 { color: #fff; margin-bottom: 12px; }
.closing-cta p:not(.eyebrow) { max-width: 750px; margin-bottom: 0; color: rgba(255,255,255,0.72); }
.team-placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(145deg, #ede9e5, #d8d2cd); }

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; min-height: 560px; }
  .hero-copy { padding-right: 34px; }
  .about-media img { min-height: 460px; }
}

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; min-height: auto; }
  .hero-copy { padding: 64px 0 54px; }
  .hero-visual { min-height: 380px; margin: 0 -20px; }
  .hero-visual::before { background: linear-gradient(180deg, #282828 0%, rgba(40,40,40,0.2) 26%, rgba(40,40,40,0.08) 100%); }
  .intro-grid, .about-grid { grid-template-columns: 1fr; }
  .intro-copy { padding-left: 0; border-left: 0; }
  .about-media { order: 2; }
  .closing-cta-inner { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .hero-copy h1 { font-size: clamp(2.7rem, 13vw, 4rem); }
  .hero-visual { min-height: 300px; margin-inline: -14px; }
  .hero-actions { align-items: stretch; }
  .hero-actions .button { width: 100%; }
  .office-grid { grid-template-columns: 1fr; }
  .about-media img { min-height: 360px; }
}

/* Inner pages */
.inner-hero { position: relative; overflow: hidden; padding: clamp(58px, 7vw, 88px) 0; }
.inner-hero::after { content: ""; position: absolute; inset: auto 0 0; height: 4px; background: var(--rc-red); }
.inner-hero-inner { max-width: 980px; }
.inner-hero h1 { color: #fff; font-size: clamp(2.7rem, 5vw, 4.25rem); }
.inner-hero-lead { max-width: 760px; margin: 18px 0 0; color: rgba(255,255,255,0.74); font-size: clamp(1.05rem, 1.8vw, 1.25rem); }
.inner-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr); align-items: center; gap: clamp(40px, 7vw, 90px); }
.inner-hero-media { margin: 0; min-height: 300px; overflow: hidden; border-left: 3px solid var(--rc-red); }
.inner-hero-media img { width: 100%; height: 100%; min-height: 300px; object-fit: cover; filter: saturate(0.92); }
.about-hero, .contact-hero { padding-block: clamp(52px, 6vw, 78px); }

.about-hero { background: #f4f1ee; color: var(--rc-charcoal); }
.about-hero h1 { color: var(--rc-charcoal); }
.about-hero .inner-hero-lead { color: #5a5754; }
.about-hero .inner-hero-media { background: #fff; border-left-width: 2px; }
.about-hero .inner-hero-media img { object-fit: contain; padding: 12px; filter: saturate(1) brightness(1.08) contrast(1.02); }
.editorial-grid { display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.05fr); gap: clamp(50px, 9vw, 130px); align-items: start; }
.editorial-heading { position: sticky; top: 34px; }
.editorial-copy { font-size: 1.05rem; color: #4e4e4e; }
.values-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.value-item { padding: 34px 0 0; border-top: 1px solid rgba(18,18,18,0.13); }
.value-number { display: block; margin-bottom: 28px; color: var(--rc-red); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; }
.value-item p { color: #626262; }
.image-callout-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: clamp(44px, 8vw, 105px); align-items: center; }
.image-callout-media { margin: 0; }
.image-callout-media img { width: 100%; min-height: 500px; object-fit: cover; }
.image-callout-copy p:not(.eyebrow) { color: #5b5b5b; }
.service-grid-large { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.team-grid-large, .home-team .team-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); }
.empty-team-state { max-width: 800px; padding: clamp(40px, 7vw, 74px); border: 1px solid rgba(18,18,18,0.1); background: var(--rc-soft); }
.empty-team-state p { color: #595959; }
.office-grid-contact .office-card { padding: clamp(34px, 5vw, 54px); }
.contact-guidance-grid { display: grid; grid-template-columns: 0.8fr 1fr; gap: clamp(45px, 8vw, 110px); }
.content-with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(44px, 8vw, 110px); align-items: start; }
.service-content { font-size: 1.04rem; }
.service-aside { position: sticky; top: 34px; padding: 30px; border-top: 4px solid var(--rc-red); background: var(--rc-soft); }
.service-aside h2 { font-size: 1.7rem; }
.service-aside p:not(.eyebrow) { color: #5d5d5d; }
.team-profile-grid { display: grid; grid-template-columns: minmax(280px, 0.65fr) minmax(0, 1.15fr); gap: clamp(45px, 9vw, 120px); align-items: start; }
.team-profile-media { background: var(--rc-soft); }
.team-profile-media img { width: 100%; max-height: 740px; object-fit: cover; object-position: center top; }
.team-profile-copy h1 { font-size: clamp(3rem, 6vw, 5.5rem); }
.profile-position { color: var(--rc-red); font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.profile-qualifications { color: #666; }
.profile-contact { display: flex; flex-wrap: wrap; gap: 18px 30px; margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(18,18,18,0.12); }
.profile-contact a { font-weight: 700; }
.not-found { min-height: 68vh; display: grid; place-items: center; padding: 80px 0; }
.not-found-inner { max-width: 760px; }
.not-found h1 { color: #fff; }
.not-found p:not(.eyebrow):not(.error-code) { color: rgba(255,255,255,0.72); }
.error-code { margin: 0 0 -20px; color: rgba(255,255,255,0.06); font-family: var(--rc-heading-font, Georgia, serif); font-size: clamp(7rem, 20vw, 14rem); line-height: 0.8; }

@media (max-width: 1024px) {
  .content-with-aside { grid-template-columns: minmax(0, 1fr) 300px; gap: 45px; }
}

@media (max-width: 820px) {
  .inner-hero-grid, .editorial-grid, .image-callout-grid, .contact-guidance-grid, .content-with-aside, .team-profile-grid { grid-template-columns: 1fr; }
  .inner-hero-media { min-height: 300px; }
  .inner-hero-media img { min-height: 300px; }
  .editorial-heading, .service-aside { position: static; }
  .values-grid { grid-template-columns: 1fr; }
  .image-callout-media img { min-height: 380px; }
}

@media (max-width: 600px) {
  .service-grid-large, .team-grid-large { grid-template-columns: 1fr; }
  .team-card { grid-template-columns: 1fr; }
  .team-card-media { min-height: 0; aspect-ratio: 4 / 4.3; }
  .team-card-media img { min-height: 0; }
  .inner-hero { padding: 50px 0; }
  .inner-hero h1 { font-size: clamp(2.5rem, 12vw, 3.65rem); }
}
