/* ═══════════════════════════════════════════════════════════
   SHARED STYLES - Wspólne dla wszystkich stron
   Nawigacja, footer, page-loader, dark mode, typografia bazowa
═══════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────
   CSS Variables
───────────────────────────────────────────────────────── */
:root {
    --v3-charcoal: #2d2d2d;
    --v3-warm-gray: #4a4a4a;
    --v3-terracotta: #c4745a;
    --v3-terracotta-dark: #a85d46;
    --v3-cream: #faf8f5;
    --v3-sand: #e8e4df;
    --v3-forest: #3d5a4c;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Outfit', sans-serif;
}

/* ─────────────────────────────────────────────────────────
   Base
───────────────────────────────────────────────────────── */

/* Prevent horizontal overflow on all pages */
html,
body {
    overflow-x: hidden;
}

/* Brand name — allow wrap on very small screens to prevent navbar overflow */
@media (max-width: 400px) {
    .brand-v-b__name,
    .brand-v-b__eyebrow {
        white-space: normal;
        line-height: 1.3;
    }
}

.index-v3 {
    font-family: var(--font-body);
    background: var(--v3-cream);
    color: var(--v3-charcoal);
}

.index-v3 p {
    font-size: 1.1rem;
    line-height: 1.85;
    color: var(--v3-warm-gray);
    font-weight: 300;
}

.index-v3 h1, .index-v3 h2, .index-v3 h3, .index-v3 h4, .index-v3 h5 {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--v3-charcoal);
}

/* ─────────────────────────────────────────────────────────
   Navigation — site-navbar
───────────────────────────────────────────────────────── */

/* Outer nav container (fixed-top from Bootstrap kept via class) */
.site-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
}

.index-v3 .navbar-top {
    background: var(--v3-charcoal) !important;
    color: #fff;
    font-size: 0.8rem;
}

@media (max-width: 767px) {
    .index-v3 .navbar-top {
        font-size: 0.7rem;
    }

    .index-v3 .navbar-top svg {
        width: 14px;
        height: 14px;
    }
}

.index-v3 .navbar-top a,
.index-v3 .navbar-top span {
    color: #fff !important;
    opacity: 0.9;
}

.index-v3 .navbar-top a:hover,
.index-v3 .navbar-top a:focus {
    opacity: 1;
    text-decoration: underline;
}

.index-v3 .navbar-bottom {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    min-height: 70px;
    display: flex;
    align-items: center;
}

.index-v3 .navbar-bottom > .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Affix — box-shadow po zjechaniu */
.index-v3 .site-navbar.affix .navbar-bottom {
    background: #fff;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.index-v3 .navbar-brand {
    padding: 0;
    margin: 0 !important;
    display: flex;
    align-items: center;
}

/* ── Desktop nav list ───────────────────────────────────── */
.desktop-nav {
    display: none; /* ukryte na mobile */
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 0.25rem;
}

@media (min-width: 1200px) {
    .desktop-nav {
        display: flex;
        gap: 0.5rem;
    }
}

.desktop-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    color: var(--v3-charcoal);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
    min-height: 44px; /* WCAG 2.5.5: min touch target */
}

.desktop-nav__link:hover {
    color: var(--v3-terracotta);
    background: rgba(196, 116, 90, 0.06);
}

.desktop-nav__link:focus-visible {
    color: var(--v3-terracotta);
    background: rgba(196, 116, 90, 0.06);
    outline: 2px solid var(--v3-terracotta);
    outline-offset: 2px;
}

.desktop-nav__link.active {
    color: var(--v3-terracotta);
}

/* Chevron rotation when dropdown open */
.desktop-nav__toggle[aria-expanded="true"] .desktop-nav__arrow {
    transform: rotate(180deg);
}
.desktop-nav__arrow {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* ── Desktop dropdown ───────────────────────────────────── */
.desktop-nav__item--dropdown {
    position: relative;
}

.desktop-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 300px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border-top: 2px solid var(--v3-terracotta);
    list-style: none;
    padding: 0.375rem 0 0.5rem;
    padding-top: calc(0.375rem + 4px); /* wizualny odstęp bez szczeliny powietrznej */
    z-index: 1050;
    border-radius: 0 0 4px 4px;
}

.desktop-nav__item--dropdown.is-open > .desktop-dropdown,
.desktop-nav__item--dropdown:hover > .desktop-dropdown {
    display: block;
}

.desktop-dropdown__item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--v3-charcoal);
    text-decoration: none;
    font-family: var(--font-body);
    transition: background 0.15s, color 0.15s;
}

.desktop-dropdown__item:hover {
    background: var(--v3-cream);
    color: var(--v3-terracotta);
}

.desktop-dropdown__item:focus-visible {
    background: var(--v3-cream);
    color: var(--v3-terracotta);
    outline: 2px solid var(--v3-terracotta);
    outline-offset: -2px;
}

.desktop-dropdown__item.active {
    color: var(--v3-terracotta);
}

.dropdown-item__icon {
    flex-shrink: 0;
    width: 22px;
    color: var(--v3-terracotta);
    margin-top: 2px;
}

.dropdown-item__content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dropdown-item__title {
    font-size: 0.9375rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.dropdown-item__desc {
    font-size: 0.8125rem;
    color: var(--v3-warm-gray);
}

/* ── Brand typograficzny — Wersja B ── */
.brand-v-b {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.22rem;
    text-decoration: none;
    line-height: 1;
}

.brand-v-b__eyebrow {
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: #a85d46; /* #c4745a fails 4.5:1 on white; #a85d46 = 4.85:1 ✓ WCAG AA */
    line-height: 1;
    white-space: nowrap;
}

.brand-v-b__name {
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--v3-warm-gray);
    line-height: 1;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.brand-v-b:hover .brand-v-b__name {
    color: var(--v3-terracotta);
}

body.dark-mode .brand-v-b__name {
    color: rgba(232, 228, 223, 0.75);
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--v3-charcoal);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, color 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(15deg);
    color: var(--v3-terracotta);
}

.theme-toggle svg {
    transition: opacity 0.3s ease;
}

/* ─────────────────────────────────────────────────────────
   Mobile Controls (hamburger + theme toggle — widoczne < 1200px)
───────────────────────────────────────────────────────── */
.mobile-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

@media (min-width: 1200px) {
    .mobile-controls {
        display: none;
    }
}

/* Hamburger button */
.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    color: var(--v3-charcoal);
    transition: background 0.2s;
}

.mobile-menu-btn:hover {
    background: rgba(45, 45, 45, 0.07);
}

.mobile-menu-btn:focus-visible {
    outline: 3px solid var(--v3-terracotta);
    outline-offset: 2px;
}

/* Hamburger lines */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 22px;
    height: 22px;
}

.hamburger__line {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
    transform-origin: center;
}

/* Animacja X gdy menu otwarte */
.mobile-menu-btn[aria-expanded="true"] .hamburger__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-menu-btn[aria-expanded="true"] .hamburger__line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.mobile-menu-btn[aria-expanded="true"] .hamburger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ─────────────────────────────────────────────────────────
   Mobile Panel (wysuwana szuflada)
───────────────────────────────────────────────────────── */
.mobile-panel {
    position: fixed;
    inset: 0;
    z-index: 1055;
    visibility: hidden;
    pointer-events: none;
}

.mobile-panel.is-open {
    visibility: visible;
    pointer-events: auto;
}

/* Backdrop */
.mobile-panel__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    cursor: pointer;
}

.mobile-panel.is-open .mobile-panel__backdrop {
    background: rgba(0, 0, 0, 0.55);
}

/* Szuflada */
.mobile-panel__drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 90vw);
    background: var(--v3-charcoal);
    color: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mobile-panel.is-open .mobile-panel__drawer {
    transform: translateX(0);
}

/* Nagłówek szuflady */
.mobile-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.mobile-panel__heading {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.mobile-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    margin: -0.5rem -0.5rem -0.5rem 0;
}

.mobile-panel__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.mobile-panel__close:focus-visible {
    outline: 3px solid var(--v3-terracotta);
    outline-offset: 2px;
}

/* ── Mobilna lista nawigacji ───────────────────────────── */
.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    flex: 1;
}

.mobile-nav-list__item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.mobile-nav-list__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.9rem 1.25rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    min-height: 44px;
    transition: color 0.2s, background 0.2s;
}

.mobile-nav-list__link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
}

.mobile-nav-list__link:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: -2px;
}

.mobile-nav-list__link.active {
    color: var(--v3-terracotta);
}

/* Chevron w przycisku akordeonu */
.accordion-chevron {
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.mobile-nav-list__accordion-btn[aria-expanded="true"] .accordion-chevron {
    transform: rotate(180deg);
}

/* Podmenu akordeonu */
.mobile-nav-list__submenu {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0 0.5rem 0;
    background: rgba(0, 0, 0, 0.15);
}

.mobile-nav-list__submenu[hidden] {
    display: none;
}

.mobile-nav-list__sublink {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem 0.65rem 2rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    min-height: 44px;
    transition: color 0.2s;
}

.mobile-nav-list__sublink:hover {
    color: #fff;
}

.mobile-nav-list__sublink:focus-visible {
    color: #fff;
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: -2px;
}

.mobile-nav-list__sublink.active {
    color: var(--v3-terracotta);
}

/* ─────────────────────────────────────────────────────────
   Page Loader
───────────────────────────────────────────────────────── */
.page-loader {
    position: fixed;
    inset: 0;
    background: var(--v3-cream);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--v3-sand);
    border-top-color: var(--v3-terracotta);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────────────────
   Footer
───────────────────────────────────────────────────────── */
.footer-v3 {
    background: var(--v3-charcoal);
    color: rgba(255, 255, 255, 0.7);
    padding: 5rem 0 2rem;
}

.footer-v3 p {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

.footer-v3 .footer-heading {
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.footer-v3 a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-v3 a:hover {
    color: var(--v3-terracotta);
}

.footer-v3__bottom {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}

@media (min-width: 992px) {
    .footer-v3__bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.footer-v3__copy {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6); /* opacity:0.5 na rgba(255,255,255,0.7) dawało 3.1:1; rgba(255,255,255,0.6) daje ~6.3:1 ✓ WCAG AA */
}

/* ─────────────────────────────────────────────────────────
   Buttons (shared base)
───────────────────────────────────────────────────────── */
.btn-v3 {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-v3--primary {
    background: var(--v3-terracotta);
    color: #fff;
}

.btn-v3--primary:hover {
    background: var(--v3-terracotta-dark);
    color: #fff;
}

/* ─────────────────────────────────────────────────────────
   Accessibility
───────────────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--v3-terracotta-dark); /* #a85d46 — 4.85:1 na białym ✓ WCAG AA */
    color: #fff;
    padding: 1rem 2rem;
    z-index: 100000;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--v3-charcoal);
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--v3-terracotta);
    outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

a {
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* WCAG 1.4.3: Prevent AOS opacity:0 pre-animation state from failing contrast checks.
   Elements animate via transform only; opacity stays 1 so content is always readable. */
[data-aos] {
    opacity: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .page-loader {
        transition: none;
    }

    .loader-spinner {
        animation: none;
    }

    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ─────────────────────────────────────────────────────────
   Dark Mode
───────────────────────────────────────────────────────── */
body.dark-mode {
    --v3-cream: #1a1a1a;
    --v3-sand: #242424;
    --v3-charcoal: #e8e4df;
    --v3-warm-gray: #b0b0b0;
}

body.dark-mode.index-v3 {
    background: #1a1a1a;
    color: #e8e4df;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5 {
    color: #fff;
}

/* Navbar-top stays dark */
body.dark-mode .navbar-top {
    background: #1a1a1a !important;
}

body.dark-mode .navbar-bottom {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
}

body.dark-mode .site-navbar.affix .navbar-bottom {
    background: #1a1a1a;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* Desktop nav — dark mode */
body.dark-mode .desktop-nav__link {
    color: #e8e4df;
}

body.dark-mode .desktop-nav__link:hover,
body.dark-mode .desktop-nav__link:focus-visible {
    color: var(--v3-terracotta);
    background: rgba(255, 255, 255, 0.06);
}

body.dark-mode .desktop-dropdown {
    background: #242424;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

body.dark-mode .desktop-dropdown__item {
    color: #e8e4df;
}

body.dark-mode .desktop-dropdown__item:hover,
body.dark-mode .desktop-dropdown__item:focus-visible {
    background: #333;
    color: var(--v3-terracotta);
}

body.dark-mode .dropdown-item__desc {
    color: rgba(232, 228, 223, 0.7);
}

/* Mobile controls — dark mode */
body.dark-mode .mobile-menu-btn {
    color: #e8e4df;
}

body.dark-mode .theme-toggle {
    color: #e8e4df;
}

body.dark-mode .page-loader {
    background: #1a1a1a;
}

body.dark-mode .loader-spinner {
    border-color: #333;
    border-top-color: var(--v3-terracotta);
}

body.dark-mode .footer-v3 {
    background: #0f0f0f;
}

body.dark-mode .eyebrow {
    color: #e07a5f;
}

/* ─────────────────────────────────────────────────────────
   Map placeholder (lazy Google Maps consent)
───────────────────────────────────────────────────────── */
.map-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
    background: var(--v3-sand);
}

.map-placeholder__icon svg {
    width: 36px;
    height: 36px;
    color: var(--v3-warm-gray);
}

.map-placeholder__address {
    font-size: 1rem;
    font-weight: 500;
    color: var(--v3-charcoal);
    margin: 0;
}

.map-placeholder__note {
    font-size: 0.8rem;
    color: var(--v3-warm-gray);
    max-width: 380px;
    line-height: 1.5;
    margin: 0;
}

.map-placeholder__btn {
    margin-top: 0.5rem;
    background: var(--v3-terracotta-dark); /* #a85d46 — 4.85:1 na białym ✓ WCAG AA */
    color: white;
    border: none;
    padding: 0.75rem 1.75rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.map-placeholder__btn:hover {
    background: var(--v3-charcoal);
}

.hero-b__photo-caption {
    font-family: var(--font-body);
    font-size: 0.65rem;
    color: #767676; /* opacity:0.55 na #4a4a4a dawało ~2.7:1; #767676 = 4.54:1 na kremowym ✓ WCAG AA */
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 1.25rem;
    padding-left: 2px;
}

