
/* =========================================
   ANNIE'S FINDS — REUSABLE HEADER
   Quiet Sage Theme
========================================= */


/* =========================================
   1. TOP ANNOUNCEMENT
========================================= */

.topline {
    text-align: center;
    font-size: 10px;
    letter-spacing: 2px;
    padding: 11px;
    background: #e8ebe3;
    color: #586457;
    transition: background-color 0.7s ease, color 0.7s ease;
}


/* =========================================
   2. NAVIGATION
========================================= */

.nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 86px;
    gap: 20px;
    padding: 14px 9%;
    border-bottom: 1px solid var(--line);
    transition: border-color 0.55s ease;
}

.nav .brand {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    white-space: nowrap;
    font-family: "DM Serif Display", serif;
    font-size: 30px;
    letter-spacing: -0.7px;
    line-height: 1;
}

.brand span {
    color: var(--rose);
}

.nav .navlinks {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: clamp(15px, 2.3vw, 32px);
    white-space: nowrap;
    font-size: 12px;
    color: #656963;
}

.navlinks a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 0;
    transition: color 0.3s ease, transform 0.3s ease;
}

.navlinks a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 100%;
    height: 1px;
    background: var(--rose);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}


.navlinks a:hover {
    transform: translateY(-2px);
    font-weight: 700;
    color: var(--ink);
}


.navlinks a:hover::after {
    transform: scaleX(1);
}


/* Active Categories Navigation */

.navlinks a.active {
    font-weight: 700;
    color: var(--ink);
}

.navlinks a.active::after {
    transform: scaleX(1);
}


.nav .navright {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 10px;
    margin-left: auto;
}


/* =========================================
   3. PINTEREST BUTTON
========================================= */

.pinterest-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink);
    transition:
        transform 0.3s ease,
        background-color 0.35s ease,
        border-color 0.35s ease,
        color 0.35s ease;
}

.pinterest-link:hover {
    transform: translateY(-3px) scale(1.07);
    background: var(--sage);
    border-color: var(--sage);
}


/* =========================================
   4. LIGHT / DARK MODE BUTTON
========================================= */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 10px 15px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: transparent;
    color: var(--ink);
    font-size: 12px;
    white-space: nowrap;
    transition:
        background-color 0.45s ease,
        color 0.45s ease,
        border-color 0.45s ease,
        transform 0.3s ease;
}

.theme-toggle:hover {
    background: var(--sage);
    border-color: var(--sage);
    color: #30332e;
    transform: translateY(-3px) scale(1.07);
}

.theme-toggle:focus-visible,
.nav a:focus-visible {
    outline: 2px solid var(--rose);
    outline-offset: 4px;
}


/* =========================================
   5. DARK MODE
========================================= */

body[data-theme="dark"] .topline {
    background: #29382f;
    color: #b3c4b2;
}

body[data-theme="dark"] .navlinks {
    color: #bdc7bc;
}

body[data-theme="dark"] .theme-toggle,
body[data-theme="dark"] .pinterest-link {
    background: #243129;
    color: #f0eee7;
}

body[data-theme="dark"] .theme-toggle:hover,
body[data-theme="dark"] .pinterest-link:hover {
    background: #526b55;
    border-color: #526b55;
    color: #ffffff;
}


/* =========================================
   6. GENTLE ENTRANCE ANIMATIONS
========================================= */

@keyframes af-header-enter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.topline,
.nav {
    animation: af-header-enter 2.1s both cubic-bezier(0.22, 1, 0.36, 1);
}

.nav {
    animation-delay: 0.12s;
}


/* =========================================
   7. TABLET RESPONSIVENESS
========================================= */

@media (max-width: 1050px) {
    .nav {
        padding-left: 5%;
        padding-right: 5%;
    }

    .nav .navlinks {
        gap: 15px;
    }
}

@media (max-width: 850px) {
    .nav {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 10px;
        row-gap: 14px;
        min-height: 0;
        padding: 20px 7% 17px;
    }

    .nav .brand {
        grid-column: 1 / -1;
        grid-row: 1;
        justify-self: center;
        text-align: center;
        font-size: clamp(23px, 5.8vw, 29px);
    }

    .nav .navlinks {
        position: static;
        transform: none;
        grid-column: 1;
        grid-row: 2;
        justify-content: flex-start;
        width: auto;
        gap: clamp(12px, 3.3vw, 24px);
        font-size: clamp(10px, 2.7vw, 12px);
    }

    .nav .navright {
        grid-column: 2;
        grid-row: 2;
        align-self: center;
        justify-self: end;
        gap: 7px;
        margin: 0;
    }
}


/* =========================================
   8. MOBILE RESPONSIVENESS
========================================= */

@media (max-width: 420px) {
    .topline {
        padding: 12px 10px;
        font-size: 9px;
        letter-spacing: 1.3px;
    }

    .nav {
        padding-left: 5%;
        padding-right: 5%;
        column-gap: 6px;
    }

    .nav .brand {
        font-size: clamp(18px, 5.2vw, 22px);
    }

    .nav .navright {
        gap: 6px;
    }

    .nav .pinterest-link {
        flex: none;
        width: 33px;
        height: 33px;
    }

    .nav .theme-toggle {
        min-height: 33px;
        padding: 7px 9px;
        font-size: 10px;
    }

    .nav .navlinks {
        gap: clamp(16px, 6vw, 26px);
        font-size: 11px;
    }
}

@media (max-width: 380px) {
    .nav {
        padding-left: 4%;
        padding-right: 4%;
        column-gap: 5px;
    }

    .nav .navlinks {
        gap: 10px;
        font-size: 10px;
    }

    .nav .navright {
        gap: 5px;
    }

    .nav .theme-toggle {
        padding: 6px 7px;
        font-size: 9px;
    }
}

@media (max-width: 340px) {
    .nav .brand {
        font-size: 17px;
    }

    .nav .theme-toggle {
        padding: 6px;
        font-size: 9px;
    }

    .nav .pinterest-link {
        width: 30px;
        height: 30px;
    }

    .nav .navlinks {
        gap: 15px;
    }
}


/* =========================================
   9. REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {
    .topline,
    .nav {
        animation: none;
    }
}
