/* ── Theme tokens ─────────────────────────────────────────────────────────── */
:root, [data-theme="light"] {
    --bg:        #f3f0ec;
    --surface:   #ffffff;
    --surface2:  #ece9e5;
    --border:    #dad7d2;
    --text:      #1a1614;
    --text2:     #8a8582;
    --text3:     #c5c2be;
    --accent:    #b8922a;
    --accent-h:  #c9a540;
    --nav-bg:    rgba(243, 240, 236, 0.88);
    --danger:    #e05555;
    --warning:   #c77d1a;
    --success:   #5a9e7a;
}

[data-theme="dark"] {
    --bg:        #0b0b0b;
    --surface:   #141414;
    --surface2:  #1f1f1f;
    --border:    #2a2a2a;
    --text:      #ede9e3;
    --text2:     #6b6866;
    --text3:     #3a3836;
    --accent:    #c9a84c;
    --accent-h:  #d9bc72;
    --nav-bg:    rgba(11, 11, 11, 0.88);
    --danger:    #e05555;
    --warning:   #e0a23a;
    --success:   #5a9e7a;
}

/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    transition: background 0.25s, color 0.25s;
    min-height: 100dvh;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
}

body > .page { flex: 1 1 auto; }

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

button {
    font-family: inherit;
    cursor: pointer;
    color: inherit;
    background: none;
    border: none;
    padding: 0;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 9px 12px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Focus visible */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

/* Hide scrollbar in horizontal pill bars */
.scroll-x-no-bar { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.scroll-x-no-bar::-webkit-scrollbar { display: none; }

/* ── Typography helpers ───────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Urbanist', system-ui, sans-serif;
}

.font-display {
    font-family: 'Urbanist', system-ui, sans-serif;
    letter-spacing: 0.03em;
}

.text-muted { color: var(--text2); }
.text-faint { color: var(--text3); }

/* ── Top navigation bar (public) ──────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    height: 60px;
    padding: 0 clamp(16px, 4vw, 48px);
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    gap: 14px;
}

.topbar .brand {
    font-family: 'Urbanist', sans-serif;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: 0.03em;
    color: var(--text);
}

.topbar .brand-meta {
    font-size: 12px;
    color: var(--text2);
    letter-spacing: 0.03em;
}

.topbar .spacer { flex: 1; }

.topbar .link {
    background: none;
    border: none;
    color: var(--text2);
    font-size: 13px;
    padding: 6px 0;
}

.topbar .link:hover { color: var(--text); }

.theme-toggle {
    display: inline-flex;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 3px;
    gap: 2px;
}

.theme-toggle button {
    background: none;
    border: none;
    padding: 6px 12px;
    border-radius: 100px;
    color: var(--text2);
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.18s, background 0.18s;
    font-family: inherit;
}

.theme-toggle button:hover { color: var(--text); }

.theme-toggle button.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

[data-theme="dark"] .theme-toggle button.active { color: #1a1614; }

.topbar.compact { height: 56px; padding: 0 clamp(12px, 3vw, 28px); }
.topbar.compact .brand { font-size: 15px; font-weight: 700; }

.topbar .divider {
    width: 1px;
    height: 18px;
    background: var(--border);
    flex-shrink: 0;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-size: 13px;
    transition: opacity 0.15s, background 0.15s, border-color 0.15s;
    text-decoration: none;
}

.btn:hover { opacity: 0.88; }

.btn.primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 700;
}

.btn.danger {
    background: rgba(224, 85, 85, 0.08);
    color: var(--danger);
    border-color: rgba(224, 85, 85, 0.5);
}

.btn.warning {
    background: rgba(217, 145, 40, 0.14);
    color: var(--warning);
    border-color: rgba(217, 145, 40, 0.55);
    font-weight: 600;
}

.btn.ghost {
    background: transparent;
    border-color: var(--border);
}

.btn.sm { padding: 6px 12px; font-size: 12px; }

.btn[disabled], .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Page wrappers ────────────────────────────────────────────────────────── */
.page {
    background: var(--bg);
}

.container {
    padding: 0 clamp(16px, 4vw, 48px) 60px;
}

/* ── Home grid (gallery cards) ───────────────────────────────────────────── */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: clamp(12px, 2vw, 24px);
    padding: 8px clamp(12px, 3vw, 48px) 60px;
}

.gallery-card {
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: block;
    color: inherit;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.gallery-card:hover .card-cover { transform: scale(1.05); }

.card-cover-wrap {
    overflow: hidden;
    aspect-ratio: 3 / 2;
    background: var(--surface2);
    position: relative;
}

/* Category card = a slightly-tilted folder. When the category has an uploaded cover,
   the photo sits "taped" on the folder's front face; otherwise the folder is plain. */
.category-card { --cf: #ebc86f; --cf-d: #dcb64e; --cf-edge: #caa53f; }
.cat-folder { overflow: visible; background: transparent; }
.cat-folder .cf-tab {
    position: absolute; top: 8px; left: 16px; width: 42%; height: 20px;
    background: var(--cf-edge); border-radius: 10px 12px 0 0;
}
.cat-folder .cf-body {
    position: absolute; left: 8px; right: 8px; top: 22px; bottom: 10px;
    background: linear-gradient(180deg, var(--cf), var(--cf-d));
    border: 1px solid var(--cf-edge); border-radius: 6px 13px 13px 13px;
    box-shadow: 0 6px 13px rgba(0, 0, 0, 0.18);
}
.cat-folder .cf-lip {
    position: absolute; left: 18px; right: 18px; top: 30px; height: 7px;
    border-radius: 5px; background: rgba(255, 255, 255, 0.18);
}
.cat-folder .cf-photo {
    position: absolute; top: 38px; left: 26px; right: 26px; bottom: 24px;
    border: 5px solid #fff; border-radius: 3px;
    background-size: cover; background-position: center; background-color: #d8d4cc;
    box-shadow: 0 6px 13px rgba(0, 0, 0, 0.30); transform: rotate(-1.5deg);
}
.category-card:hover .cf-photo { transform: rotate(-1.5deg); }

/* Breadcrumb trail on category pages. */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text2);
    padding: 8px clamp(12px, 3vw, 48px) 0;
}

.breadcrumbs a {
    color: var(--text2);
    text-decoration: none;
}

.breadcrumbs a:hover { color: var(--text); text-decoration: underline; }
.breadcrumbs .sep { opacity: 0.5; }
.breadcrumbs .current { color: var(--text); font-weight: 600; }

/* Per-site logo in the topbar brand slot. */
.brand-logo {
    height: 28px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Minimal lightbox for virtual albums. */
.v-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.v-lb-img {
    max-width: 96vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 6px;
}

.v-lb-close,
.v-lb-download {
    position: absolute;
    top: 16px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.v-lb-close { right: 16px; }
.v-lb-download { left: 16px; }
.v-lb-close:hover,
.v-lb-download:hover { background: rgba(255, 255, 255, 0.25); }

.card-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card-body { padding: 12px 14px 14px; }

.card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.card-title {
    font-family: 'Urbanist', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-lock {
    font-size: 13px;
    flex-shrink: 0;
    opacity: 0.65;
}

.card-meta { font-size: 12px; color: var(--text2); line-height: 1.4; }

/* ── Empty / messages ─────────────────────────────────────────────────────── */
.empty-msg {
    padding: 60px 20px;
    text-align: center;
    color: var(--text2);
}

.empty-msg .title {
    font-family: 'Urbanist', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

/* ── Flash messages (TempData) ────────────────────────────────────────────── */
.flash {
    padding: 12px 16px;
    border-radius: 7px;
    margin-bottom: 14px;
    font-size: 13px;
    border: 1px solid transparent;
}

.flash.success {
    background: rgba(90, 158, 122, 0.1);
    color: var(--success);
    border-color: rgba(90, 158, 122, 0.35);
}

.flash.error {
    background: rgba(224, 85, 85, 0.08);
    color: var(--danger);
    border-color: rgba(224, 85, 85, 0.5);
}

.flash.warning {
    background: rgba(214, 158, 46, 0.12);
    color: #8a6300;
    border-color: rgba(214, 158, 46, 0.5);
}

.flash.warning a {
    color: inherit;
    font-weight: 700;
    margin-left: 6px;
    text-decoration: underline;
}

/* Skrij prazan validation summary (renderira se s klasom -valid kad nema grešaka). */
.validation-summary-valid { display: none; }

/* ── Site footer ──────────────────────────────────────────────────────────── */
.site-footer {
    padding: 18px clamp(16px, 4vw, 48px);
    text-align: center;
    color: var(--text2);
    font-size: 13px;
    letter-spacing: 0.04em;
    border-top: 1px solid var(--border);
    background: var(--surface2);
    flex-shrink: 0;
}

.site-footer a {
    color: var(--text);
    transition: color 0.15s;
}

.site-footer a:hover { color: var(--accent); }

.site-footer .footer-sep {
    margin: 0 10px;
    color: var(--text3);
}

/* ── About page ───────────────────────────────────────────────────────────── */
.about-content {
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(32px, 6vw, 72px) clamp(20px, 4vw, 32px);
    color: var(--text);
}

.about-content h1 {
    font-family: 'Urbanist', sans-serif;
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 800;
    margin-bottom: 22px;
    color: var(--text);
    letter-spacing: 0.01em;
}

.about-content h2 {
    font-family: 'Urbanist', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin: 36px 0 12px;
    color: var(--text);
    letter-spacing: 0.02em;
}

.about-content p {
    margin-bottom: 14px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
}

.about-content .lead {
    font-size: 17px;
    color: var(--text2);
    margin-bottom: 28px;
    line-height: 1.55;
}

.about-content .signature {
    margin-top: 48px;
    color: var(--text2);
    font-style: italic;
}

/* ── Contact form (na About stranici) ─────────────────────────────────────── */
.contact-form-wrap {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.contact-intro {
    margin-bottom: 22px;
    color: var(--text2);
    font-size: 14px;
}

.contact-form .field {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.contact-form .field label {
    font-size: 12px;
    color: var(--text2);
    margin-bottom: 5px;
    letter-spacing: 0.02em;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(184, 146, 42, 0.15);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    line-height: 1.5;
}

.contact-form .field-err {
    color: var(--danger);
    font-size: 12px;
    margin-top: 5px;
    min-height: 14px;
}

.contact-form .btn.primary {
    margin-top: 6px;
    width: auto;
    padding: 11px 22px;
}

/* Honeypot polje — ljudi ga ne smiju vidjeti, čitače ne moraju (aria-hidden). */
.hp-field {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ── Feedback FAB ─────────────────────────────────────────────────────────── */
.fab-feedback {
    position: fixed;
    right: clamp(14px, 3vw, 24px);
    bottom: clamp(14px, 3vw, 24px);
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.02em;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.fab-feedback:hover {
    background: var(--accent-h);
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

.fab-feedback-ico {
    font-size: 16px;
    line-height: 1;
}

@media (max-width: 540px) {
    .fab-feedback { padding: 11px 13px; }
    .fab-feedback-label { display: none; }
}

/* ── Feedback modal ───────────────────────────────────────────────────────── */
.fb-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.fb-modal[hidden] { display: none; }

.fb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.fb-dialog {
    position: relative;
    width: min(520px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    padding: 22px 22px 18px;
}

.fb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.fb-head h2 {
    font-family: 'Urbanist', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.fb-close {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    color: var(--text2);
    font-size: 16px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.fb-close:hover {
    background: var(--surface2);
    color: var(--text);
}

.fb-intro {
    color: var(--text2);
    font-size: 13px;
    margin-bottom: 14px;
    line-height: 1.5;
}

.fb-flash {
    padding: 10px 14px;
    border-radius: 7px;
    margin-bottom: 12px;
    font-size: 13px;
    border: 1px solid transparent;
}

.fb-flash.success {
    background: rgba(90, 158, 122, 0.1);
    color: var(--success);
    border-color: rgba(90, 158, 122, 0.35);
}

.fb-flash.error {
    background: rgba(224, 85, 85, 0.08);
    color: var(--danger);
    border-color: rgba(224, 85, 85, 0.5);
}

.fb-modal .field {
    margin-bottom: 12px;
}

.fb-modal .field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 5px;
    letter-spacing: 0.02em;
}

.fb-modal textarea,
.fb-modal input[type="email"] {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 14px;
    color: var(--text);
}

.fb-modal textarea {
    resize: vertical;
    min-height: 96px;
    line-height: 1.5;
}

.fb-optional {
    color: var(--text3);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.fb-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
}
