/**
 * Alliance Law Firm - Custom Styles
 * Additional styles and overrides
 *
 * @package Alliance_Law_Firm
 */

/* ==========================================================================
   Menu Overlay
   ========================================================================== */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Body States
   ========================================================================== */
body.menu-open {
    overflow: hidden;
}

body.loaded .animate-fade-in,
body.loaded .animate-fade-in-up,
body.loaded .animate-slide-in-left {
    opacity: 1;
}

/* ==========================================================================
   Submenu Toggle (Mobile)
   ========================================================================== */
.submenu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.submenu-toggle .toggle-icon {
    display: block;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--color-text-white);
    border-bottom: 2px solid var(--color-text-white);
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.submenu-open > .submenu-toggle .toggle-icon {
    transform: rotate(-135deg);
}

@media screen and (max-width: 992px) {
    .menu-item-has-children {
        position: relative;
    }

    .submenu-toggle {
        display: block;
    }

    .nav-menu .sub-menu {
        max-height: 0;
        overflow: hidden;
    }

    .nav-menu .submenu-open > .sub-menu {
        max-height: 500px;
    }
}

/* ==========================================================================
   Hero Background Placeholder
   ========================================================================== */
.hero-background-placeholder {
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(15, 15, 15, 0.98) 0%, rgba(26, 26, 26, 0.9) 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:%23333;stop-opacity:1" /><stop offset="100%" style="stop-color:%231a1a1a;stop-opacity:1" /></linearGradient></defs><rect fill="url(%23grad)" width="100" height="100"/></svg>');
}

/* ==========================================================================
   Post Styles
   ========================================================================== */
.posts-list {
    display: grid;
    gap: 40px;
}

.post-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media screen and (min-width: 768px) {
    .post-item.has-thumbnail {
        grid-template-columns: 250px 1fr;
    }
}

.post-item .post-thumbnail {
    overflow: hidden;
}

.post-item .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-item:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-item .entry-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.post-item .entry-title a {
    color: var(--color-text-white);
}

.post-item .entry-title a:hover {
    color: var(--color-primary-blue);
}

.post-item .entry-summary {
    color: var(--color-text-gray);
    margin-bottom: 15px;
}

.read-more {
    display: inline-block;
    color: var(--color-primary-blue);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    position: relative;
}

.read-more::after {
    content: '→';
    margin-left: 8px;
    transition: margin-left 0.3s ease;
}

.read-more:hover {
    color: var(--color-accent-gold);
}

.read-more:hover::after {
    margin-left: 15px;
}

/* ==========================================================================
   Post Navigation
   ========================================================================== */
.post-navigation {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
    min-width: 200px;
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation .nav-subtitle {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-light-gray);
    margin-bottom: 5px;
}

.post-navigation .nav-title {
    color: var(--color-text-white);
    font-family: var(--font-serif);
    font-size: 1.1rem;
}

.post-navigation a:hover .nav-title {
    color: var(--color-accent-gold);
}

/* ==========================================================================
   Search Form
   ========================================================================== */
.search-form {
    display: flex;
    max-width: 400px;
}

.search-form .search-field {
    flex: 1;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-right: none;
    color: var(--color-text-white);
    font-size: 1rem;
}

.search-form .search-field:focus {
    outline: none;
    border-color: var(--color-primary-blue);
}

.search-form .search-submit {
    padding: 12px 20px;
    background: var(--color-primary-blue);
    border: none;
    color: var(--color-text-white);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-form .search-submit:hover {
    background: var(--color-accent-gold);
    color: var(--color-dark-bg);
}

/* ==========================================================================
   404 Page
   ========================================================================== */
.error-404 {
    text-align: center;
    padding: 80px 20px;
}

.error-404 .page-title {
    font-size: 8rem;
    color: var(--color-primary-blue);
    margin-bottom: 20px;
    opacity: 0.5;
}

.error-404 .page-content {
    max-width: 500px;
    margin: 0 auto;
}

/* ==========================================================================
   Archive Styles
   ========================================================================== */
.archive-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.archive-title {
    font-size: 2.5rem;
    color: var(--color-primary-blue);
}

.archive-description {
    color: var(--color-text-gray);
    margin-top: 10px;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.breadcrumbs {
    font-size: 0.85rem;
    margin-bottom: 30px;
    color: var(--color-text-light-gray);
}

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

.breadcrumbs a:hover {
    color: var(--color-accent-gold);
}

.breadcrumbs .separator {
    margin: 0 8px;
    opacity: 0.5;
}

.breadcrumbs .current {
    color: var(--color-text-white);
}

/* ==========================================================================
   Social Links
   ========================================================================== */
.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-gray);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--color-primary-blue);
    color: var(--color-text-white);
}

/* Social Icons using CSS */
.social-icon {
    display: block;
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* ==========================================================================
   Button Loading State
   ========================================================================== */
button.loading,
input[type="submit"].loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

button.loading::after,
input[type="submit"].loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--color-text-white);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .site-sidebar,
    .hamburger-menu,
    .menu-overlay,
    .decorative-element,
    .cta-section,
    .site-footer,
    .post-navigation {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .page-layout .site-content {
        margin-left: 0;
    }

    .content-background {
        display: none;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    .page-title {
        color: black;
    }
}
