/* ═══════════════════════════════════════════════════════════
   M2 Legal – Premium Design System
   PHP 7.0 compatible (pure CSS + vanilla JS)
════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --brown:      #965b2c;
    --brown-lt:   #b8783e;
    --brown-dk:   #6b3f1c;
    --cream:      #faf7f2;
    --off-white:  #ffffff;
    --ink:        #111111;
    --ink-50:     #555555;
    --ink-20:     #aaaaaa;
    --line:       rgba(150, 91, 44, 0.15);
    --dark-bg:    #0d1117;
    --dark-card:  rgba(255,255,255,0.05);
    --easing:     cubic-bezier(0.4, 0, 0.2, 1);
    --speed:      0.5s;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Outfit', sans-serif;
    background: var(--dark-bg);
    color: var(--ink);
    overflow: hidden;
    line-height: 1.65;
}

/* ────────────────────────────────
   LOGO CONTAINER + THEME SWITCHING
──────────────────────────────── */
#logo-container {
    position: fixed;
    top: 48px;
    left: 60px;
    z-index: 1000;
    transition: all 0.4s var(--easing);
}
/* show/hide by data-theme - FORCE SINGLE VISIBILITY */
#logo-container svg { display: none !important; }
#logo-container[data-theme="dark"]  .logo-dark  { display: block !important; }
#logo-container[data-theme="light"] .logo-light { display: block !important; }

.logo-svg { 
    display: block; 
    transition: opacity 0.3s ease;
    height: 100%;
    width: auto;
}

/* ────────────────────────────────
   BOOK SCROLL ENGINE
──────────────────────────────── */
#book-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
#book-container::-webkit-scrollbar { display: none; }

/* ────────────────────────────────
   SECTIONS BASE
──────────────────────────────── */
.section {
    flex: 0 0 100vw;
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}
.section--with-logo-clearance .section-inner {
    padding-top: 80px; /* Push content down to avoid overlapping with the fixed logo */
}
/* Spine line pattern – bookshelf motif */
.section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        90deg,
        var(--line) 0, var(--line) 1px,
        transparent 1px, transparent 80px
    );
    pointer-events: none;
    z-index: 0;
}

.section-dark  { background: var(--dark-bg); }
.section-light { background: var(--off-white); }
.section-cream { background: var(--cream); }

/* section content layer above ::after */
.hero-content,
.section-inner { position: relative; z-index: 10; width: 100%; }

/* ────────────────────────────────
   FADE-IN ON ARRIVE
──────────────────────────────── */
.section-inner,
.hero-content {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.65s var(--easing), transform 0.65s var(--easing);
}
.section.in-view .section-inner,
.section.in-view .hero-content {
    opacity: 1;
    transform: translateY(0);
}

/* ────────────────────────────────
   HERO SECTION
──────────────────────────────── */
#uvod { padding: 0; }

/* half-screen photo on right */
.hero-image-panel {
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}
.hero-image-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
    opacity: 0.35;
    filter: grayscale(0.2) contrast(1.1);
    transition: transform 10s linear;
}
#uvod.in-view .hero-image-panel img {
    transform: scale(1.1);
}
.hero-image-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, 
        var(--dark-bg) 0%, 
        var(--dark-bg) 15%, 
        transparent 65%, 
        rgba(13, 17, 23, 0.4) 100%
    );
    z-index: 2;
}

/* grain overlay */
#uvod::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E") center/200px;
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

/* layout: left hero text | right FAQ panel */
.hero-content {
    display: grid;
    grid-template-columns: 1fr 440px;
    gap: 6vw;
    min-height: 100vh;
    height: auto;
    padding: 180px calc(5vw + 280px) 60px 10vw; /* Logo & Sidebar clearance */
    align-items: center;
}
@media (max-width: 1300px) {
    .hero-content { padding-left: 15vw; }
}
@media (max-height: 900px), (max-width: 1400px) {
    .hero-content {
        padding-top: 140px;
        padding-bottom: 40px;
        padding-right: calc(4vw + 260px);
        gap: 4vw;
        grid-template-columns: 1fr 400px;
    }
    .eyebrow { margin-bottom: 1rem; }
    h1 { font-size: clamp(3rem, 5.5vw, 5.5rem); margin-bottom: 1.2rem; }
    .hero-quote { padding: 8px 0 8px 20px; margin-bottom: 1.2rem; font-size: 0.95rem; }
    .hero-desc { font-size: 1.05rem; margin-bottom: 1.8rem; line-height: 1.6; }
    .hero-faq { height: 350px; padding: 30px; }
    .hero-menu-item { padding: 10px 20px; font-size: 0.75rem; }
}

/* ── LEFT: hero text ── */
.hero-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--brown-lt);
    margin-bottom: 1.6rem;
}
.eyebrow::before {
    content: '';
    display: block;
    width: 36px;
    height: 2px;
    background: var(--brown);
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(4rem, 7.5vw, 8rem);
    font-weight: 900;
    color: #fff;
    line-height: 1;
    margin-bottom: 2rem;
}
h1 em { font-style: italic; color: var(--brown-lt); }

.hero-quote {
    border-left: 4px solid var(--brown);
    padding: 12px 0 12px 28px;
    margin-bottom: 2rem;
    font-style: italic;
    color: rgba(255,255,255,0.6);
    font-size: 1.1rem;
    line-height: 1.7;
}
.hero-quote cite {
    display: block;
    margin-top: 10px;
    font-style: normal;
    font-size: 0.9rem;
    color: var(--brown-lt);
    letter-spacing: 1.5px;
}

.hero-desc {
    font-size: 1.25rem;
    font-weight: 300;
    color: rgba(255,255,255,0.65);
    max-width: 580px;
    margin-bottom: 3rem;
    line-height: 1.85;
}

/* ── Hero floating FAQ (Slider) ── */
.hero-faq {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(150,91,44,0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    height: 400px;
    z-index: 10;
    transition: transform 0.4s ease;
}
.hero-faq:hover { transform: translateY(-5px); border-color: rgba(150,91,44,0.3); }

.faq-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.faq-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--brown-lt);
}
.faq-dots { display: flex; gap: 8px; }
.faq-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none; cursor: pointer;
    transition: all 0.3s;
}
.faq-dot.active { background: var(--brown); transform: scale(1.3); }

.faq-slider { 
    position: relative; 
    flex: 1;
    min-height: 200px; /* Ensure enough height for content */
}
.faq-slide {
    position: absolute;
    top: 0; left: 0; right: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(30px);
}
.faq-slide.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}
.faq-slide h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 1.2rem;
    color: #fff;
    line-height: 1.2;
}
.faq-slide p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.6);
}

/* ── Hero inline menu ── */
.hero-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.hero-menu-item {
    display: inline-block;
    padding: 12px 26px;
    border: 1px solid rgba(150,91,44,0.5);
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 2px;
    transition: background var(--speed) var(--easing),
                color var(--speed) var(--easing),
                border-color var(--speed) var(--easing),
                transform 0.3s;
}
.hero-menu-item:hover {
    background: var(--brown);
    border-color: var(--brown);
    color: #fff;
    transform: translateY(-2px);
}

/* ── RIGHT: FAQ rotating panel ── */
.hero-faq {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 4px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.faq-header {
    margin-bottom: 20px;
}
.faq-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--brown-lt);
    margin-bottom: 14px;
}
.faq-dots {
    display: flex;
    gap: 8px;
}
.faq-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid var(--brown);
    background: transparent;
    cursor: pointer;
    transition: background 0.3s, width 0.3s;
    padding: 0;
}
.faq-dot.active {
    background: var(--brown);
    width: 22px;
    border-radius: 4px;
}

.faq-slider {
    position: relative;
    flex: 1;
}
.faq-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.55s var(--easing), transform 0.55s var(--easing);
    pointer-events: none;
}
.faq-slide.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    position: relative;
}
.faq-slide h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 14px;
}
.faq-slide p {
    font-size: 0.95rem;
    font-weight: 300;
    color: rgba(255,255,255,0.55);
    line-height: 1.8;
    max-width: none;
}

/* ────────────────────────────────
   INNER SECTIONS
──────────────────────────────── */
.section-inner { 
    padding: 200px calc(5vw + 280px) 60px 10vw !important; /* Force logo & sidebar clearance */
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--brown);
    margin-bottom: 1rem;
}
.section-label::before {
    content: '';
    display: block;
    width: 28px;
    height: 2px;
    background: var(--brown);
}

h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 3.2vw, 3.2rem);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.15;
    margin-bottom: 1.5rem;
}
h2 em { font-style: italic; color: var(--brown); }

.body-text {
    font-size: 1.05rem;
    font-weight: 300;
    color: var(--ink-50);
    max-width: 600px;
    line-height: 1.85;
}

/* ── O NÁS split ── */
.split-layout {
    display: grid;
    grid-template-columns: 55% 1fr;
    gap: 7vw;
    align-items: center;
}
.split-image {
    position: relative;
}
.split-image img {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    border-radius: 2px;
    filter: sepia(0.15);
}
.split-image::before {
    content: '';
    position: absolute;
    top: -16px; left: -16px; right: 16px; bottom: 16px;
    border: 2px solid var(--brown);
    border-radius: 2px;
    z-index: -1;
}

/* ── TÍM ── */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 1rem;
    max-width: 1400px;
}
.member-card {
    border-radius: 2px;
    overflow: hidden;
    background: var(--cream);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    transition: box-shadow 0.4s;
}
.member-card:hover { box-shadow: 0 10px 40px rgba(0,0,0,0.1); }

.member-photo-wrap {
    width: 100%;
    aspect-ratio: 1/1; /* Square for more compactness */
    overflow: hidden;
    position: relative;
}
.member-photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    filter: grayscale(1);
    transition: filter 0.6s var(--easing), transform 0.6s var(--easing);
    transform: scale(1.04);
}
.member-card:hover .member-photo-wrap img {
    filter: grayscale(0) sepia(0.15);
    transform: scale(1);
}
.member-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 50px 16px 16px;
    background: linear-gradient(to top, rgba(10,5,0,0.8), transparent);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s, transform 0.4s;
}
.member-card:hover .member-overlay { opacity: 1; transform: translateY(0); }
.member-overlay h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 3px;
}
.member-overlay p {
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--brown-lt);
    max-width: none;
}
.member-info { padding: 12px; }
.member-name-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
}
.member-name-row h3 {
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    color: var(--ink);
    margin-bottom: 2px;
}
.member-role {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--brown);
}
.member-role--partner { color: var(--ink-50); }
.member-bio {
    font-size: 0.78rem; /* Smaller for 4 columns */
    color: var(--ink-50);
    line-height: 1.5;
    max-width: none;
}

/* ── PARTNER badge ── */
.member-card--partner .member-photo-wrap::after {
    content: 'Spolupracujúci';
    position: absolute;
    top: 12px; right: 12px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.7);
    color: var(--brown-lt);
    font-size: 0.62rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 2px;
}

/* ── SERVICES ── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    margin-top: 1.5rem;
}
.service-item {
    padding: 28px 24px;
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
    transition: background 0.4s;
}
.service-item::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 3px;
    background: var(--brown);
    transition: width 0.5s var(--easing);
}
.service-item:hover::after { width: 100%; }
.service-item:hover { background: #fff; }
.service-num {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--line);
    line-height: 1;
    margin-bottom: 8px;
    transition: color 0.4s;
}
.service-item:hover .service-num { color: rgba(150,91,44,0.2); }
.service-item h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    color: var(--ink);
    margin-bottom: 8px;
}
.service-item p { font-size: 0.85rem; color: var(--ink-50); line-height: 1.6; max-width: none; }

/* ── NEWS / AKTUALITY ── */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 2rem;
}
.news-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.4s var(--easing), box-shadow 0.4s var(--easing);
    display: flex;
    flex-direction: column;
}
.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(150, 91, 44, 0.1);
}
.news-img {
    width: 100%;
    aspect-ratio: 16/8;
    overflow: hidden;
    background: var(--cream);
}
.news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--easing);
}
.news-card:hover .news-img img {
    transform: scale(1.05);
}
.news-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.news-date {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--brown-lt);
    margin-bottom: 12px;
}
.news-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: var(--ink);
    margin-bottom: 12px;
    line-height: 1.4;
}
.news-card p {
    font-size: 0.9rem;
    color: var(--ink-50);
    line-height: 1.7;
    margin-bottom: 20px;
}
.news-more {
    margin-top: auto;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--brown);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.news-more::after {
    content: '→';
    transition: transform 0.3s;
}
.news-more:hover::after {
    transform: translateX(5px);
}

/* ── CONTACT ── */
#kontakt h2 { color: #fff; }
/* ── CONTACT GRID ── */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 4vw;
    margin-top: 2rem;
}
.branches-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.branch-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s var(--easing);
}
.branch-card:hover {
    transform: translateY(-5px);
    border-color: var(--brown-lt);
}
.branch-info {
    padding: 30px;
}
.branch-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--brown-lt);
    margin-bottom: 25px;
}
.contact-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}
.contact-row i {
    color: var(--brown-lt);
    font-size: 1.1rem;
    margin-top: 3px;
    width: 20px;
    text-align: center;
}
.contact-row .label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 4px;
}
.contact-row .value {
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.5;
}
.contact-row .value a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}
.contact-row .value a:hover {
    color: var(--brown-lt);
}
.contact-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.branch-map-small {
    height: 180px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    filter: grayscale(1) invert(1) contrast(0.8) brightness(0.8);
    transition: filter 0.5s;
}
.branch-card:hover .branch-map-small {
    filter: grayscale(0) invert(0) contrast(1) brightness(1);
}

.central-card {
    background: rgba(150, 91, 44, 0.05);
    border: 1px solid rgba(150, 91, 44, 0.2);
    padding: 40px;
    border-radius: 8px;
    height: 100%;
}
.central-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}
.central-cta {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--line);
}
.central-cta p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
}

/* ────────────────────────────────
   SIDEBAR BOOKMARK NAVIGATION
   – vždy viditeľné, neschovava sa
──────────────────────────────── */
#sidebar-nav {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bookmark {
    display: block;
    padding: 10px 20px 10px 14px;
    background: rgba(13, 17, 23, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    border-radius: 3px 0 0 3px;
    border-left: 3px solid rgba(150, 91, 44, 0.3);
    white-space: nowrap;
    /* NEVER hide off-screen */
    transform: none !important;
    transition: background 0.3s, color 0.3s, border-left-color 0.3s;
}

.bookmark:hover {
    background: rgba(13, 17, 23, 0.97);
    color: #ffffff;
    border-left-color: var(--brown);
}

.bookmark.active {
    background: rgba(150, 91, 44, 0.92);
    color: #ffffff;
    border-left-color: var(--brown-dk);
}

.bookmark-admin {
    color: var(--brown-lt) !important;
    border-left: 2px solid var(--brown-lt) !important;
    margin-top: 20px;
}

/* ────────────────────────────────
   PAGE NUMBER
──────────────────────────────── */
.page-number {
    position: absolute;
    bottom: 30px;
    right: 50px;
    font-family: 'Playfair Display', serif;
    font-size: 6rem;
    font-weight: 900;
    opacity: 0.04;
    line-height: 1;
    pointer-events: none;
    z-index: 0;
    color: #fff;
}
.section-light .page-number,
.section-cream .page-number { color: var(--ink); }

/* ────────────────────────────────
   PROGRESS BAR
──────────────────────────────── */
#progress-bar {
    position: fixed;
    bottom: 0; left: 0;
    height: 3px;
    background: var(--brown);
    z-index: 999;
    transition: width 0.1s linear;
    width: 0;
}

/* ────────────────────────────────
   RESPONSIVE (Tablet & Mobile ≤ 1100px)
──────────────────────────────── */
@media (max-width: 1100px) {
    body { overflow-y: auto; overflow-x: hidden; }

    #book-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
        scroll-snap-type: none;
    }

    .section, #uvod {
        flex: none;
        width: 100%;
        height: auto;
        min-height: auto; /* Removed 100svh to prevent unnecessary long sections */
        padding: 100px 24px 60px !important; 
        align-items: flex-start;
        display: block;
    }

    h1 {
        font-size: clamp(2rem, 9vw, 3.2rem) !important;
        margin-bottom: 1.2rem;
        line-height: 1.1;
        word-wrap: break-word;
    }
    h2 {
        font-size: clamp(1.8rem, 8vw, 2.8rem) !important;
        margin-bottom: 1.2rem !important;
        line-height: 1.1 !important;
    }

    /* Force visibility on mobile (bypass JS animations) and fix huge padding */
    .section-inner, .hero-content {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .section-inner {
        padding: 0 !important; /* Remove the 200px top padding from desktop */
    }

    /* Fix: images too large/blurry on tablet */
    .split-image {
        max-width: 600px;
        margin: 40px auto 0;
    }
    .split-image img {
        height: auto;
        max-height: 50vh;
        object-fit: contain;
    }
    .member-photo-wrap {
        max-width: 280px; /* Smaller photo on mobile */
        aspect-ratio: 1/1;
        margin: 0 auto;
    }
    .team-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
        margin: 0 auto;
    }

    #logo-container { 
        position: fixed;
        left: 0; top: 0; 
        right: 0;
        height: 85px;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: none;
        display: flex;
        align-items: center;
        padding: 0 24px;
        width: 100%;
        z-index: 2000;
    }
    #logo-container .logo-svg {
        height: 38px !important;
        width: 130px !important; /* Fixed width to prevent squashing */
        flex: none !important;
    }

    .hero-image-panel {
        height: 60vh;
        min-height: 400px;
        position: absolute; /* Full width behind content */
        top: 0; left: 0; right: 0;
        z-index: 1;
    }
    .hero-image-panel img {
        height: 100%;
        object-fit: cover;
    }
    .hero-image-panel::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, var(--dark-bg) 10%, transparent 90%),
                    linear-gradient(to bottom, var(--dark-bg) 0%, transparent 30%);
        z-index: 3;
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        height: auto;
        padding: 0 10px;
        gap: 30px;
    }
    .hero-menu {
        display: none !important;
    }

    /* navigation bar */
    #sidebar-nav {
        top: auto; bottom: 0;
        left: 0; right: 0;
        transform: none;
        flex-direction: row;
        height: 65px; /* Slightly shorter */
        background: rgba(13, 17, 23, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(150,91,44,0.4);
        padding: 0 10px;
        gap: 4px;
        overflow-x: auto;
        z-index: 5000;
        justify-content: flex-start; /* Better for scrolling */
        -webkit-overflow-scrolling: touch;
    }
    .bookmark {
        flex: 0 0 auto; /* Don't stretch */
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.62rem;
        padding: 0 12px;
        border-left: none !important;
        border-bottom: 3px solid transparent;
        border-radius: 0;
        min-width: auto;
    }
    .bookmark.active {
        background: rgba(150,91,44,0.2);
        border-bottom-color: var(--brown);
    }

    .bookmark-admin {
        margin-top: 0 !important;
        border-left: none !important;
        border-bottom: 3px solid var(--brown-lt) !important;
    }

    #contact-bubble {
        bottom: 95px !important; /* Move above bottom nav */
        right: 20px !important;
        width: 55px !important;
        height: 55px !important;
    }

    .split-layout, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
    .team-grid { grid-template-columns: 1fr; gap: 20px; }
    .services-grid, .news-grid { grid-template-columns: 1fr; gap: 15px; }
    
    .body-text { font-size: 1rem; }
    
    .split-image img { aspect-ratio: 16/9; }
}

/* ────────────────────────────────
   CONTACT BUBBLE
──────────────────────────────── */
#contact-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--brown);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1500;
    box-shadow: 0 10px 30px rgba(150,91,44,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--easing);
}
#contact-bubble:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--brown-lt);
    box-shadow: 0 15px 40px rgba(150,91,44,0.5);
}
#contact-bubble svg {
    width: 28px;
    height: 28px;
}

/* ────────────────────────────────
   MODAL OVERLAY & WINDOW
──────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--easing);
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-window {
    background: var(--off-white);
    width: 100%;
    max-width: 500px;
    padding: 60px 50px;
    border-radius: 4px;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.5s var(--easing);
    box-shadow: 0 30px 100px rgba(0,0,0,0.5);
}
.modal-window--large {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-overlay.active .modal-window {
    transform: translateY(0);
}

.news-detail-body {
    margin-top: 20px;
}

.modal-close {
    position: absolute;
    top: 25px;
    right: 25px;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--ink-20);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}
.modal-close:hover { color: var(--brown); }

.modal-header { margin-bottom: 30px; }
.modal-header h2 { margin-bottom: 10px; }
.modal-header p { color: var(--ink-50); font-size: 0.95rem; }

/* ── Contact Form inside Modal ── */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 16px 20px;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 2px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    transition: all 0.3s;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brown);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(150,91,44,0.05);
}

@media (max-width: 600px) {
    .modal-window {
        max-width: none;
        height: 100%;
        border-radius: 0;
        padding: 80px 24px 40px;
        overflow-y: auto;
    }
}
