/*
Theme Name: TJS Attorneys
Theme URI: https://www.tjs.co.za/
Author: Theron, Jordaan & Smit Inc.
Description: Custom WordPress theme based on the provided TJS static site (Hero, About, Expertise, Contact, Facebook/Maps, and Office Portal).
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tjs-attorneys
*/

/* --- Variables --- */
:root {
  --color-bg: #faf9f6;
  --color-surface: #fff;
  --color-text: #1a1a1a;
  --color-text-muted: #4a4a4a;
  --color-accent: #8b6914;
  --color-accent-light: #c9a227;
  --color-navy: #1e2d3a;
  --color-navy-light: #2d4154;
  --font-heading: "Cormorant Garamond", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --max-width: 1100px;
  --header-height: 4rem;
  --transition: 0.2s ease;
}

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

/* --- Watermark Logo --- */
main {
  position: relative;
}
.watermark-logo {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  opacity: 0.4;
}
.watermark-logo img {
  max-width: min(60vw, 500px);
  max-height: min(60vh, 500px);
  width: auto;
  height: auto;
  object-fit: contain;
}

/* --- Splash --- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-navy);
  opacity: 1;
  transition: opacity 0.8s ease;
  pointer-events: auto;
}
.splash.splash-fade {
  opacity: 0;
  pointer-events: none;
}
.splash-logo {
  max-width: min(90vw, 800px);
  max-height: min(80vh, 600px);
  width: auto;
  height: auto;
  object-fit: contain;
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(250, 249, 246, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(30, 45, 58, 0.08);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.logo-img {
  height: 2.5rem;
  width: auto;
  opacity: 0.85;
  transition: opacity var(--transition);
}
.logo:hover .logo-img {
  opacity: 1;
}
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-lg);
}
.nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color var(--transition);
}
.nav a:hover { color: var(--color-navy); }
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-navy);
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-height) + var(--space-xl)) var(--space-md) var(--space-xl);
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-light) 100%);
  color: #fff;
  overflow: hidden;
}
.hero-accent {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50%;
  max-width: 400px;
  height: 40%;
  background: linear-gradient(160deg, transparent 30%, rgba(201, 162, 39, 0.15) 100%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}
.hero-label {
  font-size: 0.8125rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent-light);
  margin: 0 0 var(--space-sm);
}
.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 var(--space-sm);
  letter-spacing: 0.02em;
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  opacity: 0.9;
}
.hero-tagline {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 var(--space-lg);
  max-width: 28ch;
}
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 2px;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-accent-light);
  color: #fff;
}

/* --- Sections --- */
.section {
  position: relative;
  z-index: 2;
  padding: var(--space-2xl) var(--space-md);
}
.container {
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 400;
  color: var(--color-navy);
  margin: 0 0 var(--space-lg);
  letter-spacing: 0.02em;
}

/* --- About --- */
.about { background: var(--color-surface); }
.about-content {
  max-width: 60ch;
}
.about-content .lead {
  font-size: 1.25rem;
  color: var(--color-navy);
  margin: 0 0 var(--space-md);
}
.about-content p {
  margin: 0 0 var(--space-sm);
  color: var(--color-text-muted);
}

/* --- Expertise --- */
.expertise-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-lg);
}
.expertise-grid li {
  padding: var(--space-md);
  background: var(--color-surface);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.expertise-grid li:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.expertise-icon {
  display: block;
  color: var(--color-accent);
  font-size: 0.75rem;
  margin-bottom: var(--space-xs);
}
.expertise-grid h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-navy);
  margin: 0 0 var(--space-xs);
}
.expertise-grid p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

/* --- Contact --- */
.contact { background: var(--color-navy); color: #fff; }
.contact .section-title { color: #fff; }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}
.contact-info p,
.contact-note p { margin: 0 0 var(--space-sm); }
.contact-info a,
.contact-note a {
  color: var(--color-accent-light);
  text-decoration: none;
}
.contact-info a:hover,
.contact-note a:hover { text-decoration: underline; }

/* --- Facebook --- */
.facebook { background: #742b2a; }
.facebook .section-title { color: #fff; }
.fb-note {
  margin: 0 0 var(--space-md);
  color: rgba(255, 255, 255, 0.85);
}
.fb-note a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.fb-note a:hover { text-decoration: underline; }
.social-col {
  width: 100%;
  max-width: 520px;
  text-align: center;
}
.social-col .section-title {
  text-align: center;
}
.social-col .fb-note {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  max-width: 70ch;
}
.social-col--map .fb-note a {
  color: #fff;
}
.social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
  align-items: start;
  justify-items: center;
}
.social-card {
  width: 100%;
  max-width: 520px;
}
.fb-embed {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(30, 45, 58, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}
.fb-embed iframe {
  display: block;
  width: 100%;
  height: 700px;
  border: 0;
}
.map-embed {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(30, 45, 58, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}
.map-embed iframe {
  display: block;
  width: 100%;
  height: 700px;
  border: 0;
}
.map-note {
  margin: 0;
  padding: 0.75rem;
  text-align: center;
  background: rgba(30, 45, 58, 0.03);
}
.map-note a {
  color: var(--color-navy);
  font-weight: 600;
  text-decoration: none;
}
.map-note a:hover { text-decoration: underline; }

/* --- Portal --- */
.portal-main {
  padding-top: calc(var(--header-height) + var(--space-xl));
}
.portal-card {
  position: relative;
  z-index: 2;
  margin-bottom: var(--space-lg);
  padding: var(--space-lg);
  background: var(--color-surface);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}
.portal-card--hidden {
  display: none;
}
.portal-text {
  margin: 0 0 var(--space-sm);
  color: var(--color-text-muted);
}
.portal-hint {
  margin: var(--space-sm) 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
.portal-error {
  margin-top: var(--space-sm);
  color: #b22222;
  min-height: 1.25em;
  font-size: 0.9rem;
}
.portal-form {
  display: grid;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}
.portal-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}
.portal-form input,
.portal-form select {
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  font-family: inherit;
  font-size: 0.95rem;
}
.portal-form--inline {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: flex-end;
}
.portal-form--inline button {
  justify-self: flex-start;
}
.portal-admin {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.portal-users {
  margin-top: var(--space-md);
}
.portal-users-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.portal-users-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
  font-size: 0.9rem;
}
.portal-users-list span {
  opacity: 0.8;
}
.portal-content-section {
  margin-top: var(--space-md);
}
.portal-calendar {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.portal-calendar-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}
.portal-calendar-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-navy);
  text-decoration: none;
}
.portal-calendar-link:hover {
  text-decoration: underline;
}
.portal-calendar iframe {
  width: 100%;
  height: 600px;
  border: 0;
  border-radius: 6px;
}

/* Documents listing */
.portal-doks {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.portal-doks-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}
.portal-doks-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
}
.portal-doks-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-navy);
  text-decoration: none;
}
.portal-doks-link:hover { text-decoration: underline; }
.portal-doks-btn {
  background: rgba(30, 45, 58, 0.06);
  color: var(--color-navy);
}
.portal-doks-btn:hover {
  background: rgba(30, 45, 58, 0.1);
}
.portal-doks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-sm);
}
.portal-doks-list li a {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  background: rgba(30, 45, 58, 0.04);
  color: var(--color-navy);
  text-decoration: none;
  font-size: 0.95rem;
  border: 1px solid rgba(30, 45, 58, 0.08);
}
.portal-doks-list li a:hover {
  background: rgba(30, 45, 58, 0.07);
}

/* --- Footer --- */
.site-footer {
  padding: var(--space-md) var(--space-md);
  background: var(--color-navy);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}
.site-footer .container { max-width: var(--max-width); }
.site-footer p { margin: 0; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav { display: none; }
  .nav.is-open { display: block; }
  .nav.is-open ul {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: var(--space-md);
    background: rgba(250, 249, 246, 0.98);
    border-bottom: 1px solid rgba(30, 45, 58, 0.08);
  }
  .nav.is-open a { padding: var(--space-sm) 0; display: block; }
  .nav-toggle { display: flex; }
  .contact-grid { grid-template-columns: 1fr; }
  .hero { min-height: 75vh; }
  .portal-form--inline {
    grid-template-columns: 1fr;
  }
  .portal-calendar-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .portal-calendar iframe {
    height: 500px;
  }
  .portal-doks-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .social-grid {
    grid-template-columns: 1fr;
  }
  .fb-embed iframe,
  .map-embed iframe {
    height: 500px;
  }
}

@media (max-width: 480px) {
  .section { padding: var(--space-xl) var(--space-md); }
  .expertise-grid { grid-template-columns: 1fr; }
}
