/*
  Pilne24.pl — news portal CSS template
  Założenia:
  - układ portalowy: topbar, header, breaking news, hero, grid newsów, sidebar, article, footer
  - nowoczesny wygląd z czerwonym akcentem „pilne”
  - responsywny layout
  - gotowe klasy utility pod CMS
*/

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --text: #101418;
  --muted: #5f6b76;
  --line: #dbe2e8;
  --primary: #d71920;
  --primary-dark: #b31218;
  --primary-soft: #ffe7e8;
  --accent: #111827;
  --success: #0f8b4c;
  --warning: #b26b00;
  --shadow: 0 10px 30px rgba(16, 20, 24, 0.08);
  --shadow-soft: 0 4px 14px rgba(16, 20, 24, 0.05);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --container: 1280px;
  --gap: 24px;
  --header-height: 74px;
  --font-sans: "Lato", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  width: min(calc(100% - 32px), var(--container));
  margin-inline: auto;
}

.grid {
  display: grid;
  gap: var(--gap);
}

.section {
  margin-block: 28px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.topbar {
  background: #0d1117;
  color: #e5e7eb;
  font-size: 0.875rem;
}

.topbar__inner {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar__left,
.topbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(215, 25, 32, 0.15);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(219, 226, 232, 0.9);
}

.site-header__inner {
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.logo__badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  line-height: 1;
  box-shadow: var(--shadow-soft);
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.main-nav a {
  padding: 12px 14px;
  border-radius: 999px;
  color: #24303b;
  font-weight: 700;
  transition: 0.2s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
  background: var(--primary-soft);
  color: var(--primary);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn,
.btn {
  border: 0;
  cursor: pointer;
  transition: 0.2s ease;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent);
  border: 1px solid var(--line);
}

.icon-btn:hover {
  background: #eef2f6;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 800;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.btn--primary:hover {
  background: var(--primary-dark);
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.breaking {
  margin-top: 18px;
}

.breaking__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #fff1f2 0%, #ffffff 100%);
  border: 1px solid #ffd4d7;
}

.breaking__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
}

.breaking__text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

.breaking__more {
  color: var(--primary);
  font-weight: 800;
}

.layout-home {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.95fr);
  gap: var(--gap);
  align-items: start;
}

.hero {
  overflow: hidden;
}

.hero__media {
  aspect-ratio: 16 / 8.4;
  background: linear-gradient(135deg, #d9dee3, #f5f7fa);
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__content {
  padding: 24px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero__title,
.article-card__title,
.article__title {
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.hero__title {
  font-size: clamp(2rem, 3.8vw, 3.4rem);
}

.hero__lead {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.meta strong {
  color: var(--text);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.article-card {
  overflow: hidden;
}

.article-card__thumb {
  aspect-ratio: 16 / 10;
  background: #dde3e8;
}

.article-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card__body {
  padding: 18px;
}

.article-card__title {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.article-card__excerpt {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.article-card--compact {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 14px;
  align-items: stretch;
}

.article-card--compact .article-card__thumb {
  aspect-ratio: auto;
  height: 100%;
  min-height: 100px;
}

.sidebar {
  display: grid;
  gap: var(--gap);
}

.widget {
  padding: 20px;
}

.widget__title {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.widget__list {
  display: grid;
  gap: 14px;
}

.rank-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
}

.rank-item__no {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.rank-item__title {
  font-weight: 800;
  line-height: 1.35;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: #34414c;
  font-weight: 700;
}

.newsletter {
  background: linear-gradient(180deg, #141a21 0%, #0e1319 100%);
  color: #f3f4f6;
}

.newsletter p {
  color: #b8c0c8;
}

.form-stack {
  display: grid;
  gap: 12px;
}

.input,
.select {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  outline: none;
}

.input:focus,
.select:focus {
  border-color: rgba(215, 25, 32, 0.45);
  box-shadow: 0 0 0 4px rgba(215, 25, 32, 0.12);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head__title {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.section-head__link {
  color: var(--primary);
  font-weight: 800;
}

.category-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

.category-box {
  padding: 20px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.category-box__name {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.category-box__headline {
  margin: 18px 0 0;
  font-size: 1.125rem;
  font-weight: 900;
  line-height: 1.25;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.72fr);
  gap: 36px;
  align-items: start;
}

.article {
  padding: 28px;
}

.article__title {
  font-size: clamp(2rem, 4vw, 3.75rem);
}

.article__lead {
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.75;
}

.article__hero {
  margin: 26px 0;
  border-radius: 18px;
  overflow: hidden;
}

.article__hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article__content {
  font-size: 1.0625rem;
  line-height: 1.9;
}

.article__content p {
  margin: 0 0 1.2em;
}

.article__content h2,
.article__content h3 {
  margin: 1.8em 0 0.6em;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.article__content blockquote {
  margin: 1.8em 0;
  padding: 20px 24px;
  border-left: 5px solid var(--primary);
  border-radius: 0 16px 16px 0;
  background: #fff7f7;
  font-size: 1.2rem;
  font-weight: 700;
}

.article__content ul,
.article__content ol {
  padding-left: 1.4rem;
  margin: 0 0 1.2em;
}

.article-share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.article-author {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 30px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ced6de, #eef2f6);
}

.footer {
  margin-top: 46px;
  color: #dbe3ea;
  background: linear-gradient(180deg, #0f141a 0%, #0a0e13 100%);
}

.footer__top {
  padding: 36px 0;
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr 1fr;
  gap: 28px;
}

.footer__brand p,
.footer__col a,
.footer__bottom {
  color: #9aa7b2;
}

.footer__title {
  margin: 0 0 14px;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
}

.footer__links {
  display: grid;
  gap: 10px;
}

.footer__bottom {
  padding: 18px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

/* Helpers for CMS */
.hide-mobile {
  display: initial;
}

.show-mobile {
  display: none;
}

.text-muted {
  color: var(--muted);
}

.text-primary {
  color: var(--primary);
}

.bg-primary {
  background: var(--primary);
  color: #fff;
}

.mb-0 { margin-bottom: 0; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

@media (max-width: 1200px) {
  .news-grid,
  .category-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer__top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .site-header__inner,
  .layout-home,
  .article-layout,
  .breaking__inner {
    grid-template-columns: 1fr;
  }

  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    flex-wrap: nowrap;
  }

  .header-tools {
    justify-content: flex-start;
  }

  .hero__media {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 720px) {
  :root {
    --gap: 18px;
  }

  .container {
    width: min(calc(100% - 20px), var(--container));
  }

  .topbar__inner,
  .section-head,
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .news-grid,
  .category-strip,
  .footer__top {
    grid-template-columns: 1fr;
  }

  .article-card--compact,
  .article-author {
    grid-template-columns: 1fr;
  }

  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: initial !important;
  }

  .article,
  .hero__content,
  .widget,
  .category-box {
    padding: 18px;
  }

  .article__title,
  .hero__title {
    word-break: break-word;
  }
}

.topbar__datetime {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.live-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: #c00;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  animation: livePulse 1.2s infinite;
}

@keyframes livePulse {
  0% { opacity: 1; }
  50% { opacity: .55; }
  100% { opacity: 1; }
}

/* Suggested CMS structure reference:

<body>
  <div class="topbar">...</div>
  <header class="site-header">...</header>
  <div class="container">
    <section class="breaking">...</section>
    <main class="layout-home section">
      <section>
        <article class="hero card">...</article>
        <section class="section">
          <div class="section-head">...</div>
          <div class="news-grid">
            <article class="article-card card">...</article>
          </div>
        </section>
      </section>
      <aside class="sidebar">
        <div class="widget card">...</div>
      </aside>
    </main>
  </div>
  <footer class="footer">...</footer>
</body>
*/
