/* ========================================
   CSS Custom Properties (Design Tokens)
   ======================================== */
:root {
    /* Primary Teal Palette - Sophisticated M&A aesthetic */
    --color-levera-50: #f0fdfa;
    --color-levera-100: #ccfbf1;
    --color-levera-200: #99f6e4;
    --color-levera-300: #5eead4;
    --color-levera-400: #2dd4bf;
    --color-levera-500: #14b8a6;
    --color-levera-600: #0d9488;
    --color-levera-700: #0f766e;
    --color-levera-800: #115e59;
    --color-levera-900: #134e4a;
    --color-levera-950: #042f2e;

    /* Stone Neutral Palette - Warm sophistication */
    --color-stone-50: #fafaf9;
    --color-stone-100: #f5f5f4;
    --color-stone-200: #e7e5e4;
    --color-stone-300: #d6d3d1;
    --color-stone-400: #a8a29e;
    --color-stone-500: #78716c;
    --color-stone-600: #57534e;
    --color-stone-700: #44403c;
    --color-stone-800: #292524;
    --color-stone-900: #1c1917;

    /* Spacing Scale */
    --section-padding-sm: 2rem;
    --section-padding-md: 3rem;
    --section-padding-lg: 4rem;
    --section-padding-xl: 5rem;

    /* Shadows - Subtle elegance */
    --shadow-subtle: 0 1px 2px 0 rgb(0 0 0 / 0.03), 0 1px 3px 0 rgb(0 0 0 / 0.05);
    --shadow-elevated: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lifted: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-prominent: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.04);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode overrides */
.dark {
    --shadow-subtle: 0 1px 2px 0 rgb(0 0 0 / 0.1), 0 1px 3px 0 rgb(0 0 0 / 0.15);
    --shadow-elevated: 0 4px 6px -1px rgb(0 0 0 / 0.15), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lifted: 0 10px 15px -3px rgb(0 0 0 / 0.15), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-prominent: 0 20px 25px -5px rgb(0 0 0 / 0.2), 0 8px 10px -6px rgb(0 0 0 / 0.15);
}

/* ========================================
   Global Refinements
   ======================================== */
html {
    scroll-behavior: smooth;
}

::selection {
    background-color: var(--color-levera-200);
    color: var(--color-levera-900);
}

.dark ::selection {
    background-color: var(--color-levera-700);
    color: var(--color-levera-100);
}

:focus-visible {
    outline: 2px solid var(--color-levera-500);
    outline-offset: 2px;
}

/* ========================================
   Typography System
   ======================================== */
@font-face {
    font-family: 'Spock Pro';
    src: url('../website/fonts/SpockPro-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Display Headings - Spock Pro for hero/feature sections */
.heading-display-xl {
    font-family: 'Spock Pro', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: normal;
}

.heading-display-lg {
    font-family: 'Spock Pro', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    letter-spacing: -0.015em;
    font-weight: normal;
}

.heading-display-md {
    font-family: 'Spock Pro', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    font-weight: normal;
}

.heading-display-sm {
    font-family: 'Spock Pro', sans-serif;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    line-height: 1.25;
    font-weight: normal;
}

/* Section Headings - Inter bold */
.heading-section {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.heading-subsection {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    line-height: 1.3;
    font-weight: 600;
}

/* Body Text */
.text-body-lg {
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--color-stone-600);
}

.dark .text-body-lg {
    color: var(--color-stone-400);
}

.text-body {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-stone-600);
}

.dark .text-body {
    color: var(--color-stone-400);
}

.text-body-sm {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-stone-500);
}

.dark .text-body-sm {
    color: var(--color-stone-400);
}

/* Labels */
.text-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-stone-500);
}

.dark .text-label {
    color: var(--color-stone-400);
}

.text-label-levera {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-levera-700);
}

.dark .text-label-levera {
    color: var(--color-levera-400);
}

/* ========================================
   Button System
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Spock Pro', sans-serif;
    font-size: 0.875rem;
    font-weight: normal;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
}

.btn:focus-visible {
    outline: 2px solid var(--color-levera-500);
    outline-offset: 2px;
}

/* Primary Button - Solid teal */
.btn-primary {
    background-color: var(--color-levera-700);
    color: white;
    border-color: var(--color-levera-700);
}

.btn-primary:hover {
    background-color: var(--color-levera-800);
    border-color: var(--color-levera-800);
}

.dark .btn-primary {
    background-color: var(--color-levera-600);
    border-color: var(--color-levera-600);
}

.dark .btn-primary:hover {
    background-color: var(--color-levera-500);
    border-color: var(--color-levera-500);
}

/* Secondary Button - Outlined teal */
.btn-secondary {
    background-color: transparent;
    color: var(--color-levera-700);
    border-color: var(--color-levera-700);
}

.btn-secondary:hover {
    background-color: var(--color-levera-50);
    color: var(--color-levera-800);
}

.dark .btn-secondary {
    color: var(--color-levera-400);
    border-color: var(--color-levera-400);
}

.dark .btn-secondary:hover {
    background-color: var(--color-levera-950);
    color: var(--color-levera-300);
}

/* Ghost Button - Text only */
.btn-ghost {
    background-color: transparent;
    color: var(--color-levera-700);
    border-color: transparent;
}

.btn-ghost:hover {
    background-color: var(--color-levera-50);
}

.dark .btn-ghost {
    color: var(--color-levera-400);
}

.dark .btn-ghost:hover {
    background-color: var(--color-levera-950);
}

/* Accent Button - Gradient for hero CTAs */
.btn-accent {
    position: relative;
    background: linear-gradient(to bottom right, #5eead4, #a3e635);
    color: var(--color-stone-900);
    border-color: transparent;
    padding: 0;
}

.btn-accent > span {
    display: block;
    padding: 0.625rem 1.25rem;
    background-color: white;
    border-radius: calc(var(--radius-md) - 1px);
    margin: 1px;
    transition: background-color var(--transition-fast);
}

.btn-accent:hover > span {
    background-color: transparent;
}

.dark .btn-accent > span {
    background-color: #111827;
    color: white;
}

.dark .btn-accent:hover > span {
    background-color: transparent;
    color: var(--color-stone-900);
}

/* Button Sizes */
.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-accent.btn-sm > span {
    padding: 0.375rem 0.875rem;
}

.btn-accent.btn-lg > span {
    padding: 0.875rem 1.75rem;
}

/* ========================================
   Card System
   ======================================== */
.card {
    background-color: white;
    border: 1px solid var(--color-stone-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-subtle);
    transition: all var(--transition-base);
}

.dark .card {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.card-interactive {
    cursor: pointer;
}

.card-interactive:hover {
    box-shadow: var(--shadow-elevated);
    transform: translateY(-2px);
    border-color: var(--color-stone-300);
}

.dark .card-interactive:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.card-body {
    padding: 1.5rem;
}

.card-body-lg {
    padding: 2rem;
}

.card-body-sm {
    padding: 1rem;
}

/* Feature Card */
.card-feature {
    text-align: center;
    padding: 2rem 1.5rem;
}

.card-feature .card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-lg);
    background-color: var(--color-levera-50);
    color: var(--color-levera-700);
    margin-bottom: 1rem;
}

.dark .card-feature .card-icon {
    background-color: var(--color-levera-950);
    color: var(--color-levera-400);
}

/* Testimonial Card */
.card-testimonial {
    position: relative;
    padding: 2rem;
}

.card-testimonial::before {
    content: '"';
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    font-family: Georgia, serif;
    font-size: 4rem;
    line-height: 1;
    color: var(--color-levera-200);
}

.dark .card-testimonial::before {
    color: var(--color-levera-800);
}

.card-testimonial blockquote {
    position: relative;
    z-index: 1;
    padding-left: 1rem;
    font-style: italic;
    color: var(--color-stone-600);
    margin-bottom: 1.5rem;
}

.dark .card-testimonial blockquote {
    color: var(--color-stone-400);
}

/* Article Card */
.card-article {
    overflow: hidden;
}

.card-article img {
    width: 100%;
    height: 12rem;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.card-article:hover img {
    transform: scale(1.05);
}

.card-article .card-content {
    padding: 1.5rem;
}

/* ========================================
   Form Input System
   ======================================== */
.input {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-stone-900);
    background-color: white;
    border: 1px solid var(--color-stone-300);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.input::placeholder {
    color: var(--color-stone-400);
}

.input:focus {
    outline: none;
    border-color: var(--color-levera-500);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.dark .input {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--color-stone-100);
}

.dark .input::placeholder {
    color: var(--color-stone-500);
}

.dark .input:focus {
    border-color: var(--color-levera-500);
    box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.15);
}

/* Minimal Input - Bottom border only */
.input-minimal {
    display: block;
    width: 100%;
    padding: 0.75rem 0;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-stone-900);
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--color-stone-300);
    border-radius: 0;
    transition: border-color var(--transition-base);
}

.input-minimal:focus {
    outline: none;
    border-bottom-color: var(--color-levera-600);
}

.dark .input-minimal {
    color: var(--color-stone-100);
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.dark .input-minimal:focus {
    border-bottom-color: var(--color-levera-400);
}

/* Textarea */
.textarea {
    min-height: 8rem;
    resize: vertical;
}

/* Select */
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem 1.25rem;
    padding-right: 2.5rem;
}

/* Label */
.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-stone-700);
    margin-bottom: 0.5rem;
}

.dark .label {
    color: var(--color-stone-300);
}

/* Form Group */
.form-group {
    margin-bottom: 1.5rem;
}

/* Error States */
.input-error {
    border-color: #ef4444;
}

.input-error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-text {
    font-size: 0.875rem;
    color: #ef4444;
    margin-top: 0.375rem;
}

/* ========================================
   Section Spacing
   ======================================== */
.section {
    padding-top: var(--section-padding-md);
    padding-bottom: var(--section-padding-md);
}

@media (min-width: 768px) {
    .section {
        padding-top: var(--section-padding-lg);
        padding-bottom: var(--section-padding-lg);
    }
}

@media (min-width: 1024px) {
    .section {
        padding-top: var(--section-padding-xl);
        padding-bottom: var(--section-padding-xl);
    }
}

.section-hero {
    padding-top: var(--section-padding-lg);
    padding-bottom: var(--section-padding-lg);
}

@media (min-width: 768px) {
    .section-hero {
        padding-top: var(--section-padding-xl);
        padding-bottom: var(--section-padding-xl);
    }
}

.section-compact {
    padding-top: var(--section-padding-sm);
    padding-bottom: var(--section-padding-sm);
}

@media (min-width: 768px) {
    .section-compact {
        padding-top: var(--section-padding-md);
        padding-bottom: var(--section-padding-md);
    }
}

/* Section Divider */
.section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-stone-200), transparent);
    margin: 0 auto;
    max-width: 80%;
}

.dark .section-divider {
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* ========================================
   Link Transitions
   ======================================== */
a {
    transition: color var(--transition-fast);
}

.link-levera {
    color: var(--color-levera-700);
    text-decoration: none;
}

.link-levera:hover {
    color: var(--color-levera-800);
    text-decoration: underline;
}

.dark .link-levera {
    color: var(--color-levera-400);
}

.dark .link-levera:hover {
    color: var(--color-levera-300);
}

/* ========================================
   Badge System
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-levera {
    background-color: var(--color-levera-100);
    color: var(--color-levera-800);
}

.dark .badge-levera {
    background-color: var(--color-levera-900);
    color: var(--color-levera-300);
}

.badge-stone {
    background-color: var(--color-stone-100);
    color: var(--color-stone-700);
}

.dark .badge-stone {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-stone-300);
}

/* ========================================
   Original Base Styles (Preserved)
   ======================================== */
html, body,
section,
header,
footer,
nav,
main,
.bg-white,
.bg-custom-dark-bg,
.rounded-lg,
.shadow-sm {
    transition: background-color 1s, color 1s;
}

/* Exclude gradient buttons from global transitions to prevent flickering */
.bg-gradient-to-br {
    transition: none !important;
}

.bg-gradient-to-br span {
    transition: background-color 0.075s ease-in, color 0.075s ease-in !important;
}

/* Apply Spock font to all buttons */
button,
input[type="submit"],
input[type="button"],
.bg-primary-700,
.bg-primary-600,
.bg-blue-600,
.bg-indigo-600,
a[class*="bg-primary"],
a[class*="bg-blue"],
a[class*="bg-indigo"] {
    font-family: 'Spock Pro', sans-serif !important;
}

/* Apply Spock font to all navigation menu items */
nav ul li a,
nav button,
#servicesDropdownButton,
#servicesDropdown a {
    font-family: 'Spock Pro', sans-serif !important;
}

/* Mobile dropdown full width */
@media (max-width: 1023px) {
    #servicesDropdown {
        width: calc(100vw - 4rem) !important;
        left: -0.75rem !important;
        margin-left: 0 !important;
        margin-right: 2rem !important;
    }
}

/* Blog Content Styling - for CKEditor generated content */
.blog-content {
    line-height: 1.7;
}

/* Blog content styling - Override CKEditor styles */
.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.25;
    color: #1f2937;
}

.dark .blog-content h1,
.dark .blog-content h2,
.dark .blog-content h3,
.dark .blog-content h4,
.dark .blog-content h5,
.dark .blog-content h6 {
    color: #ffffff !important;
}

.blog-content h1 {
    font-size: 2rem;
}

.blog-content h2 {
    font-size: 1.75rem;
}

.blog-content h3 {
    font-size: 1.5rem;
}

.blog-content h4 {
    font-size: 1.25rem;
}

.blog-content h5,
.blog-content h6 {
    font-size: 1.125rem;
}

.blog-content p {
    margin-bottom: 1rem;
    color: #6b7280;
}

.dark .blog-content p,
.dark .blog-content div,
.dark .blog-content span {
    color: #9ca3af !important;
}

.blog-content strong,
.blog-content b {
    font-weight: 600;
    color: #374151;
}

.dark .blog-content strong,
.dark .blog-content b {
    color: #f3f4f6 !important;
}

.blog-content ul,
.blog-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: #6b7280;
}

/* Ensure bullets and numbers show up properly */
.blog-content ul {
    list-style-type: disc !important;
    list-style-position: outside !important;
}

.blog-content ol {
    list-style-type: decimal !important;
    list-style-position: outside !important;
}

.blog-content ul ul {
    list-style-type: circle !important;
}

.blog-content ol ol {
    list-style-type: lower-alpha !important;
}

.dark .blog-content ul,
.dark .blog-content ol,
.dark .blog-content li {
    color: #9ca3af !important;
}

.blog-content li {
    margin-bottom: 0.5rem;
    display: list-item !important;
}

.blog-content blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6b7280;
}

.dark .blog-content blockquote {
    border-left-color: #4b5563;
    color: #9ca3af !important;
}

.blog-content a {
    color: #2563eb;
    text-decoration: underline;
}

.blog-content a:hover {
    color: #1d4ed8;
}

.dark .blog-content a {
    color: #60a5fa !important;
}

.dark .blog-content a:hover {
    color: #93c5fd !important;
}

/* Force override any inline styles from CKEditor */
.dark .blog-content * {
    color: #9ca3af !important;
}

.dark .blog-content h1,
.dark .blog-content h2,
.dark .blog-content h3,
.dark .blog-content h4,
.dark .blog-content h5,
.dark .blog-content h6 {
    color: #ffffff !important;
}

.dark .blog-content a {
    color: #60a5fa !important;
}

.dark .blog-content strong,
.dark .blog-content b {
    color: #f3f4f6 !important;
}

/* Table styling for blog content */
.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark .blog-content table {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
}

.blog-content th,
.blog-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.dark .blog-content th,
.dark .blog-content td {
    border-bottom-color: #374151 !important;
}

.blog-content th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e5e7eb;
}

.dark .blog-content th {
    background-color: #374151 !important;
    color: #ffffff !important;
    border-bottom-color: #4b5563 !important;
}

.blog-content td {
    color: #6b7280;
    font-size: 0.875rem;
}

.dark .blog-content td {
    color: #9ca3af !important;
}

.blog-content tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

.dark .blog-content tbody tr:nth-child(even) {
    background-color: #2d3748 !important;
}

.blog-content tbody tr:hover {
    background-color: #f3f4f6;
}

.dark .blog-content tbody tr:hover {
    background-color: #374151 !important;
}

/* Responsive table styling */
@media (max-width: 768px) {
    .blog-content table {
        font-size: 0.75rem;
    }

    .blog-content th,
    .blog-content td {
        padding: 0.5rem 0.75rem;
    }
}

/* Mobile-first image-text section styling */
@media (max-width: 767px) {
    /* Ensure proper spacing on mobile for md:grid-cols-2 */
    .md\:grid-cols-2 > div {
        margin-bottom: 2rem;
    }

    .md\:grid-cols-2 > div:last-child {
        margin-bottom: 0;
    }

    /* Ensure images are properly sized on mobile */
    .md\:grid-cols-2 img {
        max-width: 85%;
        height: auto;
        margin: 0 auto;
    }
}

@media (max-width: 1023px) {
    /* Ensure proper spacing on mobile/tablet for lg:grid-cols-2 */
    .lg\:grid-cols-2 > div {
        margin-bottom: 2rem;
    }

    .lg\:grid-cols-2 > div:last-child {
        margin-bottom: 0;
    }

    /* Ensure images are properly sized on mobile/tablet */
    .lg\:grid-cols-2 img {
        max-width: 85%;
        height: auto;
        margin: 0 auto;
    }

    /* Clean mobile padding for all layouts */
    .px-4 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}
