﻿/* ---- Global ---- */
* { box-sizing: border-box; }

/* Make sure the hidden attribute always wins (fixes popups that never close). */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: #222;
  background: #fff;
}

a { color: #0000ee; }
a:visited { color: #551a8b; }
a:hover { color: #c00; }

/* ---- Header ---- */
#site-header {
  border-bottom: 3px solid #000;
  background: #fff;
  padding: 14px 16px 10px;
}
.header-inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #000;
  font-size: 26px;
  font-weight: bold;
  letter-spacing: 0.5px;
}
.logo:hover { color: #000; }
.menu { font-size: 15px; }
.menu a { margin-left: 16px; }
.tagline {
  max-width: 880px;
  margin: 6px auto 0;
  font-size: 14px;
  color: #444;
}

/* ---- Main layout ---- */
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  text-align: center;
}

#comic-title {
  font-size: 26px;
  font-weight: bold;
  margin: 10px 0 14px;
  word-wrap: break-word;
}

#comic-image {
  max-width: 100%;
  max-height: 70vh;
  border: 1px solid #ddd;
  background: #fafafa;
}

.comic-actions {
  margin: 10px 0 6px;
  display: flex;
  justify-content: center;
  gap: 24px;
}
.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 14px;
  color: #0000ee;
  text-decoration: underline;
  cursor: pointer;
}
.link-button:hover { color: #c00; }

.alt-box {
  max-width: 620px;
  margin: 6px auto 14px;
  padding: 10px 14px;
  border: 2px dashed #888;
  background: #f4f4f4;
  font-size: 15px;
  line-height: 1.4;
}

.comic-nav {
  margin: 8px 0 4px;
  font-size: 16px;
}
.nav-link {
  margin: 0 14px;
  cursor: pointer;
  color: #0000ee;
  text-decoration: underline;
  user-select: none;
}
.nav-link:hover { color: #c00; }
.nav-link.disabled {
  color: #aaa;
  text-decoration: none;
  cursor: default;
}

.meta { font-size: 14px; color: #555; }

/* ---- Archive grid ---- */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  margin-top: 18px;
  text-align: center;
}
.archive-cell a { text-decoration: none; }
.archive-cell img {
  max-width: 100%;
  max-height: 160px;
  border: 1px solid #ddd;
  background: #fafafa;
}
.archive-cell .cell-title {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  color: #0000ee;
  text-decoration: underline;
}
.archive-cell a:hover .cell-title { color: #c00; }

.empty-msg { font-size: 18px; margin: 30px 0 14px; }

/* ---- Buttons / links ---- */
.button {
  font: inherit;
  font-size: 15px;
  padding: 8px 18px;
  border: 2px solid #000;
  background: #fff;
  color: #000;
  cursor: pointer;
}
.button:hover { background: #f2f2f2; }
.button.secondary { border-color: #999; color: #555; }
.button.secondary:hover { background: #f2f2f2; }
.button.danger { border-color: #a00; color: #a00; }
.button.danger:hover { background: #fdf2f2; }
.button:disabled { opacity: 0.6; cursor: default; }

.button-link {
  display: inline-block;
  font: inherit;
  font-size: 15px;
  padding: 7px 14px;
  border: 2px solid #0000ee;
  color: #0000ee;
  text-decoration: none;
  cursor: pointer;
}
.button-link:hover { background: #f2f2ff; color: #c00; border-color: #c00; }

/* ---- Operator page ---- */
.operator-main { text-align: left; }

.page-heading {
  font-size: 28px;
  margin: 4px 0 18px;
}

.op-card {
  border: 2px solid #ddd;
  padding: 16px;
  margin-bottom: 14px;
  background: #fff;
}
.op-card h2 { margin: 0 0 12px; font-size: 20px; }

.op-card-form .field { max-width: 520px; }

.field { display: block; margin-bottom: 14px; }
.field span {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
}
.field input[type="text"],
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 6px 8px;
  border: 1px solid #999;
}
.field input[type="file"] { font: inherit; }

.op-feedback { font-size: 15px; color: #080; margin: 4px 0 10px; }
.op-feedback.error { color: #c00; }

.op-list { margin-top: 6px; }

.op-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.op-thumb {
  max-width: 160px;
  max-height: 120px;
  border: 1px solid #ddd;
  background: #fafafa;
  flex-shrink: 0;
}
.op-info { flex: 1; min-width: 0; }
.op-row-title { font-size: 17px; font-weight: bold; }
.op-row-meta {
  font-size: 13px;
  color: #666;
  margin: 4px 0 10px;
  word-wrap: break-word;
}
.op-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.op-actions .button-link { font-size: 14px; padding: 6px 10px; }

.op-edit-form .field { max-width: 520px; }

/* ---- Storage notice ---- */
.storage-note {
  margin: 24px auto 0;
  max-width: 620px;
  font-size: 14px;
  color: #a00;
  border: 1px solid #a00;
  padding: 8px 12px;
}

/* ---- Footer ---- */
footer {
  border-top: 1px solid #ccc;
  padding: 18px 16px 30px;
  text-align: center;
  font-size: 13px;
  color: #555;
}
footer p { margin: 4px 0; }
