/* ──────────────────────────────────────────────────────────────
   Karocamp Tabs Widget  |  tabs.css
   ────────────────────────────────────────────────────────────── */

/* RTL wrapper */
.kct-wrapper { direction: rtl; font-family: inherit; }

/* ═══ NAV ═══ */
.kct-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background-color: #1a2744;
  border-radius: 12px;
  margin-bottom: 28px;
}

.kct-nav__btn {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  transition: color .2s, background-color .2s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}
.kct-nav__btn:focus-visible {
  outline: 2px solid #4d90fe;
  outline-offset: 2px;
}
.kct-nav__btn:hover:not(.is-active) {
  color: #fff;
  background-color: rgba(255,255,255,.1);
}
.kct-nav__btn.is-active {
  background-color: #fff;
  color: #1a2744;
}
.kct-nav__btn--link.is-active {
  background-color: #fff;
  color: #1a2744;
}

/* ═══ PANELS ═══ */
.kct-panel { display: none; }
.kct-panel.is-active { display: block; }
.kct-panel[hidden="false"] { display: block; }

/* ═══ GRID ═══ */
.kct-grid {
  display: grid;
  gap: 20px;
  min-height: 200px;
  transition: opacity .25s;
}
.kct-grid.is-loading { opacity: .45; pointer-events: none; }

/* Desktop columns */
.kct-grid--d1 { grid-template-columns: repeat(1, 1fr); }
.kct-grid--d2 { grid-template-columns: repeat(2, 1fr); }
.kct-grid--d3 { grid-template-columns: repeat(3, 1fr); }
.kct-grid--d4 { grid-template-columns: repeat(4, 1fr); }

/* Tablet */
@media (max-width: 1024px) {
  .kct-grid--t1 { grid-template-columns: repeat(1, 1fr); }
  .kct-grid--t2 { grid-template-columns: repeat(2, 1fr); }
  .kct-grid--t3 { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile */
@media (max-width: 767px) {
  .kct-grid--m1 { grid-template-columns: repeat(1, 1fr); }
  .kct-grid--m2 { grid-template-columns: repeat(2, 1fr); }
}

/* ═══ CARD ═══ */
.kct-post-card {
  background-color: #1a2744;
  border-radius: 14px;
  overflow: hidden;
  transition: transform .22s, box-shadow .22s;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
}
.kct-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0,0,0,.35);
}

.kct-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Thumbnail */
.kct-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #0f1b35;
  flex-shrink: 0;
}
.kct-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s;
}
.kct-post-card:hover .kct-card-thumb img { transform: scale(1.05); }

.kct-card-thumb--no-image .kct-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f2250 0%, #1d3a6e 100%);
}

/* Category badge */
.kct-card-cat {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: #1a7a3c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: .3px;
  line-height: 1.4;
}

/* Card body */
.kct-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.kct-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.kct-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,.5);
  margin-top: auto;
}
.kct-card-author { font-weight: 600; color: rgba(255,255,255,.7); }
.kct-card-date { direction: ltr; }

/* ═══ LOADER ═══ */
.kct-loader {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 32px;
}
.kct-panel.is-loading .kct-loader { display: flex; }
.kct-loader span {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #4d90fe;
  animation: kct-bounce .8s infinite ease-in-out both;
}
.kct-loader span:nth-child(1) { animation-delay: -.3s; }
.kct-loader span:nth-child(2) { animation-delay: -.15s; }
@keyframes kct-bounce {
  0%, 80%, 100% { transform: scale(0); opacity: .4; }
  40%            { transform: scale(1); opacity: 1; }
}

/* ═══ PAGINATION ═══ */
.kct-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
}
.kct-pag__btn {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.7);
  transition: background-color .2s, color .2s, border-color .2s;
}
.kct-pag__btn:hover:not(.is-active):not(:disabled) {
  background-color: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.4);
  color: #fff;
}
.kct-pag__btn.is-active {
  background-color: #4d90fe;
  border-color: #4d90fe;
  color: #fff;
}
.kct-pag__btn:disabled {
  opacity: .3;
  cursor: not-allowed;
}
.kct-pag__btn--prev,
.kct-pag__btn--next { font-size: 16px; }

/* ═══ EMPTY STATE ═══ */
.kct-empty {
  text-align: center;
  padding: 48px 24px;
  color: rgba(255,255,255,.4);
  font-size: 14px;
  grid-column: 1 / -1;
}

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  .kct-post-card,
  .kct-post-card:hover,
  .kct-card-thumb img,
  .kct-post-card:hover .kct-card-thumb img,
  .kct-grid { transition: none; }
  .kct-loader span { animation: none; background-color: #4d90fe; }
}
