/* Новостник — Mobile-only feed
   Clean Hot News / NewsPulse style
*/

:root {
  --bg: #f2f3f5;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #6b7280;
  --accent: #e11d48; /* hot red */
  --border: #e5e7eb;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
  --header-h: 52px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}

img {
  max-width: 100%;
  display: block;
  object-fit: cover;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ========== Header ========== */
.header {
  position: relative; /* не sticky — скроллится вместе со страницей */
  z-index: 100;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.3px;
}

.logo-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 5px;
  line-height: 1;
}

.logo-text {
  color: #111;
}

.menu-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.menu-btn svg {
  width: 22px;
  height: 22px;
  stroke: #374151;
}

/* ========== Feed ========== */
.feed {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 12px 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Card */
.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.04);
  transition: transform .15s ease;
}

.card:active {
  transform: scale(.985);
}

.card-img-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #e5e7eb;
  overflow: hidden;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
}

.card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.card-badge.best {
  background: #e11d48;
}

.card-body {
  padding: 12px 14px 14px;
}

.card-title {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.2px;
  color: #111;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #9ca3af;
}

/* Teaser variant (slightly different accent) */
.card.is-teaser .card-title {
  color: #111;
}

/* ========== Full Article ========== */
.article-page {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  min-height: 100dvh;
}

.article-hero {
  position: relative;
  aspect-ratio: 16 / 11;
  background: #e5e7eb;
  padding: 12px 0px 0px;
}

.article-hero img {
  width: 100%;
  height: 100%;
}

.article-content {
  padding: 18px 16px 32px;
}

.article-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.4px;
  margin-bottom: 12px;
  color: #0f0f0f;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.article-body {
  font-size: 16.5px;
  line-height: 1.65;
  color: #1f2937;
}

.article-body p {
  display: block;
  margin: 0 0 1.1em 0;
  padding: 0;
}

.article-body p:last-child {
  margin-bottom: 0;
}

/* Related / more teasers */
.related {
  background: var(--bg);
  padding: 16px 12px 40px;
}

.related-title {
  font-size: 15px;
  font-weight: 700;
  color: #374151;
  margin: 0 4px 12px;
}

/* ========== Loader / empty ========== */
.loader {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
  .header {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .feed, .article-content, .related {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

/* Small refinements */
.card-title a {
  display: block;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 14px;
  font-weight: 500;
}

.back-btn svg {
  width: 18px;
  height: 18px;
}

/* Кнопка "Tovább" в превью новости */
.read-more-btn {
  display: block;
  width: fit-content;
  margin-top: 12px;
  margin-left: auto; /* прижимаем вправо */
  padding: 8px 16px;
  background: #e11d48;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
}

.read-more-btn:active {
  opacity: 0.85;
}

/* ========== Compact teaser (над новостью) ========== */
/* ========== Compact teaser ========== */
.compact-teasers {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compact-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.04);
  position: relative;
  height: 92px;
  max-height: 92px;
}

.compact-card > a.card-link {
  display: flex !important;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.compact-img {
  width: 92px !important;
  min-width: 92px !important;
  max-width: 92px !important;
  height: 92px !important;
  object-fit: cover;
  flex-shrink: 0;
  pointer-events: none; /* клик всегда уходит в <a>, не в «открыть фото» */
  background: #e5e7eb;
}

.compact-body {
  flex: 1;
  min-width: 0;
  padding: 8px 28px 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.compact-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  color: #111;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.compact-more {
  font-size: 12px;
  color: #9ca3af;
  text-align: right;
}

.compact-close {
  position: absolute;
  top: 4px;
  right: 6px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}