/**
 * Lexovia Theme — Main CSS
 *
 * Design System: CSS Reset, Custom Properties, Typography, Layout, Utilities.
 * Dark luxury law firm aesthetic with gold accents.
 *
 * @package Lexovia
 */

/* ═══════════════════════════════════════════════════════════════
   CSS RESET
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-secondary);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg-light);
    overflow-x: hidden;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul, ol {
    list-style: none;
}

button, input, textarea, select {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}

button {
    cursor: pointer;
}

::selection {
    background: var(--color-accent);
    color: var(--color-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES (Defaults — overridden by PHP inline)
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* ── Gold & Dark Navy Palette (Lexovia Reference) ── */
    --color-primary:          #C9A84C;   /* Gold – CTAs, accents */
    --color-secondary:        #B8943E;   /* Deep Gold */
    --color-accent:           #D4B96A;   /* Light Gold */
    --color-accent-light:     #E8D5A0;   /* Very Light Gold */
    --color-accent-dark:      #A07830;   /* Darker Gold */

    /* ── Text ── */
    --color-text:             #0B1A2D;   /* Dark navy – body on light bg */
    --color-text-muted:       #5A6575;   /* Grey – secondary on light bg */
    --color-text-on-dark:     #F0EDE6;   /* Warm white for dark sections */
    --color-text-muted-dark:  rgba(230, 220, 200, 0.65);

    /* ── Backgrounds ── */
    --color-bg-dark:          #0B1A2D;   /* Deep dark navy – hero/footer */
    --color-bg-medium:        #112038;   /* Slightly lighter dark */
    --color-bg-light:         #FFFFFF;   /* White sections */
    --color-bg-cream:         #F5F0E8;   /* Warm cream sections */
    --color-bg-cream-mid:     #EAE4D6;   /* Darker cream */
    --color-bg-card:          rgba(201, 168, 76, 0.06);
    --color-bg-card-dark:     rgba(255, 255, 255, 0.05);
    --color-border:           rgba(201, 168, 76, 0.2);
    --color-border-dark:      rgba(255, 255, 255, 0.08);
    --color-glass:            rgba(255, 255, 255, 0.7);
    --color-glass-dark:       rgba(11, 26, 45, 0.85);
    --color-glass-border:     rgba(201, 168, 76, 0.25);
    --color-taupe:            #C5B8AA;

    /* ── Misc ── */
    --color-white:   #FFFFFF;
    --color-success: #4CAF50;
    --color-error:   #F44336;

    /* Typography */
    --font-primary: 'Playfair Display', serif;
    --font-secondary: 'Inter', sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;
    --space-5xl: 128px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* ── Shadows ── */
    --shadow-sm:          0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md:          0 4px 20px rgba(0, 0, 0, 0.12);
    --shadow-lg:          0 8px 40px rgba(0, 0, 0, 0.18);
    --shadow-glow:        0 0 30px rgba(201, 168, 76, 0.25);
    --shadow-glow-strong: 0 0 50px rgba(201, 168, 76, 0.4);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Layout */
    --container-max: 1240px;
    --container-narrow: 900px;
    --header-height: 80px;

    /* Z-index */
    --z-header: 1000;
    --z-overlay: 900;
    --z-modal: 1100;
    --z-whatsapp: 1050;
}

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

/* Dark section overrides */
.section-dark-bg h1,
.section-dark-bg h2,
.section-dark-bg h3,
.section-dark-bg h4,
.section-dark-bg h5,
.section-dark-bg h6 {
    color: var(--color-text-on-dark);
}

.section-dark-bg p {
    color: var(--color-text-muted-dark);
}

.section-dark-bg strong {
    color: var(--color-text-on-dark);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: clamp(1rem, 2vw, 1.25rem); }

p {
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

strong {
    color: var(--color-text);
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container--narrow {
    max-width: var(--container-narrow);
}

/* ═══════════════════════════════════════════════════════════════
   SECTION SYSTEM
   ═══════════════════════════════════════════════════════════════ */

.section-heading {
    margin-bottom: var(--space-3xl);
}

.section-heading--center {
    text-align: center;
}

.section-heading--left {
    text-align: left;
}

.section-label {
    display: inline-block;
    font-family: var(--font-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
    position: relative;
    padding-left: 40px;
}

.section-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 2px;
    background: var(--color-primary);
}

.section-dark-bg .section-label {
    color: var(--color-accent);
}

.section-dark-bg .section-label::before {
    background: var(--color-accent);
}

.section-heading--center .section-label {
    padding-left: 0;
    padding-bottom: var(--space-sm);
}

.section-heading--center .section-label::before {
    display: none;
}

.section-title {
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

[data-animate] {
    opacity: 0;
    transform: translateY(36px);
    will-change: transform, opacity;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate="fade-right"] {
    transform: translateX(-40px);
}

[data-animate="fade-left"] {
    transform: translateX(40px);
}

[data-animate="fade-up"] {
    transform: translateY(36px);
}

[data-animate].is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Stagger parent — invisible itself, children animate individually */
[data-animate="stagger"] {
    opacity: 1;
    transform: none;
    will-change: auto;
    transition: none;
}

/* Stagger child initial state */
[data-animate="stagger"] > * {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate="stagger"].is-visible > * {
    opacity: 1;
    transform: translate(0, 0);
}

/* ═══════════════════════════════════════════════════════════════
   ICON SYSTEM
   ═══════════════════════════════════════════════════════════════ */

.icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.text-accent {
    color: var(--color-accent);
}

.text-center {
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE CONTENT (Generic pages)
   ═══════════════════════════════════════════════════════════════ */

.page-content {
    padding: calc(var(--header-height) + var(--space-3xl)) 0 var(--space-3xl);
    min-height: 60vh;
}

.page-content .entry-title {
    margin-bottom: var(--space-xl);
}

.page-content .entry-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.page-content .entry-content p {
    margin-bottom: var(--space-lg);
}

/* 404 */
.error-404 {
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.error-404__number {
    display: block;
    font-family: var(--font-primary);
    font-size: clamp(6rem, 15vw, 12rem);
    font-weight: 700;
    color: var(--color-accent);
    opacity: 0.3;
    line-height: 1;
}

.error-404__title {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: var(--space-md);
}

.error-404__desc {
    max-width: 500px;
    margin: 0 auto var(--space-xl);
}
