/* Style strony INF-EL. Zasady CSP zabraniają stylów inline,
   dlatego cały wygląd opisany jest tutaj. */

:root {
    color-scheme: light;
    --ink: #172033;
    --muted: #657084;
    --brand: #155eef;
    --brand-dark: #0b47c2;
    --surface: #fff;
    --soft: #f4f7fb;
    --border: #d7deea;
    --danger: #b42318;
    --success: #067647;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--soft);
    color: var(--ink);
    font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--brand-dark); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.container, .page { width: min(1100px, calc(100% - 32px)); margin: 0 auto; }
.page { max-width: 760px; padding: 36px 0 64px; }
.container { padding-top: 24px; padding-bottom: 64px; }

/* --- Nagłówek --- */

.banner {
    position: relative;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
    color: #fff;
    background: linear-gradient(#102044aa, #102044aa), url('../images/banner.jpg') center/cover;
}
.banner h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.1; }
.banner h3, .banner h4 { max-width: 850px; margin: 12px 0 0; font-weight: 500; }

.visit-stats { margin-top: 16px; display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.visit-stats p { margin: 0; }

/* --- Menu i wyszukiwarka --- */

.user-menu, .toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.inline-form { display: inline; margin: 0; }

.search {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(180px, 280px) auto;
    gap: 10px;
    margin-bottom: 28px;
}

/* --- Wpisy --- */

.entry, .panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 5px 18px #1720330d;
}
.entry h3, .panel h1 { margin-top: 0; line-height: 1.25; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); }
.entry-date { font-style: italic; }

.gallery { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery img, .entry img, .preview {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.file-list { padding-left: 20px; }
.hint-inline { color: var(--muted); font-size: .9rem; }

.actions { display: flex; gap: 14px; align-items: center; margin-top: 14px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #e8efff; font-size: .8rem; color: var(--ink); }

/* --- Formularze --- */

label { display: block; font-weight: 650; margin-bottom: 18px; }
.hint { display: block; color: var(--muted); font-size: .9rem; font-weight: 400; margin-top: 4px; }

input, select, textarea, button { font: inherit; }
input[type=text], input[type=password], input[type=number], input[type=search],
input[type=file], select, textarea {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #aeb8c8;
    border-radius: 8px;
}
textarea { min-height: 170px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
    outline: 3px solid #84adff;
    outline-offset: 2px;
}

button, .button {
    display: inline-block;
    padding: 9px 15px;
    border: 0;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
}
button:hover, .button:hover { background: var(--brand-dark); }
button[disabled] { background: var(--muted); cursor: progress; }
.delete-button { background: transparent; color: var(--danger); padding: 0; }
.delete-button:hover { background: transparent; text-decoration: underline; }

/* --- Komunikaty --- */

.alert { padding: 12px 14px; border-radius: 8px; margin: 16px 0; }
.alert-error { color: #7a271a; background: #fef3f2; border: 1px solid #fecdca; }
.alert-success { color: #05603a; background: #ecfdf3; border: 1px solid #abefc6; }
.empty { color: var(--muted); }

/* --- Wysyłka plików --- */

.upload-field { margin-bottom: 18px; }
.upload-field label { margin-bottom: 0; }
.upload-status { margin: 8px 0 0; color: var(--muted); font-size: .95rem; }
.upload-status-error { color: var(--danger); font-weight: 600; }
.upload-progress { width: 100%; height: 12px; margin-top: 8px; }

.file-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.file-row label { margin: 0 0 0 auto; }

/* --- Dostępność --- */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Pierwszy przystanek klawisza Tab: skok od razu do treści. */
.skip-link {
    position: absolute;
    left: 8px;
    top: -60px;
    z-index: 10;
    padding: 10px 14px;
    background: var(--surface);
    color: var(--brand-dark);
    border-radius: 0 0 8px 8px;
    font-weight: 700;
    transition: top .15s ease-in-out;
}
.skip-link:focus { top: 0; }

/* --- Paginacja --- */

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin: 28px 0 8px;
}
.page-number, .page-step, .page-gap {
    display: inline-block;
    padding: 8px 13px;
    border-radius: 8px;
    text-decoration: none;
}
.page-number, .page-step {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--brand-dark);
}
.page-number:hover, .page-step:hover { border-color: var(--brand); }
.page-number.is-current {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 700;
}
.page-step.is-disabled { color: var(--muted); border-style: dashed; }
.page-gap { color: var(--muted); padding-inline: 4px; }

.result-count { color: var(--muted); margin: 0 0 18px; }

/* --- Dziennik zdarzeń --- */

.table-scroll { overflow-x: auto; }
.log-table { width: 100%; border-collapse: collapse; margin-bottom: 26px; }
.log-table th, .log-table td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    white-space: nowrap;
}
.log-table th { background: var(--soft); font-size: .9rem; }
.log-table td.wrap { white-space: normal; min-width: 220px; }
.log-table tr:last-child td { border-bottom: 0; }

@media (max-width: 700px) {
    .search { grid-template-columns: 1fr; }
    .user-menu { justify-content: flex-start; }
    .entry, .panel { padding: 16px; }
    .container, .page { width: min(100% - 20px, 1100px); }
    .gallery img, .entry img, .preview { width: 100px; height: 76px; }
    .file-row { flex-wrap: wrap; gap: 8px; }
    .file-row label { margin-left: 0; }
    .page-number, .page-step { padding: 8px 11px; }
}
