/**
 * Component Styles
 * Navigation, pagination, breadcrumbs, forms, buttons, etc.
 */

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 3rem 0 4rem 0;
}

.pagination ul.page-numbers {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.pagination ul.page-numbers li {
    margin: 0;
    padding: 0;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 0.75rem 1rem;
    border: 1px solid #e1e5e9;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    background: white;
    transition: all 0.3s ease;
    min-width: 45px;
    text-align: center;
}

.pagination a.page-numbers:hover {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.pagination .page-numbers.current {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
    font-weight: 600;
}

.pagination .page-numbers.dots {
    border: none;
    background: none;
    color: #999;
}

.pagination .page-numbers.prev,
.pagination .page-numbers.next {
    font-weight: 600;
}

.pagination .page-numbers.prev:hover,
.pagination .page-numbers.next:hover {
    background: var(--primary-green);
    color: white;
}

/* WordPress Core Styles */
.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1.5rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-style: italic;
    margin-top: 0.5rem;
    text-align: center;
}

/* Search Form */
.search-form {
    position: relative;
    max-width: 300px;
}

.search-form input[type="search"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    font-size: 1rem;
}

.search-form button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
}

.back-to-top:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Header Scroll Effect */
.site-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

/* Enhanced Post Navigation */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid #e1e5e9;
}

.post-navigation a {
    display: flex;
    flex-direction: column;
    max-width: 45%;
    text-decoration: none;
    color: #333;
    padding: 1rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.post-navigation a:hover {
    background: #f8f9fa;
}

.nav-subtitle {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.nav-title {
    font-weight: 600;
    line-height: 1.4;
}

/* Comments */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e1e5e9;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.comment-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 0 1rem 0;
    font-size: 0.875rem;
}

.breadcrumb-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background-color: var(--primary-green);
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.breadcrumb-pill:hover {
    background-color: var(--secondary-forest-green);
    color: var(--primary-white);
    transform: translateY(-1px);
    text-decoration: none;
}

.breadcrumb-pill::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid var(--neutral-gray);
    border-bottom: 2px solid var(--neutral-gray);
    transform: rotate(-45deg);
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.breadcrumb-pill:last-child::after {
    display: none;
}

.breadcrumb-home {
    padding-left: 0.5rem;
}

.breadcrumb-home-icon {
    flex-shrink: 0;
}

.breadcrumb-current {
    background-color: var(--primary-charcoal);
    cursor: default;
}

.breadcrumb-current:hover {
    background-color: var(--primary-charcoal);
    transform: none;
}

/* Breadcrumb Responsive */
@media (max-width: 768px) {
    .breadcrumb {
        gap: 0.35rem;
        font-size: 0.8rem;
    }

    .breadcrumb-pill {
        padding: 0.25rem 0.6rem;
    }

    .breadcrumb-pill::after {
        width: 5px;
        height: 5px;
        margin-left: 0.35rem;
    }

    .breadcrumb-home-icon {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 480px) {
    .breadcrumb {
        gap: 0.25rem;
        font-size: 0.75rem;
    }

    .breadcrumb-pill {
        padding: 0.2rem 0.5rem;
        gap: 0.25rem;
    }

    .breadcrumb-pill::after {
        width: 4px;
        height: 4px;
        margin-left: 0.25rem;
        border-width: 1.5px;
    }

    .breadcrumb-home span {
        display: none;
    }

    .breadcrumb-home {
        padding: 0.3rem;
    }

    .breadcrumb-home-icon {
        width: 14px;
        height: 14px;
    }
}

/* Dashboard Navigation Tabs */
.ihowz-dashboard-nav {
    margin-bottom: 30px;
    border-bottom: 2px solid #e5e5e5;
}

.ihowz-dashboard-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 10px;
}

.ihowz-dashboard-nav li {
    margin: 0;
}

.ihowz-dashboard-nav a {
    display: inline-block;
    padding: 12px 20px;
    text-decoration: none;
    color: #555;
    border-bottom: 3px solid transparent;
    background-color: rgba(156, 193, 48, 0.25);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.ihowz-dashboard-nav a.active {
    color: var(--primary-white);
    background-color: var(--primary-green);
    border-bottom-color: transparent;
}

.ihowz-dashboard-nav a:hover {
    background-color: var(--primary-green);
    color: var(--primary-white);
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Post Tags */
.post-tags {
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid #e1e5e9;
}

.post-tags a {
    display: inline-block;
    background: #f8f9fa;
    color: #666;
    padding: 0.25rem 0.75rem;
    margin: 0.25rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.post-tags a:hover {
    background: #3498db;
    color: white;
}

/* Hamburger Menu Button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1002;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary-charcoal);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Hamburger animation when toggled */
.menu-toggle.toggled .hamburger-icon span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.menu-toggle.toggled .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.toggled .hamburger-icon span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

/* Enhanced Mobile Navigation */
@media (max-width: 1023px) {
    /* Show hamburger button, hide regular menu */
    .menu-toggle {
        display: block;
    }

    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        max-width: 300px;
        background: var(--background-pure-white);
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        z-index: 1001;
        padding: 1rem 0;
        border-radius: 8px;
        margin-top: 10px;
    }

    .main-navigation.toggled {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }

    .main-navigation a {
        display: block;
        padding: 1rem 1.5rem;
        border-radius: 0;
        transition: background-color 0.3s ease;
    }

    .main-navigation a:hover,
    .main-navigation .current-menu-item a {
        background-color: var(--primary-green);
        color: white;
    }

    /* When header is scrolled and sticky */
    .header-scrolled .main-navigation {
        position: fixed;
        top: 100px; /* Adjust based on sticky header height */
    }
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .main-navigation {
        max-width: 100%;
        right: 0;
        left: 0;
        margin: 10px;
    }
}

/* Screen Reader Text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* ===================================
   Page Templates - Wireframe Implementations
   =================================== */

