/* ===========================================================
   Freedom4um - Latest Comments Page Styles
   Version: 2025-10-22c (black title, sidebar height match)
   =========================================================== */

:root {
  --bg-color: #FFF5E1;
  --text-color: #3C2F2F;
  --nav-bg: #A32D2D;
  --nav-text: #FFF5E1;
  --link-color: #800000;
  --mail-bg-color: #B2AC9D;
}

/* -----------------------------------------------------------
   Global layout + typography
   ----------------------------------------------------------- */
html, body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: "Times New Roman", Times, serif;
  font-size: 16px;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background-image: url('/static/images/4umheader2560.jpg');
  background-size: auto;
  background-position: left top;
  background-repeat: no-repeat;
  height: 105px;
  width: 100%;
  display: block;
  margin-bottom: 5px;
}

a {
  color: var(--link-color);
  text-decoration: none;
}
a:hover {
  color: var(--nav-bg);
  text-decoration: underline;
}

/* ===========================================================
   Main frame layout — same as readarticle / postarticle
   =========================================================== */

body.latest-comments-page .content-wrapper {
  display: flex;
  flex-direction: row;
  align-items: stretch;               /* ✅ makes sidebar match main height */
  justify-content: flex-start;
  background-color: var(--bg-color);
  width: 100%;
  margin: 0;
  padding: 0;
}

/* ---- MAIN CONTENT FRAME (the red box) ---- */
body.latest-comments-page main.article-frame {
  background-color: #F9E9C7;          /* parchment-like cream */
  border: 1px solid #A32D2D;          /* dark red border */
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.15);
  padding: 1.2rem 2rem;
  margin-left: 40px;                  /* align under Home nav link */
  margin-right: 20px;
  margin-top: 0;
  margin-bottom: 2rem;
  width: calc(100% - 380px);
  max-width: 1200px;
  box-sizing: border-box;
}

/* ---- Title inside red frame ---- */
body.latest-comments-page main.article-frame h2 {
  margin-top: 0.2rem;
  margin-bottom: 1rem;
  font-size: 1.5em;
  color: #000;                        /* ✅ black title */
  font-weight: bold;
}

/* ===========================================================
   Sidebar (title bar) — unified with readarticle
   =========================================================== */
body.latest-comments-page aside.title-bar {
  width: 300px;
  margin-right: 40px;
  border-left: 1px solid #ccc;        /* ✅ neutral borders */
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  border-right: 1px solid #ccc;
  border-radius: 6px;
  background-color: var(--bg-color);
  padding: 10px 14px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  height: auto !important;            /* ✅ auto height */
  max-height: none !important;        /* ✅ remove viewport cap */
}

.title-bar-header {
  border-bottom: 2px solid var(--nav-bg);
  margin-bottom: 0.6em;
  padding-bottom: 0.3em;
}

.title-bar-header h3 {
  font-size: 1.2em;
  color: var(--nav-bg);
  margin: 0;
}

.title-bar ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.title-bar li {
  margin: 10px 0;
  line-height: 1.3;
}
.title-bar a.nav-link {
  text-decoration: none;
  color: var(--link-color);
  font-weight: bold;
}
.title-bar a.nav-link:hover {
  color: var(--nav-bg);
  text-decoration: underline;
}

/* Visited links in sidebar title bar */
.title-bar a:visited {
  color: #3B0000;  /* same darker red for visited links */
}

.title-bar a:visited:hover {
  color: var(--nav-bg);  /* still use nav-bg color on hover */
}


/* ===========================================================
   Filter form (inside red frame)
   =========================================================== */

#filter-form {
  display: flex;
  align-items: center;
  gap: 1em;
  flex-wrap: wrap;
  margin-bottom: 1.2em;
}

#filter-form label {
  font-weight: bold;
  margin-right: 0.3em;
}

#filter-form input[type="text"] {
  padding: 4px 8px;
  border: 1px solid #aaa;
  border-radius: 4px;
  font-size: 1em;
}

#filter-form button {
  padding: 6px 14px;
  background: linear-gradient(to right, #A32D2D, #7D1F1F);
  color: var(--bg-color);
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

#filter-form button:hover {
  background: linear-gradient(to right, #7D1F1F, #A32D2D);
  transform: translateY(-1px);
}

/* Autocomplete dropdowns */
.autocomplete-container {
  position: relative;
  display: inline-block;
}
.autocomplete-suggestions {
  position: absolute;
  z-index: 1000;
  background: var(--bg-color);
  border: 1px solid var(--text-color);
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
  display: none;
}

/* ===========================================================
   Comments list (clean presentation, tighter)
   =========================================================== */

.comment-data {
  font-size: 1.1em;
  line-height: 1.35;
  margin-bottom: 0.35em;              /* ✅ slightly reduced spacing */
  padding: 0.25em 0;
  font-weight: bold;
}

.comment-data:hover {
  background-color: #FFDAB9;
}

.comment-meta {
  font-size: 0.9em;
  color: #555;
}

/* Visited link styling */
.comment-data a:visited {
  color: #3B0000;  /* darker red than the default #800000 maroon */
}

.comment-data a:visited:hover {
  color: var(--nav-bg);  /* still use the nav-bg color on hover */
}
/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 900px) {
  body.latest-comments-page .content-wrapper {
    flex-direction: column;
  }
  body.latest-comments-page main.article-frame,
  body.latest-comments-page aside.title-bar {
    width: auto;
    margin: 10px 20px;
  }
}

/* ===========================================================
   Pagination
   =========================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 1rem 0 0.5rem 0;
    padding-top: 0.75rem;
    border-top: 1px solid #c8a870;
}

.page-link {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #a08050;
    border-radius: 4px;
    color: var(--link-color);
    font-size: 0.95em;
    font-weight: bold;
    text-decoration: none;
    background-color: #f5e8cc;
    transition: background 0.2s;
}

.page-link:hover {
    background-color: #e0c898;
    color: var(--nav-bg);
}

.page-link.active {
    background-color: var(--nav-bg);
    color: #fff5e1;
    border-color: var(--nav-bg);
    pointer-events: none;
}

.page-ellipsis {
    padding: 4px 4px;
    color: var(--text-color);
    font-weight: bold;
}

.no-comments {
    color: #888;
    font-style: italic;
    margin-top: 1rem;
}
