/* Flag accent bar */
.fm-flag-bar {
    height: 6px;
    background: linear-gradient(90deg, #005BBB 50%, #FFD500 50%);
}

/* ---------- Header ---------- */
.fm-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    transition: box-shadow .3s, background .3s;
    box-shadow: 0 0 40px rgba(0,0,0,.05);
}
.fm-header.is-scrolled {
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,40,90,.18);
}
.fm-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: .85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.fm-brand-wrap .custom-logo-link img { max-height: 44px; width: auto; }

.fm-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: var(--fm-dark);
    font-weight: 800;
    font-size: 1.2rem;
}
.fm-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(180deg, #005BBB 50%, #FFD500 50%);
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px #FFD500;
    transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.fm-brand:hover .fm-brand-mark { transform: rotate(180deg); }

.fm-menu {
    list-style: none;
    display: flex;
    gap: 1.6rem;
    margin: 0;
    padding: 0;
}
.fm-menu li { margin: 0; }
.fm-menu a {
    position: relative;
    display: inline-block;
    padding: .4rem 0;
    color: var(--fm-text);
    font-weight: 600;
    text-decoration: none;
}
.fm-menu a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: var(--fm-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.fm-menu a:hover::after,
.fm-menu .current-menu-item > a::after { transform: scaleX(1); }

.fm-header-actions { display: flex; align-items: center; gap: .75rem; }

.fm-btn-tickets {
    background: var(--fm-primary);
    color: #fff !important;
    padding: .6rem 1.2rem;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .3s, background .3s, color .3s;
}
.fm-btn-tickets:hover {
    background: var(--fm-accent);
    color: var(--fm-dark) !important;
    transform: translateY(-2px);
}

/* Burger (hidden on desktop) */
.fm-burger {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.fm-burger span {
    position: absolute;
    left: 10px;
    right: 10px;
    height: 3px;
    border-radius: 3px;
    background: var(--fm-primary);
    transition: transform .35s cubic-bezier(.2,.7,.2,1), opacity .2s;
}
.fm-burger span:nth-child(1) { top: 13px; }
.fm-burger span:nth-child(2) { top: 20px; }
.fm-burger span:nth-child(3) { top: 27px; }
.fm-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.fm-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.fm-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Ornament band (embroidery-inspired) ---------- */
.fm-ornament {
    height: 20px;
    background-color: #005BBB;
    background-image:
        linear-gradient(135deg, #FFD500 25%, transparent 25%),
        linear-gradient(225deg, #FFD500 25%, transparent 25%),
        linear-gradient(45deg,  #FFD500 25%, transparent 25%),
        linear-gradient(315deg, #FFD500 25%, #005BBB 25%);
    background-position: 10px 0, 10px 0, 0 0, 0 0;
    background-size: 20px 20px;
}

/* ---------- Footer ---------- */
.fm-footer {
    background: linear-gradient(180deg, #003A78, #002650);
    color: #DBE7F7;
}
.fm-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.25rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
}
.fm-footer h3 {
    margin: 0 0 1rem;
    color: var(--fm-accent);
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .1em;
}
.fm-footer p { margin: .4rem 0; line-height: 1.6; }
.fm-footer a { color: #DBE7F7; text-decoration: none; transition: color .25s; }
.fm-footer a:hover { color: var(--fm-accent); }
.fm-footer .fm-brand { color: #fff; }
.fm-footer .fm-menu { flex-direction: column; gap: .6rem; }
.fm-footer .fm-menu a::after { display: none; }
.fm-footer .fm-btn-tickets { display: inline-block; margin-top: .5rem; background: var(--fm-accent); color: var(--fm-dark) !important; }
.fm-footer .fm-btn-tickets:hover { background: #fff; color: var(--fm-primary) !important; }

.fm-social { display: flex; gap: .6rem; margin-top: 1.2rem; }
.fm-social a {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid rgba(255,213,0,.5);
    font-weight: 700;
    font-size: .8rem;
    transition: transform .3s, background .3s, color .3s;
}
.fm-social a:hover {
    background: var(--fm-accent);
    border-color: var(--fm-accent);
    color: var(--fm-dark);
    transform: translateY(-3px);
}

.fm-footer-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    padding: 1.2rem;
    text-align: center;
    font-size: .9rem;
    opacity: .85;
}

/* Back to top */
.fm-totop {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 90;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: var(--fm-accent);
    color: var(--fm-dark);
    font-size: 1.3rem;
    font-weight: 800;
    box-shadow: 0 10px 25px rgba(0,0,0,.25);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity .3s, transform .3s;
}
.fm-totop.show { opacity: 1; transform: none; pointer-events: auto; }
.fm-totop:hover { background: #fff; }

.post-type-archive {
    .fm_festival {
        .entry-title {
            font-size: 1.5rem;
        }
    }
}

.single-fm_festival {
    .fm_festival {
        .entry-title {
            font-size: 3rem;
        }
    }
}

.post-type-archive,
.single-fm_festival {
    background: var(--fm-bg);

    .page-header {
        padding-top: 5rem;
        border: none;
    }
    .page-title {
        font-size: 2.5rem;
    }

    .entry-header {
        max-width: 900px!important;
    }

    .post-thumbnail img {
        /* margin: 0; */
        display: block;
        max-width: 900px!important;
        border-radius: 2rem;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .fm-burger { display: block; }

    .fm-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 20px 40px rgba(0,40,90,.15);
        max-height: 0;
        overflow: hidden;
        transition: max-height .45s cubic-bezier(.2,.7,.2,1);
    }
    .fm-nav.is-open { max-height: 420px; }

    .fm-menu {
        flex-direction: column;
        gap: 0;
        padding: .5rem 1.25rem 1rem;
    }
    .fm-menu a {
        display: block;
        padding: .8rem 0;
        border-bottom: 1px solid #EEF3FA;
    }
    .fm-menu a::after { display: none; }
}

@media (max-width: 520px) {
    .fm-btn-tickets { display: none; }
    .fm-footer-inner { padding-top: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
    .fm-nav, .fm-totop, .fm-brand-mark { transition: none; }
}
