/* ════════════════════════════════════════════════════════════════
   Nástěnka Hrabová – custom CSS
   Moderní, čistý design postavený na Bootstrap 5.3
   ════════════════════════════════════════════════════════════════ */

/* ── Typografie ─────────────────────────────────────────────── */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #f8f9fc;
    color: #1a1a2e;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1 0 auto; }

h1, h2, h3, h4, h5, h6 { font-weight: 700; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
    background: #fff !important;
    padding: .6rem 0;
}

.brand-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #fff;
    border-radius: .5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.navbar-brand {
    font-size: 1rem;
}

.nav-pill {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #555 !important;
    border-radius: .4rem;
    padding: .35rem .75rem !important;
    transition: background .15s, color .15s;
}

.nav-pill:hover,
.nav-pill.active {
    background: #e8f0fe;
    color: #0d6efd !important;
}

.user-chip {
    font-size: .8rem;
    font-weight: 500;
    color: #444;
    background: #f1f3f9;
    border-radius: 2rem;
    padding: .25rem .75rem;
    display: inline-flex;
    align-items: center;
}

.btn-ghost {
    background: transparent;
    border: none;
    padding: .3rem .6rem;
    border-radius: .4rem;
    transition: background .15s;
}
.btn-ghost:hover { background: #f0f0f0; }

/* ── Welcome banner ─────────────────────────────────────────── */
.welcome-card {
    background: #fff;
    border-radius: 1rem;
    border: 1px solid #e8eaf0;
    box-shadow: 0 .125rem .75rem rgba(0,0,0,.06);
    overflow: hidden;
}

/* ── Board table card ───────────────────────────────────────── */
.card-board {
    background: #fff;
    border-radius: .75rem;
    border: 1px solid #e8eaf0;
}

.card-board .table { margin: 0; }

.card-board thead {
    background: #f6f8ff;
}

.card-board thead th {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #7a828e;
    border-bottom: 1px solid #ebeef4;
    padding: .85rem .75rem;
    white-space: nowrap;
}

.card-board tbody tr {
    border-bottom: 1px solid #f0f2f7;
    transition: background .1s;
}

.card-board tbody tr:last-child { border-bottom: none; }
.card-board tbody tr:hover { background: #f8f9ff; }

.card-board td { padding: .75rem; vertical-align: middle; }

/* Row states */
.row-hidden { background: #fffbf0 !important; }
.row-hidden:hover { background: #fff7e0 !important; }
.row-draft  { background: #f0faff !important; }
.row-draft:hover  { background: #e6f7ff !important; }

/* Status badges */
.status-badge {
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: .18rem .45rem;
    border-radius: .25rem;
    vertical-align: middle;
    margin-left: .3rem;
}

.badge-hidden { background: #fff3cd; color: #856404; }
.badge-draft  { background: #cff4fc; color: #055160; }

/* Column widths */
.col-date    { width: 100px; white-space: nowrap; }
.col-title   { min-width: 200px; }
.col-desc    { }
.col-actions { width: 140px; white-space: nowrap; }

/* Date chip */
.date-chip {
    font-size: .78rem;
    color: #6c757d;
    font-variant-numeric: tabular-nums;
}

/* Mini kalendářová ikonka pro mobil */
.date-mini {
    width: 38px;
    height: 38px;
    border: 1px solid #154A7F;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    background: #fff;
    flex-shrink: 0;
}
.date-mini-month {
    background: #154A7F;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 0;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.date-mini-day {
    color: #154A7F;
    font-size: 13px;
    font-weight: 700;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Action buttons */
.btn-icon {
    width: 30px; height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: .375rem;
    color: #555;
    font-size: .85rem;
    transition: background .15s, border-color .15s, color .15s;
}

.btn-icon:hover {
    background: #e8f0fe;
    border-color: #0d6efd;
    color: #0d6efd;
}

/* ── Post detail (modal + show page) ────────────────────────── */
.post-meta-box {
    padding: 1rem 1.1rem;
    border-radius: .6rem;
    border-left: 4px solid #0d6efd;
    font-size: .85rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 .0625rem .25rem rgba(0,0,0,.06);
}

.state-default { background: #f8f9fa; border-left-color: #0d6efd; }
.state-hidden  { background: #fff9e6; border-left-color: #ffc107; color: #664d03; }
.state-draft   { background: #e8f7fd; border-left-color: #0dcaf0; color: #055160; }

.identity-row {
    margin-top: .5rem;
    padding-top: .5rem;
    border-top: 1px solid rgba(0,0,0,.06);
    font-size: .75rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .25rem;
}

.post-content-body {
    line-height: 1.75;
    font-size: 1rem;
    color: #2d3142;
}

.post-content-body p { margin-bottom: .85rem; }
.post-content-body a { color: #0d6efd; }
.post-content-body img { max-width: 100%; height: auto; border-radius: .35rem; }

.carousel-img {
    max-height: 500px;
    object-fit: contain;
    cursor: zoom-in;
}

/* ── Logs table ─────────────────────────────────────────────── */
.table-logs td, .table-logs th {
    font-size: .82rem;
    vertical-align: middle;
}

.log-url-cell {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.filter-link:hover {
    color: #0d6efd;
    text-decoration: underline;
}

/* ── Post page title ────────────────────────────────────────── */
.post-page-title {
    font-size: 1.6rem;
    line-height: 1.2;
}

/* ── Link chips ─────────────────────────────────────────────── */
.link-chip {
    display: inline-flex;
    align-items: center;
    font-size: .8rem;
    padding: .25rem .65rem;
    background: #f0f4ff;
    border: 1px solid #c9d6ff;
    border-radius: 2rem;
    color: #0d6efd;
    text-decoration: none;
    transition: background .15s;
    word-break: break-all;
}

.link-chip:hover { background: #dce8ff; }

/* ── Flood embeds ───────────────────────────────────────────── */
.embed-box {
    width: 100%;
    height: 70vh;
    min-height: 480px;
    background: #f8f9fa;
}

.embed-box iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.letter-spacing-1 { letter-spacing: .05em; }

/* ── Search box ─────────────────────────────────────────────── */
.search-wrap {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    padding: .3rem .75rem;
    box-shadow: 0 .125rem .3rem rgba(0,0,0,.06);
    transition: border-color .15s, box-shadow .15s;
}

.search-wrap:focus-within {
    border-color: #0d6efd;
    box-shadow: 0 0 0 .2rem rgba(13,110,253,.15);
}

.search-wrap-icon {
    color: #adb5bd;
    font-size: .85rem;
    flex-shrink: 0;
}

.search-wrap-input {
    border: none;
    outline: none;
    padding: .15rem 0;
    font-size: .875rem;
    background: transparent;
    width: 100%;
    color: #1a1a2e;
}

.search-wrap-input::placeholder { color: #adb5bd; }

.search-wrap-clear {
    color: #adb5bd;
    text-decoration: none;
    line-height: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    font-size: .75rem;
    transition: color .15s;
}

.search-wrap-clear:hover { color: #6c757d; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination .page-link {
    border-radius: .375rem !important;
    margin: 0 .1rem;
    min-width: 36px;
    text-align: center;
    font-size: .85rem;
}

/* ── Misc utilities ─────────────────────────────────────────── */
.card {
    border-radius: .75rem;
}

.shadow-sm {
    box-shadow: 0 .125rem .5rem rgba(0,0,0,.07) !important;
}

/* ── Sjednocení fontu v obsahu poznámek ──────────────────── */
/* Zachováváme barvy, tučné, kurzívu – jen font-family normalizujeme */
.post-content-body,
.post-content-body * {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

/* ── Galerie fotek ───────────────────────────────────────── */
.photo-gallery { width: 100%; }

.gallery-label {
    font-size: .78rem;
    font-weight: 600;
    color: #6c757d;
    letter-spacing: .03em;
    text-transform: uppercase;
    margin-bottom: .4rem;
}

.gallery-label-count {
    font-weight: 400;
    color: #adb5bd;
}

/* Jedna fotka – pevná šířka jako ostatní thumbnaile */
.gallery-single {
    display: flex;
}
.gallery-single .gallery-thumb {
    width: 100px;
    height: 100px;
    flex: 0 0 auto;
    border-radius: .35rem;
    overflow: hidden;
}
.gallery-single .gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #111;
    display: block;
}

/* 2–3 fotky i 4+ fotek – flex wrap s pevnou velikostí thumbnailů */
.gallery-sm,
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-radius: .6rem;
    overflow: hidden;
}

/* Každý thumbnail */
.gallery-thumb {
    position: relative;
    width: 100px;
    height: 100px;
    flex: 0 0 auto;
    overflow: hidden;
    cursor: pointer;
    background: #1a1a1a;
    border-radius: .35rem;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s ease, filter .25s ease;
}

.gallery-thumb:hover img,
.gallery-thumb:focus img {
    transform: scale(1.06);
    filter: brightness(.85);
}

.gallery-thumb:focus {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
}

/* Overlay se zoom ikonou / +N */
.gallery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .18);
    color: #fff;
    font-size: 1.4rem;
    opacity: 1;
    transition: background .2s;
    pointer-events: none;
}

.gallery-overlay i {
    opacity: .55;
    transition: opacity .2s, transform .2s;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.5));
}

.gallery-thumb:hover .gallery-overlay,
.gallery-thumb:focus .gallery-overlay {
    background: rgba(0, 0, 0, .45);
}

.gallery-thumb:hover .gallery-overlay i,
.gallery-thumb:focus .gallery-overlay i {
    opacity: 1;
    transform: scale(1.15);
}

/* "+N dalších" overlay – vždy viditelný */
.gallery-overlay.gallery-more {
    background: rgba(0, 0, 0, .55);
    opacity: 1;
}

.gallery-more-count {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.02em;
    text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

/* ── Lightbox ────────────────────────────────────────────── */
.lb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9990;
    align-items: center;
    justify-content: center;
}

.lb-overlay.lb-active {
    display: flex;
}

body.lb-open { overflow: hidden; }

.lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .93);
    cursor: zoom-out;
}

.lb-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 3rem 4rem;
    box-sizing: border-box;
}

.lb-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
}

.lb-img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: .5rem;
    box-shadow: 0 1rem 4rem rgba(0,0,0,.6);
    display: block;
    user-select: none;
}

.lb-btn {
    position: absolute;
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background .15s, transform .1s;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.lb-btn:hover { background: rgba(255,255,255,.25); transform: scale(1.1); }
.lb-btn:active { transform: scale(.95); }

.lb-close { top: 1rem;  right: 1rem;  font-size: 1rem; }
.lb-prev  { left: 1rem;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: 1rem; top: 50%; transform: translateY(-50%); }
.lb-prev:hover { transform: translateY(-50%) scale(1.1); }
.lb-next:hover { transform: translateY(-50%) scale(1.1); }

.lb-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.65);
    font-size: .8rem;
    letter-spacing: .05em;
    background: rgba(0,0,0,.3);
    padding: .2rem .7rem;
    border-radius: 1rem;
    backdrop-filter: blur(4px);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 576px) {
    .col-desc    { display: none; }
    .col-date    { width: 48px; padding-left: .5rem !important; }
    .col-actions { width: 44px; padding-right: .5rem !important; }
    .col-title   { min-width: 0; max-width: 0; width: auto; }
    .post-page-title { font-size: 1.25rem; }
    .embed-box { height: 55vh; min-height: 320px; }
    .lb-content { padding: 3rem 1rem; }
    .lb-prev { left: .25rem; }
    .lb-next { right: .25rem; }

    /* Modal na mobilu: admin akce v hlavičce skrýt, křížek vždy viditelný */
    #modalAdminActions { display: none !important; }
    .modal-header { flex-wrap: nowrap; align-items: center; }
    .modal-title  { font-size: 1rem; }
}
