/* components.css — refactor by Sigma (mobile-first, clean) */

/* ===================== Theme variables ===================== */
:root {
  --color-bg: #0e0e0f;
  --color-panel: rgba(20, 20, 20, 0.6);
  --color-text: #efefef;
  --color-muted: #9a9a9a;
  --color-accent: #e31b23; /* primary (LFC red) */
  --color-accent-2: #ff3b30; /* secondary accent */
  --color-glass: rgba(255, 255, 255, 0.03);
  --color-card-border: rgba(255, 255, 255, 0.04);
  --container-max: 1300px;
  --border-radius: 12px;
  --shadow-primary: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-button: 0 8px 24px rgba(227, 27, 35, 0.14);
  --header-height: 84px; /* używane przy sticky aside */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ===================== Helpers / utilities ===================== */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
}
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 18px;
  padding-right: 18px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

/* ===================== HERO / GRID (mobile-first) ===================== */
.hero {
  padding-top: 22px;
  padding-bottom: 20px;
  color: var(--color-text);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "main"
    "feature"
    "aside";
  gap: 1.25rem;
  align-items: start;
}
.hero__main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  text-align: left;
}
.hero__feature {
  grid-area: feature;
  width: 100%;
  max-width: 860px;
  justify-self: start;
}
.hero__aside {
  grid-area: aside;
}

/* feature article */
.feature-article {
  background: linear-gradient(
    180deg,
    hwb(0 100% 0% / 0.01),
    rgba(0, 0, 0, 0.2)
  );
  border-radius: var(--border-radius);
  padding: 1.1rem;
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-primary);
}

/* hero image */
.hero__image {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
}
.hero__image img {
  display: block;
  width: 100%;
  height: min(460px, 60vh);
  object-fit: cover;
  object-position: center;
  filter: grayscale(8%) contrast(1.04) saturate(0.95) brightness(0.96);
  transform-origin: center;
  transition: transform 600ms var(--ease), filter 300ms ease;
}
.hero__image::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
      60% 50% at 50% 35%,
      rgba(0, 0, 0, 0.18),
      transparent 35%
    ),
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.25) 0%,
      rgba(0, 0, 0, 0.5) 70%,
      rgba(255, 46, 77, 0.04) 100%
    );
  mix-blend-mode: multiply;
}
.hero__image::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6%;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 46, 77, 0.06),
    transparent
  );
  filter: blur(6px);
}
@media (hover: hover) and (pointer: fine) {
  .hero__image:hover img,
  .hero__image:focus-within img {
    transform: scale(1.035);
    filter: grayscale(0%) contrast(1.06) brightness(1.02);
  }
}

/* ===================== ASIDE WIDGETS: MATCHDAY / NEWSROOM ===================== */
.matchday {
  color: var(--color-text);
  background: radial-gradient(
      120% 120% at 0% 0%,
      rgba(227, 27, 35, 0.12),
      transparent 60%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.35));
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.matchday__label {
  font-size: 0.78rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.matchday__opponent {
  font-weight: 700;
  font-size: 1.15rem;
  margin-top: 0.35rem;
  margin-bottom: 0.25rem;
}
.matchday__meta {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 0.6rem;
}
.matchday__countdown {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.6rem;
}
.matchday__progress {
  height: 6px;
  background: var(--color-accent);
  border-radius: 999px;
  overflow: hidden;
}
.matchday__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(
    90deg,
    var(--color-accent) 0%,
    var(--color-accent-2) 100%
  );
  box-shadow: 0 0 12px rgba(227, 27, 35, 0.4);
  transition: width 0.6s ease;
}

/* newsroom */
.newsroom {
  margin-top: 0.8rem;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.01),
    rgba(0, 0, 0, 0.22)
  );
  border-radius: 10px;
  padding: 0.85rem;
  border: 1px solid var(--color-card-border);
}
.newsroom__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.newsroom__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}
.newsroom__item {
  padding: 0.55rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.02);
}
.newsroom__meta {
  color: var(--color-muted);
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}
.newsroom__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
}
.newsroom__excerpt {
  margin: 0.35rem 0 0;
  color: var(--color-text);
  font-size: 0.95rem;
}
.newsroom__footer {
  margin-top: 0.6rem;
  text-align: right;
}

/* ===================== POSTS / CARDS (mobile-first) ===================== */
/* posts container */
#posts-container,
.posts-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-top: 1rem;
  padding: 12px 6px;
}

/* single item (card) */
.post-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: stretch;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.01);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.02);
  box-shadow: 0 8px 20px rgba(2, 6, 12, 0.6);
  overflow: hidden;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
  opacity: 0;
  transform: translateY(6px);
}
.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.6);
}
.post-card img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
  border-radius: 6px;
}

/* meta / title / excerpt */
.post-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-family: "Poppins", system-ui, -apple-system;
}
.post-date {
  font-variant-numeric: tabular-nums;
  color: #c7cbd0;
}
.post-tag {
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 8px;
  border-radius: 8px;
  color: #ff6b6b;
  font-weight: 700;
  font-size: 0.75rem;
}
.post-card h3 {
  margin: 0 0 8px 0;
  font-size: 1.05rem;
  line-height: 1.15;
  color: var(--color-text);
}
.post-excerpt {
  margin: 0;
  color: #9ea6ad;
  font-size: 0.95rem;
}

/* NEW badge + animation */
.post-card.is-new {
  border: 1px solid rgba(0, 184, 255, 0.12);
  box-shadow: 0 18px 40px rgba(0, 184, 255, 0.04);
  position: relative;
}
.post-card.is-new::after {
  content: "NEW";
  position: absolute;
  top: 10px;
  right: 10px;
  background: #00b8ff;
  color: #031018;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.6px;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.post-card.animated {
  animation: fadeUp 0.42s ease forwards;
}

/* desktop: columns + card layout changes */
@media (min-width: 900px) {
  #posts-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    padding: 20px 6px;
    align-items: start;
  }
  .post-card {
    flex-direction: row;
    gap: 16px;
    padding: 14px;
    min-height: 120px;
    height: 100%;
  }
  .post-media {
    flex: 0 0 180px;
    max-width: 220px;
    min-width: 140px;
    height: 120px;
    overflow: hidden;
    border-radius: 10px;
  }
  .post-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .post-content,
  .post-body {
    flex: 1 1 auto;
    min-width: 0;
  } /* important for flex text wrapping */
  .post-card h3 {
    word-break: break-word;
    overflow-wrap: break-word;
  }
}

/* larger desktop: 3 columns */
@media (min-width: 1300px) {
  #posts-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  } /* if used elsewhere */
}

/* ===================== OFFCANVAS / NAV fixes ===================== */
.off__panel {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.9),
    rgba(0, 0, 0, 0.96)
  ) !important;
  backdrop-filter: blur(10px);
  color: var(--color-text);
}

/* ===================== FOOTER / MISC ===================== */
.site-footer {
  padding: 2rem 0;
  color: var(--color-muted);
  font-size: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.02);
  margin-top: 2rem;
}

/* ===================== DESKTOP LAYOUT ADJUSTMENTS (HERO GRID) ===================== */
@media (min-width: 1025px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-rows: auto auto;
    grid-template-areas:
      "main aside"
      "feature aside";
    gap: 2rem;
    align-items: start;
  }
  .hero__aside {
    position: sticky;
    top: calc(var(--header-height) + 8px);
    align-self: start;
    width: 360px;
    justify-self: end;
  }
}

/* ===================== ACCESSIBILITY / REDUCED MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ===================== MOBILE TWEAKS ===================== */
@media (max-width: 768px) {
  .hero__image img {
    height: 260px;
  }
  .hero__caption {
    left: 12px;
    bottom: 12px;
    font-size: 0.95rem;
  }
}

/* ===================== DEBUG helpers ===================== */
/* enable by adding .debug on elements in DOM */
.hero__grid.debug {
  outline: 1px dashed #ffffff0a;
}
.hero__main.debug {
  outline: 1px dashed rgba(0, 255, 0, 0.06);
}
.hero__feature.debug {
  outline: 1px dashed rgba(0, 120, 255, 0.06);
}
.hero__aside.debug {
  outline: 1px dashed rgba(255, 0, 0, 0.05);
}
