/*
 * CBDOils Theme - Components CSS
 * Non-critical styles loaded after main stylesheet
 * Performance Budget: Keep under 50KB total CSS
 */

/* Header Components */
.site-header {
    padding: 16px 0;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.site-title a {
    color: #2c5530;
    text-decoration: none;
}

.site-description {
    margin: 0;
    font-size: 0.875rem;
    color: #666;
}

.custom-logo {
    max-height: 60px;
    width: auto;
}

/* Navigation */
.main-navigation {
    position: relative;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    font-size: 1.125rem;
}

.menu-icon::before {
    content: "☰";
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 24px;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a:focus {
    color: #2c5530;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.cart-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #2c5530;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.cart-link:hover,
.cart-link:focus {
    background: #1a3d1f;
    color: white;
}

.cart-icon::before {
    content: "🛒";
}

.cart-count {
    background: #fff;
    color: #2c5530;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #333;
    font-size: 1.125rem;
    transition: color 0.2s ease;
}

.search-toggle:hover,
.search-toggle:focus {
    color: #2c5530;
}

.search-icon::before {
    content: "🔍";
}

/* Search Form */
.search-form-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px 0;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-form-container.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.search-form {
    display: flex;
    gap: 8px;
    max-width: 400px;
    margin: 0 auto;
}

.search-field {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.search-field:focus {
    outline: none;
    border-color: #2c5530;
}

.search-submit {
    padding: 12px 16px;
    background: #2c5530;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.search-submit:hover,
.search-submit:focus {
    background: #1a3d1f;
}

/* Breadcrumbs */
.breadcrumbs {
    margin: 16px 0;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
    font-size: 0.875rem;
}

.breadcrumb-item:not(:last-child)::after {
    content: "→";
    margin-left: 8px;
    color: #666;
}

.breadcrumb-item a {
    color: #2c5530;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item [aria-current="page"] {
    color: #666;
}

/* Post Components */
.posts-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.post-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.post-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 24px;
}

.entry-title {
    margin: 0 0 16px 0;
}

.entry-title a {
    color: #333;
    text-decoration: none;
}

.entry-title a:hover {
    color: #2c5530;
}

.entry-meta {
    margin-bottom: 16px;
    font-size: 0.875rem;
    color: #666;
    display: flex;
    gap: 16px;
}

.entry-meta a {
    color: #2c5530;
    text-decoration: none;
}

.entry-meta a:hover {
    text-decoration: underline;
}

.entry-content {
    margin-bottom: 16px;
}

.entry-footer {
    margin-top: 16px;
}

.read-more-link {
    font-size: 0.875rem;
    padding: 8px 16px;
}

/* Pagination */
.posts-navigation {
    margin: 32px 0;
    text-align: center;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.nav-previous,
.nav-next {
    flex: 1;
}

.nav-previous a,
.nav-next a {
    display: block;
    padding: 12px 24px;
    background: #f8f9fa;
    color: #2c5530;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-previous a:hover,
.nav-next a:hover {
    background: #2c5530;
    color: white;
}

/* Sidebar */
.widget-area {
    margin-top: 32px;
}

.widget {
    margin-bottom: 32px;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 8px;
}

.widget-title {
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    color: #2c5530;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget li {
    margin-bottom: 8px;
}

.widget a {
    color: #666;
    text-decoration: none;
}

.widget a:hover {
    color: #2c5530;
}

/* Footer */
.footer-widgets {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e9ecef;
}

.footer-widget {
    margin-bottom: 24px;
}

.footer-widget-title {
    margin: 0 0 16px 0;
    font-size: 1.125rem;
    color: #2c5530;
}

.footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.site-info {
    margin: 0;
    font-size: 0.875rem;
    color: #666;
}

.footer-navigation .footer-nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 24px;
}

.footer-nav-menu a {
    color: #666;
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-nav-menu a:hover {
    color: #2c5530;
}

/* Responsive Design */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 16px;
    }

    .main-navigation {
        width: 100%;
        order: 3;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: white;
        border: 1px solid #e9ecef;
        border-radius: 4px;
        padding: 16px;
        gap: 8px;
    }

    .nav-menu.active {
        display: flex;
    }

    .posts-container {
        grid-template-columns: 1fr;
    }

    .post-content {
        padding: 16px;
    }

    .footer-info {
        flex-direction: column;
        text-align: center;
    }

    .footer-nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .breadcrumb-list {
        flex-wrap: wrap;
    }
}

@media (min-width: 769px) {
    .site-header .container {
        display: flex;
        align-items: center;
        gap: 32px;
    }

    .posts-container {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (min-width: 1024px) {
    .main-content {
        display: grid;
        grid-template-columns: 1fr 300px;
        gap: 48px;
    }

    .widget-area {
        margin-top: 0;
    }
} 