/**
 * =============================================================================
 * MAIN STYLESHEET
 * =============================================================================
 * 
 * Location:    /assets/css/style.css
 * Structure:   assets/css/style.css
 * Filename:    style.css
 * 
 * Sections:
 *   - CSS Variables (Custom Properties)
 *   - Base Styles
 *   - Typography
 *   - Layout
 *   - Components
 *   - Page-specific Styles
 *   - Utilities
 *   - Animations
 *   - Print Styles
 * 
 * Version:     1.0.0
 * Since:       2025-01-21
 * 
 * Changelog:
 *   1.0.0 (2025-01-21) - Initial stylesheet
 *                      - Bootstrap customization
 *                      - Component styles
 * =============================================================================
 */

/* =============================================================================
   CSS VARIABLES
   ============================================================================= */

:root {
    /* Brand Colors */
    --cms-primary: #0d6efd;
    --cms-primary-dark: #0a58ca;
    --cms-secondary: #6c757d;
    --cms-success: #198754;
    --cms-info: #0dcaf0;
    --cms-warning: #ffc107;
    --cms-danger: #dc3545;
    
    /* Neutral Colors */
    --cms-white: #ffffff;
    --cms-light: #f8f9fa;
    --cms-gray-100: #f8f9fa;
    --cms-gray-200: #e9ecef;
    --cms-gray-300: #dee2e6;
    --cms-gray-400: #ced4da;
    --cms-gray-500: #adb5bd;
    --cms-gray-600: #6c757d;
    --cms-gray-700: #495057;
    --cms-gray-800: #343a40;
    --cms-gray-900: #212529;
    --cms-dark: #212529;
    --cms-black: #000000;
    
    /* Typography */
    --cms-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --cms-font-family-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --cms-font-size-base: 1rem;
    --cms-line-height-base: 1.6;
    
    /* Spacing */
    --cms-spacer: 1rem;
    --cms-section-padding: 4rem;
    
    /* Border Radius */
    --cms-border-radius: 0.375rem;
    --cms-border-radius-sm: 0.25rem;
    --cms-border-radius-lg: 0.5rem;
    --cms-border-radius-xl: 1rem;
    
    /* Shadows */
    --cms-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --cms-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --cms-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    /* Transitions */
    --cms-transition-base: all 0.2s ease-in-out;
    --cms-transition-fast: all 0.15s ease-in-out;
    --cms-transition-slow: all 0.3s ease-in-out;
    
    /* Z-index layers */
    --cms-zindex-dropdown: 1000;
    --cms-zindex-sticky: 1020;
    --cms-zindex-fixed: 1030;
    --cms-zindex-modal-backdrop: 1040;
    --cms-zindex-modal: 1050;
    --cms-zindex-tooltip: 1070;
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
    :root {
        --cms-body-bg: #1a1a1a;
        --cms-body-color: #e9ecef;
        --cms-card-bg: #2d2d2d;
        --cms-border-color: #404040;
    }
}

/* =============================================================================
   BASE STYLES
   ============================================================================= */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Account for fixed header */
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: var(--cms-font-family);
    font-size: var(--cms-font-size-base);
    line-height: var(--cms-line-height-base);
    color: var(--cms-gray-900);
    background-color: var(--cms-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================================================
   TYPOGRAPHY
   ============================================================================= */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
    color: var(--cms-gray-900);
}

h1, .h1 { font-size: 2.5rem; }
h2, .h2 { font-size: 2rem; }
h3, .h3 { font-size: 1.75rem; }
h4, .h4 { font-size: 1.5rem; }
h5, .h5 { font-size: 1.25rem; }
h6, .h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 1.5;
}

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

a:hover {
    color: var(--cms-primary-dark);
    text-decoration: underline;
}

/* =============================================================================
   LAYOUT
   ============================================================================= */

.container-fluid {
    max-width: 1400px;
}

/* Section spacing */
section {
    padding: var(--cms-section-padding) 0;
}

/* Main content area */
main {
    min-height: calc(100vh - 200px);
}

/* =============================================================================
   NAVIGATION
   ============================================================================= */

.navbar {
    transition: var(--cms-transition-base);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: var(--cms-transition-fast);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--cms-primary);
}

/* Sticky navbar shadow */
.navbar.scrolled {
    box-shadow: var(--cms-shadow);
}

/* =============================================================================
   CARDS
   ============================================================================= */

.card {
    border: none;
    border-radius: var(--cms-border-radius-lg);
    box-shadow: var(--cms-shadow-sm);
    transition: var(--cms-transition-base);
}

.card:hover {
    box-shadow: var(--cms-shadow);
    transform: translateY(-2px);
}

.card-img-top {
    border-radius: var(--cms-border-radius-lg) var(--cms-border-radius-lg) 0 0;
    object-fit: cover;
}

/* Article cards */
.article-card {
    height: 100%;
}

.article-card .card-img-top {
    height: 200px;
}

.article-card .card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .card-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

.btn {
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    border-radius: var(--cms-border-radius);
    transition: var(--cms-transition-fast);
}

.btn-primary {
    background-color: var(--cms-primary);
    border-color: var(--cms-primary);
}

.btn-primary:hover {
    background-color: var(--cms-primary-dark);
    border-color: var(--cms-primary-dark);
    transform: translateY(-1px);
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
}

/* CTA Button */
.btn-cta {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--cms-border-radius-lg);
}

/* =============================================================================
   FORMS
   ============================================================================= */

.form-control,
.form-select {
    padding: 0.75rem 1rem;
    border-radius: var(--cms-border-radius);
    border: 1px solid var(--cms-gray-300);
    transition: var(--cms-transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--cms-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Form validation */
.form-control.is-valid {
    border-color: var(--cms-success);
}

.form-control.is-invalid {
    border-color: var(--cms-danger);
}

/* =============================================================================
   HERO SECTIONS
   ============================================================================= */

.hero-section {
    background: linear-gradient(135deg, var(--cms-primary) 0%, var(--cms-primary-dark) 100%);
    color: var(--cms-white);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

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

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
}

/* =============================================================================
   BREADCRUMBS
   ============================================================================= */

.breadcrumb {
    background: transparent;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    color: var(--cms-gray-600);
}

.breadcrumb-item a:hover {
    color: var(--cms-primary);
}

.breadcrumb-item.active {
    color: var(--cms-gray-900);
    font-weight: 500;
}

/* =============================================================================
   ARTICLE CONTENT
   ============================================================================= */

.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.article-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--cms-gray-200);
}

.article-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--cms-border-radius);
    margin: 1.5rem 0;
}

.article-content blockquote {
    border-left: 4px solid var(--cms-primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--cms-gray-100);
    border-radius: 0 var(--cms-border-radius) var(--cms-border-radius) 0;
}

.article-content code {
    background: var(--cms-gray-100);
    padding: 0.2em 0.4em;
    border-radius: var(--cms-border-radius-sm);
    font-size: 0.875em;
}

.article-content pre {
    background: var(--cms-gray-900);
    color: var(--cms-gray-100);
    padding: 1.5rem;
    border-radius: var(--cms-border-radius);
    overflow-x: auto;
}

.article-content pre code {
    background: transparent;
    padding: 0;
}

/* =============================================================================
   AUTHOR BOX
   ============================================================================= */

.author-box {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--cms-gray-100);
    border-radius: var(--cms-border-radius-lg);
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-info h4 {
    margin-bottom: 0.25rem;
}

.author-bio {
    color: var(--cms-gray-600);
    font-size: 0.9rem;
}

/* =============================================================================
   SIDEBAR
   ============================================================================= */

.sidebar-widget {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--cms-white);
    border-radius: var(--cms-border-radius-lg);
    box-shadow: var(--cms-shadow-sm);
}

.sidebar-widget h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--cms-primary);
}

/* =============================================================================
   PAGINATION
   ============================================================================= */

.pagination {
    justify-content: center;
    gap: 0.25rem;
}

.pagination .page-link {
    border-radius: var(--cms-border-radius);
    padding: 0.5rem 1rem;
    margin: 0 0.125rem;
    border: none;
    background: var(--cms-gray-100);
    color: var(--cms-gray-700);
    transition: var(--cms-transition-fast);
}

.pagination .page-link:hover {
    background: var(--cms-primary);
    color: var(--cms-white);
}

.pagination .page-item.active .page-link {
    background: var(--cms-primary);
    color: var(--cms-white);
}

/* =============================================================================
   FOOTER
   ============================================================================= */

footer {
    background: var(--cms-gray-900);
    color: var(--cms-gray-300);
    padding: 4rem 0 2rem;
}

footer h5 {
    color: var(--cms-white);
    margin-bottom: 1.5rem;
}

footer a {
    color: var(--cms-gray-400);
}

footer a:hover {
    color: var(--cms-white);
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid var(--cms-gray-700);
    padding-top: 2rem;
    margin-top: 3rem;
}

/* =============================================================================
   BACK TO TOP
   ============================================================================= */

.btn-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--cms-transition-base);
    z-index: var(--cms-zindex-fixed);
}

.btn-back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* =============================================================================
   LOADING STATES
   ============================================================================= */

.skeleton {
    background: linear-gradient(90deg, var(--cms-gray-200) 25%, var(--cms-gray-100) 50%, var(--cms-gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--cms-border-radius);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

/* =============================================================================
   UTILITIES
   ============================================================================= */

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--cms-primary) 0%, var(--cms-primary-dark) 100%);
}

.hover-shadow {
    transition: var(--cms-transition-base);
}

.hover-shadow:hover {
    box-shadow: var(--cms-shadow-lg);
}

.hover-lift {
    transition: var(--cms-transition-base);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
    .navbar,
    footer,
    .sidebar,
    .btn-back-to-top,
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
    
    .container {
        max-width: 100%;
        width: 100%;
    }
    
    .article-content {
        font-size: 11pt;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}
