/* ============================================
   css/directory.css
   State Directory Page — max-width 1400px
   ─ .directory-shell  : full-width bg wrapper
   ─ .directory-page   : 1400px centred flex row
   ─ .dir-sidebar      : 260px sticky left panel
   ─ .dir-main         : flex:1 right, no own scroll
   ─ .dir-item-*       : spa item rows + rating
   ─ .dir-pagination   : right-aligned pagination
   ============================================ */


/* ══════════════════════════════════════════
   OUTER SHELL
   ══════════════════════════════════════════ */
.directory-shell {
  width: 100%;
  background: #0f0f0f;
}

/* ══════════════════════════════════════════
   PAGE WRAPPER
   ══════════════════════════════════════════ */
.directory-page {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - 100px);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  background: #0f0f0f;
  position: relative;
}


/* ══════════════════════════════════════════
   LEFT SIDEBAR
   ══════════════════════════════════════════ */
.dir-sidebar {
  width: 260px;
  min-width: 260px;
  flex-shrink: 0;
  background: #111213;
  border-right: 1px solid #1e2020;
  position: sticky;
  top: 48px;
  height: calc(100vh - 48px);
  align-self: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #252525 #111213;
  display: flex;
  flex-direction: column;
}

.dir-sidebar::-webkit-scrollbar         { width: 4px; }
.dir-sidebar::-webkit-scrollbar-track   { background: #111213; }
.dir-sidebar::-webkit-scrollbar-thumb   { background: #252525; border-radius: 4px; }
.dir-sidebar::-webkit-scrollbar-thumb:hover { background: #333; }

/* Label */
.dir-sidebar__label {
  padding: 18px 20px 9px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: #4a4a4a;
  border-bottom: 1px solid #1a1a1a;
  flex-shrink: 0;
}

/* Heading */
.dir-sidebar__heading {
  padding: 13px 20px 11px;
  font-size: 13px;
  font-weight: 700;
  color: #c0c0c0;
  letter-spacing: 0.2px;
  border-bottom: 1px solid #1a1a1a;
  flex-shrink: 0;
}

/* State list */
.dir-state-list {
  list-style: none;
  margin: 0;
  padding: 5px 0;
  flex: 1;
}

.dir-state-list li a {
  display: block;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  color: #8a8a8a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.14s, color 0.14s, padding-left 0.14s;
}

.dir-state-list li a:hover {
  background: #162016;
  color: #c0e8c0;
  padding-left: 26px;
}

.dir-state-list li.active a {
  background: #1a3a1a;
  color: #bce8bc;
  border-left: 3px solid #4caf50;
  padding-left: 17px;
  font-weight: 700;
}


/* ══════════════════════════════════════════
   RIGHT MAIN — no own scroll
   ══════════════════════════════════════════ */
.dir-main {
  flex: 1;
  min-width: 0;
  padding: 28px 36px 48px;
  overflow: visible;
}

/* Breadcrumb */
.dir-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #4a4a4a;
  margin-bottom: 18px;
}

.dir-breadcrumb a        { color: #3d6e3d; transition: color 0.14s; }
.dir-breadcrumb a:hover  { color: #81c784; }
.dir-breadcrumb .sep     { color: #2e2e2e; }
.dir-breadcrumb .cur     { color: #777; }

/* Section heading */
.dir-main__title {
  font-size: 19px;
  font-weight: 700;
  color: #ddd;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #1e1e1e;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.3px;
}

.dir-main__title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, #243424, transparent);
}

/* Total count label */
.dir-main__count {
  font-size: 12px;
  font-weight: 500;
  color: #3a5a3a;
  background: #141e14;
  border: 1px solid #1e321e;
  border-radius: 20px;
  padding: 3px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}


/* ══════════════════════════════════════════


/* ══════════════════════════════════════════
   SPA ITEM GRID
   ─ Responsive grid: 3 cols → 2 → 1
   ─ Each card: image top, body below, footer
   ══════════════════════════════════════════ */

/* Grid wrapper */
.dir-item-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
}

/* ── Single card ── */
.dir-card {
  display: flex;
  flex-direction: column;
  background: #111213;
  border: 1px solid #1c1c1c;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  cursor: pointer;
}

.dir-card:hover {
  transform: translateY(-3px);
  border-color: #2a4a2a;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
}

/* ── Card image ── */
.dir-card__img-wrap {
  position: relative;
  width: 100%;
  padding-top: 56%;          /* 16:9 aspect ratio */
  overflow: hidden;
  background: #161e16;
  flex-shrink: 0;
}

.dir-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.dir-card:hover .dir-card__img { transform: scale(1.05); }

/* Fallback placeholder */
.dir-card__img-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #141e14, #0d130d);
}

.dir-card__img-fallback svg {
  width: 36px;
  height: 36px;
  color: #2a4a2a;
  opacity: 0.45;
}

/* ── Card body ── */
.dir-card__body {
  flex: 1;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

/* Title */
.dir-card__title {
  font-size: 14px;
  font-weight: 700;
  color: #d8d8d8;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.14s;
}

.dir-card:hover .dir-card__title { color: #bde8bd; }

/* Stars + rating + review count */
.dir-card__rating-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.dir-card__stars {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}

.dir-card__stars .star {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.dir-card__stars .star--full  { color: #388e3c; }
.dir-card__stars .star--half  { color: #388e3c; opacity: 0.65; }
.dir-card__stars .star--empty { color: #ede8e88f; }

.dir-card__rating {
  font-size: 12.5px;
  font-weight: 700;
  color: #5a9a5a;
  flex-shrink: 0;
}

.dir-card__reviews {
  font-size: 11.5px;
  color: #444;
  flex-shrink: 0;
}

/* Description */
.dir-card__desc {
  font-size: 12px;
  color: #505050;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  flex: 1;
}

/* ── Card footer: stats + button ── */
.dir-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #1a1a1a;
}

/* Stats (views, watches) */
.dir-card__stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.dir-card__stat {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #3a3a3a;
  flex-shrink: 0;
  transition: color 0.13s;
}

.dir-card:hover .dir-card__stat { color: #4a6a4a; }

.dir-card__stat svg {
  width: 11px;
  height: 11px;
  opacity: 0.4;
  flex-shrink: 0;
}

/* Read Reviews button */
.dir-card__btn {
  background: #1a3a1a;
  color: #8cd88c;
  border: 1px solid #2a5a2a;
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-body, sans-serif);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s, box-shadow 0.14s, color 0.14s;
}

.dir-card:hover .dir-card__btn {
  background: #223e22;
  color: #bde8bd;
  box-shadow: 0 0 10px rgba(76,175,80,0.25);
}

/* ── Grid responsive breakpoints ── */

/* 2 columns at medium widths */
@media (max-width: 1100px) {
  .dir-item-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

/* 1 column on small screens */
@media (max-width: 600px) {
  .dir-item-grid { grid-template-columns: 1fr; gap: 12px; }
  .dir-card__desc { -webkit-line-clamp: 1; }
}

   EMPTY STATE
   ══════════════════════════════════════════ */
.dir-empty {
  padding: 50px 24px;
  text-align: center;
}

.dir-empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.18;
  margin: 0 auto 14px;
  display: block;
}

.dir-empty p {
  margin: 0;
  font-size: 14px;
  color: #3a3a3a;
}

.dir-empty strong { color: #4a6a4a; }


/* ══════════════════════════════════════════
   PAGINATION — right-aligned
   ══════════════════════════════════════════ */
.dir-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.dir-page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid #242424;
  background: #161616;
  color: #6a6a6a;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body, sans-serif);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
  user-select: none;
  line-height: 1;
}

.dir-page-btn:hover:not([disabled]):not(.active) {
  background: #1a3a1a;
  border-color: #2e6a2e;
  color: #bce8bc;
}

.dir-page-btn.active {
  background: #1a3a1a;
  border-color: #4caf50;
  color: #bce8bc;
  cursor: default;
  box-shadow: 0 0 8px rgba(76,175,80,0.2);
  pointer-events: none;
}

.dir-page-btn[disabled] {
  opacity: 0.22;
  cursor: not-allowed;
  pointer-events: none;
}

.dir-page-btn.prev,
.dir-page-btn.next {
  font-size: 17px;
  padding: 0 9px;
  color: #555;
}

/* Info text "1–10 of 48" */
.dir-page-info {
  font-size: 11.5px;
  color: #383838;
  margin-right: 10px;
  white-space: nowrap;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 1400px) {
  .dir-sidebar { width: 240px; min-width: 240px; }
  .dir-main    { padding: 26px 30px 44px; }
}

@media (max-width: 1100px) {
  .dir-sidebar         { width: 210px; min-width: 210px; }
  .dir-main            { padding: 22px 24px 40px; }
}

@media (max-width: 900px) {
  .dir-sidebar         { width: 180px; min-width: 180px; }
  .dir-main            { padding: 18px 18px 32px; }
}

@media (max-width: 640px) {
  .directory-page {
    flex-direction: column;
  }
  .dir-sidebar {
    width: 100%;
    min-width: unset;
    height: auto;
    max-height: 240px;
    position: static;
    border-right: none;
    border-bottom: 1px solid #1e1e1e;
    overflow-y: auto;
  }
  .dir-main       { padding: 16px 14px 28px; }
  .dir-pagination { justify-content: center; }
}

@media (max-width: 400px) {
  .dir-page-btn    { min-width: 28px; height: 28px; font-size: 12px; }
  .dir-main__title { font-size: 16px; }
}


/* ══════════════════════════════════════════
   CARD META ROW  (creator · date · category)
   ══════════════════════════════════════════ */
.dir-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 2px;
}

.dir-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #484848;
  white-space: nowrap;
  transition: color 0.13s;
}

.dir-card:hover .dir-card__meta-item { color: #5a7a5a; }

.dir-card__meta-item svg {
  width: 11px;
  height: 11px;
  opacity: 0.45;
  flex-shrink: 0;
}

/* Category pill */
.dir-card__meta-item--cat {
  background: #141e14;
  border: 1px solid #1e2e1e;
  border-radius: 20px;
  padding: 2px 8px 2px 5px;
  color: #3a6a3a;
}

.dir-card:hover .dir-card__meta-item--cat {
  color: #6ab86a;
  border-color: #2a4a2a;
}