/* =========================================================
   Deník potravinové banky – materiály pro sociální sítě
   Stejný vizuální jazyk jako administrace webu: zelená, bílé karty, klid
   ========================================================= */

:root {
    --green: #2e9e4f;
    --green-dark: #1b7a3d;
    --deep: #0f5a2c;
    --tint: #eaf6ee;
    --tint-2: #f3faf5;
    --ink: #14261b;
    --soft: #5d6b62;
    --line: #e3eae5;
    --bg: #f5f7f6;
    --danger: #b3261e;
    --white: #fff;
    --ff: "Inter", "Segoe UI", system-ui, sans-serif;
    --ff-display: "Poppins", "Inter", sans-serif;
    --r-sm: 9px;
    --r: 14px;
    --r-lg: 20px;
    --shadow: 0 16px 40px rgba(15, 90, 44, .12);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--ff); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--green-dark); text-decoration: none; }
a:hover { color: var(--green); }
img, video { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0 0 .5em; font-family: var(--ff-display); font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
.muted { color: var(--soft); font-size: .9rem; }
.hint { font-size: .82rem; color: var(--soft); }
.nowrap { white-space: nowrap; }
.container { width: min(100% - 32px, 1180px); margin-inline: auto; }
.main { padding: 26px 0 60px; }

/* ---------- horní lišta ---------- */
.topbar { background: var(--deep); color: #fff; position: sticky; top: 0; z-index: 40; }
.topbar__inner { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; margin-right: auto; }
.brand:hover { color: #fff; }
.brand__mark { width: 38px; height: 38px; border-radius: 11px; background: var(--green); display: grid; place-items: center; font-family: var(--ff-display); font-weight: 700; font-size: 1.1rem; }
.brand__name { display: block; font-family: var(--ff-display); font-weight: 600; line-height: 1.15; }
.brand__sub { display: block; font-size: .74rem; opacity: .7; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { color: rgba(255, 255, 255, .85); padding: 8px 12px; border-radius: 999px; font-size: .92rem; font-weight: 500; white-space: nowrap; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.nav a.is-active { color: #fff; background: rgba(255, 255, 255, .16); }
.nav .nav__muted { opacity: .7; }
.nav .nav__cta { margin-left: 8px; color: #fff; }
.burger { display: none; width: 42px; height: 42px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 11px; background: transparent; cursor: pointer; align-items: center; justify-content: center; }
.burger span { display: block; position: relative; width: 20px; height: 2px; background: #fff; border-radius: 2px; }
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: #fff; border-radius: 2px; }
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }

/* ---------- panely a karty ---------- */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; }
.panel--narrow { width: min(100%, 440px); margin: 40px auto; }
.panel--form { width: min(100%, 760px); }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead h1 { margin: 0; }
.empty { text-align: center; padding: 54px 20px; color: var(--soft); background: var(--white); border: 1px dashed var(--line); border-radius: var(--r-lg); }

.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.card__media { display: grid; gap: 2px; background: var(--tint); aspect-ratio: 16 / 10; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media img.is-video { filter: brightness(.92); }
.card__media--2 { grid-template-columns: 1fr 1fr; }
.card__media--3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.card__media--3 img:first-child { grid-row: span 2; }
.card__media--4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__meta { font-size: .8rem; color: var(--soft); }
.card h3 { margin: 0; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--green-dark); }
.card__text { margin: 0; font-size: .92rem; color: var(--soft); white-space: pre-line; }
.card__foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }

.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--tint); color: var(--green-dark); }
.pill--grey { background: #eef1ef; color: var(--soft); }
.pill--today { vertical-align: middle; margin-left: 6px; font-size: .7rem; }
.tag { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: .74rem; border: 1px solid var(--line); color: var(--soft); background: var(--white); }
a.tag:hover { border-color: var(--green); color: var(--green-dark); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ---------- den a měsíc ---------- */
.dayhead { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 14px; margin-bottom: 22px; }
.dayhead h1 { margin: 0; }
.dayhead__title h1::first-letter { text-transform: uppercase; }
.dayhead__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 860px) {
    .dayhead { grid-template-columns: auto 1fr auto auto; }
    .dayhead__actions { grid-column: auto; margin-left: 12px; }
}

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar__head { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); text-align: center; padding: 6px 0; }
.calendar__cell { min-height: 84px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; color: var(--soft); }
.calendar__cell--empty { background: transparent; border-color: transparent; }
.calendar__cell.has-entries { color: var(--ink); border-color: #cfe5d7; background: var(--tint-2); }
.calendar__cell.has-entries:hover { border-color: var(--green); }
.calendar__cell.is-today .calendar__day { color: var(--green-dark); }
.calendar__day { font-family: var(--ff-display); font-weight: 600; }
.calendar__count { font-size: .76rem; font-weight: 600; color: var(--green-dark); }
.calendar__count.muted { font-weight: 400; }
@media (max-width: 640px) { .calendar { gap: 3px; } .calendar__cell { min-height: 58px; padding: 5px 6px; } .calendar__count { font-size: .66rem; } }

/* ---------- filtry ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 18px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--soft); }
.filters input, .filters select { font: inherit; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--ink); min-width: 140px; }
.filters__grow { flex: 1 1 220px; }
.filters__grow input { width: 100%; }

/* ---------- tlačítka ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border: 1.5px solid transparent; border-radius: var(--r-sm); font-family: var(--ff-display); font-size: .88rem; font-weight: 600; line-height: 1.1; cursor: pointer; text-decoration: none; }
.btn--primary { background: var(--green-dark); color: #fff; }
.btn--primary:hover { background: var(--green); color: #fff; }
.btn--light { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--light:hover { border-color: var(--green); color: var(--green-dark); }
.btn--ghost { background: transparent; color: var(--soft); }
.btn--ghost:hover { color: var(--ink); background: #eef1ef; }
.btn--danger { background: #fff; border-color: #f0cdc9; color: var(--danger); }
.btn--danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--sm { padding: 7px 12px; font-size: .8rem; }
.btn--block { width: 100%; }
.linklike { padding: 0; border: 0; background: none; color: var(--soft); font: inherit; font-size: .8rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linklike:hover { color: var(--danger); }
form { margin: 0; }

/* ---------- formuláře ---------- */
.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 600; font-size: .87rem; margin-bottom: 6px; }
.field input:not([type="checkbox"]):not([type="file"]), .field select, .field textarea {
    width: 100%; font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus, .filters input:focus, .filters select:focus, .comment-form textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(46, 158, 79, .13); }
.field input[type="file"] { display: block; width: 100%; padding: 14px; border: 2px dashed #cfe5d7; border-radius: var(--r-sm); background: var(--tint-2); font: inherit; font-size: .9rem; }
.field .hint { margin-top: 6px; }
.field-row { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: .92rem; margin-bottom: 14px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--green); }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); }
.field-validation-error, .validation-summary-errors { color: var(--danger); font-size: .84rem; font-weight: 500; }
.validation-summary-errors ul { margin: 0 0 14px; padding-left: 18px; }
.input-validation-error { border-color: var(--danger) !important; }

/* ---------- průběh nahrávání ---------- */
.progress { position: relative; flex: 1 1 100%; height: 34px; margin: 4px 0 14px; border-radius: var(--r-sm); background: var(--tint); overflow: hidden; font-size: .84rem; font-weight: 600; color: var(--deep); }
.progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: #cbe8d6; transition: width .2s ease; }
.progress span { position: relative; display: flex; align-items: center; height: 100%; padding: 0 14px; }
.progress.is-error { background: #fdecea; color: #8c1d18; }
.progress.is-error i { display: none; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10, 24, 16, .92); display: flex; align-items: center; justify-content: center; }
.lightbox figure { margin: 0; max-width: min(96vw, 1400px); max-height: 94vh; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox img { max-width: 96vw; max-height: 86vh; width: auto; height: auto; border-radius: 6px; background: #000; }
.lightbox figcaption { color: rgba(255, 255, 255, .85); font-size: .92rem; text-align: center; padding: 0 16px; }
.lightbox__close, .lightbox__nav { position: absolute; border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; font-size: 1.6rem; line-height: 1; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; }
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255, 255, 255, .24); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
body.lightbox-open { overflow: hidden; }

/* ---------- hlášky ---------- */
.flash { padding: 13px 18px; border-radius: var(--r); font-weight: 500; margin-bottom: 20px; }
.flash--success { background: var(--tint); color: var(--deep); border: 1px solid #cbe8d6; }
.flash--warning { background: #fdefe3; color: #8a4a0f; border: 1px solid #f3d9bf; }
.flash--error { background: #fdecea; color: #8c1d18; border: 1px solid #f6c9c4; }

/* ---------- detail záznamu ---------- */
.detail { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; }
.detail__head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 18px; }
.detail__head h1 { margin: 4px 0 0; }
.detail__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.detail__text { white-space: pre-line; font-size: 1.02rem; max-width: 72ch; margin-bottom: 8px; }
.detail__section { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }

.media { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.media__item { margin: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--white); display: flex; flex-direction: column; }
.media__preview { display: block; aspect-ratio: 4 / 3; background: var(--tint); width: 100%; }
.media__preview img { width: 100%; height: 100%; object-fit: cover; }
video.media__preview { object-fit: contain; background: #111; }
.media__preview--doc { display: grid; place-items: center; font-family: var(--ff-display); font-weight: 700; font-size: 1.6rem; color: var(--green-dark); }
.media__item figcaption { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.media__caption { display: flex; gap: 6px; }
.media__caption input { flex: 1; min-width: 0; font: inherit; font-size: .88rem; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 8px; }
.media__text { font-size: .92rem; }
.media__meta { font-size: .76rem; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media__actions { display: flex; gap: 6px; }
.upload { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.comment { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment__meta { font-size: .82rem; color: var(--soft); display: flex; gap: 10px; align-items: center; }
.comment__meta form { margin-left: auto; }
.comment__text { white-space: pre-line; margin-top: 3px; }
.comment-form { margin-top: 16px; display: grid; gap: 10px; }
.comment-form textarea { width: 100%; font: inherit; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--r-sm); resize: vertical; }
.comment-form .btn { justify-self: start; }

/* ---------- záloha, odeslání na web ---------- */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 0 0 22px; padding: 16px 20px; background: var(--tint-2); border-radius: var(--r); font-size: .93rem; }
.facts dt { color: var(--soft); }
.facts dd { margin: 0; }
.steps { padding-left: 20px; margin: 0 0 8px; }
.steps li { margin-bottom: 6px; }
code { font-size: .88em; background: var(--tint); padding: 1px 6px; border-radius: 5px; }
.flash__link { display: block; margin-top: 4px; font-weight: 600; }
.pill--web { background: #e8effa; color: #24467a; }
a.pill:hover { background: #d5ebdd; }

.pick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pick__item { position: relative; display: block; border: 2px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--white); cursor: pointer; }
.pick__item:has(input:checked) { border-color: var(--green); }
.pick__item.is-disabled { opacity: .5; cursor: not-allowed; }
.pick__item input { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; accent-color: var(--green); z-index: 2; }
.pick__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pick__caption { display: block; padding: 6px 8px; font-size: .78rem; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; gap: 2px 0; } .facts dt { margin-top: 8px; } .pick { grid-template-columns: 1fr 1fr; } }

/* ---------- export ---------- */
.export__formats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: 12px; }
.export__format { text-align: left; background: var(--white); border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px 18px; cursor: pointer; font: inherit; color: var(--ink); display: grid; gap: 4px; }
.export__format strong { font-family: var(--ff-display); font-size: 1rem; }
.export__format span { font-size: .84rem; color: var(--soft); }
.export__format:hover { border-color: var(--green); }

/* ---------- tabulky ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
thead th { text-align: left; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--tint-2); white-space: nowrap; }
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }

/* ---------- mobil ---------- */
@media (max-width: 860px) {
    .burger { display: flex; }
    .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; align-items: stretch; background: var(--deep); padding: 10px 16px 18px; gap: 4px; border-top: 1px solid rgba(255, 255, 255, .12); }
    body.nav-open .nav { display: flex; }
    .nav a { padding: 12px 14px; font-size: 1rem; border-radius: var(--r-sm); }
    .nav .nav__cta { margin: 8px 0 0; }
    .panel, .detail { padding: 18px; }
    .dayhead h1 { font-size: 1.25rem; }
    .detail__actions .btn, .dayhead__actions .btn { flex: 1 1 auto; }
    .media { grid-template-columns: 1fr 1fr; gap: 10px; }
    .media__actions .btn { flex: 1; }
}
@media (max-width: 480px) {
    .media { grid-template-columns: 1fr; }
    .cards { grid-template-columns: 1fr; }
}
