/**
 * Forgeee Theme Main Stylesheet
 * 
 * @package Forgeee
 * @since 1.0.0
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Use CSS Variables from theme options */
body {
    font-family: var(--fg-font-family-body);
    font-size: var(--fg-font-size-base);
    line-height: var(--fg-line-height-base);
    color: var(--fg-text-color);
    background-color: #fff;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--fg-font-family-heading);
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    color: var(--fg-link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--fg-link-hover-color);
}

/* Container */
.container {
    max-width: var(--fg-container-width);
    margin: 0 auto;
    padding-left: var(--fg-padding-horizontal);
    padding-right: var(--fg-padding-horizontal);
}

/* Site Layout */
.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1;
    padding-top: var(--fg-margin-top);
    padding-bottom: var(--fg-margin-bottom);
}

/* Header */
.site-header {
    background-color: var(--fg-header-bg-color);
    color: var(--fg-header-text-color);
    min-height: var(--fg-header-height);
}

/* Footer */
.site-footer {
    color: var(--fg-footer-text-color);
    padding: var(--fg-padding-vertical) 0;
}

/* Header */
.site-header {
    background-color: var(--fg-header-bg-color);
    color: var(--fg-header-text-color);
    min-height: var(--fg-header-height);
    border-bottom: 1px solid #eee;
}

.site-header.sticky {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.site-title a {
    color: var(--fg-header-text-color);
}

.site-description {
    margin: 5px 0 0;
    font-size: 14px;
    opacity: 0.7;
}

.site-logo {
    max-height: 60px;
    width: auto;
}

/* Navigation */
.main-navigation {
    flex-grow: 1;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

.main-navigation a {
    color: var(--fg-header-text-color);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: var(--fg-primary-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle-inner span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--fg-header-text-color);
    transition: all 0.3s ease;
}

.menu-toggle.is-active .menu-toggle-inner span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.is-active .menu-toggle-inner span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-active .menu-toggle-inner span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.menu-toggle-text {
    display: none;
}

/* Search */
.header-search {
    position: relative;
}

.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    color: var(--fg-header-text-color);
}

.search-form-wrapper {
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: none;
    min-width: 300px;
    z-index: 100;
}

.search-form-wrapper.active {
    display: block;
}

.search-form input[type="search"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Skip Link */
.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    position: absolute;
    left: 6px;
    top: 7px;
    z-index: 999999;
    padding: 8px 16px;
    background-color: var(--fg-primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
}

/* Screen Reader Text */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .menu-toggle-text {
        display: inline-block;
        margin-left: 5px;
    }
    
    .main-navigation ul {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--fg-header-bg-color);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        display: none;
    }
    
    .main-navigation.toggled ul {
        display: flex;
    }
    
    .header-inner {
        flex-wrap: wrap;
    }
    
    .site-header {
        position: relative;
    }
}