/*
 * Shared site chrome: navigation bar and footer.
 *
 * The canonical header/footer for every page. Extracted after /iza-kulisa was
 * found rendering a 100px navbar and a one-line footer stub while every other
 * page rendered an 80px navbar and a four-block footer, and after the legal
 * pages turned out to have no site navigation at all.
 *
 * Values here match the homepage: logo 55px, navbar padding 0.75rem 4rem,
 * four-column footer grid.
 *
 * Pages using this file must NOT redeclare .navbar, .nav-logo img, .nav-menu,
 * .menu-toggle, footer, .footer-* or .social-links. If a page needs a variation,
 * change it here so every page moves together.
 *
 * Used by: galerija.html, privatne-galerije.html, iza-kulisa.html, cijene.html,
 * pravila-privatnosti.html, uvjeti-koristenja.html. Pair it with js/site-chrome.js
 * for the mobile drawer, and with fonts/fonts.css for the Julee wordmark.
 *
 * index.html keeps its own copy because its navbar is transparent over the hero
 * and only turns solid on scroll. Its measured values are the ones reproduced
 * here, so if you change something in this file, change it there too.
 */

:root {
    --gold: #c9a227;
    --gold-light: #e6c860;
    --gold-dark: #a68820;
    --bg-dark: #1a1d21;
    --bg-medium: #232730;
    --bg-light: #2d323b;
    --bg-card: #353b47;
    --text-light: #f5f5f5;
    --text-medium: #c5c8ce;
    --text-muted: #8a8f9a;
}

/* ==================== Anchor offset for the fixed navbar ====================
   Without this, an in-page jump such as /#usluge or /#kontakt lands with the
   section's top edge exactly under the fixed navbar, hiding its heading.
   Each value is the navbar height at that breakpoint plus a little clearance. */

html {
    scroll-padding-top: 6rem;
}

@media (max-width: 1024px) {
    html { scroll-padding-top: 5.5rem; }
}

@media (max-width: 480px) {
    html { scroll-padding-top: 5.25rem; }
}

/* ========================= Header background ======================== */

/* The faint diagonal gold lines the homepage, galerija, privatne-galerije and
   cijene already draw behind their page header. iza-kulisa and the two legal
   pages had no background treatment at all. */
.page-hero,
.legal-wrap {
    position: relative;
}

.page-hero::before,
.legal-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 40px,
        rgba(201, 162, 39, 0.025) 40px,
        rgba(201, 162, 39, 0.025) 41px
    );
    pointer-events: none;
}

/* ============================= Scrollbar ============================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-dark, #a68820);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* Always reserve the scrollbar's width. Without it a page that starts shorter
   than the window (privatne-galerije while its spinner shows) gains a scrollbar
   when content arrives, and the whole centred layout slides 15px left. */
html {
    scrollbar-color: var(--gold-dark, #a68820) var(--bg-dark);
    scrollbar-gutter: stable;
}

/* ============================ Navigation ============================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.75rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(26, 29, 33, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(201, 162, 39, 0.1);
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo img {
    height: 55px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.nav-menu {
    display: flex;
    gap: 3rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--gold);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-cta {
    color: var(--gold) !important;
}

.external-icon {
    font-size: 0.75em;
    margin-left: 0.2em;
    opacity: 0.7;
    display: inline;
    transition: opacity 0.3s ease;
}

a:hover .external-icon {
    opacity: 1;
}

/* The current page's link keeps the arrow's width but not the arrow. Removing
   the glyph outright made that link ~12px narrower, and since .nav-menu is a
   right-aligned flex row, every link to its left shifted by 12px between pages. */
.nav-menu a.active .external-icon {
    visibility: hidden;
}

/* Social row inside the mobile drawer (added by js/site-chrome.js); desktop hides it */
.nav-social {
    display: none;
}

/* Mobile menu button */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
    padding: 4px;
    background: none;
    border: 0;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 1px;
    background: var(--text-light);
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.menu-toggle:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
}

/* ============================== Footer ============================== */

footer {
    padding: 3rem 4rem 2rem;
    background: var(--bg-medium);
    border-top: 1px solid var(--bg-card);
    /* Explicit, so a page's own body line-height cannot change the footer's height.
       `normal` is what the homepage renders, since its body sets no line-height. */
    line-height: normal;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Julee, matching the homepage and the logo wordmark. Pages including this file
   must also load the Julee face, e.g. <link rel="stylesheet" href="/fonts/fonts.css">. */
.footer-brand h4 {
    font-family: 'Julee', cursive;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-brand h4 span {
    color: var(--gold);
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.8;
    max-width: 300px;
}

.footer-col h5 {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-col li {
    margin-bottom: 0.75rem;
}

.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: color 0.3s ease;
}

.footer-col a:hover {
    color: var(--gold);
}

.social-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border: 1px solid var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.footer-bottom {
    max-width: 1400px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bg-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-copy a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-copy a:hover {
    color: var(--gold);
}

.footer-legal {
    display: flex;
    gap: 2rem;
}

.footer-legal a {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-legal a:hover {
    color: var(--gold);
}

/* ============================ Responsive ============================ */

/* The three navbar breakpoints below mirror index.html exactly, including its
   safe-area handling, so the header is the same height on every page. */
@media (max-width: 1024px) {
    .navbar {
        padding: calc(env(safe-area-inset-top, 0px) + 0.65rem) 2rem 0.65rem;
        min-height: calc(env(safe-area-inset-top, 0px) + 72px);
    }

    .nav-logo img {
        height: 48px;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--bg-dark);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu a {
        font-size: 1.2rem;
        padding: 1rem;
    }

    .menu-toggle {
        display: flex;
    }

    /* Mobile menu: a drawer from the right, the page dimmed behind it (.nav-backdrop),
       left-aligned rows with hairlines, Kontakt as a gold row with an arrow, and the
       social links in their own colours at the bottom (.nav-social, added by script).
       Same rules in index.html and css/site-chrome.css. */
    .nav-menu {
        width: min(82%, 380px);
        left: auto;
        height: 100vh;
        height: 100dvh;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0;
        padding: calc(env(safe-area-inset-top, 0px) + 6.5rem) 2rem calc(env(safe-area-inset-bottom, 0px) + 2rem);
        border-left: 1px solid rgba(201, 162, 39, 0.18);
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
        box-sizing: border-box;
    }
    .nav-menu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        opacity: 0;
        transform: translateX(16px);
        transition: opacity 0.35s ease, transform 0.35s ease;
    }
    .nav-menu.active li { opacity: 1; transform: none; }
    .nav-menu.active li:nth-child(1) { transition-delay: 0.12s; }
    .nav-menu.active li:nth-child(2) { transition-delay: 0.16s; }
    .nav-menu.active li:nth-child(3) { transition-delay: 0.2s; }
    .nav-menu.active li:nth-child(4) { transition-delay: 0.24s; }
    .nav-menu.active li:nth-child(5) { transition-delay: 0.28s; }
    .nav-menu.active li:nth-child(6) { transition-delay: 0.32s; }
    .nav-menu.active li:nth-child(7) { transition-delay: 0.36s; }
    .nav-menu a {
        display: block;
        text-align: left;
        font-size: 0.95rem;
        padding: 1.1rem 0;
        letter-spacing: 0.22em;
    }
    .nav-menu a::after { display: none; }
    .nav-menu a.active:not(.nav-cta),
    .nav-menu > li:not(.nav-social) > a:not(.nav-cta):hover { color: var(--text-light); }
    .nav-menu .external-icon { display: none; }
    .nav-menu a.nav-cta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: var(--gold);
        font-weight: 500;
    }
    .nav-menu a.nav-cta::before {
        content: '\2192';
        order: 2;
        letter-spacing: 0;
    }
    .nav-menu li.nav-social {
        border-bottom: 0;
        margin-top: auto;
        padding-top: 2rem;
        display: flex;
        gap: 1rem;
    }
    .nav-social a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 50%;
        letter-spacing: 0;
    }
    .nav-social svg { width: 20px; height: 20px; display: block; }
    .nav-menu .nav-social a[aria-label="Instagram"] { color: #E4405F; }
    .nav-menu .nav-social a[aria-label="Facebook"] { color: #1877F2; }
    .nav-menu .nav-social a[aria-label="Google Business Profile"] { color: #4285F4; }
    .nav-menu .nav-social a[aria-label="WhatsApp"] { color: #25D366; }
    .nav-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(10, 12, 15, 0.6);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, visibility 0.4s ease;
        z-index: 999;
    }
    .nav-backdrop.show { opacity: 1; visibility: visible; }
    html.nav-open, html.nav-open body { overflow: hidden; }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: calc(env(safe-area-inset-top, 0px) + 0.6rem) 1.5rem 0.6rem;
        min-height: calc(env(safe-area-inset-top, 0px) + 70px);
    }

    .nav-logo img {
        height: 46px;
    }

    footer {
        padding: 3rem 2rem;
    }

    /* Usluge and Linkovi side by side; brand and Kontakt take the full row */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem 1.5rem;
    }

    .footer-brand,
    .footer-grid > .footer-col:last-child {
        grid-column: 1 / -1;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        min-height: calc(env(safe-area-inset-top, 0px) + 66px);
    }

    .nav-logo img {
        height: 42px;
    }

    .menu-toggle span {
        width: 23px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-menu,
    .nav-menu a::after,
    .menu-toggle span {
        transition-duration: 0.01ms;
    }
    .nav-menu li,
    .nav-menu.active li { transition: none; opacity: 1; transform: none; }
    .nav-backdrop { transition: none; }
}
