:root {
  --header-h: 44px;
  --nav-h: 52px;
  --blue: #369af8;
  --red: #e8312f;
  --tab-grey: #b8b8b8;
  --text-dark: #1a1a1a;
  --text-body: #3a3a3a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html,
body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #000;
  color: var(--text-dark);
  overflow: hidden; /* Prevent body scrolling */
}

/* Top tab bar */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: #000;
  z-index: 100;
  display: flex;
  align-items: center;
}

.tabs {
  display: flex;
  gap: 18px;
  padding: 0 14px;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
}

.tab {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tab-grey);
  letter-spacing: 0.1px;
}

.tab.active {
  color: var(--blue);
}

/* Scroll snap container */
.feed-container {
  position: fixed;
  top: calc(var(--header-h) + env(safe-area-inset-top));
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.feed-container::-webkit-scrollbar {
  display: none;
}

/* Individual full-screen card */
.news-card {
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: 0 6px 6px;
  display: flex;
}

.card-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

/* Card Image */
.card-image-wrap {
  position: relative;
  height: 40%;
  flex-shrink: 0;
  background: #222;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-icons {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
}

.image-icons span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Badges straddling the image bottom edge */
.badge {
  position: absolute;
  bottom: -13px; /* half of height, so the image edge bisects the badge content */
  height: 26px;
  background: #fff;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.badge-brand {
  left: 10px;
  padding-left: 6px;
  padding-right: 8px;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.1px;
}

.badge-brand svg {
  width: 13px;
  height: 13px;
  display: block;
}

.badge-actions {
  right: 10px;
  padding-left: 10px;
  padding-right: 10px;
  gap: 14px;
}

.badge-actions svg {
  width: 13px;
  height: 13px;
  display: block;
  stroke: #222;
}

/* Card Body Content */
.card-body {
  flex: 1;
  padding: 22px 16px 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-title {
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.card-text {
  font-size: 0.85rem;
  line-height: 1.6;
  font-weight: 400;
  color: var(--text-body);
}

.card-meta {
  margin-top: 10px;
  font-size: 0.7rem;
  color: #999;
}

/* Translucent "Tap to know more" footer */
.card-footer {
  position: relative;
  height: 64px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 18px;
  color: #fff;
  text-decoration: none;
}

.card-footer::before {
  content: "";
  position: absolute;
  inset: -20px;
  background-image: var(--footer-bg);
  background-size: cover;
  background-position: center;
  filter: blur(16px);
  z-index: 0;
}

.card-footer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(40, 40, 40, 0.55);
  z-index: 0;
}

.footer-title,
.footer-sub {
  position: relative;
  z-index: 1;
}

.footer-title {
  font-size: 0.85rem;
  font-weight: 500;
}

.footer-sub {
  font-size: 0.7rem;
  opacity: 0.75;
  margin-top: 2px;
}

/* Bottom nav bar */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: space-around;
  pointer-events: none;
  z-index: 100;
}

.nav-icon {
  width: 24px;
  height: 24px;
  stroke: #8a8a8a;
}

.nav-icon.active {
  stroke: #fff;
}

.nav-avatar {
  width: 26px;
  height: 26px;
}

.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 1.1rem;
  color: #aaa;
}
