/* =========================================================
   HB RSS Reader — Harrasteblogi v4.1
   Värit: #d6111e | #ddc76d | #000000 | #ffffff
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
.hb-rss {
  --red:        #d6111e;
  --gold:       #ddc76d;
  --black:      #000000;
  --white:      #ffffff;

  --red-dim:    rgba(214,17,30,.15);
  --red-glow:   rgba(214,17,30,.35);
  --red-edge:   rgba(214,17,30,.60);
  --gold-dim:   rgba(221,199,109,.12);
  --gold-edge:  rgba(221,199,109,.55);

  --surface:    #0d0d0d;
  --card:       #111111;
  --card2:      #181818;
  --line:       rgba(255,255,255,.07);
  --muted:      #888888;

  --radius-sm:  9px;
  --radius:     14px;
  --radius-lg:  20px;
  --shadow:     0 8px 36px rgba(0,0,0,.7);
  --shadow-red: 0 4px 22px rgba(214,17,30,.30);
  --shadow-gold:0 4px 16px rgba(221,199,109,.18);

  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--white);
  background: var(--black);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 1.5rem auto;
  max-width: 1200px;
  width: calc(100% - 32px);
  position: relative;
}

/* ── Scanline ───────────────────────────────────────────── */
.hb-rss::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,.04) 3px,
    rgba(0,0,0,.04) 4px
  );
  pointer-events: none;
  z-index: 0;
}

.hb-rss__inner { position: relative; z-index: 1; }

/* ── TOP BAR ────────────────────────────────────────────── */
.hb-rss__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  background: #000;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

/* ── Logo ───────────────────────────────────────────────── */
.hb-rss__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.hb-rss__logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-red);
}
.hb-rss__logo-mark svg { width: 22px; height: 22px; fill: #fff; }

.hb-rss__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.hb-rss__logo-hb {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .1em;
  color: var(--white);
  text-transform: uppercase;
}
.hb-rss__logo-sub {
  font-family: 'Oswald', sans-serif;
  font-weight: 400;
  font-size: .63rem;
  letter-spacing: .22em;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 3px;
}

/* ── Meta (live + timestamp + refresh) ──────────────────── */
.hb-rss__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hb-rss__live {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Oswald', sans-serif;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--red);
  text-transform: uppercase;
}
.hb-rss__live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
  animation: hb-pulse 1.4s ease-in-out infinite;
}
@keyframes hb-pulse {
  0%,100%{ opacity:1; transform:scale(1); }
  50%     { opacity:.4; transform:scale(.7); }
}

.hb-rss__timestamp {
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Refresh button  (gold accent) ─────────────────────── */
.hb-rss__refresh {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-edge);
  background: var(--gold-dim);
  color: var(--gold);
  font-family: 'Oswald', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .18s, border-color .18s, box-shadow .18s, transform .1s;
  white-space: nowrap;
}
.hb-rss__refresh svg { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }
.hb-rss__refresh:hover {
  background: rgba(221,199,109,.22);
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}
.hb-rss__refresh:active { transform: translateY(0); }
.hb-rss__refresh:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--gold-dim); }
.hb-rss__refresh.is-loading { opacity: .6; cursor: progress; pointer-events: none; }
.hb-rss__refresh.is-loading svg { animation: hb-spin .8s linear infinite; }
@keyframes hb-spin { to { transform: rotate(360deg); } }

/* ── Red + gold dual stripe ─────────────────────────────── */
.hb-rss__stripe {
  height: 3px;
  background: linear-gradient(90deg,
    var(--red) 0%,
    var(--red) 55%,
    var(--gold) 55%,
    var(--gold) 72%,
    transparent 100%
  );
}

/* ── TABS ───────────────────────────────────────────────── */
.hb-rss__tabs-wrap {
  padding: 11px 16px 5px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.hb-rss__tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 5px;
}
.hb-rss__tabs::-webkit-scrollbar { display: none; }

.hb-rss__tab {
  flex: 0 0 auto;
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: 'Oswald', sans-serif;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.hb-rss__tab:hover {
  color: var(--gold);
  border-color: var(--gold-edge);
  background: var(--gold-dim);
}
.hb-rss__tab.is-active {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
  box-shadow: var(--shadow-red);
}
.hb-rss__tab:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--red-glow); }

/* ── BODY / PANELS ──────────────────────────────────────── */
.hb-rss__body {
  padding: 13px 16px 18px;
  background: var(--black);
}
.hb-rss__panel { display: none; }
.hb-rss__panel.is-active {
  display: block;
  animation: hb-fadein .22s ease;
}
@keyframes hb-fadein {
  from { opacity:0; transform:translateY(5px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── List ───────────────────────────────────────────────── */
.hb-rss__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Card ───────────────────────────────────────────────── */
.hb-rss__card {
  display: flex;
  gap: 0;
  align-items: stretch;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.hb-rss__card::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--red);
  opacity: 0;
  transition: opacity .2s;
}
.hb-rss__card:hover {
  border-color: var(--red-edge);
  box-shadow: 0 4px 22px rgba(214,17,30,.18);
  transform: translateY(-2px);
}
.hb-rss__card:hover::after { opacity: 1; }
.hb-rss__card:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--red-glow); }

/* ── Thumbnail ──────────────────────────────────────────── */
.hb-rss__thumb {
  flex: 0 0 96px;
  width: 96px;
  min-height: 80px;
  overflow: hidden;
  background: var(--card2);
  position: relative;
}
.hb-rss__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.hb-rss__card:hover .hb-rss__thumb img { transform: scale(1.07); }

/* ── Card body ──────────────────────────────────────────── */
.hb-rss__card-body {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.hb-rss__card-source {
  font-family: 'Oswald', sans-serif;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--gold);
}
.hb-rss__card-title {
  font-size: .93rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--white);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.hb-rss__card-desc {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.hb-rss__card-arrow {
  margin-top: auto;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: 'Oswald', sans-serif;
  font-size: .67rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--red);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .18s, transform .18s;
}
.hb-rss__card-arrow svg { width: 11px; height: 11px; fill: currentColor; }
.hb-rss__card:hover .hb-rss__card-arrow { opacity: 1; transform: translateX(0); }

/* ── Empty state ────────────────────────────────────────── */
.hb-rss__empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  border: 1px dashed rgba(255,255,255,.12);
  border-radius: var(--radius);
}

/* ── Footer ─────────────────────────────────────────────── */
.hb-rss__footer {
  padding: 8px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.hb-rss__footer-brand {
  font-family: 'Oswald', sans-serif;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.hb-rss__footer-brand span { color: var(--red); }
.hb-rss__footer-url { font-size: .7rem; color: var(--muted); }

/* ── Toast ──────────────────────────────────────────────── */
.hb-rss__toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  background: #111;
  color: var(--white);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  box-shadow: var(--shadow);
  font-size: .85rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  max-width: min(320px, calc(100vw - 2rem));
}
.hb-rss__toast.is-show { opacity: 1; transform: translateY(0); }

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hb-rss__topbar { flex-direction: column; align-items: flex-start; padding: 12px 14px; }
  .hb-rss__meta { width: 100%; justify-content: space-between; }
  .hb-rss__thumb { flex: 0 0 78px; width: 78px; }
  .hb-rss__body { padding: 10px 12px 14px; }
  .hb-rss__tabs-wrap { padding: 8px 12px 4px; }
}
@media (max-width: 380px) {
  .hb-rss__thumb { flex: 0 0 60px; width: 60px; }
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hb-rss__live-dot { animation: none; opacity: 1; }
  .hb-rss__refresh.is-loading svg { animation: none; }
  .hb-rss__panel.is-active { animation: none; }
  .hb-rss__thumb img,
  .hb-rss__card,
  .hb-rss__card-arrow { transition: none; }
}
