/* ===============================
   HBCT Suomen Kaupungit – Dark UI
   Musta + punainen teema
   =============================== */

.hbct-kaupungit {
  --hbct-accent: #d6111e;
  --hbct-bg: #0b0b0d;
  --hbct-card-bg: #141417;
  --hbct-border: #242428;
  --hbct-text: #f3f4f6;
  --hbct-muted: #9ca3af;
  --hbct-shadow: 0 10px 30px rgba(0,0,0,0.65);
  color: var(--hbct-text);
}

/* -------- Search -------- */

.hbct-search {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hbct-search__input {
  background: #0f0f12;
  color: var(--hbct-text);
  border: 1px solid var(--hbct-border);
  border-radius: 12px;
  padding: 12px 14px;
  width: min(420px, 100%);
}

.hbct-search__input::placeholder {
  color: var(--hbct-muted);
}

.hbct-search__input:focus {
  outline: none;
  border-color: var(--hbct-accent);
  box-shadow: 0 0 0 3px rgba(214,17,30,0.35);
}

.hbct-search__button,
.hbct-btn {
  background: linear-gradient(135deg, #d6111e, #9f0d16);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.hbct-search__button:hover,
.hbct-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(214,17,30,0.45);
}

/* -------- Count -------- */

.hbct-count {
  margin-bottom: 20px;
  font-weight: 800;
  color: var(--hbct-text);
}

/* -------- Grid -------- */

.hbct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px;
}

/* -------- Card -------- */

.hbct-card {
  background: radial-gradient(
    circle at top,
    #1a1a1f,
    var(--hbct-card-bg)
  );
  border: 1px solid var(--hbct-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--hbct-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .2s ease, box-shadow .2s ease;
}

.hbct-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 45px rgba(0,0,0,0.85);
}

.hbct-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #1f1f24;
}

.hbct-card__title {
  font-size: 19px;
  color: var(--hbct-accent);
  margin: 4px 0 0;
}

.hbct-card__excerpt {
  color: var(--hbct-muted);
  font-size: 14px;
  line-height: 1.55;
}

/* -------- Share (Card) -------- */

.hbct-card__share {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.hbct-card__shareLabel {
  font-size: 12px;
  font-weight: 800;
  color: var(--hbct-muted);
}

.hbct-share-btn {
  background: #0f0f12;
  border: 1px solid #2a2a2f;
  color: var(--hbct-accent);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: background .15s ease, box-shadow .15s ease;
}

.hbct-share-btn:hover {
  background: rgba(214,17,30,0.15);
  box-shadow: 0 0 0 2px rgba(214,17,30,0.25);
}

/* -------- Pagination -------- */

.hbct-pagination {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hbct-page {
  background: #0f0f12;
  border: 2px solid var(--hbct-accent);
  color: var(--hbct-accent);
  padding: 9px 14px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: all .15s ease;
}

.hbct-page:hover {
  background: var(--hbct-accent);
  color: #fff;
}

.hbct-page.is-active {
  background: var(--hbct-accent);
  color: #fff;
  cursor: default;
}

/* -------- Modal -------- */

.hbct-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.hbct-modal.is-open {
  display: block;
}

.hbct-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(2px);
}

.hbct-modal__content {
  position: relative;
  background: radial-gradient(circle at top, #1b1b20, #0e0e11);
  color: var(--hbct-text);
  width: min(880px, calc(100% - 24px));
  margin: 48px auto;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid #2a2a2f;
  box-shadow: 0 25px 80px rgba(0,0,0,0.9);

  max-height: calc(100vh - 96px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.hbct-modal__close {
  position: sticky;
  top: 6px;
  float: right;
  font-size: 34px;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
}

/* -------- Modal Content -------- */

.hbct-modal-title {
  color: var(--hbct-accent);
  margin-bottom: 14px;
}

.hbct-modal-image {
  max-width: 100%;
  border-radius: 16px;
  margin-bottom: 16px;
  border: 1px solid #242428;
}

.hbct-modal-share {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.hbct-modal-share__label {
  font-weight: 900;
  color: var(--hbct-muted);
}

.hbct-modal-body {
  line-height: 1.65;
  color: #e5e7eb;
}

/* -------- Scroll lock -------- */

body.hbct-modal-open {
  overflow: hidden;
}
