/* Prästebolsblomster – admin. Enkel, luftig och lätt att använda i mobilen. */

@font-face { font-family: 'Gilda Display'; src: url(fonts/gilda-display.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Jost'; src: url(fonts/jost.woff2) format('woff2'); font-weight: 300 500; font-display: swap; }

:root {
  --paper: #f5f0ea; --card: #fffdfa; --ink: #26211d; --muted: #6d6359; --line: #e0d7cb;
  --rose: #9c5f62; --rose-soft: #f3e4e1; --sage: #5f6b50; --sage-soft: #e8ecdf; --danger: #a33a32;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 'Jost', system-ui, sans-serif; }
a { color: var(--rose); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: 'Gilda Display', serif; font-weight: 400; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.admin-top { background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.admin-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: 'Gilda Display', serif; font-size: 1.15rem; }
.admin-brand img { height: 38px; width: auto; }
.admin-brand small { font-family: 'Jost', sans-serif; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--rose); margin-left: 4px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.admin-nav a { color: var(--ink); text-decoration: none; padding: 7px 11px; border-radius: 999px; font-size: .93rem; }
.admin-nav a:hover { background: var(--paper); }
.admin-nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.badge { display: inline-block; background: var(--rose); color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 7px; margin-left: 3px; font-weight: 500; }

.admin-main { max-width: 1100px; margin: 0 auto; padding: 28px 16px 80px; }
.flash { padding: 13px 18px; border-radius: 10px; background: var(--sage-soft); border: 1px solid #cfd8c0; margin: 0 0 22px; }
.flash-error { background: var(--rose-soft); border-color: #e4c4bf; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: clamp(18px, 3vw, 28px); margin-bottom: 22px; }
.panel > :last-child { margin-bottom: 0; }
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.head-row h1, .head-row h2 { margin: 0; }

.btn { display: inline-flex; align-items: center; gap: 6px; font: 500 .95rem/1 'Jost', sans-serif; padding: 12px 18px; border-radius: 10px; border: 1px solid var(--ink); background: var(--ink); color: #fff; text-decoration: none; cursor: pointer; }
.btn:hover { background: #000; }
.btn.light { background: transparent; color: var(--ink); }
.btn.light:hover { background: var(--paper); }
.btn.danger { background: transparent; color: var(--danger); border-color: #e3b9b4; }
.btn.danger:hover { background: var(--rose-soft); }
.btn.small { padding: 8px 12px; font-size: .88rem; }
.btn[disabled], .busy .btn[type="submit"] { opacity: .6; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 26px; }
.quick a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; text-decoration: none; color: var(--ink); transition: border-color .2s, transform .2s; }
.quick a:hover { border-color: var(--rose); transform: translateY(-2px); }
.quick b { display: block; font-family: 'Gilda Display', serif; font-weight: 400; font-size: 1.2rem; margin-bottom: 4px; }
.quick span { color: var(--muted); font-size: .9rem; }
.quick .ico { font-size: 1.5rem; display: block; margin-bottom: 8px; }

label.field { display: block; margin-bottom: 18px; }
label.field > span, .field-label { display: block; font-weight: 500; margin-bottom: 6px; }
.hint { display: block; color: var(--muted); font-size: .86rem; margin-top: 4px; font-weight: 400; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="date"], input[type="time"], input[type="number"], input[type="tel"], select, textarea {
  width: 100%; font: 400 1rem/1.4 'Jost', sans-serif; color: var(--ink); background: #fff; border: 1px solid #cfc4b6; border-radius: 9px; padding: 11px 12px;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--rose-soft); border-color: var(--rose); }
textarea { min-height: 160px; resize: vertical; line-height: 1.6; }
textarea.short { min-height: 80px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--rose); }

.format-help { font-size: .84rem; color: var(--muted); background: var(--paper); border-radius: 8px; padding: 8px 12px; margin-top: 6px; }
.format-help code { background: #fff; padding: 1px 5px; border-radius: 4px; }

/* Typval för evenemang */
.kinds { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.kinds label { cursor: pointer; }
.kinds input { position: absolute; opacity: 0; }
.kinds span { display: inline-block; padding: 9px 15px; border: 1px solid #cfc4b6; border-radius: 999px; background: #fff; }
.kinds input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.kinds input:focus-visible + span { outline: 3px solid var(--rose-soft); }

/* Listor */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex: none; background: var(--paper); }
.list .grow { flex: 1; min-width: 0; }
.list .grow b { font-weight: 500; }
.list .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.date-chip { flex: none; width: 64px; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 6px 0; background: #fff; }
.date-chip b { display: block; font: 400 1.5rem/1 'Gilda Display', serif; }
.date-chip span { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.tag { display: inline-block; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--rose); }
.tag.off { color: var(--muted); }
.past { opacity: .6; }

/* Bildväljare */
.picker { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: start; margin-bottom: 18px; }
@media (max-width: 560px) { .picker { grid-template-columns: 1fr; } }
.picker-current { border-radius: 10px; overflow: hidden; background: var(--paper); min-height: 120px; display: grid; place-items: center; border: 1px solid var(--line); }
.picker-current img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.picker-actions details { margin-top: 12px; }
.picker-actions summary { cursor: pointer; color: var(--rose); padding: 6px 0; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 10px; max-height: 360px; overflow-y: auto; padding: 4px; }
.pick { position: relative; cursor: pointer; border-radius: 8px; overflow: hidden; border: 3px solid transparent; }
.pick input { position: absolute; opacity: 0; }
.pick img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.pick:has(input:checked) { border-color: var(--rose); }
.pick.none { display: grid; place-items: center; aspect-ratio: 1; background: var(--paper); font-size: .85rem; color: var(--muted); text-align: center; border: 1px dashed #cfc4b6; }
.pick.none:has(input:checked) { border: 3px solid var(--rose); }
.file-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px dashed #b9ab9a; border-radius: 10px; padding: 12px 16px; cursor: pointer; background: #fff; }
.file-btn:hover { border-color: var(--rose); }
.file-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-name { display: block; font-size: .86rem; color: var(--sage); margin-top: 6px; }

/* Bildbiblioteket */
.dropzone { display: block; border: 2px dashed #b9ab9a; border-radius: 14px; padding: 30px 18px; text-align: center; cursor: pointer; background: #fff; transition: border-color .2s, background .2s; }
.dropzone:hover, .dropzone.over { border-color: var(--rose); background: var(--rose-soft); }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dropzone b { display: block; font-size: 1.1rem; font-weight: 500; }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.lib-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.lib-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.lib-item .meta { padding: 9px 11px; font-size: .86rem; }
.lib-item .meta .tag { margin-right: 6px; }
.lib-item a { text-decoration: none; color: inherit; display: block; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .9rem; background: #fff; }
.filters a[aria-current="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.focus-pick { position: relative; display: inline-block; cursor: crosshair; max-width: 100%; border-radius: 10px; overflow: hidden; }
.focus-pick img { max-height: 460px; width: auto; }
.focus-dot { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px var(--rose), 0 2px 8px rgba(0,0,0,.4); pointer-events: none; }
.edit-img { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 760px) { .edit-img { grid-template-columns: 1fr; } }

.section-group h2 { margin-top: 10px; }
.msg { border-bottom: 1px solid var(--line); padding: 16px 0; }
.msg:last-child { border: 0; }
.msg.done { opacity: .6; }
.msg p { white-space: pre-wrap; margin: 8px 0; }

.login { max-width: 420px; margin: 6vh auto; }
.login .panel { padding: 30px; }
.login-logo { width: 170px; margin: 0 auto 28px; }
table.simple { width: 100%; border-collapse: collapse; }
table.simple td, table.simple th { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); }
