/* ===========================================
   NIBANGO WEB - LAYOUT
   Page structure and flow
   =========================================== */

/* ========== Reset & Core ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family-base);
    background-color: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ========== Container ========== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ========== Main Structure ========== */
main {
    padding-top: 120px;
    /* Space for floating header */
    padding-bottom: 120px;
    /* Space for floating tab bar (mobile) */
}

@media (min-width: 769px) {
    main {
        padding-bottom: 60px;
        /* Less space needed on desktop footer */
    }
}

/* ========== Sections ========== */
.section {
    padding: 24px 0;
}

.section-title {
    font-size: var(--font-size-subtitle);
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

/* ========== Category Section ========== */
.category-section {
    position: sticky;
    top: 100px;
    /* Below floating header */
    z-index: 50;
    background: var(--color-background);
    padding: 12px 0;
    margin-bottom: 24px;
}

/* ========== Footer ========== */
.footer {
    padding: 60px 0 160px;
    border-top: 1px solid var(--color-border-light);
    background: var(--color-background-secondary);
}

.footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.footer__links {
    display: flex;
    gap: 24px;
}

.footer__link {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer__link:hover {
    color: var(--brand-primary);
}

.footer__copyright {
    font-size: var(--font-size-mini);
    color: var(--color-text-tertiary);
}

/* ========== Loading States ========== */
.loading {
    opacity: 0.6;
    pointer-events: none;
    filter: blur(2px);
    transition: all 0.3s ease;
}

/* ========== Empty Feed ========== */
.empty-feed {
    text-align: center;
    padding: 80px 20px;
    color: var(--color-text-tertiary);
    font-size: var(--font-size-headline);
}

/* ========== Responsiveness ========== */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    main {
        padding-top: 100px;
    }

    .footer {
        padding-bottom: 120px;
    }

    /* Space for Tab Bar on mobile */
}

/* Animations Viewport Check */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}