/* Modern theme for IDS — responsive, mobile-first */

:root {
  --header-bg:  #18202c;
  --accent:     #3b82f6;
  --page-bg:    #f1f5f9;
  --card-bg:    #ffffff;
  --text:       #1e293b;
  --text-muted: #64748b;
  --border:     #e2e8f0;
  --highlight:  #dc2626;
  --radius:     0.5rem;
  --shadow:     0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }

/* ── Header ── */
.site-header {
  background: var(--header-bg);
  color: #fff;
  padding: 0.75rem 1.25rem;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.site-title { font-size: 1.1rem; font-weight: 600; }
.site-title a { color: inherit; text-decoration: none; }

/* search in header */
.header-search form { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.header-search input[type="text"] {
  padding: 0.3rem 0.5rem;
  border: 1px solid #374151;
  border-radius: 4px;
  background: #2d3748;
  color: #fff;
  font-size: 0.85rem;
  width: 160px;
}
.header-search input[type="submit"] {
  padding: 0.3rem 0.75rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

/* ── Main ── */
main { flex: 1; padding: 1.25rem 1rem; }
.container { max-width: 1100px; margin: 0 auto; }

/* ── Cards ── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.section-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb b { color: var(--text); font-weight: 600; }

/* ── Album grid ── */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  padding: 0.25rem 0;
}
.album-cell {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.home-albumname a,
.album-item a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  font-size: 0.78rem;
  text-align: center;
  gap: 0.3rem;
  padding: 0.4rem;
  border-radius: var(--radius);
  transition: background 0.15s;
  width: 100%;
}
.home-albumname a:hover,
.album-item a:hover { background: var(--page-bg); }

.home-albumname img,
.album-item img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: var(--shadow);
}

/* ── Album footer (item count + paging) ── */
.album-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.album-pagelinks { text-align: right; }
.album-pagelinks a { color: var(--accent); text-decoration: none; margin: 0 0.15rem; }
.album-pagelinks a:hover { text-decoration: underline; }
.album-hascomments { width: 100%; font-size: 0.75rem; }

/* ── Album header ── */
.album-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.album-description { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.3rem; }
.album-sort select {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  background: #fff;
  cursor: pointer;
}

/* ── Site description / news ── */
.site-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
/* news is a table; make it look clean */
.card table { width: 100%; border-collapse: collapse; }
.home-newsdate {
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0.5rem 1rem 0.5rem 0;
  white-space: nowrap;
  vertical-align: top;
}
.home-newsbody {
  font-size: 0.875rem;
  padding: 0.5rem 0;
  vertical-align: top;
}
.card tr { border-bottom: 1px solid var(--border); }
.card tr:last-child { border-bottom: none; }
.comment-link { margin-top: 0.75rem; font-size: 0.85rem; }

/* ── Image page ── */
.image-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.image-resizer select {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  background: #fff;
}
.prevnext { font-size: 0.85rem; }
.prevnext a { color: var(--accent); text-decoration: none; }
.prevnext a:hover { text-decoration: underline; }
.prevnext img { max-width: 90px; height: auto; border-radius: 4px; vertical-align: middle; }

.image-display {
  text-align: center;
  margin-bottom: 1.25rem;
}
.image-display img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

.image-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.75rem; }
.image-meta-body {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.image-info { font-size: 0.8rem; color: var(--text-muted); line-height: 1.9; }

.image-prevnext {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 0.5rem;
}
.image-prevnext .prevnext { flex: 0 0 auto; max-width: 110px; text-align: center; }
.image-comments { flex: 1; min-width: 0; }
.image-comments .description,
.description { font-size: 0.875rem; color: var(--text); line-height: 1.6; }

/* ── Search ── */
.search-meta { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; margin-bottom: 1rem; }
.search-results table { width: 100%; }
.search-results td { padding: 0.5rem; vertical-align: top; }
.search-results img { max-width: 100px; height: auto; border-radius: 4px; }
.search-results hr { border: none; border-top: 1px solid var(--border); margin: 0.5rem 0; }
.search-results div { font-size: 0.875rem; }

/* ── Comments ── */
.commentp-text,
.commentv-results { font-size: 0.875rem; color: var(--text); }
.commentp-text table { border-collapse: collapse; }
.commentp-text td { padding: 0.4rem 0; }
.commentp-text input[type="text"] {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.875rem;
  font-family: inherit;
  width: 100%;
}
.commentp-text textarea {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.875rem;
  font-family: inherit;
  width: 100%;
  resize: vertical;
}
.commentp-text input[type="submit"] {
  padding: 0.4rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
}

/* ── Highlight (search matches, comment markers) ── */
.highlight { color: var(--highlight); font-weight: bold; }

/* ── Footer ── */
.site-footer {
  background: var(--header-bg);
  color: #94a3b8;
  font-size: 0.8rem;
  padding: 0.75rem 1.25rem;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-version { opacity: 0.65; }
.footer-prefs { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.footer-prefs form { display: inline; }
.footer-prefs select {
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  background: #2d3748;
  color: #fff;
  border: 1px solid #4a5568;
  border-radius: 4px;
  cursor: pointer;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .header-search input[type="text"] { width: 130px; }
  .image-prevnext { flex-direction: column; }
  .image-prevnext .prevnext { max-width: none; }
  .image-meta-body { flex-direction: column; gap: 0.75rem; }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
