/* ==========================================================================
   Faran Consulting Website - Main Styles
   Mobile-first, accessibility-focused, performance-optimized
   ========================================================================== */

/* CSS Reset & Base Styles
   ========================================================================== */

/* Alpine.js cloak - hide elements until Alpine loads */
[x-cloak] {
    display: none !important;
}

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

html {
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--color-text);
    background-color: var(--color-background);
    overflow-x: hidden;
}

/* CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
    /* Color Palette - Matching AI Will Work aesthetics */
    --color-primary: #243552;      /* Dark navy blue */
    --color-primary-dark: #1a2741;
    --color-primary-light: #3d4f6d;
    --color-accent: #DFA400;        /* Gold/Orange accent */
    --color-accent-dark: #b88600;

    --color-text: #1A1A1A;
    --color-text-light: #4A4A4A;
    --color-text-muted: #6B6B6B;
    --color-background: #FFFFFF;
    --color-background-alt: #F8F9FA;
    --color-border: #DEE2E6;

    --color-success: #00A86B;
    --color-error: #D32F2F;
    --color-warning: #F57C00;

    /* Typography Scale */
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 1.875rem;  /* 30px */
    --font-size-4xl: 2.25rem;   /* 36px */
    --font-size-5xl: 3rem;      /* 48px */

    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Spacing Scale */
    --space-xs: 0.25rem;   /* 4px */
    --space-sm: 0.5rem;    /* 8px */
    --space-md: 1rem;      /* 16px */
    --space-lg: 1.5rem;    /* 24px */
    --space-xl: 2rem;      /* 32px */
    --space-2xl: 3rem;     /* 48px */
    --space-3xl: 4rem;     /* 64px */
    --space-4xl: 6rem;     /* 96px */

    /* Layout */
    --container-max-width: 1200px;
    --content-max-width: 800px;
    --grid-gap: var(--space-lg);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

/* Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-lg);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

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

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover,
a:focus {
    color: #DFA400;
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

strong, b {
    font-weight: var(--font-weight-semibold);
}

em, i {
    font-style: italic;
}

small {
    font-size: var(--font-size-sm);
}

/* Lists */
ul, ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-xl);
}

li {
    margin-bottom: var(--space-sm);
    color: var(--color-text-light);
}

/* Layout Grid
   ========================================================================== */

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

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

.container--wide {
    max-width: 1440px;
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--grid-gap);
}

.grid--2col {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--3col {
    grid-template-columns: 1fr;
    align-items: start;
}

@media (min-width: 768px) {
    .grid--3col {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Flexbox Utilities */
.flex {
    display: flex;
}

.flex--center {
    justify-content: center;
    align-items: center;
}

.flex--between {
    justify-content: space-between;
    align-items: center;
}

.flex--wrap {
    flex-wrap: wrap;
}

/* Sections & Spacing
   ========================================================================== */

section {
    padding: var(--space-3xl) 0;
}

section:first-of-type {
    padding-top: var(--space-2xl);
}

.section--dark {
    background-color: var(--color-text);
    color: var(--color-background);
}

.section--dark h1,
.section--dark h2,
.section--dark h3 {
    color: var(--color-background);
}

.section--dark a:not(.btn) {
    color: #DFA400;
}

.section--dark a:not(.btn):hover,
.section--dark a:not(.btn):focus {
    color: #ecc866;
    text-decoration: underline;
}

.section--alt {
    background-color: var(--color-background-alt);
}

/* Links on any dark background (navy, black, etc.) should use gold/light colors */
/* But exclude buttons to preserve their own styling */
section[style*="background-color: #243552"] a:not(.btn),
section[style*="background-color: #1a1a1a"] a:not(.btn),
section[style*="background-color: #0d0d0d"] a:not(.btn),
section[style*="background-color: #2d2d2d"] a:not(.btn) {
    color: #DFA400;
}

section[style*="background-color: #243552"] a:not(.btn):hover,
section[style*="background-color: #1a1a1a"] a:not(.btn):hover,
section[style*="background-color: #0d0d0d"] a:not(.btn):hover,
section[style*="background-color: #2d2d2d"] a:not(.btn):hover,
section[style*="background-color: #243552"] a:not(.btn):focus,
section[style*="background-color: #1a1a1a"] a:not(.btn):focus,
section[style*="background-color: #0d0d0d"] a:not(.btn):focus,
section[style*="background-color: #2d2d2d"] a:not(.btn):focus {
    color: #ecc866;
    text-decoration: underline;
}

/* Accessibility
   ========================================================================== */

.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: var(--space-sm) var(--space-md);
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

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

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Image Optimization
   ========================================================================== */

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

picture {
    line-height: 0;
}

/* Loading attribute support */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity var(--transition-base);
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Page Content Layout
   ========================================================================== */

#main-content {
    min-height: 60vh;
}

.page-content {
    padding: var(--space-2xl) 0;
}

.page-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.page-subtitle {
    font-size: var(--font-size-xl);
    color: var(--color-text-muted);
    margin-top: var(--space-md);
}

.page-body {
    /* Allow sections to extend full-width */
}

/* Breadcrumbs */
.breadcrumbs {
    padding: var(--space-md) 0;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: var(--space-sm);
}

.breadcrumbs li {
    margin: 0;
}

.breadcrumbs li:not(:last-child)::after {
    content: "/";
    margin-left: var(--space-sm);
    color: var(--color-text-muted);
}

.breadcrumbs a {
    color: var(--color-text-light);
}

.breadcrumbs a:hover {
    color: #DFA400;
}

/* Utility Classes
   ========================================================================== */

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

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

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

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

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

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

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

/* Hero Section with Background Image (AI Will Work style)
   ========================================================================== */

.hero {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero--with-bg {
    background-color: var(--color-primary);
}

.hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.07);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero__title {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero__subtitle {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Display heading size */
.display-1 {
    font-size: 4rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
}

/* Rounded images with shadow */
.img-thumbnail {
    padding: 16px;
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

/* Process steps with numbered circles */
.process-step-number {
    width: 80px;
    height: 80px;
    background-color: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: white;
}

/* Overlapping image/text sections */
.overlap-section {
    position: relative;
    padding: var(--space-3xl) 0;
}

.overlap-content {
    background-color: rgba(26, 39, 65, 0.95);
    padding: var(--space-3xl) var(--space-2xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    color: white;
}

/* Lead text styling */
.lead {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-normal);
}

/* Text size utilities */
.text-lg {
    font-size: var(--font-size-lg);
}

/* Service Tier Cards
   ========================================================================== */

.service-tier-card {
    background-color: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
}

.service-tier-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
    border-color: rgba(223, 164, 0, 0.3);
}

.service-tier-card.card--highlight {
    border: 2px solid #DFA400;
    box-shadow: 0 8px 16px rgba(223, 164, 0, 0.2);
}

.service-tier-card.card--highlight:hover {
    box-shadow: 0 16px 32px rgba(223, 164, 0, 0.3);
}

.service-tier-card .card__body {
    flex: 1;
}

.service-tier-card .card__footer {
    margin-top: auto;
}

/* Services Comparison Table
   ========================================================================== */

.services-comparison-table {
    border-radius: 8px;
    overflow: hidden;
}

.services-comparison-table table {
    min-width: 700px;
}

.services-comparison-table th,
.services-comparison-table td {
    vertical-align: middle;
}

.services-comparison-table thead th {
    position: sticky;
    top: 0;
    background-color: rgba(223, 164, 0, 0.1);
    z-index: 10;
}

@media (max-width: 767px) {
    .services-comparison-table {
        margin: 0 calc(var(--space-md) * -1);
        border-radius: 0;
    }

    .services-comparison-table table {
        font-size: var(--font-size-sm);
    }

    .services-comparison-table th,
    .services-comparison-table td {
        padding: var(--space-sm) !important;
    }
}

/* ROI Framework Cards
   ========================================================================== */

.roi-frameworks {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.roi-framework-card {
    background-color: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: all var(--transition-base);
}

.roi-framework-card:hover {
    border-color: rgba(223, 164, 0, 0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.roi-framework-card__header {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: var(--space-md);
    align-items: center;
    padding: var(--space-lg);
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition-fast);
}

.roi-framework-card__header:hover {
    background-color: rgba(255,255,255,0.05);
}

.roi-framework-card__header:focus {
    outline: none;
}

.roi-framework-card__number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(223, 164, 0, 0.1);
    color: #DFA400;
    border-radius: 50%;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
}

.roi-framework-card__icon {
    font-size: 2rem;
    line-height: 1;
}

.roi-framework-card__title-wrapper {
    min-width: 0;
}

.roi-framework-card__title {
    color: white;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin: 0 0 var(--space-xs) 0;
}

.roi-framework-card__when {
    color: rgba(255,255,255,0.7);
    font-size: var(--font-size-sm);
    margin: 0;
}

.roi-framework-card__toggle {
    color: #DFA400;
    transition: transform var(--transition-fast);
}

.roi-framework-card__body {
    padding: 0 var(--space-lg) var(--space-lg);
    color: rgba(255,255,255,0.9);
}

.roi-framework-card__formula {
    margin-bottom: var(--space-lg);
}

.roi-framework-card__example {
    margin-bottom: var(--space-lg);
}

/* Mobile responsive adjustments for ROI cards */
@media (max-width: 767px) {
    .roi-framework-card__header {
        grid-template-columns: auto 1fr auto;
        gap: var(--space-sm);
        padding: var(--space-md);
    }

    .roi-framework-card__number {
        width: 32px;
        height: 32px;
        font-size: var(--font-size-md);
    }

    .roi-framework-card__icon {
        display: none; /* Hide icon on mobile to save space */
    }

    .roi-framework-card__title {
        font-size: var(--font-size-md);
    }

    .roi-framework-card__when {
        font-size: var(--font-size-xs);
    }

    .roi-framework-card__body {
        padding: 0 var(--space-md) var(--space-md);
    }
}

/* Tablet responsive adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .roi-framework-card__icon {
        font-size: 1.75rem;
    }
}

/* Process Timeline (How We Work)
   ========================================================================== */

.process-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-3xl);
    position: relative;
}

.process-phase {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: var(--space-xl);
    position: relative;
    align-items: start;
}

.process-phase__number {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
    z-index: 2;
}

.process-phase__icon {
    font-size: 2.5rem;
    line-height: 1;
}

.process-phase__num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: rgba(223, 164, 0, 0.1);
    color: #DFA400;
    border: 2px solid #DFA400;
    border-radius: 50%;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-xl);
}

.process-phase__content {
    background-color: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: var(--space-xl);
}

.process-phase__header {
    margin-bottom: var(--space-lg);
}

.process-phase__title {
    color: white;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    margin: 0 0 var(--space-sm) 0;
}

.process-phase__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: center;
}

.process-phase__duration,
.process-phase__price {
    color: rgba(255,255,255,0.7);
    font-size: var(--font-size-sm);
}

.process-phase__price {
    color: #DFA400;
    font-weight: var(--font-weight-semibold);
}

.process-phase__badge {
    background-color: rgba(223, 164, 0, 0.1);
    color: #DFA400;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 4px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
}

.process-phase__activities {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-md) 0;
    color: rgba(255,255,255,0.9);
}

.process-phase__activities li {
    padding-left: var(--space-lg);
    margin-bottom: var(--space-sm);
    position: relative;
}

.process-phase__activities li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #DFA400;
}

.process-phase__connector {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    width: 3px;
    height: 280px; /* Extended to reach almost to next circle */
    background: linear-gradient(180deg, #DFA400 0%, rgba(223, 164, 0, 0.3) 100%);
    z-index: 1;
}

/* Mobile responsive for process timeline */
@media (max-width: 767px) {
    .process-timeline {
        gap: var(--space-2xl);
    }

    .process-phase {
        grid-template-columns: 60px 1fr;
        gap: var(--space-md);
    }

    .process-phase__icon {
        font-size: 2rem;
    }

    .process-phase__num {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-lg);
    }

    .process-phase__content {
        padding: var(--space-lg);
    }

    .process-phase__title {
        font-size: var(--font-size-lg);
    }

    .process-phase__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    .process-phase__connector {
        left: 50%;
        transform: translateX(-50%);
        height: 180px; /* Mobile: extended to reach next circle */
    }
}

/* Desktop enhancements */
@media (min-width: 1024px) {
    .process-phase__content:hover {
        border-color: rgba(223, 164, 0, 0.3);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
}
