/* =========================================================
   NAV — Kancelaria Radcy Prawnego
   Art deco–refined: hairline gold, tracked capitals, hover precision
   ========================================================= */

/* ----- Site Header ----- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: box-shadow 0.35s ease, background 0.35s ease;
}

.site-header.is-scrolled {
    box-shadow: 0 2px 32px rgba(80, 80, 80, 0.10);
    background: rgba(255, 255, 255, 0.99);
}

.header-inner {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 40px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

/* Gold hairline separator */
.header-rule {
    height: 1px;
    background: linear-gradient(
        to right,
        transparent 0%,
        #C3A04B 20%,
        #C3A04B 80%,
        transparent 100%
    );
    opacity: 0.45;
}

/* ----- Logo ----- */
.site-logo {
    display: block;
    flex-shrink: 0;
    line-height: 0;
    transition: opacity 0.2s ease;
}

.site-logo:hover {
    opacity: 0.85;
}

.site-logo img {
    height: 64px;
    width: auto;
    object-fit: contain;
}

/* ----- Desktop Nav ----- */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

/* Nav links: tracked small-caps feel */
.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--graphite);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s ease;
}

/* Underline sweep animation */
.nav-link span:first-child {
    position: relative;
}

.nav-link span:first-child::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover span:first-child::after,
.nav-link--active span:first-child::after {
    width: 100%;
}

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

/* CTA link — bordered pill */
.nav-link--cta {
    margin-left: 8px;
    padding: 8px 22px;
    border: 1px solid var(--gold);
    color: var(--gold);
    transition: background 0.25s ease, color 0.25s ease;
}

.nav-link--cta span::after {
    display: none;
}

.nav-link--cta:hover {
    background: var(--gold);
    color: #fff;
}

/* Dropdown arrow */
.dropdown-arrow {
    transition: transform 0.25s ease;
    flex-shrink: 0;
    opacity: 0.6;
}

.nav-item--dropdown:hover .dropdown-arrow,
.nav-item--dropdown.is-open .dropdown-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

/* ----- Dropdown Panel ----- */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    min-width: 240px;
    background: #fff;
    border: 1px solid rgba(195, 160, 75, 0.2);
    border-top: 2px solid var(--gold);
    box-shadow: 0 16px 48px rgba(80, 80, 80, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 200;
}

.nav-item--dropdown:hover .nav-dropdown,
.nav-item--dropdown.is-open .nav-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* Small triangle pointer */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 6px;
    background: var(--gold);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.dropdown-inner {
    padding: 8px 0;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 22px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: var(--graphite);
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease, padding-left 0.2s ease;
}

.dropdown-link__bullet {
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dropdown-link:hover {
    color: var(--gold);
    background: rgba(195, 160, 75, 0.04);
    padding-left: 28px;
}

.dropdown-link:hover .dropdown-link__bullet,
.dropdown-link--active .dropdown-link__bullet {
    opacity: 1;
}

.dropdown-link--active {
    color: var(--gold);
    font-weight: 600;
}

/* ----- Hamburger ----- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.hamburger__line {
    display: block;
    height: 1.5px;
    background: var(--graphite);
    border-radius: 2px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                width 0.3s ease;
}

.hamburger__line:nth-child(1) { width: 24px; }
.hamburger__line:nth-child(2) { width: 18px; }
.hamburger__line:nth-child(3) { width: 24px; }

.hamburger[aria-expanded="true"] .hamburger__line:nth-child(1) {
    width: 22px;
    transform: translateY(6.5px) rotate(45deg);
}
.hamburger[aria-expanded="true"] .hamburger__line:nth-child(2) {
    opacity: 0;
    width: 0;
}
.hamburger[aria-expanded="true"] .hamburger__line:nth-child(3) {
    width: 22px;
    transform: translateY(-6.5px) rotate(-45deg);
}

/* ----- Mobile Menu ----- */
.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
}

.mobile-menu.is-open {
    display: flex;
}

.mobile-menu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(80, 80, 80, 0.4);
    backdrop-filter: blur(3px);
    animation: fadeInBackdrop 0.3s ease forwards;
}

@keyframes fadeInBackdrop {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.mobile-menu__panel {
    position: relative;
    z-index: 2;
    width: min(360px, 90vw);
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid rgba(195, 160, 75, 0.2);
    transform: translateX(-100%);
    animation: slideInPanel 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInPanel {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}

.mobile-menu.is-closing .mobile-menu__panel {
    animation: slideOutPanel 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.mobile-menu.is-closing .mobile-menu__backdrop {
    animation: fadeOutBackdrop 0.3s ease forwards;
}

@keyframes slideOutPanel {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
}

@keyframes fadeOutBackdrop {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.mobile-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(195, 160, 75, 0.2);
}

.mobile-menu__close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--graphite);
    padding: 6px;
    transition: color 0.2s ease;
}

.mobile-menu__close:hover {
    color: var(--gold);
}

/* Mobile nav list */
.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 16px 0;
    flex: 1;
}

.mobile-nav-item {
    animation: fadeSlideIn 0.4s ease both;
    animation-delay: calc(0.06s * var(--i, 0));
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 28px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--graphite);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease, padding-left 0.2s ease;
    text-align: left;
}

.mobile-nav-link:hover,
.mobile-nav-link--active {
    color: var(--gold);
    padding-left: 36px;
}

.mobile-dropdown-arrow {
    transition: transform 0.25s ease;
    flex-shrink: 0;
    opacity: 0.5;
}

.mobile-nav-accordion[aria-expanded="true"] .mobile-dropdown-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

/* Mobile subnav */
.mobile-subnav {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(249, 249, 249, 0.8);
    border-top: 1px solid rgba(195, 160, 75, 0.1);
}

.mobile-subnav[aria-hidden="false"] {
    max-height: 420px;
}

.mobile-subnav-link {
    display: block;
    padding: 10px 28px 10px 40px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--graphite);
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
    border-left: 2px solid transparent;
    margin-left: 28px;
}

.mobile-subnav-link:hover,
.mobile-subnav-link--active {
    color: var(--gold);
    border-left-color: var(--gold);
    padding-left: 44px;
}

/* Mobile footer */
.mobile-menu__footer {
    padding: 24px 28px;
    border-top: 1px solid rgba(195, 160, 75, 0.2);
}

.mobile-contact-phone {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--graphite);
    text-decoration: none;
    transition: color 0.2s ease;
}

.mobile-contact-phone:hover {
    color: var(--gold);
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
    .header-inner {
        padding: 0 24px;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .header-inner {
        height: 68px;
    }

    .site-logo img {
        height: 52px;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 0 20px;
    }
}

/* Offset for fixed header */
.header-offset {
    height: 81px; /* header height + hairline */
}

@media (max-width: 768px) {
    .header-offset {
        height: 69px;
    }
}
