/* ============================================
   Top Bar, Header, Navigation, Hero, Footer
   ============================================ */

/* --- Top Bar --- */
.top-bar {
    background: var(--color-green-dark);
    color: rgba(255, 255, 255, .7);
    font-size: .8rem;
    letter-spacing: .5px;
}
.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 36px;
}
.top-bar-tagline { font-style: italic; }
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}
.top-bar-user {
    color: rgba(255, 255, 255, .9);
}
.top-bar-link,
.top-bar-login {
    color: rgba(255, 255, 255, .8);
    transition: color .2s;
}
.top-bar-login {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.top-bar-link:hover,
.top-bar-login:hover { color: #fff; }

/* --- Topbar Profile (mobile avatar dropdown) --- */
.topbar-profile {
    display: none;
    position: relative;
}
.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .4);
    background: rgba(255, 255, 255, .15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color .2s, background .2s;
    font-size: 0;
    line-height: 1;
}
.topbar-avatar:hover,
.topbar-avatar:focus-visible {
    border-color: rgba(255, 255, 255, .8);
    background: rgba(255, 255, 255, .25);
    outline: none;
}
.topbar-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.topbar-avatar-initials {
    font-size: .82rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}
.topbar-avatar--guest svg {
    opacity: .85;
}
.topbar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .2s, visibility .2s, transform .2s;
    z-index: 300;
    padding: 8px 0;
    overflow: hidden;
}
.topbar-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.topbar-dropdown-header {
    padding: 10px 16px 8px;
    font-size: .82rem;
    font-weight: 700;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 4px;
}
.topbar-dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: .88rem;
    font-weight: 500;
    color: var(--color-text);
    transition: background .15s, color .15s;
}
.topbar-dropdown-link:hover {
    background: var(--color-cream);
    color: var(--color-primary);
}
.topbar-dropdown-link svg {
    flex-shrink: 0;
    color: var(--color-text-light);
}
.topbar-dropdown-link:hover svg {
    color: var(--color-primary);
}
.topbar-dropdown-link--danger:hover {
    color: #d32f2f;
}
.topbar-dropdown-link--danger:hover svg {
    color: #d32f2f;
}
.topbar-dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: 4px 0;
}

/* --- Header --- */
.site-header {
    background: var(--color-white);
    text-align: center;
    padding: 20px 0 16px;
    border-bottom: 1px solid var(--color-border);
}
.logo {
    display: inline-block;
    line-height: 1.15;
}
.logo-main {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}
.logo-sub {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 400;
    font-style: italic;
    color: var(--color-text-light);
    margin-top: -2px;
}

/* --- Navigation --- */
.main-nav {
    background: var(--color-green);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px 0;
    flex-direction: column;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    width: 26px;
    height: 2px;
    background: #fff;
    transition: .3s;
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-list {
    display: flex;
    justify-content: center;
    gap: 0;
    flex-wrap: nowrap;
}
.nav-list > li {
    position: relative;
}
.nav-list > li > a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 14px 20px;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
    color: rgba(255, 255, 255, .85);
    transition: color .2s, background .2s;
    position: relative;
}
.nav-icon {
    flex-shrink: 0;
    opacity: .8;
}
.nav-list > li > a:hover .nav-icon { opacity: 1; }
.nav-list > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--color-primary);
    transition: width .3s, left .3s;
}
.nav-list > li > a:hover::after,
.nav-list > li > a.active::after {
    width: 100%;
    left: 0;
}
.nav-list > li > a:hover { color: #fff; }
.nav-list > li > a.active { color: #fff; }
.nav-chevron {
    transition: transform .2s;
    opacity: .7;
    margin-left: -2px;
}

/* --- Megamenu --- */
.megamenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 480px;
    background: var(--color-white);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s;
    z-index: 200;
    padding: 20px 24px 0;
}
.nav-megamenu-trigger:hover .megamenu {
    opacity: 1;
    visibility: visible;
}
.nav-megamenu-trigger:hover .nav-chevron {
    transform: rotate(180deg);
}
.megamenu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}
.megamenu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    transition: background .15s;
    text-decoration: none;
}
.megamenu-item:hover {
    background: var(--color-cream);
}
.megamenu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--color-green-bg);
    color: var(--color-green);
}
.megamenu-item:hover .megamenu-icon {
    background: var(--color-green);
    color: #fff;
}
.megamenu-icon svg {
    width: 22px;
    height: 22px;
}
.megamenu-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.megamenu-name {
    font-size: .88rem;
    font-weight: 600;
    color: var(--color-text);
}
.megamenu-count {
    font-size: .75rem;
    color: var(--color-text-light);
}
.megamenu-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 0;
    margin-top: 8px;
    border-top: 1px solid var(--color-border);
    font-size: .8rem;
    font-weight: 600;
    color: var(--color-green);
    text-transform: uppercase;
    letter-spacing: .3px;
    transition: color .2s;
}
.megamenu-footer:hover {
    color: var(--color-primary);
}

/* Authors megamenu */
.megamenu-authors {
    min-width: 280px;
    padding-bottom: 12px;
}
.megamenu-grid-single {
    grid-template-columns: 1fr;
}
.megamenu-author-avatar {
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-cream);
    color: var(--color-text-light);
}
.megamenu-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.megamenu-item:hover .megamenu-author-avatar {
    background: var(--color-primary);
    color: #fff;
}

/* --- Hero --- */
/* --- Hero Carousel --- */
.hero-carousel {
    position: relative;
    height: 520px;
    overflow: hidden;
}
.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}
.carousel-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    text-decoration: none;
    color: #fff;
    opacity: 0;
    transition: opacity .8s ease;
    pointer-events: none;
}
.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}
.carousel-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, .65) 0%,
        rgba(0, 0, 0, .1) 50%,
        rgba(0, 0, 0, .15) 100%
    );
}
.carousel-caption {
    position: relative;
    z-index: 1;
    padding: 40px 56px;
    max-width: 700px;
}
.carousel-category {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 14px;
    border-radius: 50px;
    margin-bottom: 14px;
}
.carousel-caption h2 {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.15;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .4);
    margin-bottom: 8px;
}
.carousel-caption p {
    font-size: 1.05rem;
    line-height: 1.5;
    opacity: .9;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .3);
}

/* Arrows */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(6px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.carousel-arrow:hover {
    background: rgba(255, 255, 255, .3);
}
.carousel-prev { left: 20px; }
.carousel-next { right: 20px; }

/* Dots */
.carousel-dots {
    position: absolute;
    bottom: 20px;
    right: 56px;
    z-index: 2;
    display: flex;
    gap: 8px;
}
.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .6);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background .2s, border-color .2s;
}
.carousel-dot.active,
.carousel-dot:hover {
    background: #fff;
    border-color: #fff;
}

/* --- Pagination --- */
.pagination + .recipes-grid {
    margin-top: 24px;
}
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 40px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 50px;
    padding: 5px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    box-shadow: var(--shadow-sm);
}
.pagination-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-light);
    text-decoration: none;
    transition: all .2s;
}
.pagination-arrow:hover {
    background: var(--color-cream);
    color: var(--color-primary);
}
.pagination-pages {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 2px;
}
.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: .85rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-decoration: none;
    transition: all .2s;
}
.pagination-page:hover {
    background: var(--color-cream);
    color: var(--color-text);
}
.pagination-page--active {
    background: var(--color-green);
    color: #fff;
    font-weight: 700;
}
.pagination-page--active:hover {
    background: var(--color-green-dark);
    color: #fff;
}
.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 36px;
    font-size: .85rem;
    color: var(--color-border);
    letter-spacing: 1px;
    pointer-events: none;
}

/* --- Footer --- */
/* --- Footer --- */
.site-footer {
    background: #2c2c2c;
    color: rgba(255, 255, 255, .6);
    padding: 56px 0 0;
    margin-top: auto;
}
.footer-top {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 56px;
    padding-bottom: 40px;
}
.footer-brand {
    display: flex;
    flex-direction: column;
}
.footer-logo-link {
    text-decoration: none;
    display: block;
    margin-bottom: 16px;
}
.footer-logo-main {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.footer-logo-sub {
    display: block;
    font-size: .82rem;
    color: var(--color-primary);
    font-style: italic;
    margin-top: 2px;
}
.footer-tagline {
    font-size: .88rem;
    line-height: 1.7;
    margin-bottom: 20px;
}
.footer-social-links {
    display: flex;
    gap: 8px;
}
.footer-social-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
    text-decoration: none;
}
.footer-social-btn:hover {
    background: var(--color-primary);
    color: #fff;
}
.footer-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.footer-nav h4 {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 10px;
}
.footer-nav h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
}
.footer-nav ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-nav a {
    font-size: .88rem;
    color: rgba(255, 255, 255, .6);
    text-decoration: none;
    transition: color .2s;
}
.footer-nav a:hover {
    color: #fff;
}
.footer-bottom {
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .78rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.footer-copy {
    color: rgba(255, 255, 255, .4);
}
.footer-credit {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, .4);
}
.footer-codeka-logo {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: .5;
    transition: opacity .3s;
    vertical-align: middle;
}
.footer-credit a:hover .footer-codeka-logo {
    opacity: .9;
}
.footer-heart {
    color: #e25555;
    vertical-align: -2px;
    animation: heartbeat 1.5s ease-in-out infinite;
}
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.25); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    60% { transform: scale(1); }
}

/* --- Ad Container --- */
.ad-container {
    max-width: 728px;
    margin: 32px auto;
    text-align: center;
    overflow: hidden;
}
.ad-container .ad-label {
    display: block;
    font-size: .65rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
    opacity: .6;
}
.ad-container--sidebar {
    max-width: 300px;
    margin: 24px auto 0;
    min-height: 250px;
}
#filterForm .ad-container--sidebar {
    max-width: 100%;
    margin: 16px 0 0;
    min-height: 200px;
}
.ad-placeholder {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg-alt, #f5f5f5);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ad-placeholder span {
    font-size: .75rem;
    color: var(--color-text-light);
    letter-spacing: .5px;
    opacity: .7;
}
.ad-container--sidebar .ad-placeholder {
    min-height: 250px;
}
