/* responsive.css — Mobile-first responsive design for 33w */

/* --- Tablet and Smaller Desktops --- */
@media (max-width: 1200px) {
    .sidebar-left {
        width: 200px;
        margin-right: 24px;
    }
    .sidebar-right {
        width: 220px;
        margin-left: 24px;
    }
}

@media (max-width: 1024px) {
    .sidebar-left {
        width: 180px;
        margin-right: 20px;
    }
    .sidebar-right {
        width: 200px;
        margin-left: 20px;
    }
    .sidebar-left-section {
        display: none;
    }
    .sidebar-left-footer {
        display: none;
    }
    .header-container {
        width: 94%;
    }
    .main-layout {
        width: 94%;
    }
    .profile-page {
        width: 94%;
    }
}

@media (max-width: 900px) {
    .profile-body {
        flex-direction: column;
    }
    .profile-sidebar {
        width: 100%;
        position: static;
        border-top: 1px solid #f0f0f0;
        padding-top: 24px;
    }
    .suggested-list,
    .following-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

/* --- Mobile Devices --- */
@media (max-width: 768px) {
    /* Base */
    body {
        padding-top: 50px;
        padding-bottom: 64px;
    }

    /* Header: compact */
    .header {
        height: 50px;
    }

    .header-container {
        width: 100%;
        padding: 0 12px;
        gap: 10px;
    }

    .logo {
        font-size: 1.3rem;
    }

    /* Hide desktop header elements */
    .header-profile {
        display: none;
    }

    .header-nav {
        display: none;
    }

    .header-search {
        flex: 1;
        max-width: none;
        margin: 0;
    }

    .search-input {
        padding: 8px 12px 8px 36px;
        font-size: 0.82rem;
        border-radius: 20px;
    }

    .header-actions .btn-create,
    .header-actions .header-icon {
        display: none;
    }

    .header-actions {
        display: flex;
        gap: 0;
    }

    /* Show a compact create button on mobile */
    .header-actions .btn-create {
        display: flex;
        padding: 6px;
        border-radius: 50%;
        width: 34px;
        height: 34px;
        align-items: center;
        justify-content: center;
    }

    .header-actions .btn-create span:last-child {
        display: none;
    }

    /* Hide logged-out header actions on mobile (use landing/modal) */
    #header-logged-out .header-actions {
        display: flex;
    }

    .btn-auth, .btn-auth-primary {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    /* Hide both sidebars on mobile */
    .sidebar-left {
        display: none !important;
    }

    .sidebar-right {
        display: none !important;
    }

    /* Main layout: full width, no gap */
    .main-layout {
        width: 100%;
        margin: 0 auto;
        padding: 0;
        gap: 0;
    }

    /* Feed wrapper: full width */
    .feed-wrapper {
        padding: 0;
    }

    /* Hide desktop view toggle bar */
    .feed-view-bar {
        display: none;
    }

    /* Show mobile view toggle bar */
    .mobile-view-bar {
        display: flex !important;
    }

    /* Show mobile bottom nav */
    .mobile-nav {
        display: flex;
    }

    /* Feed: 2-column tight masonry */
    .feed {
        columns: 2 !important;
        column-gap: 3px;
        padding: 0 3px;
    }

    .feed.single-feed {
        columns: 1 !important;
        max-width: none;
        padding: 0 8px;
    }

    /* Post cards: tight, no rounded corners, minimal gap */
    .post-card {
        border-radius: 4px;
        margin-bottom: 3px;
        border: none;
    }

    .post-card .post-bar {
        opacity: 1;
        padding: 6px 8px;
        background: linear-gradient(transparent, rgba(0,0,0,0.65));
    }

    .post-avatar {
        width: 22px;
        height: 22px;
    }

    .username {
        font-size: 0.72rem;
    }

    .post-title-bar {
        font-size: 0.65rem;
        margin-top: 1px;
    }

    .post-medium-tag {
        font-size: 0.55rem;
        padding: 1px 5px;
    }

    /* Discover cards on mobile */
    .discover-card {
        border-radius: 4px;
        margin-bottom: 3px;
    }

    .discover-card-blur {
        padding: 10px 12px;
        gap: 4px;
    }

    .discover-card-name {
        font-size: 0.78rem;
    }

    .discover-follow-btn {
        font-size: 0.6rem;
        padding: 3px 8px;
    }

    .discover-card-tag {
        font-size: 0.6rem;
    }

    .discover-card-bio {
        font-size: 0.62rem;
        -webkit-line-clamp: 1;
    }

    .discover-card-stats {
        gap: 10px;
    }

    .discover-stat {
        font-size: 0.58rem;
    }

    /* Feed empty state */
    .feed-empty {
        padding: 40px 16px;
    }

    .feed-empty .material-icons-outlined {
        font-size: 36px;
    }

    .feed-empty p {
        font-size: 0.82rem;
    }

    /* Infinity grid: 3-column tight grid */
    .infinity-grid {
        column-gap: 2px;
        padding: 0 2px;
    }

    .infinity-item {
        margin-bottom: 2px;
        border-radius: 0;
    }

    /* Landing page: mobile adjustments */
    .landing-card {
        width: 90%;
        padding: 32px 24px;
    }

    .landing-tagline {
        font-size: 0.92rem;
    }

    /* --- Profile Page Mobile --- */
    .profile-page {
        width: 100%;
        margin: 0 auto;
        padding: 0;
    }

    .profile-header {
        margin-bottom: 1rem;
    }

    .profile-hero {
        height: 140px;
        border-radius: 0;
    }

    .profile-pic-container {
        left: 50%;
        transform: translateX(-50%);
        bottom: -36px;
    }

    .profile-pic {
        width: 80px;
        height: 80px;
    }

    .profile-details {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 44px 16px 0;
    }

    .profile-name {
        font-size: 1.2rem;
    }

    .profile-bio {
        font-size: 0.82rem;
        max-width: none;
    }

    .profile-stats {
        justify-content: center;
        gap: 1.5rem;
        font-size: 0.78rem;
    }

    .profile-actions {
        justify-content: center;
        margin-top: 10px;
    }

    .profile-body {
        flex-direction: column;
        gap: 16px;
        padding: 0 8px;
    }

    .profile-sidebar {
        width: 100%;
        position: static;
        border-top: 1px solid #f0f0f0;
        padding-top: 16px;
    }

    .work-masonry {
        columns: 2;
        column-gap: 3px;
    }

    .grid-item {
        border-radius: 4px;
        margin-bottom: 3px;
    }

    .tabs {
        margin-bottom: 1rem;
    }

    .tab-link {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    /* Edit modal */
    .auth-modal {
        width: 92%;
        max-width: 360px;
        padding: 28px 20px 24px;
    }

    /* Create modal mobile */
    .create-modal {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .create-body {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .create-previews {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Detail overlay mobile */
    .detail-content {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .detail-media {
        max-height: 50vh;
    }

    .detail-info {
        padding: 16px;
        gap: 12px;
    }

    .detail-title {
        font-size: 1rem;
    }

    .detail-close {
        top: 8px;
        right: 8px;
    }

    /* Following / suggested on mobile: single column */
    .suggested-list,
    .following-list {
        display: flex;
        flex-direction: column;
    }

    /* Visitor CTA on mobile */
    .visitor-cta {
        flex-direction: row;
    }

    .btn-follow-profile,
    .btn-message-profile {
        font-size: 0.78rem;
        padding: 8px 0;
    }
}

/* --- Small Mobile (< 380px) --- */
@media (max-width: 380px) {
    .header-container {
        padding: 0 8px;
        gap: 6px;
    }

    .logo {
        font-size: 1.1rem;
    }

    .search-input {
        font-size: 0.78rem;
        padding: 7px 10px 7px 32px;
    }

    .feed {
        columns: 2 !important;
        column-gap: 2px;
        padding: 0 2px;
    }

    .infinity-grid {
        columns: 2;
        column-gap: 2px;
        padding: 0 2px;
    }

    .profile-pic {
        width: 70px;
        height: 70px;
    }

    .profile-name {
        font-size: 1.05rem;
    }

    .mobile-view-btn {
        padding: 6px 14px;
        font-size: 0.7rem;
    }
}
