/**
 * WhatArmy Main Stylesheet
 * Base styles, variables, typography, layout
 */

/* ============================================
   CSS VARIABLES / DESIGN SYSTEM
   ============================================ */
:root {
    /* Colors */
    --color-forest: #0F3D3E;
    --color-forest-dark: #0A2C2B;
    --color-white: #ffffff;
    --color-tan: #FAFAF8;
    --color-cream: #FAFAF8;
    --color-green: #E07854;
    --color-green-bright: #E07854;
    --color-green-light: #FAFAF8;
    --color-rust: #E07854;
    --color-success: #4A9B8E;
    --color-gray: #6B7280;
    --color-gray-dark: #1A1A1A;
    --color-gray-light: #6B7280;
    --color-text-dark: #1A1A1A;
    --color-text-light: #6B7280;
    --color-black: #000000;
    --color-light-border: #E5E7EB;
    --color-border: #E5E7EB;
    
    /* Spacing System (8px grid) */
    --space-4: 4px;
    --space-8: 8px;
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-xxl: 64px;
    --space-massive: 96px;
    --space-hero: 120px;
    
    /* Typography */
    --font-family-heading: 'Space Grotesk', sans-serif;
    --font-family-body: 'Inter', sans-serif;
    --font-family: var(--font-family-body);
    --font-size-base: 18px;
    --line-height-base: 1.7;
    
    /* Typography Scale - Headings */
    --font-size-display: 64px;
    --font-size-h1: 56px;
    --font-size-h2: 40px;
    --font-size-h3: 32px;
    --font-size-h4: 24px;
    
    /* Typography Scale - Body */
    --font-size-body-large: 18px;
    --font-size-body: 18px;
    --font-size-body-small: 16px;
    --font-size-small: 14px;
    
    /* Line Heights */
    --line-height-heading-tight: 1.1;
    --line-height-heading: 1.2;
    --line-height-heading-relaxed: 1.3;
    --line-height-body: 1.7;
    --line-height-body-small: 1.6;
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.7;
    
    /* Layout */
    --max-width: 1280px;
    --container-padding-mobile: 24px;
    --container-padding-desktop: 24px;
    --nav-height: 100px;
    
    /* Transitions */
    --transition-base: 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-gray);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

/* Global wrapper constraints */
#page,
.site,
.site-main,
main {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

/* Ensure all sections are constrained */
section {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
    padding: 48px 0; /* py-12 mobile */
}

@media (min-width: 768px) {
    section {
        padding: 80px 0; /* py-20 desktop */
    }
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: var(--space-md);
}

h1 {
    font-size: var(--font-size-h1);
    font-weight: 700;
    line-height: var(--line-height-heading-tight);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--font-size-h2);
    font-weight: 700;
    line-height: var(--line-height-heading);
}

h3 {
    font-size: var(--font-size-h3);
    font-weight: 600;
    line-height: var(--line-height-heading-relaxed);
}

h4 {
    font-size: var(--font-size-h4);
    font-weight: 600;
    line-height: var(--line-height-heading);
}

p {
    font-family: var(--font-family-body);
    font-size: var(--font-size-body);
    font-weight: 400;
    line-height: var(--line-height-body);
    margin-bottom: var(--space-md);
    color: var(--color-text-dark);
}

p.lead {
    font-family: var(--font-family-body);
    font-size: var(--font-size-body-large);
    font-weight: 400;
    line-height: var(--line-height-body);
    color: var(--color-text-dark);
}

small,
.small {
    font-family: var(--font-family-body);
    font-size: var(--font-size-body-small);
    font-weight: 400;
    line-height: var(--line-height-body-small);
}

a {
    color: var(--color-forest);
    text-decoration: none;
    transition: all 300ms ease-in-out;
}

a:focus-visible {
    outline: 2px solid var(--color-rust);
    outline-offset: 2px;
    border-radius: 4px;
}

a:hover {
    color: var(--color-green);
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px; /* px-6 */
    width: 100%;
    box-sizing: border-box;
}

/* Container width variants for better content hierarchy */
.container--narrow {
    max-width: 768px;
}

.container--medium {
    max-width: 900px;
}

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

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

/* ============================================
   SECTION LAYOUT UTILITIES
   Full-width backgrounds with contained content
   ============================================ */

/* Section wrapper - full width background */
.section-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

/* Section container - contained content */
.section-container {
    max-width: 768px;
    margin: 0 auto;
    padding: 0 var(--container-padding-mobile);
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .section-container {
        padding: 0 var(--container-padding-desktop);
    }
}

/* Section container variants */
.section-container--narrow {
    max-width: 768px;
}

.section-container--medium {
    max-width: 900px;
}

.section-container--wide {
    max-width: 1200px;
}

/* Section padding variants */
.section-padding {
    padding: 48px 0;
}

@media (min-width: 768px) {
    .section-padding {
        padding: 64px 0;
    }
}

.section-padding--large {
    padding: 64px 0;
}

@media (min-width: 768px) {
    .section-padding--large {
        padding: 80px 0;
    }
}

/* Background color variants */
.section-bg-light {
    background: #F9FAFB;
}

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

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

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

.section-bg-navy {
    background: #1A202C;
}

.section-bg-tint {
    background: rgba(231, 90, 15, 0.03);
}

/* Section with border transition */
.section-border-top {
    border-top: 1px solid var(--color-light-border);
}

/* Update content-area to work with new structure */
.content-area {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Page content sections - default styling */
.entry-content {
    width: 100%;
    max-width: 100%;
}

.entry-content > * {
    max-width: 100%;
}

/* Ensure proper spacing for page content */
.entry-content > h1,
.entry-content > h2,
.entry-content > h3,
.entry-content > h4 {
    margin-top: var(--space-xxl);
    margin-bottom: var(--space-md);
}

.entry-content > h1:first-child,
.entry-content > h2:first-child,
.entry-content > h3:first-child {
    margin-top: 0;
}

/* Color blog post headings */
.entry-content h2 {
    color: var(--color-forest);
    border-left: 4px solid var(--color-rust);
    padding-left: var(--space-md);
    margin-left: calc(var(--space-md) * -1);
}

.entry-content h3 {
    color: var(--color-forest);
}

.entry-content h4 {
    color: var(--color-gray-dark);
}

/* Style blockquotes */
.entry-content blockquote {
    border-left: 4px solid var(--color-rust);
    background: linear-gradient(135deg, rgba(27, 77, 62, 0.05) 0%, rgba(224, 120, 84, 0.05) 100%);
    padding: var(--space-lg) var(--space-xl);
    margin: var(--space-xl) 0;
    border-radius: 8px;
    font-style: italic;
    color: var(--color-gray-dark);
}

/* Style links in content */
.entry-content a {
    color: var(--color-forest);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 200ms ease;
}

.entry-content a:hover {
    color: var(--color-rust);
}

/* Style lists */
.entry-content ul,
.entry-content ol {
    margin: var(--space-lg) 0;
    padding-left: var(--space-xl);
}

.entry-content ul li {
    position: relative;
    padding-left: var(--space-md);
    margin-bottom: var(--space-sm);
}

.entry-content ul li::marker {
    color: var(--color-rust);
}

.entry-content ol li {
    margin-bottom: var(--space-sm);
}

/* Style strong/bold text */
.entry-content strong {
    color: var(--color-forest);
    font-weight: 600;
}

/* Style code/pre blocks */
.entry-content code {
    background: rgba(27, 77, 62, 0.1);
    color: var(--color-forest);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.entry-content pre {
    background: rgba(27, 77, 62, 0.05);
    border: 1px solid rgba(27, 77, 62, 0.2);
    border-left: 4px solid var(--color-forest);
    padding: var(--space-lg);
    border-radius: 8px;
    overflow-x: auto;
    margin: var(--space-lg) 0;
}

/* Full-width section pattern for any content */
.content-section {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

.content-section__inner {
    max-width: 768px;
    margin: 0 auto;
    padding: 0 var(--container-padding-mobile);
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .content-section__inner {
        padding: 0 var(--container-padding-desktop);
    }
}

.content-section__inner--narrow {
    max-width: 768px;
}

.content-section__inner--medium {
    max-width: 900px;
}

.content-section__inner--wide {
    max-width: 1200px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 300ms ease-in-out;
    text-decoration: none;
    text-align: center;
    height: 48px;
    min-width: 120px;
}

.btn:focus-visible {
    outline: 2px solid var(--color-rust);
    outline-offset: 2px;
    border-radius: 8px;
}

.btn-primary {
    background: var(--color-rust);
    color: var(--color-white);
    font-weight: 600;
}

.btn-primary:hover {
    background: #C85D3A;
    transform: scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-secondary {
    background: transparent;
    color: var(--color-gray-dark);
    border: 1px solid rgba(0, 0, 0, 0.15);
    font-weight: 500;
}

.btn-secondary:hover {
    background: var(--color-gray-dark);
    color: var(--color-white);
    border-color: var(--color-gray-dark);
    transform: scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-lg {
    padding: 20px 48px;
    font-size: 16px;
}

.btn-sm {
    padding: 12px 24px;
    font-size: 13px;
}

/* ============================================
   IMAGES
   ============================================ */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   INTERACTIVE ELEMENTS - GLOBAL TRANSITIONS
   ============================================ */
button,
a,
input,
select,
textarea,
[role="button"],
[tabindex] {
    transition: all 300ms ease-in-out;
}

/* ============================================
   UTILITIES
   ============================================ */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 968px) {
    :root {
        --container-padding-desktop: 32px;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .service-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --container-padding-mobile: 24px;
        --space-hero: 64px;
    }
    
    h1 {
        font-size: 36px;
    }
    
    h2 {
        font-size: 28px;
    }
    
    h3 {
        font-size: 24px;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 14px;
        height: 44px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .service-features-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }
    
    .hero {
        min-height: 80vh;
        padding: calc(var(--nav-height) + var(--space-xl)) 0 var(--space-xl);
    }
    
    .hero-title {
        font-size: 48px;
    }
    
    .service-hero {
        min-height: 40vh;
        padding: calc(var(--nav-height) + var(--space-lg)) 0 var(--space-lg);
    }
}

