/* ============================================
   NewsPortal – Główny arkusz stylów
   ============================================ */

:root {
  --red:       #e63946;
  --navy:      #1d3557;
  --blue:      #457b9d;
  --light-bg:  #f8f9fa;
  --white:     #ffffff;
  --text:      #212529;
  --text-muted:#6c757d;
  --border:    #dee2e6;
  --shadow:    0 2px 12px rgba(0,0,0,.09);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.15);
  --radius:    8px;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;
  --transition: .25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--light-bg);
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* ── BREAKING NEWS ───────────────────────────────── */
.breaking-bar {
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  font-size: .85rem;
  overflow: hidden;
}
.breaking-label {
  background: #fff;
  color: var(--red);
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 2px;
  white-space: nowrap;
  font-size: .78rem;
  letter-spacing: .5px;
}
.ticker-wrap { overflow: hidden; flex: 1; }
.ticker {
  display: inline-block;
  white-space: nowrap;
  animation: ticker 30s linear infinite;
}
@keyframes ticker {
  from { transform: translateX(100vw); }
  to   { transform: translateX(-100%); }
}

/* ── HEADER ──────────────────────────────────────── */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
  flex-wrap: wrap;
}
.logo a {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
}
.logo a span { color: var(--red); }
.logo .tagline { font-size: .75rem; color: rgba(255,255,255,.55); margin-top: 2px; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.search-box { display: flex; }
.search-box input {
  border: 2px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: .9rem;
  width: 220px;
  outline: none;
  transition: var(--transition);
}
.search-box input::placeholder { color: rgba(255,255,255,.5); }
.search-box input:focus { background: rgba(255,255,255,.2); border-color: var(--red); }
.search-box button {
  background: var(--red);
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1rem;
  transition: var(--transition);
}
.search-box button:hover { background: #c1121f; }

.btn-admin {
  background: var(--red);
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-admin:hover { background: #c1121f; }

/* Navigation */
.main-nav { border-top: 1px solid rgba(255,255,255,.1); }
.main-nav ul { display: flex; flex-wrap: wrap; gap: 0; }
.main-nav ul li a {
  display: block;
  padding: 12px 16px;
  font-size: .9rem;
  font-weight: 600;
  color: rgba(255,255,255,.8);
  transition: var(--transition);
  border-bottom: 3px solid transparent;
}
.main-nav ul li a:hover,
.main-nav ul li a.active {
  color: #fff;
  border-bottom-color: var(--red);
}
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; padding: 8px; }

/* ── HERO ─────────────────────────────────────────── */
.hero-section { padding: 24px 0 0; }
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; min-height: 480px; }
.hero-main { position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.hero-main img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.hero-main:hover img { transform: scale(1.03); }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.8) 0%, transparent 60%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 24px;
}
.hero-overlay .cat-badge { margin-bottom: 8px; }
.hero-overlay h2 { font-family: var(--font-head); font-size: 1.75rem; color: #fff; line-height: 1.2; }
.hero-overlay .meta { color: rgba(255,255,255,.7); font-size: .85rem; margin-top: 8px; }

.hero-side { display: flex; flex-direction: column; gap: 16px; }
.hero-side-card { position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer; flex: 1; }
.hero-side-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-side-card .hero-overlay h2 { font-size: 1.1rem; }

/* ── MAIN LAYOUT ──────────────────────────────────── */
.main-content { padding: 32px 0 48px; }
.content-layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 3px solid var(--navy); }
.section-header h2 { font-family: var(--font-head); font-size: 1.5rem; color: var(--navy); }

.sort-controls { display: flex; gap: 8px; }
.sort-btn { padding: 6px 16px; border: 2px solid var(--navy); background: none; border-radius: 20px; cursor: pointer; font-size: .85rem; transition: var(--transition); }
.sort-btn.active, .sort-btn:hover { background: var(--navy); color: #fff; }

/* ── ARTICLES GRID ────────────────────────────────── */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

.article-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.card-image { position: relative; height: 180px; overflow: hidden; background: #e9ecef; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.article-card:hover .card-image img { transform: scale(1.05); }
.no-image { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; background: linear-gradient(135deg, #e9ecef, #dee2e6); }

.cat-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.breaking-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--red);
  color: #fff;
  padding: 2px 8px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 2px;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.7} }

.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card-title { font-family: var(--font-head); font-size: 1.05rem; font-weight: 700; line-height: 1.3; color: var(--navy); margin-bottom: 8px; flex: 1; }
.card-title:hover { color: var(--red); }
.card-lead { font-size: .88rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-muted); }

/* ── SIDEBAR ──────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.widget { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.widget-title { font-family: var(--font-head); font-size: 1.1rem; color: var(--navy); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--red); }

.categories-list li a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: .9rem; color: var(--text); transition: var(--transition);
}
.categories-list li:last-child a { border-bottom: none; }
.categories-list li a:hover { color: var(--red); padding-left: 4px; }
.cat-count { background: var(--light-bg); padding: 2px 8px; border-radius: 10px; font-size: .78rem; }

.popular-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.popular-item:last-child { border-bottom: none; }
.popular-thumb { width: 64px; height: 48px; border-radius: 4px; object-fit: cover; flex-shrink: 0; background: #e9ecef; }
.popular-title { font-size: .85rem; font-weight: 600; color: var(--navy); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.popular-meta { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }

.newsletter-widget { background: linear-gradient(135deg, var(--navy), #2a6496); color: #fff; }
.newsletter-widget .widget-title { color: #fff; border-color: rgba(255,255,255,.3); }
.newsletter-widget p { font-size: .88rem; color: rgba(255,255,255,.8); margin-bottom: 14px; }
.newsletter-form { display: flex; flex-direction: column; gap: 8px; }
.newsletter-form input { padding: 10px 14px; border: none; border-radius: var(--radius); font-size: .9rem; }
.newsletter-form button { padding: 10px; background: var(--red); color: #fff; border: none; border-radius: var(--radius); cursor: pointer; font-weight: 600; transition: var(--transition); }
.newsletter-form button:hover { background: #c1121f; }

/* ── PAGINATION ───────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; flex-wrap: wrap; }
.page-btn {
  padding: 8px 14px; border: 2px solid var(--border); background: #fff;
  border-radius: var(--radius); cursor: pointer; font-size: .9rem; transition: var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── MODAL ────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 2000;
  overflow-y: auto;
  padding: 20px;
}
.modal-overlay.open { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(0,0,0,.1); border: none; font-size: 1.2rem;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10; transition: var(--transition);
}
.modal-close:hover { background: var(--red); color: #fff; }

.article-hero-image { width: 100%; max-height: 420px; object-fit: cover; border-radius: 12px 12px 0 0; }
.article-body { padding: 32px; }
.article-category { margin-bottom: 12px; }
.article-title { font-family: var(--font-head); font-size: 2rem; line-height: 1.2; color: var(--navy); margin-bottom: 16px; }
.article-meta { color: var(--text-muted); font-size: .85rem; display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.article-lead { font-size: 1.1rem; font-weight: 600; color: var(--text); border-left: 4px solid var(--red); padding-left: 16px; margin-bottom: 24px; font-style: italic; }
.article-content { line-height: 1.8; color: var(--text); }
.article-content p { margin-bottom: 1em; }
.article-content h2, .article-content h3 { font-family: var(--font-head); color: var(--navy); margin: 1.5em 0 .5em; }
.article-tags { margin-top: 24px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag { padding: 4px 12px; background: var(--light-bg); border-radius: 20px; font-size: .8rem; color: var(--text-muted); }
.related-articles { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 16px; }
.related-card { cursor: pointer; }
.related-card img { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }
.related-card p { font-size: .85rem; font-weight: 600; color: var(--navy); }

/* ── FOOTER ───────────────────────────────────────── */
.site-footer { background: var(--navy); color: rgba(255,255,255,.8); padding: 48px 0 0; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-bottom: 32px; }
.footer-logo { font-family: var(--font-head); font-size: 1.75rem; font-weight: 900; color: #fff; margin-bottom: 8px; }
.footer-logo span { color: var(--red); }
.site-footer h4 { color: #fff; margin-bottom: 12px; font-size: .9rem; text-transform: uppercase; letter-spacing: 1px; }
.site-footer ul li { margin-bottom: 6px; }
.site-footer ul li a:hover { color: var(--red); }
.site-footer p { font-size: .88rem; line-height: 1.6; }
.social-links { display: flex; flex-direction: column; gap: 8px; }
.social-btn { display: inline-block; padding: 6px 14px; border-radius: var(--radius); font-size: .85rem; font-weight: 600; }
.social-btn.fb { background: #1877f2; color: #fff; }
.social-btn.tw { background: #000; color: #fff; }
.social-btn.ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 0; text-align: center; font-size: .82rem; color: rgba(255,255,255,.4); }

/* ── SKELETON LOADERS ─────────────────────────────── */
.skeleton-box, .skeleton-card {
  background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
.skeleton-box { height: 100%; min-height: 200px; }
.skeleton-box.tall { min-height: 380px; }
.skeleton-card { height: 320px; }
@keyframes shimmer { from{background-position:200% 0} to{background-position:-200% 0} }

/* ── UTILITIES ────────────────────────────────────── */
.text-red { color: var(--red); }
.hidden { display: none !important; }

/* ── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 1024px) {
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { display: none; }
  .header-top { flex-direction: column; align-items: flex-start; }
  .search-box input { width: 160px; }
  .nav-toggle { display: block; }
  .main-nav ul { display: none; flex-direction: column; }
  .main-nav ul.open { display: flex; }
  .main-nav ul li a { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
  .articles-grid { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .article-title { font-size: 1.5rem; }
  .related-grid { grid-template-columns: 1fr; }
  .modal-content { margin: 0; }
  .article-body { padding: 20px; }
}

@media (max-width: 480px) {
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .header-actions { flex-wrap: wrap; }
}
