/*
Theme Name: Civil.uz
Theme URI: https://civil.uz
Author: Islombek Abdikhakimov
Author URI: https://civil.uz
Description: A modern legal services theme with glassmorphism design
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: legal-services
*/

/* --------------------------------
  1. CSS Custom Properties
-------------------------------- */
:root {
    /* Colors */
    --primary-color: #5e17eb;
    --secondary-color: #40A9FF;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Backgrounds */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-bg-hover: rgba(255, 255, 255, 0.95);
    
    /* Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-color: rgba(0, 138, 255, 0.1);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --header-height: 4rem;
    --container-max: 72rem;
    --z-header: 50;
    --z-overlay: 40;
    --z-drawer: 30;
    --z-dropdown: 20;
    --z-default: 1;
}

/* --------------------------------
  2. Reset & Base Styles
-------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    text-size-adjust: 100%;
    height: 100%;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    color: var(--text-primary);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
                 Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

/* --------------------------------
  3. Typography
-------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h5 { font-size: clamp(1.125rem, 2vw, 1.5rem); }
h6 { font-size: clamp(1rem, 1.5vw, 1.25rem); }

p {
    margin-bottom: 1.5rem;
    max-width: 65ch;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-base);
}

/* --------------------------------
  4. Layout & Grid
-------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    transition: background-color var(--transition-base);
}

.glass:hover {
    background: var(--glass-bg-hover);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    transition: all var(--transition-base);
}

.glass-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: var(--shadow-lg);
    background: var(--glass-bg-hover);
}

/* --------------------------------
  5. Header & Navigation
-------------------------------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: var(--z-header);
    transition: transform var(--transition-base);
}

.header-hidden {
    transform: translateY(-100%);
}

.nav-menu {
    position: absolute;
    top: calc(100% + 1rem);
    left: 0;
    right: 0;
    transform-origin: top center;
    transition: all var(--transition-base);
}

.nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.nav-menu a:hover {
    color: var(--primary-color);
    background: rgba(0, 138, 255, 0.1);
}

.sub-menu {
    background: var(--glass-bg-hover);
    margin-left: 1rem;
    border-left: 2px solid var(--primary-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
}

/* --------------------------------
  6. Buttons & Links
-------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all var(--transition-base);
    cursor: pointer;
}

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

.btn-primary:hover {
    background: var(--secondary-color);
}

.service-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    color: var(--primary-color);
    border: 1px solid currentColor;
    border-radius: 0.75rem;
    transition: all var(--transition-base);
    font-weight: 500;
}

.service-link:hover {
    background: var(--primary-color);
    color: white;
}

/* --------------------------------
  7. Blog & Post Components
-------------------------------- */
.blog-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-image-container {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.blog-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.blog-card:hover .blog-image {
    transform: scale(1.05);
}

.blog-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Category Navigation Styles */
.category-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-scroll .inline-flex {
    padding-left: max(1rem, calc((100vw - 72rem) / 2));
    padding-right: max(1rem, calc((100vw - 72rem) / 2));
}

/* Category link base styles */
.category-link {
    position: relative;
    border: 1px solid transparent;
}

/* Hover styles */
.category-link:hover:not(.active) {
    border-color: rgba(0, 138, 255, 0.2);
}

/* Active state */
.category-link.active {
    background-color: #5e17eb;
    color: #ffffff !important;
    border-color: #5e17eb;
}

/* Active state count */
.category-link.active span {
    color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 1024px) {
    .category-scroll .inline-flex {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* --------------------------------
  8. Forms & Search
-------------------------------- */
.search-form {
    position: relative;
    max-width: 32rem;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 3rem;
    border-radius: 9999px;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 138, 255, 0.2);
}

/* --------------------------------
  9. Background Effects
-------------------------------- */
.glow {
    position: fixed;
    width: 50%;
    height: 50%;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    pointer-events: none;
    z-index: -1;
}

.glow-1 {
    top: -25%;
    left: -25%;
    background: var(--primary-color);
    animation: glow-float 8s ease-in-out infinite;
}

.glow-2 {
    bottom: -25%;
    right: -25%;
    background: var(--secondary-color);
    animation: glow-float 8s ease-in-out infinite reverse;
}

@keyframes glow-float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(0, -20px); }
}

/* --------------------------------
  10. Animations
-------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(1rem); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn var(--transition-base) forwards;
}

/* Loading spinner */
.loading-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--text-muted);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* --------------------------------
  12. Media Queries
-------------------------------- */
@media (max-width: 1280px) {
    :root {
        --container-max: 64rem;
    }
}

@media (max-width: 1024px) {
    :root {
        --container-max: 48rem;
    }
    
    html {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    :root {
        --container-max: 100%;
        --header-height: 3.5rem;
    }
    
    html {
        font-size: 14px;
    }

    .nav-menu {
        border-radius: 0.75rem;
    }

    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .nav-menu a {
        padding: 1rem;
    }

    .blog-content {
        padding: 1rem;
    }
}

/* --------------------------------
  13. Print Styles
-------------------------------- */
@media print {
    .glass,
    .glass-card {
        background: none !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .nav-menu,
    .menu-toggle,
    .glow {
        display: none !important;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    body {
        background: none;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}

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

.sr-only-focusable:active,
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Focus styles */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to main content */
.skip-to-content {
    position: fixed;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 0.5rem 0.5rem;
    transition: top var(--transition-base);
    z-index: calc(var(--z-header) + 1);
}

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

/* --------------------------------
  15. WordPress Specific Styles
-------------------------------- */
/* Alignment */
.alignleft {
    float: left;
    margin: 0.5rem 1.5rem 0.5rem 0;
}

.alignright {
    float: right;
    margin: 0.5rem 0 0.5rem 1.5rem;
}

.aligncenter {
    clear: both;
    display: block;
    margin: 1.5rem auto;
}

/* Captions */
.wp-caption {
    max-width: 100%;
    margin-bottom: 1.5rem;
}

.wp-caption img {
    margin: 0;
    padding: 0;
    border: none;
}

.wp-caption-text {
    text-align: center;
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

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

.gallery-caption {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Comments */
.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment {
    margin: 1.5rem 0;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.comment-metadata {
    font-size: 0.875rem;
    color: var(--text-muted);
}
.content {
    font-size: 18px !important;
}
/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
    background: var(--glass-bg);
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.page-numbers.current {
    background: var(--primary-color);
    color: white;
}

.page-numbers:hover:not(.current) {
    background: var(--glass-bg-hover);
    color: var(--primary-color);
}

/* Post Navigation */
.post-navigation {
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.nav-links {
    display: flex;
    justify-content: space-between;
}

.nav-previous,
.nav-next {
    max-width: 48%;
}

.nav-previous a,
.nav-next a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.nav-previous a:hover,
.nav-next a:hover {
    color: var(--primary-color);
}

/* --------------------------------
  16. Utilities
-------------------------------- */
/* Spacing */
.mt-auto { margin-top: auto; }
.mb-auto { margin-bottom: auto; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* Display */
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }

/* Flexbox */
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Text */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* State */
.visible { visibility: visible; }
.invisible { visibility: hidden; }
.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }

/* Z-index */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }