/* ============================================================
   CSS Gallery CMS — CSS Refresh Theme
   ============================================================ */

/* ── Reset ─────────────────────────────────────────────────── */
html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, img,
ul, ol, li, form, label, table, tbody, tr, th, td {
  margin: 0; padding: 0; border: 0; font-size: 100%;
  vertical-align: baseline; background: transparent;
  font-family: Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  background: url('../theme-images/BG.JPG') no-repeat 50% 0;
  background-color: #b8d898;
  font-family: Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #4f4f4f;
}
ol, ul { list-style: none; }
a { color: #6aa850; text-decoration: none; }
a:hover { text-decoration: underline; color: #4a8830; }
img { display: block; }
.clear { clear: both; }

/* ── Outer wrap ─────────────────────────────────────────────── */
#wrap {
  width: 972px;
  margin: 0 auto;
}

/* ── Header — 230px tall to show BG.JPG logo ───────────────── */
#header {
  height: 230px;
  position: relative;
  padding-top: 20px;
}

.main-nav { float: left; margin-top: 18px; display: flex; }
.main-nav a { display: block; text-indent: -9999px; overflow: hidden; text-decoration: none; font-size: 0; line-height: 0; }
.main-nav a.nav-newest,    .main-nav a.nav-item-0 { background: url('../theme-images/MNU_HOME.GIF') no-repeat;     width: 97px;  height: 50px; }
.main-nav a.nav-popular,   .main-nav a.nav-item-1 { background: url('../theme-images/mnu_showcase.gif') no-repeat; width: 118px; height: 50px; }
.main-nav a.nav-about,     .main-nav a.nav-item-2 { background: url('../theme-images/MNU_ABT.GIF') no-repeat;      width: 84px;  height: 50px; }
.main-nav a.nav-item-3                             { background: url('../theme-images/mnu_advertise.gif') no-repeat; width: 131px; height: 50px; }

#srchform {
  float: right;
  background: #c7e4b8;
  padding: 8px;
  width: 260px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
}
#srchtxt {
  background: url('../theme-images/txt_search.gif') repeat-x;
  width: 163px; padding: 5px; height: 29px;
  border: 0 none; font-size: 12px; color: #4f4f4f; outline: none;
}
#srchsbmt {
  background: url('../theme-images/btn_search.gif') no-repeat;
  width: 78px; height: 29px; border: 0 none; cursor: pointer;
  text-indent: -9999px; overflow: hidden;
}

.btn-submit-header {
  position: absolute;
  right: 0; top: 115px;
  background: none; border: none; cursor: pointer; padding: 0;
}
.btn-submit-header img { display: block; }

/* ── Page box ───────────────────────────────────────────────── */
#page {
  /* PAGE.GIF is 972×14, repeat-y creates the vertical stripe divider at x=707 */
  background: url('../theme-images/PAGE.GIF') repeat-y top left;
  width: 972px;
  border-top: 1px solid #e5e5e5;
}
#page-in {
  /* PAGE-BTM.GIF is 972×228, sits at bottom right, has the divider fade */
  background: url('../theme-images/PAGE-BTM.GIF') no-repeat bottom right;
  overflow: hidden;
  padding-bottom: 150px; /* room for PAGE-BTM.GIF to show */
}

/* Ad strip */
.ad-strip {
  background: rgba(255,255,255,0.8);
  border-bottom: 1px solid #d9d9d9;
  text-align: center;
  padding: 8px;
}

/* ── Layout: content 707px left, sidebar 265px right ────────── */
/* These match the divider line baked into PAGE.GIF and PAGE-BTM.GIF at x=707 */
#content {
  float: left;
  width: 707px;
  padding: 10px 14px;
}

#sidebar-right {
  float: right;
  width: 265px;
  padding: 8px 10px;
}

/* ── Filters bar ────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px;
  border-bottom: 1px solid #d9d9d9;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-label { font-size: 11px; color: #888; }
.filter-label strong { color: #4f4f4f; }
.clear-filter {
  font-size: 10px; background: #e0e0e0;
  border-radius: 2px; padding: 2px 6px; color: #666;
}
.sort-tabs { display: flex; gap: 3px; flex-wrap: wrap; }
.sort-tab {
  font-size: 11px; padding: 3px 10px;
  background: #e5e5e5; border: 1px solid #cecece;
  color: #4f4f4f; border-radius: 2px;
  text-decoration: none; font-weight: bold;
}
.sort-tab:hover, .sort-tab.active {
  background: #6aa850; border-color: #4a8830; color: #fff; text-decoration: none;
}

/* ── Gallery grid — 3 per row inside 707px content ─────────── */
/* 3 × 218px + 2 × 6px gap = 666px — leaves room for padding  */
#lists {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.gallery-card { width: 214px; }

.card-thumb-link { display: block; text-decoration: none; }

.siteshot {
  background: url('../theme-images/BOX.GIF') no-repeat center center;
  width: 214px; height: 188px;
  padding: 11px;
  overflow: hidden; position: relative;
}
.siteshot img {
  width: 192px; height: 166px;
  object-fit: cover; object-position: top; display: block;
}
.no-screenshot {
  width: 192px; height: 166px;
  background: #eee;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #999; text-align: center; padding: 8px;
}
.card-hover-overlay {
  position: absolute; top: 11px; left: 11px;
  width: 192px; height: 166px;
  background: rgba(106,168,80,0.75);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.gallery-card:hover .card-hover-overlay { opacity: 1; }
.visit-badge {
  background: #fff; color: #4a8830;
  padding: 5px 12px; font-size: 11px; font-weight: bold; border-radius: 2px;
}

.webtitle {
  display: block; padding: 5px 6px;
  background: #6aa850; color: #fff;
  font-size: 11px; font-weight: bold;
  text-align: center; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.webtitle:hover { background: #4a8830; text-decoration: none; }

.card-url-link {
  display: block; font-size: 10px; color: #888;
  text-align: center; padding: 2px 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none;
}
.card-url-link:hover { color: #6aa850; text-decoration: underline; }

.vote-wrap {
  display: flex; gap: 3px;
  padding: 3px 4px;
  background: #f5f5f5; border-top: 1px solid #e0e0e0;
}
.vote-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 3px; background: #e8e8e8; border: 1px solid #cecece;
  border-radius: 2px; color: #666; font-size: 10px; font-weight: bold;
  padding: 3px 2px; cursor: pointer; transition: all 0.15s;
  font-family: Arial, sans-serif;
}
.vote-btn:hover     { background: #d8d8d8; }
.vote-up.voted      { background: #d4edda; border-color: #6aa850; color: #3a7a28; }
.vote-down.voted    { background: #fde8e8; border-color: #dc2626; color: #dc2626; }
.vote-up:hover      { background: #d4edda; border-color: #6aa850; color: #3a7a28; }
.vote-down:hover    { background: #fde8e8; border-color: #dc2626; color: #dc2626; }

.empty-state { padding: 30px 10px; text-align: center; color: #888; font-size: 12px; }
.empty-state a { color: #6aa850; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 14px 0 0;
  flex-wrap: wrap;
}
.pg-btn {
  display: inline-block;
  padding: 5px 12px;
  background: #e5e5e5;
  border: 1px solid #cecece;
  color: #4f4f4f;
  font-size: 12px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 2px;
}
.pg-btn:hover { background: #6aa850; border-color: #4a8830; color: #fff; text-decoration: none; }
.pg-disabled { opacity: 0.4; cursor: default; }
.pg-num {
  display: inline-block;
  padding: 5px 9px;
  background: #e5e5e5;
  border: 1px solid #cecece;
  color: #4f4f4f;
  font-size: 12px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 2px;
  min-width: 28px;
  text-align: center;
}
.pg-num:hover { background: #6aa850; border-color: #4a8830; color: #fff; text-decoration: none; }
.pg-active { background: #6aa850; border-color: #4a8830; color: #fff; }
.pg-dots { padding: 5px 4px; color: #888; font-size: 12px; }

/* ── Sidebar — 265px, sits right of the divider line ────────── */
.widget-title-cats {
  background: url('../theme-images/CATS_H2.GIF') no-repeat;
  width: 258px; height: 53px;
  text-indent: -9999px; display: block;
  margin: 5px 0 8px; overflow: hidden;
}
.cat-list li { margin: 3px 0; }
.cat-list a {
  display: flex; justify-content: space-between; align-items: center;
  background: #e5e5e5; border: 1px solid #cecece;
  padding: 5px 10px; color: #4f4f4f; font-size: 12px; font-weight: bold;
  text-decoration: none; transition: all 0.12s;
}
.cat-list a:hover, .cat-list a.active {
  background: #6aa850; border-color: #4a8830; color: #fff; text-decoration: none;
}
.cat-list span {
  font-size: 10px; font-weight: normal;
  background: rgba(0,0,0,0.1); padding: 1px 5px; border-radius: 2px;
}
.sidebar-section-title {
  font-size: 11px; font-weight: bold; color: #4f4f4f;
  margin: 12px 0 5px; padding-bottom: 3px; border-bottom: 1px solid #d9d9d9;
}
.text-links a {
  display: block; font-size: 11px; padding: 3px 0;
  border-bottom: 1px solid #e8e8e8; color: #6aa850;
}
.text-links a:last-child { border: none; }
.text-links a:hover { color: #4a8830; }
.widget-submit-box {
  margin-top: 14px; padding: 10px;
  background: #f0f0f0; border: 1px solid #d0d0d0;
}
.widget-submit-box p { font-size: 11px; color: #666; margin-bottom: 8px; line-height: 1.4; }
.btn-submit-sidebar {
  display: block; width: 100%; background: #6aa850; color: #fff;
  border: none; padding: 7px; font-size: 12px; font-weight: bold;
  text-align: center; cursor: pointer; font-family: Arial, sans-serif;
}
.btn-submit-sidebar:hover { background: #4a8830; }

/* ── Footer ─────────────────────────────────────────────────── */
#footer {
  background: url('../theme-images/footer_bg.gif') no-repeat left top;
  width: 972px; min-height: 200px;
  margin: 0 auto; overflow: hidden; padding-bottom: 20px; clear: both;
}
/* Footer columns match footer_bg.gif divider at x=580 */
/* box-sizing: border-box so padding is inside width */
/* 580 + 392 = 972px total */
#fleft {
  float: left;
  width: 580px;
  padding: 30px 20px 20px 20px;
  line-height: 1.8;
  box-sizing: border-box;
}
#fleft h2 { color: #6aa850; margin-bottom: 8px; font-size: 18px; }
#fleft p  { font-size: 12px; color: #555; }
#fleft ul { margin-top: 16px; margin-left: 20px; }
#fleft ul li { display: inline; padding-right: 15px; }
#fleft ul a { color: #4f4f4f; text-decoration: none; font-size: 14px; font-weight: bold; }
#fleft ul a:hover { color: #6aa850; }
#fright {
  float: left;
  width: 392px;
  padding: 40px 20px 20px 30px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
#fright h2 { color: #6aa850; margin-bottom: 8px; font-size: 18px; }
#fright p  { font-size: 12px; color: #555; margin-bottom: 16px; line-height: 1.5; max-width: 280px; }
#fright .btn-submit-sidebar {
  width: 200px;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; overflow-x: hidden;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #fff; border: 1px solid #cecece;
  padding: 22px 24px; width: 100%; max-width: 460px;
  position: relative; margin: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  box-sizing: border-box; flex-shrink: 0;
}
.modal-close {
  position: absolute; top: 8px; right: 8px;
  background: #e0e0e0; border: 1px solid #cecece;
  width: 22px; height: 22px; cursor: pointer;
  font-size: 11px; color: #666; font-family: Arial, sans-serif;
}
.modal-close:hover { background: #cecece; }
.modal-title {
  font-size: 15px; font-weight: bold; color: #4f4f4f;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #e0e0e0;
  background: url('../theme-images/PAGE-H2.GIF') no-repeat 6px 50%;
  padding-left: 46px;
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 10px; }
.form-group label {
  display: block; font-size: 10px; font-weight: bold; color: #666;
  margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.04em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; background: #f8f8f8; border: 1px solid #cecece;
  color: #4f4f4f; padding: 5px 7px; font-size: 12px; font-family: Arial, sans-serif; outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: #6aa850; background: #fff; }
.form-group textarea { resize: vertical; min-height: 65px; }
.btn-primary {
  display: block; width: 100%; background: #6aa850; color: #fff;
  border: none; padding: 9px; font-size: 13px; font-weight: bold;
  cursor: pointer; font-family: Arial, sans-serif; margin-top: 4px;
}
.btn-primary:hover { background: #4a8830; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert { padding: 7px 10px; margin-bottom: 10px; font-size: 12px; font-weight: bold; }
.alert-success { background: #e8f5e3; border: 1px solid #6aa850; color: #3a6a28; }
.alert-error   { background: #fde8e8; border: 1px solid #dc2626; color: #991b1b; }