/* sianel.css — consolidated styles for the Sianel pages.
   Each page sets a body class (page-index / page-login / page-admin / page-play)
   so per-page rules can't leak across pages. embed.php has its own inline styles */

body { font-family: system-ui, sans-serif; }

/* ===================== Public grid (index.php) ===================== */
body.page-index { margin: 0; color: #1b1b1f; background: #fafafa; color-scheme: light dark; }
.page-index header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; border-bottom: 1px solid #e5e5e5; background: #fff;
}
.page-index header h1 { margin: 0; font-size: 1.25rem; }
.page-index .logo { height: 40px; width: auto; display: block; }
.page-index header a { color: #36c; text-decoration: none; font-size: .9rem; }
.page-index header a:hover { text-decoration: underline; }
.page-index main { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }
.page-index .grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.page-index .tile {
  display: block; text-decoration: none; color: inherit; border-radius: 8px; overflow: hidden;
  background: #fff; border: 1px solid #e5e5e5; transition: transform .1s, box-shadow .1s;
}
.page-index .tile:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.page-index .tile .thumb { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #e9e9ef; }
.page-index .tile .ph {
  display: flex; width: 100%; aspect-ratio: 16/9; align-items: center; justify-content: center;
  background: #e9e9ef; color: #aaa; font-size: 2rem;
}
.page-index .tile .cap { padding: .5rem .65rem; font-size: .8rem; color: #666; }
.page-index .empty { color: #888; padding: 3rem 0; text-align: center; }
.page-index .pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 1.5rem 0 .5rem; }
.page-index .pager a,
.page-index .pager span.btn {
  display: inline-block; padding: .45rem .9rem; border: 1px solid #d0d0d5;
  border-radius: .4rem; text-decoration: none; color: #36c;
}
.page-index .pager a:hover { background: #f0f0f5; }
.page-index .pager .btn.disabled { color: #bbb; border-color: #eee; pointer-events: none; }
.page-index .pager .count { color: #888; font-size: .9rem; }

@media (prefers-color-scheme: dark) {
  body.page-index { background: #161618; color: #e7e7ea; }
  .page-index header { background: #1f1f22; border-color: #2c2c30; }
  .page-index .tile { background: #1f1f22; border-color: #2c2c30; }
  .page-index .tile .thumb,
  .page-index .tile .ph { background: #26262b; }
  .page-index .pager a,
  .page-index .pager span.btn { border-color: #3a3a40; }
  .page-index .pager a:hover { background: #26262b; }
  .page-index .pager .btn.disabled { color: #555; border-color: #2c2c30; }
}

/* ===================== Login (login.php) ===================== */
body.page-login { max-width: 420px; margin: 4rem auto; padding: 0 1rem; color: #222; }
.page-login h1 { margin: 0 0 .5rem; }
.page-login .logo { height: 48px; width: auto; display: block; margin-bottom: 1rem; }
.page-login p { color: #555; }
.page-login label { display: block; margin: 1rem 0 .25rem; font-weight: 600; }
.page-login input,
.page-login button { font: inherit; padding: .6rem; width: 100%; box-sizing: border-box; }
.page-login button { cursor: pointer; margin-top: .75rem; background: #39c; color: #fff; border: none; border-radius: .25rem; }
.page-login button.secondary { background: none; color: #900; border: 1px solid #d88; }
.page-login #out { margin-top: 1rem; min-height: 1.2rem; }
.page-login #out.err { color: #900; }
.page-login #out.ok { color: #160; }

/* ===================== Admin (admin.php) ===================== */
body.page-admin { max-width: 720px; margin: 2rem auto; padding: 0 1rem; color: #222; }
.page-admin h1,
.page-admin h2 { margin: 1.5rem 0 .5rem; }
.page-admin label { display: block; margin: .75rem 0 .25rem; }
.page-admin input,
.page-admin button { font: inherit; padding: .5rem; width: 100%; box-sizing: border-box; }
.page-admin button { cursor: pointer; }
.page-admin .row { display: flex; gap: .5rem; margin-top: .5rem; }
.page-admin .row > * { flex: 1; }
.page-admin #progress { height: 1rem; background: #eee; border-radius: .25rem; overflow: hidden; display: none; margin-top: 1rem; }
.page-admin #bar { height: 100%; width: 0; background: #39c; transition: width .15s; }
.page-admin #out { margin-top: 1rem; font-family: ui-monospace, monospace; white-space: pre-wrap; word-break: break-all; }
.page-admin table { width: 100%; border-collapse: collapse; margin-top: .5rem; font-size: .9rem; }
.page-admin th,
.page-admin td { text-align: left; padding: .4rem .25rem; border-bottom: 1px solid #eee; vertical-align: top; }
.page-admin th { color: #666; font-weight: 600; }
.page-admin td button { width: auto; padding: .25rem .5rem; }
.page-admin td a { color: #36c; }
.page-admin .muted { color: #888; font-size: .85rem; }
.page-admin .thumb { width: 96px; height: 54px; object-fit: cover; border-radius: 4px; background: #eee; display: block; }
.page-admin .thumb-placeholder {
  width: 96px; height: 54px; border-radius: 4px; background: #eee;
  display: flex; align-items: center; justify-content: center; color: #aaa; font-size: 1.5rem;
}
.page-admin .topbar { display: flex; justify-content: space-between; align-items: center; }
.page-admin .topbar a { color: #36c; font-size: .9rem; text-decoration: none; }
.page-admin .topbar a:hover { text-decoration: underline; }
.page-admin .topbar .brand { line-height: 0; }
.page-admin .topbar .logo { height: 36px; width: auto; display: block; }
.page-admin .check { display: flex; align-items: center; gap: .5rem; font-weight: 400; font-size: .9rem; }
.page-admin .check input { width: auto; }
.page-admin .badge {
  display: inline-block; font-size: .7rem; padding: .1rem .4rem; border-radius: .6rem;
  background: #eee; color: #666; margin-left: .4rem; vertical-align: middle;
}
.page-admin .pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 1rem 0; }
.page-admin .pager button { width: auto; padding: .4rem .9rem; background: #fff; border: 1px solid #ccc; border-radius: .3rem; color: #36c; }
.page-admin .pager button:disabled { color: #bbb; border-color: #eee; cursor: default; }
.page-admin .pager .count { color: #888; font-size: .9rem; }

/* ===================== Playback (play.php) ===================== */
.page-play video { height: auto; display: block; max-height: 800px; max-width: 1200px; }
.page-play .meta code { user-select: all; }
.page-play .site-header { padding: 1rem 0; }
.page-play .site-header img { height: 40px; width: auto; display: block; }
.page-play .admin-actions { margin-top: 1rem; }

/* ===================== Log: chronological list (index.php) ===================== */
body.page-loglist { margin: 0; color: #1b1b1f; background: #fafafa; color-scheme: light dark; }
.page-loglist header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; border-bottom: 1px solid #e5e5e5; background: #fff;
}
.page-loglist .logo { height: 40px; width: auto; display: block; }
.page-loglist header a { color: #36c; text-decoration: none; font-size: .9rem; }
.page-loglist header a:hover { text-decoration: underline; }
.page-loglist main { max-width: 720px; margin: 0 auto; padding: 1.5rem 1.25rem; }
.page-loglist .post-list { list-style: none; padding: 0; margin: 0; }
.page-loglist .post-item { border-bottom: 1px solid #e5e5e5; }
.page-loglist .post-item:last-child { border-bottom: none; }
.page-loglist .post-link {
  display: block; padding: 1rem 0; text-decoration: none; color: inherit;
}
.page-loglist .post-link:hover .post-title { color: #36c; }
.page-loglist .post-title { margin: 0 0 .25rem; font-size: 1.1rem; font-weight: 600; }
.page-loglist .post-meta { color: #777; font-size: .85rem; }
.page-loglist .empty { color: #888; padding: 3rem 0; text-align: center; }
.page-loglist .pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 2rem 0 .5rem; }
.page-loglist .pager a,
.page-loglist .pager span.btn {
  display: inline-block; padding: .45rem .9rem; border: 1px solid #d0d0d5;
  border-radius: .4rem; text-decoration: none; color: #36c;
}
.page-loglist .pager a:hover { background: #f0f0f5; }
.page-loglist .pager .btn.disabled { color: #bbb; border-color: #eee; pointer-events: none; }
.page-loglist .pager .count { color: #888; font-size: .9rem; }

@media (prefers-color-scheme: dark) {
  body.page-loglist { background: #161618; color: #e7e7ea; }
  .page-loglist header { background: #1f1f22; border-color: #2c2c30; }
  .page-loglist .post-item { border-color: #2c2c30; }
  .page-loglist .post-meta { color: #999; }
  .page-loglist .pager a,
  .page-loglist .pager span.btn { border-color: #3a3a40; }
  .page-loglist .pager a:hover { background: #26262b; }
  .page-loglist .pager .btn.disabled { color: #555; border-color: #2c2c30; }
}

/* ===================== Log: single post (view.php) ===================== */
body.page-post { max-width: 720px; margin: 0 auto; padding: 0 1rem 2rem; color: #1b1b1f; }
.page-post .site-header { padding: 1rem 0; }
.page-post .site-header img { height: 40px; width: auto; display: block; }
.page-post .post { margin: 1rem 0; }
.page-post .post-title { margin: 0 0 .25rem; font-size: 1.75rem; line-height: 1.2; }
.page-post .post-meta { color: #777; font-size: .9rem; margin-bottom: 1rem; }
.page-post .post-image { display: block; max-width: 100%; height: auto; margin: 1rem 0; border-radius: 6px; }
.page-post .post-body { line-height: 1.55; font-size: 1.05rem; }
.page-post .post-body img { max-width: 100%; height: auto; }
.page-post .post-body p { margin: 1rem 0; }
.page-post .post-body pre {
  background: #f0f0f5; padding: .75rem 1rem; border-radius: 6px; overflow-x: auto;
}
.page-post .post-body code {
  font-family: ui-monospace, monospace; background: #f0f0f5; padding: .1rem .3rem; border-radius: 3px;
}
.page-post .post-body pre code { background: none; padding: 0; }
.page-post .post-body blockquote {
  margin: 1rem 0; padding: .25rem 1rem; border-left: 3px solid #d0d0d5; color: #555;
}
.page-post .meta code { user-select: all; }
.page-post .meta { color: #777; font-size: .85rem; margin-top: 2rem; }
.page-post .admin-actions { margin-top: 1.5rem; display: flex; gap: .5rem; }
.page-post .admin-actions .btn,
.page-post .admin-actions button {
  font: inherit; padding: .45rem .9rem; border-radius: .3rem; cursor: pointer; text-decoration: none;
}
.page-post .admin-actions .btn { border: 1px solid #d0d0d5; color: #36c; background: #fff; }
.page-post .admin-actions button { background: #fee; border: 1px solid #d88; color: #900; }

@media (prefers-color-scheme: dark) {
  body.page-post { color: #e7e7ea; background: #161618; }
  .page-post .post-meta,
  .page-post .meta { color: #999; }
  .page-post .post-body pre,
  .page-post .post-body code { background: #26262b; }
  .page-post .post-body blockquote { border-color: #3a3a40; color: #aaa; }
  .page-post .admin-actions .btn { background: #1f1f22; border-color: #3a3a40; }
}

/* ===================== Log admin & edit (additions to .page-admin) ===================== */
.page-admin textarea {
  font: inherit; padding: .5rem; width: 100%; box-sizing: border-box;
  min-height: 12em; resize: vertical; font-family: ui-monospace, monospace;
}
.page-admin .btn {
  display: inline-block; padding: .25rem .6rem; border: 1px solid #d0d0d5; border-radius: .3rem;
  text-decoration: none; color: #36c; background: #fff; font-size: .9rem; margin-right: .25rem;
}
.page-admin .btn:hover { background: #f0f0f5; }
.page-admin td .btn { width: auto; }
