/**
 * Components - The NatureCredits Theme
 * Professional News Site Design
 */

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: #1a1a1a;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.site-logo:hover {
    color: #ffffff;
    opacity: 0.9;
}

.site-logo__img {
    height: 28px;
    width: auto;
}

.site-logo__img--dark {
    display: none;
}

/* Header Navigation */
.header-nav {
    display: flex;
    gap: 32px;
}

.header-nav__link {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.header-nav__link:hover {
    opacity: 1;
    color: #ffffff;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-search-toggle,
.search-toggle,
.header-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #ffffff;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.header-search-toggle:hover,
.search-toggle:hover,
.header-theme-toggle:hover {
    opacity: 1;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.theme-toggle__label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.theme-toggle__switch {
    position: relative;
    width: 40px;
    height: 22px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 11px;
    transition: background-color 0.2s ease;
}

.theme-toggle__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

[data-theme="dark"] .theme-toggle__switch {
    background-color: #4fd1c5;
}

[data-theme="dark"] .theme-toggle__thumb {
    transform: translateX(18px);
}

/* Header Search Panel */
.header-search-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, visibility 0.3s ease;
}

.header-search-panel.is-open {
    max-height: 80px;
    padding: 16px 24px;
    visibility: visible;
}

.header-search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.header-search-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #e5e5e5;
    border-right: none;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.header-search-input:focus {
    border-color: #1a1a1a;
}

.header-search-button {
    padding: 12px 20px;
    background-color: #1a1a1a;
    color: #ffffff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger__line {
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger.is-active .hamburger__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.is-active .hamburger__line:nth-child(2) {
    opacity: 0;
}

.hamburger.is-active .hamburger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #1a1a1a;
    padding: 24px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    overflow-y: auto;
}

.mobile-menu.is-open {
    transform: translateX(0);
}

.mobile-menu__nav {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mobile-menu__link {
    display: block;
    padding: 16px 0;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 48px 0 24px;
    margin-top: 80px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 32px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-logo {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
}

.footer-logo__img {
    height: 24px;
    width: auto;
}

.footer-nav {
    display: flex;
    gap: 24px;
}

.footer-nav__link {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    transition: color 0.15s ease;
}

.footer-nav__link:hover {
    color: #ffffff;
}

.footer-copyright {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    text-align: center;
}

/* ==========================================================================
   Bottom Bar (Mobile)
   ========================================================================== */
.bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom, 20px) + 12px);
    padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 12px);
    background-color: #ffffff;
    border-top: 1px solid #e5e5e5;
    z-index: 1000;
}

.bottom-bar__inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 64px;
}

.bottom-bar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: #6b6b6b;
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: color 0.15s ease;
}

.bottom-bar__item:hover,
.bottom-bar__item.is-active {
    color: #1a1a1a;
}

.bottom-bar__icon {
    width: 22px;
    height: 22px;
}

/* ==========================================================================
   Mobile Search Modal
   ========================================================================== */
.mobile-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.mobile-search-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.mobile-search-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
}

.mobile-search-modal__form {
    display: flex;
    width: 100%;
    max-width: 500px;
    background-color: #ffffff;
    border-radius: 4px;
    overflow: hidden;
}

.mobile-search-modal__input {
    flex: 1;
    padding: 16px 20px;
    font-size: 16px;
    border: none;
    outline: none;
}

.mobile-search-modal__button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    background-color: #1a1a1a;
    color: #ffffff;
    border: none;
    cursor: pointer;
}

/* ==========================================================================
   Post Card
   ========================================================================== */
.post-card {
    position: relative;
    background-color: #ffffff;
    transition: transform 0.2s ease;
}

.post-card:hover {
    transform: translateY(-2px);
}

.post-card__title a::after,
.post-card .wp-block-post-title a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.post-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.post-card__thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #f5f5f5;
}

.post-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-card__image {
    transform: scale(1.03);
}

.post-card__placeholder {
    width: 100%;
    height: 100%;
    background-color: #e5e5e5;
}

.post-card__category {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
    background-color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-card__category--news,
.post-card__category--opinion,
.post-card__category--explainer {
    background-color: #1a1a1a;
}

.post-card__content {
    padding: 16px 0;
}

.post-card__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a1a;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #6b6b6b;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card .wp-block-post-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #6b6b6b;
    margin: 0 0 8px 0;
}

.post-card .wp-block-post-excerpt__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.post-card__date {
    font-size: 12px;
    color: #999999;
}

/* ==========================================================================
   Category Label
   ========================================================================== */
.category-label {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #1a1a1a;
    background-color: transparent;
    border: 1px solid #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
}

.category-label--news,
.category-label--opinion,
.category-label--explainer {
    background-color: transparent;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
}

.btn--primary {
    background-color: #1a1a1a;
    color: #ffffff;
}

.btn--primary:hover {
    background-color: #2d2d2d;
    color: #ffffff;
}

.btn--outline {
    background-color: transparent;
    color: #1a1a1a;
    border: 1px solid #1a1a1a;
}

.btn--outline:hover {
    background-color: #1a1a1a;
    color: #ffffff;
}

/* ==========================================================================
   Homepage Search
   ========================================================================== */
.homepage-search {
    max-width: 600px;
    margin: 0 auto 48px;
}

.homepage-search__form {
    display: flex;
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}

.homepage-search__input {
    flex: 1;
    padding: 14px 20px;
    font-size: 15px;
    border: none;
    outline: none;
}

.homepage-search__button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    background-color: #1a1a1a;
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.homepage-search__button:hover {
    background-color: #2d2d2d;
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.breadcrumb {
    font-size: 12px;
    color: #999999;
    margin-bottom: 16px;
}

.breadcrumb a {
    color: #999999;
}

.breadcrumb a:hover {
    color: #1a1a1a;
}

.breadcrumb__separator {
    margin: 0 8px;
    color: #cccccc;
}

/* ==========================================================================
   Post Tags
   ========================================================================== */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 32px 0;
}

.post-tags__item {
    padding: 6px 12px;
    font-size: 12px;
    color: #6b6b6b;
    background-color: #f5f5f5;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.post-tags__item:hover {
    background-color: #e5e5e5;
    color: #1a1a1a;
}

/* ==========================================================================
   Share Buttons
   ========================================================================== */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 32px 0;
    padding-top: 24px;
    border-top: 1px solid #e5e5e5;
}

.share-buttons__label {
    font-size: 13px;
    font-weight: 500;
    color: #6b6b6b;
}

.share-buttons__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #6b6b6b;
    transition: all 0.15s ease;
}

.share-buttons__link:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

.share-buttons__link--twitter {
    background-color: transparent;
    color: #6b6b6b;
}

.share-buttons__link--facebook {
    background-color: transparent;
    color: #6b6b6b;
}

.share-buttons__link--linkedin {
    background-color: transparent;
    color: #6b6b6b;
}

/* ==========================================================================
   Source Info
   ========================================================================== */
.source-info-wrapper {
    margin: 32px 0 48px 0;
}

.source-info {
    margin: 0;
}

.source-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

.source-info-list .source-info {
    margin: 0;
}

.source-info__inner {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.source-info__label {
    font-size: 11px;
    font-weight: 700;
    color: #6b6b6b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.source-info__name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.source-info__url {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #6b6b6b;
    text-decoration: none;
}

.source-info__url:hover {
    color: #1a1a1a;
}

.source-info__icon {
    flex-shrink: 0;
}

/* ==========================================================================
   CTA Banner
   ========================================================================== */
.cta-banner {
    background-color: #f5f5f5;
    border-radius: 4px;
    padding: 32px;
    text-align: center;
    margin: 48px 0;
}

.cta-banner__text {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0 0 16px 0;
}

.cta-banner__button {
    display: inline-block;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background-color: #1a1a1a;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.cta-banner__button:hover {
    background-color: #2d2d2d;
    color: #ffffff;
}

/* ==========================================================================
   Related Posts
   ========================================================================== */
.related-posts {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 2px solid #1a1a1a;
}

.related-posts__title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 24px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1023px) {
    .header-nav {
        display: none;
    }

    .hamburger {
        display: flex;
    }
}

@media (max-width: 767px) {
    .site-header {
        height: 56px;
    }

    .header-inner {
        padding: 0 16px;
    }

    .site-logo {
        font-size: 16px;
    }

    .header-actions {
        gap: 8px;
    }

    .bottom-bar {
        display: block;
    }

    .site-footer {
        padding: 32px 0 16px;
        margin-top: 48px;
    }

    .footer-top {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .footer-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .post-card__content {
        padding: 12px 0;
    }

    .post-card__title {
        font-size: 15px;
    }

    .cta-banner {
        padding: 24px 20px;
    }
}
