/* =========================================================================
   Core Directory - Component styles
   Maps to the drawings: dark header, platform nav, listing cards,
   ribbon badges, star ratings, download box, comments, footer, hub pills,
   archive filters. Pairs with utilities.css.
   ========================================================================= */

/* ---------------------------------------------------------------
   HEADER (top dark bar: logo + search + Categories + Add to Chrome)
   --------------------------------------------------------------- */
.ce-header {
  background: var(--ce-header-bg);
  color: var(--ce-header-ink);
  border-bottom: 1px solid var(--ce-header-line);
}
.ce-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}
.ce-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--ce-header-line);
  border-radius: 10px;
  background: #1a1d24;
  color: var(--ce-header-ink);
  font-weight: 800;
}
.ce-logo img { width: 28px; height: 28px; object-fit: contain; }

/* Search */
.ce-search {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border-radius: 10px;
  padding: 6px 10px;
  max-width: 560px;
}
.ce-search .ce-search-ico {
  display:inline-flex; align-items:center; justify-content:center;
  width: 30px; height: 30px; border-radius: 8px;
  background: #f3f4f6; color:#111827; flex-shrink:0;
}
.ce-search input {
  border: 0; outline: 0; width: 100%;
  font-size: 14px; color: #111827; background: transparent;
}

/* Header right links */
.ce-header-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ce-header-ink); font-weight: 500; font-size: 14px;
  white-space: nowrap;
}
.ce-header-link svg { width: 18px; height: 18px; }

/* Add to Chrome pill button */
.ce-chrome-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #1a1d24;
  border: 2px solid var(--ce-header-ink);
  color: var(--ce-header-ink);
  font-weight: 700; font-size: 14px;
  padding: 8px 16px; border-radius: 9999px;
  white-space: nowrap;
}
.ce-chrome-btn:hover { background: #23262d; }

/* ---------------------------------------------------------------
   PLATFORM NAV (icon + label tabs row)
   --------------------------------------------------------------- */
.ce-platnav {
  background: #ffffff;
  border-bottom: 1px solid var(--ce-line);
}
.ce-platnav-inner {
  display: flex;
  align-items: stretch;
}
.ce-platnav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 16px 22px;
  font-size: 15px; font-weight: 600; color: var(--ce-ink);
  border-right: 1px solid var(--ce-line);
  white-space: nowrap;
}
.ce-platnav-item:first-child { border-left: 1px solid var(--ce-line); }
.ce-platnav-item:hover { background: var(--ce-surface); }
.ce-platnav-item svg,
.ce-platnav-item img { width: 22px; height: 22px; object-fit: contain; }
.ce-platnav-item.is-active { background: var(--ce-surface); }
.ce-platnav-item .ce-crown {
  position: absolute; top: 4px; right: 8px;
  width: 14px; height: 14px; color: var(--ce-crown);
}
@media (max-width: 1024px) {
  .ce-platnav-inner { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ce-platnav-item { padding: 12px 16px; font-size: 14px; }
}

/* ---------------------------------------------------------------
   BREADCRUMB BAR (Home > Category, with title left)
   --------------------------------------------------------------- */
.ce-crumbbar {
  background: var(--ce-surface);
  border-bottom: 1px solid var(--ce-line);
}
.ce-crumbbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; gap: 12px;
}
.ce-crumbbar-title { font-size: 20px; font-weight: 800; color: var(--ce-ink); }
.ce-crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ce-ink-soft); }
.ce-crumbs a:hover { color: var(--ce-ink); }
.ce-crumbs .sep { color: var(--ce-ink-mute); }

/* ---------------------------------------------------------------
   SECTION HEADER (e.g. "Windows" + View All)
   --------------------------------------------------------------- */
.ce-section-head {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--ce-line); border-radius: var(--ce-radius);
  padding: 16px 18px; margin-bottom: 16px;
}
.ce-section-head .title {
  font-size: 20px; font-weight: 800;
  padding-left: 12px; border-left: 4px solid var(--ce-ink);
}
.ce-viewall {
  border: 1px solid var(--ce-line-2); border-radius: 8px;
  padding: 6px 14px; font-size: 13px; font-weight: 600;
}
.ce-viewall:hover { background: var(--ce-surface); }

/* Sort dropdown (archive) */
.ce-sort {
  border: 1px solid var(--ce-line-2); border-radius: 8px;
  padding: 6px 12px; font-size: 13px; background: #fff;
}

/* ---------------------------------------------------------------
   LISTING CARD (icon / title / desc / category / platform+dl / stars / size)
   --------------------------------------------------------------- */
.ce-card {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--ce-line);
  border-radius: var(--ce-radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #fff;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.ce-card:hover { box-shadow: var(--ce-shadow-md); border-color: var(--ce-line-2); }

.ce-card-ico {
  flex-shrink: 0;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-radius: 8px;
}
.ce-card-ico img { width: 100%; height: 100%; object-fit: contain; }

.ce-card-body { flex: 1 1 auto; min-width: 0; }
.ce-card-title { font-size: 16px; font-weight: 700; color: var(--ce-ink); }
.ce-card-title:hover { text-decoration: underline; }
.ce-card-desc { font-size: 13px; color: var(--ce-ink-soft); margin-top: 2px; }
.ce-card-cat  { font-size: 13px; font-weight: 600; color: var(--ce-ink); margin-top: 2px; }

/* Meta columns on the right of a card */
.ce-card-meta {
  display: flex; align-items: center; gap: 0;
  flex-shrink: 0;
}
.ce-card-col {
  padding: 0 18px;
  text-align: center;
  border-left: 1px solid var(--ce-line);
  min-width: 110px;
}
.ce-card-col:first-child { border-left: 0; }
.ce-card-platform {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
}
.ce-card-platform svg { width: 16px; height: 16px; }
.ce-card-dl { display:inline-flex; align-items:center; gap:5px; font-size: 13px; color: var(--ce-ink-soft); margin-top: 4px; }
.ce-card-dl svg { width: 14px; height: 14px; }
.ce-card-rep-label { font-size: 13px; color: var(--ce-ink-soft); margin-bottom: 3px; }
.ce-card-size { font-size: 22px; font-weight: 800; white-space: nowrap; }
.ce-card-size .unit { font-size: 13px; font-weight: 700; vertical-align: super; margin-left: 1px; }

@media (max-width: 768px) {
  .ce-card { flex-wrap: wrap; }
  .ce-card-meta { width: 100%; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--ce-line); justify-content: space-between; }
  .ce-card-col { padding: 0 8px; min-width: 0; }
}

/* Ribbon badges (Recommended / Latest / Hot) on the thumbnail */
.ce-ribbon {
  position: absolute; top: 0; left: 0;
  background: #111827; color: #fff;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; padding: 2px 8px;
  border-bottom-right-radius: 6px;
}
.ce-ribbon.is-latest { background: #2563eb; }
.ce-ribbon.is-hot    { background: #dc2626; }

/* ---------------------------------------------------------------
   STAR RATING
   --------------------------------------------------------------- */
.ce-stars { display: inline-flex; gap: 2px; }
.ce-stars .s { width: 14px; height: 14px; color: var(--ce-line-2); }
.ce-stars .s.on { color: var(--ce-star); }

/* ---------------------------------------------------------------
   SIDEBAR (small list items - "Pc Games", related products)
   --------------------------------------------------------------- */
.ce-widget {
  border: 1px solid var(--ce-line);
  border-radius: var(--ce-radius);
  padding: 18px;
  margin-bottom: 20px;
}
.ce-widget-title {
  font-size: 18px; font-weight: 800; margin: 0 0 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--ce-line);
}
.ce-mini {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--ce-line);
}
.ce-mini:last-child { border-bottom: 0; }
.ce-mini-ico { width: 44px; height: 44px; flex-shrink: 0; border-radius: 8px; overflow: hidden; }
.ce-mini-ico img { width: 100%; height: 100%; object-fit: contain; }
.ce-mini-title { font-size: 14px; font-weight: 600; }
.ce-mini-cat   { font-size: 12px; color: var(--ce-ink-mute); }

/* ---------------------------------------------------------------
   ARCHIVE FILTER PANELS (Primary Category / Sub Category)
   --------------------------------------------------------------- */
.ce-filter {
  border: 1px solid var(--ce-line);
  border-radius: var(--ce-radius);
  padding: 20px;
  margin-bottom: 20px;
}
.ce-filter h3 {
  font-size: 18px; font-weight: 800; margin: 0 0 6px;
}
.ce-filter .rule { height:1px; background: var(--ce-line); margin: 8px 0 14px; }
.ce-check {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; font-size: 14px;
}
.ce-check input { width: 16px; height: 16px; }
.ce-private {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--ce-ink-soft);
  border: 1px solid var(--ce-line-2); border-radius: 6px;
  padding: 2px 7px; margin-left: auto;
}
.ce-private svg { width: 12px; height: 12px; color: var(--ce-crown); }

/* ---------------------------------------------------------------
   SINGLE POST: download box + product info
   --------------------------------------------------------------- */
.ce-dlbox {
  border: 1px solid var(--ce-line);
  border-radius: var(--ce-radius);
  padding: 20px; margin-bottom: 20px; text-align: center;
}
.ce-dlbox .size { font-size: 34px; font-weight: 800; line-height: 1; }
.ce-dlbox .size .unit { font-size: 16px; vertical-align: super; }
.ce-dlbox .verline { font-size: 12px; color: var(--ce-ink-mute); margin: 6px 0 14px; }
.ce-btn-dl {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 16px;
  background: var(--ce-accent); color: var(--ce-accent-ink);
  font-weight: 700; font-size: 15px; border: 0; border-radius: 8px;
}
.ce-btn-dl:hover { background: var(--ce-accent-d); }
.ce-btn-fav {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px 16px; margin-top: 10px;
  background: #fff; color: var(--ce-ink);
  font-weight: 600; font-size: 14px;
  border: 1px solid var(--ce-line-2); border-radius: 8px;
}
.ce-btn-fav:hover { background: var(--ce-surface); }

/* Product info meta table */
.ce-info-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; font-size: 13px;
  border-bottom: 1px solid var(--ce-line);
}
.ce-info-row:last-child { border-bottom: 0; }
.ce-info-row .k { color: var(--ce-ink-soft); }
.ce-info-row .v { font-weight: 600; text-align: right; }

/* Post body sections */
.ce-post-title { font-size: 30px; font-weight: 800; line-height: 1.2; }
.ce-prose h2 { font-size: 22px; font-weight: 700; margin: 28px 0 12px; }
.ce-prose h3 { font-size: 18px; font-weight: 700; margin: 22px 0 10px; }
.ce-prose p  { margin: 0 0 14px; color: var(--ce-ink); }
.ce-prose ul { margin: 0 0 14px; padding-left: 20px; }
.ce-prose li { margin: 4px 0; }

/* Screenshot gallery */
.ce-gallery { position: relative; border: 1px solid var(--ce-line); border-radius: var(--ce-radius); overflow: hidden; }
.ce-gallery-track { display: flex; transition: transform .3s ease; }
.ce-gallery-slide { min-width: 100%; }
.ce-gallery-slide img { width: 100%; display: block; }
.ce-gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 9999px;
  background: rgba(17,24,39,.7); color: #fff; border: 0;
  display: flex; align-items: center; justify-content: center;
}
.ce-gallery-nav.prev { left: 10px; }
.ce-gallery-nav.next { right: 10px; }

/* Previous version table */
.ce-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ce-table th { text-align: left; font-weight: 700; padding: 10px; border-bottom: 2px solid var(--ce-line-2); }
.ce-table td { padding: 10px; border-bottom: 1px solid var(--ce-line); vertical-align: top; }
.ce-table .dl-cell { text-align: right; }

/* ---------------------------------------------------------------
   HUB PAGE (platform filter pills + category card grid)
   --------------------------------------------------------------- */
.ce-hub-title { font-size: 34px; font-weight: 800; line-height: 1.2; margin: 24px 0; }
.ce-pills { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.ce-pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--ce-line-2); border-radius: 9999px;
  padding: 10px 18px; font-size: 14px; font-weight: 600;
  background: #fff;
}
.ce-pill:hover { background: var(--ce-surface); }
.ce-pill.is-active { background: #111827; color: #fff; border-color: #111827; }
.ce-pill svg { width: 18px; height: 18px; }
.ce-pill .ce-crown { position: absolute; top: -8px; right: 14px; width: 14px; height: 14px; color: var(--ce-crown); }

.ce-cat-card {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--ce-line); border-radius: var(--ce-radius);
  padding: 18px 20px; background: #fff;
  transition: box-shadow .15s ease;
}
.ce-cat-card:hover { box-shadow: var(--ce-shadow-md); }
.ce-cat-card .ico { width: 32px; height: 32px; flex-shrink: 0; }
.ce-cat-card .name { font-size: 16px; font-weight: 600; }
.ce-cat-card .ce-crown { margin-left: auto; width: 16px; height: 16px; color: var(--ce-crown); }

/* ---------------------------------------------------------------
   COMMENTS
   --------------------------------------------------------------- */
.ce-comments { margin-top: 36px; }
.ce-comment { padding: 14px 0; border-bottom: 1px solid var(--ce-line); }
.ce-comment .head { display: flex; align-items: center; gap: 10px; }
.ce-comment .avatar { width: 32px; height: 32px; border-radius: 9999px; overflow: hidden; flex-shrink: 0; }
.ce-comment .author { font-weight: 700; font-size: 14px; }
.ce-comment .date { font-size: 12px; color: var(--ce-ink-mute); }
.ce-comment .reply-link { margin-left: auto; font-size: 13px; color: var(--ce-ink-soft); }
.ce-comment .body { margin: 6px 0 0 42px; font-size: 14px; }
.ce-comment.depth-2 { margin-left: 42px; }
.ce-comment.depth-3 { margin-left: 84px; }

.ce-cform input[type=text],
.ce-cform input[type=email],
.ce-cform textarea {
  width: 100%; border: 1px solid var(--ce-line-2); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; font-family: inherit;
}
.ce-cform .submit, .ce-cform input[type=submit] {
  display: inline-flex; align-items: center; gap: 8px;
  background: #111827; color: #fff; border: 0; border-radius: 8px;
  padding: 10px 18px; font-weight: 600; font-size: 14px;
}

/* ---------------------------------------------------------------
   FOOTER (other products grid + link columns + assistant card)
   --------------------------------------------------------------- */
.ce-footer { background: var(--ce-header-bg); color: var(--ce-header-mute); margin-top: 48px; }
.ce-footer a { color: var(--ce-header-mute); }
.ce-footer a:hover { color: var(--ce-header-ink); }
.ce-footer-h { color: var(--ce-header-ink); font-weight: 700; font-size: 14px; margin: 0 0 12px; }
.ce-footer-col li { list-style: none; padding: 4px 0; font-size: 13px; }
.ce-footer-col ul { margin: 0; padding: 0; }
.ce-other-card {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--ce-header-line); border-radius: 8px;
  padding: 10px 12px; font-size: 12px;
}
.ce-assistant {
  border: 1px solid var(--ce-header-line); border-radius: 16px;
  padding: 18px; background: #14171d;
}
.ce-footer-bottom { border-top: 1px solid var(--ce-header-line); padding: 16px 0; font-size: 12px; text-align: center; }

/* ---------------------------------------------------------------
   404
   --------------------------------------------------------------- */
.ce-404 { text-align: center; padding: 80px 16px; }
.ce-404 .code { font-size: 96px; font-weight: 800; line-height: 1; color: var(--ce-ink); }
.ce-404 .msg { font-size: 20px; font-weight: 600; margin: 8px 0 20px; }
