/**
 * PC Kompas Guides - Responsive Design
 *
 * Media queries and responsive breakpoints
 */

/* ============================================================================
   REDUCED MOTION SUPPORT
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    .guide-card,
    .guide-card__image img,
    .guides-filter-btn,
    .pagination-btn,
    .share-btn,
    .guide-toc a,
    .guide-author-box,
    .guide-author-box__social-link,
    .guide-nav__link {
        transition: none;
    }

    .guide-card:hover {
        transform: none;
    }

    .guide-card__image img:hover {
        transform: none;
    }

    .guide-author-box__social-link:hover,
    .guide-nav__link:hover {
        transform: none;
    }

    .spinner {
        animation: none;
    }
}

/* ============================================================================
   TABLET BREAKPOINT (max-width: 768px)
   ============================================================================ */

@media (max-width: 768px) {
    .guides-archive,
    .guide-single {
        padding: 16px 0 60px !important;
    }

    .guides-archive > .container {
        padding: 0 16px !important;
    }

    .guides-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .guides-filters__left {
        width: 100%;
    }

    .guides-filters__right {
        width: 100%;
        justify-content: space-between;
    }

    .guides-search {
        flex: 1;
        min-width: 100%;
    }

    .guides-search__input {
        width: 100%;
    }

    .guides-sort {
        width: 100%;
    }

    .guides-sort__select {
        width: 100%;
    }

    .guide-header__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: clamp(0.75rem, 1.5vw, 1rem);
    }

    .guide-author-box {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .guide-author-box__avatar {
        width: clamp(60px, 15vw, 80px);
        height: clamp(60px, 15vw, 80px);
    }

    .guide-author-box__social {
        justify-content: center;
    }

    .guide-nav {
        flex-direction: column;
    }

    .guide-nav__link {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ============================================================================
   COMPACT MOBILE BREAKPOINT (max-width: 640px) - Builder Pattern
   ============================================================================ */

@media (max-width: 640px) {
    /* Header left-aligned */
    .guides-header {
        text-align: left;
    }

    .guides-header__title {
        font-size: 1.25rem;
        font-weight: 600;
    }

    .guides-header__subtitle {
        font-size: 0.875rem;
    }

    /* Filters as compact toolbar */
    .guides-filters {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border);
    }

    .guides-filters__left {
        flex: 1;
        min-width: 0;
        width: auto;
    }

    .guides-filters__right {
        flex-shrink: 0;
        width: auto;
        justify-content: flex-end;
    }

    /* Categories horizontal scroll */
    .guides-filters__categories {
        display: flex;
        gap: 0.25rem;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 0;
    }

    .guides-filters__categories::-webkit-scrollbar {
        display: none;
    }

    .guides-filter-btn {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Search compact */
    .guides-search {
        flex: 0 0 auto;
        min-width: auto;
        max-width: 140px;
    }

    .guides-search__input {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
        min-height: 44px;
    }

    /* Sort dropdown compact */
    .guides-sort {
        width: auto;
    }

    .guides-sort__select {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
        min-height: 44px;
        width: auto;
    }
}

/* ============================================================================
   MOBILE BREAKPOINT (max-width: 480px)
   ============================================================================ */

@media (max-width: 480px) {
    .guides-filters__categories {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        gap: 0.5rem;
    }

    .guides-filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .guides-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.75rem;
    }

    .guide-share {
        flex-direction: column;
        align-items: stretch;
    }

    .guide-share__buttons {
        justify-content: center;
    }

    .pagination-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
        min-width: 36px;
        min-height: 36px;
    }

    .guide-header h1 {
        font-size: clamp(1.25rem, 5vw, 1.75rem);
    }

    .guide-content h2 {
        font-size: clamp(1.1rem, 3vw, 1.35rem);
    }
}

/* ============================================================================
   RESPONSIVE AUTHOR HEADER
   ============================================================================ */

@media (max-width: 600px) {
    .guide-author-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .guide-author-header__bio {
        max-width: none;
    }

    .guide-author-header__meta {
        justify-content: center;
    }
}

/* ============================================================================
   LARGE SCREEN BREAKPOINT (min-width: 1440px)
   ============================================================================ */

@media (min-width: 1440px) {
    .guides-archive {
        padding: 24px 0 80px !important;
    }

    .guides-archive > .container {
        padding: 0 24px !important;
    }

    .guides-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 2rem;
    }
}
