/* ============================================================
   BLACK RIVER DESIGN SYSTEM — Components
   Svartåbladet UI components
   ============================================================ */

/* ── SITE HEADER ─────────────────────────────────────────── */

.site-header {
  background: var(--color-bg);
  border-bottom: 4px solid var(--color-river);
  padding: var(--space-3) 0;
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--grid-max-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.site-header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.site-header__logo-img {
  height: 3rem;
  width: auto;
}

.site-header__logo-text {
  font-family: var(--font-headline);
  font-weight: var(--weight-extrabold);
  font-size: 1.75rem;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.site-header__logo-text span {
  color: var(--color-river);
}

.site-header__nav {
  display: flex;
  gap: var(--space-4);
}

.site-header__nav a {
  font-family: var(--font-headline);
  font-weight: var(--weight-semibold);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  transition: color var(--duration-fast) var(--ease-out);
}

.site-header__nav a:hover {
  color: var(--color-river-bright);
}

@media (max-width: 600px) {
  .site-header__nav {
    display: none;
  }
}

/* ── BLOCK HEADER (Section titles with thick rules) ──────── */

.block-header {
  border-top: 6px solid var(--color-river);
  padding-top: var(--space-3);
  margin-bottom: var(--space-5);
}

.block-header__title {
  font-family: var(--font-headline);
  font-weight: var(--weight-extrabold);
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text);
}

.block-header__title--river {
  color: var(--color-river);
}

.block-header--thin {
  border-top-width: 4px;
}

/* ── PROMO CARD ──────────────────────────────────────────── */

.promo {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  transition: background var(--duration-normal) var(--ease-out);
}

.promo:hover {
  background: var(--color-surface-raised);
}

.promo__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
  background: var(--color-surface);
}

.promo__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-normal) var(--ease-out);
}

.promo:hover .promo__image img {
  transform: scale(1.03);
}

/* Promo image overlays (KK-style) */
.promo__tag-overlay,
.promo__meta-overlay {
  position: absolute;
  top: var(--space-2);
  z-index: 2;
  font: 500 0.75rem/1 var(--font-body);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.promo__meta-overlay { left: var(--space-2); }
.promo__tag-overlay { right: var(--space-2); }

.promo__kicker-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: #808080;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  padding: 0 var(--space-4) var(--space-4);
  font: var(--weight-extrabold) clamp(1.25rem, 3.5vw, 2.25rem)/1.1 var(--font-headline);
  text-transform: uppercase;
  text-align: center;
  text-wrap: balance;
  pointer-events: none;
}

/* ── PROMO OVERLAY (full-image card with all text overlaid) ── */

.promo-overlay {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-surface);
  color: #fff;
  text-decoration: none;
}

.promo-overlay__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-normal) var(--ease-out);
}

.promo-overlay:hover .promo-overlay__image {
  transform: scale(1.03);
}

.promo-overlay__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(0, 0, 0, 0.4) 0%,
    transparent 25%,
    rgba(0, 0, 0, 0.3) 50%,
    rgba(0, 0, 0, 0.85) 80%,
    rgba(0, 0, 0, 0.95) 100%);
  transition: background var(--duration-normal) var(--ease-out);
}

.promo-overlay:hover .promo-overlay__scrim {
  background: linear-gradient(to bottom,
    rgba(0, 0, 0, 0.5) 0%,
    transparent 20%,
    rgba(0, 0, 0, 0.4) 45%,
    rgba(0, 0, 0, 0.9) 80%,
    rgba(0, 0, 0, 0.97) 100%);
}

.promo-overlay__top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-3);
  z-index: 2;
}

.promo-overlay__meta {
  font: 500 0.75rem/1 var(--font-body);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.promo-overlay__tag {
  font: var(--weight-bold) 0.75rem/1 var(--font-headline);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.promo-overlay__bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4);
  z-index: 2;
}

.promo-overlay__headline {
  font-family: var(--font-headline);
  font-weight: var(--weight-bold);
  font-size: clamp(1.25rem, 2vw + 0.4rem, 1.75rem);
  text-transform: uppercase;
  line-height: 1.05;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.promo-overlay__summary {
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8);
  margin-top: var(--space-2);
}

.promo__body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.promo__headline {
  font-family: var(--font-headline);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  line-height: 1.05;
}

.promo__headline a {
  color: var(--color-text);
  text-decoration: none;
}

.promo__headline a:hover {
  color: var(--color-river-bright);
}

.promo__summary {
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--color-text-secondary);
}

.promo__meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: var(--space-1);
}

/* Hero variant */
.promo--hero .promo__headline {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.75rem);
}

.promo--hero .promo__image {
  aspect-ratio: 16 / 10;
}

/* Standard variant */
.promo--standard .promo__headline {
  font-size: clamp(1.15rem, 1.5vw + 0.5rem, 1.5rem);
}

/* Compact variant (no image) */
.promo--compact {
  background: transparent;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-3);
}

.promo--compact:hover {
  background: transparent;
}

.promo--compact .promo__body {
  padding: 0;
}

.promo--compact .promo__headline {
  font-size: 1.1rem;
}

/* Horizontal variant */
.promo--horizontal {
  flex-direction: row;
  gap: var(--space-3);
}

.promo--horizontal .promo__image {
  width: 140px;
  min-width: 140px;
  aspect-ratio: 4 / 3;
}

.promo--horizontal .promo__body {
  padding: var(--space-2) 0;
}

.promo--horizontal .promo__headline {
  font-size: 1rem;
}

@media (min-width: 600px) {
  .promo--horizontal .promo__image {
    width: 180px;
    min-width: 180px;
  }
}

/* ── BREAKING NEWS BANNER ────────────────────────────────── */

.breaking-banner {
  background: var(--color-breaking);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  z-index: var(--z-breaking);
}

.breaking-banner__label {
  font-family: var(--font-headline);
  font-weight: var(--weight-extrabold);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  animation: breaking-flash 1.5s ease-in-out infinite;
}

@keyframes breaking-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.breaking-banner__text {
  font-family: var(--font-headline);
  font-weight: var(--weight-bold);
  font-size: 1.125rem;
  text-transform: uppercase;
}

/* ── DENSE HEADLINE LIST ─────────────────────────────────── */

.headline-list {
  list-style: none;
}

.headline-list__item {
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-3) 0;
}

.headline-list__item:first-child {
  padding-top: 0;
}

.headline-list__link {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-headline);
  font-weight: var(--weight-semibold);
  font-size: 1.05rem;
  text-transform: uppercase;
  line-height: 1.15;
  transition: color var(--duration-fast) var(--ease-out);
}

.headline-list__link:hover {
  color: var(--color-river-bright);
}

.headline-list__link::before {
  content: "▸";
  color: var(--color-river);
  font-size: 0.75em;
  flex-shrink: 0;
}

.headline-list__time {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  margin-left: auto;
  text-transform: none;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.sidebar__section {
  border-top: 4px solid var(--color-river);
  padding-top: var(--space-3);
}

.sidebar__title {
  font-family: var(--font-headline);
  font-weight: var(--weight-extrabold);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-river);
  margin-bottom: var(--space-3);
}

/* Small-thumb promo for sidebar */
.sidebar-promo {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.sidebar-promo__image {
  width: 80px;
  min-width: 80px;
  height: 60px;
  object-fit: cover;
}

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

.sidebar-promo__headline {
  font-family: var(--font-headline);
  font-weight: var(--weight-semibold);
  font-size: 0.875rem;
  text-transform: uppercase;
  line-height: 1.15;
}

.sidebar-promo__headline a {
  color: var(--color-text);
  text-decoration: none;
}

.sidebar-promo__headline a:hover {
  color: var(--color-river-bright);
}

/* ── ARTICLE BODY ────────────────────────────────────────── */

.article-body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--color-text);
}

.article-body > * + * {
  margin-top: var(--space-4);
}

.article-body .lead {
  font-size: 1.3125rem;
  font-weight: var(--weight-medium);
  line-height: 1.5;
  color: var(--color-text);
}

.article-body h2 {
  font-family: var(--font-headline);
  font-weight: var(--weight-bold);
  font-size: 1.5rem;
  text-transform: uppercase;
  line-height: 1.1;
  margin-top: var(--space-6);
  color: var(--color-text);
}

.article-body blockquote {
  border-left: 4px solid var(--color-river);
  padding-left: var(--space-4);
  font-style: italic;
  color: var(--color-text-secondary);
  margin-block: var(--space-5);
}

.article-body p {
  margin-bottom: var(--space-4);
}

.article-body .bullet-box {
  background: var(--color-surface);
  border-left: 4px solid var(--color-river);
  padding: var(--space-4);
}

.article-body .bullet-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.article-body .bullet-box li::before {
  content: "▸ ";
  color: var(--color-river);
  font-weight: var(--weight-bold);
}

.article-body figure {
  margin-block: var(--space-5);
}

.article-body figcaption {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}

/* ── ARTICLE HEADER ──────────────────────────────────────── */

.article-header {
  border-bottom: 4px solid var(--color-river);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-5);
}

.article-header__meta {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: var(--space-3);
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

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

/* ── ARTICLE HERO (full-width image header) ──────────────── */

.article-hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.article-hero--no-image {
  min-height: auto;
  background: var(--color-surface);
  padding-block: var(--space-8);
}

.article-hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.45) 40%,
    rgba(0, 0, 0, 0.85) 100%);
}

.article-hero__content {
  position: relative;
  padding-block: var(--space-8) var(--space-6);
  color: #fff;
}

.article-hero--no-image .article-hero__content {
  color: var(--color-text);
  padding-block: 0;
}

.article-hero__kicker {
  font-family: var(--font-headline);
  font-weight: var(--weight-semibold);
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: var(--space-2);
  opacity: 0.85;
}

.article-hero__headline {
  font-family: var(--font-headline);
  font-weight: var(--weight-extrabold);
  font-size: clamp(2rem, 4vw + 1rem, 3.5rem);
  text-transform: uppercase;
  line-height: 1.05;
  margin-top: var(--space-2);
}

.article-hero__summary {
  font-family: var(--font-body);
  font-size: 1.1875rem;
  line-height: 1.5;
  margin-top: var(--space-3);
  opacity: 0.85;
  max-width: 40em;
}

.article-hero__meta {
  font-family: var(--font-body);
  font-size: 0.875rem;
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  opacity: 0.7;
}

.article-hero__meta strong {
  opacity: 1;
}

.article-hero--no-image .article-hero__kicker,
.article-hero--no-image .article-hero__summary,
.article-hero--no-image .article-hero__meta {
  opacity: 1;
  color: var(--color-text-secondary);
}

.article-hero--no-image .article-hero__meta strong {
  color: var(--color-text);
}

/* ── ARTICLE BULLETS ─────────────────────────────────────── */

.article-bullets {
  background: var(--color-surface);
  border-left: 4px solid var(--color-river);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.article-bullets li {
  margin-bottom: var(--space-2);
}

.article-bullets li::before {
  content: "▸ ";
  color: var(--color-river);
  font-weight: var(--weight-bold);
}

/* ── FOOTER ──────────────────────────────────────────────── */

.site-footer {
  background: var(--color-surface);
  border-top: 6px solid var(--color-river);
  padding: var(--space-8) 0 var(--space-6);
  margin-top: var(--space-9);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 600px) {
  .site-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .site-footer__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.site-footer__heading {
  font-family: var(--font-headline);
  font-weight: var(--weight-bold);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-river);
  margin-bottom: var(--space-3);
}

.site-footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.site-footer__links a {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.site-footer__links a:hover {
  color: var(--color-river-bright);
}

.site-footer__bottom {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* ── TAG VARIANTS ────────────────────────────────────────── */
/* Base .tag is defined in type.css */

.tag--river {
  background: var(--color-river);
  color: var(--color-bg);
  padding: var(--space-1) var(--space-2);
}

.tag--breaking {
  background: var(--color-breaking);
  color: #fff;
  padding: var(--space-1) var(--space-2);
}

/* ── DIVIDER ─────────────────────────────────────────────── */

.divider {
  height: 1px;
  background: var(--color-border);
  border: none;
  margin-block: var(--space-5);
}

/* ── FLASH MESSAGES ──────────────────────────────────────── */

.flash {
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
  font-family: var(--font-body);
  font-size: 0.875rem;
  border-left: 4px solid var(--color-river);
  background: var(--color-surface);
}

.flash--notice {
  border-left-color: var(--color-sport);
}

.flash--alert {
  border-left-color: var(--color-breaking);
}

/* ── AUTH ────────────────────────────────────────────────── */

.auth-card {
  max-width: 28rem;
  margin: var(--space-8) auto;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
}
.auth-card h1 {
  font: var(--weight-bold) 1.5rem/1.2 var(--font-headline);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.auth-card p {
  font: var(--weight-regular) 0.9375rem/1.5 var(--font-body);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-5);
}
.auth-form__field {
  margin-bottom: var(--space-4);
}
.auth-form__field label {
  display: block;
  font: var(--weight-semibold) 0.875rem/1 var(--font-body);
  margin-bottom: var(--space-2);
  color: var(--color-text);
}
.auth-form__field input[type="email"] {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font: var(--weight-regular) 1rem/1.5 var(--font-body);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  background: var(--color-bg);
  color: var(--color-text);
}
.auth-form__field input[type="email"]:focus {
  outline: 2px solid var(--color-river);
  outline-offset: 1px;
  border-color: var(--color-river);
}
.auth-form input[type="submit"] {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font: var(--weight-semibold) 0.9375rem/1 var(--font-body);
  color: var(--color-bg);
  background: var(--color-river);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
.auth-form input[type="submit"]:hover {
  background: var(--color-river-bright);
}

/* ── EMPTY STATE ─────────────────────────────────────────── */

.empty-state {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-9) 0;
  grid-column: 1 / -1;
  font-family: var(--font-body);
}

.empty-state code {
  font-family: var(--font-mono);
  background: var(--color-surface-raised);
  padding: 2px 6px;
  color: var(--color-river-bright);
}

/* ── TILE (Square overlay card) ─────────────────────────── */

.tile {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: block;
  background: var(--color-surface);
  color: #fff;
  text-decoration: none;
}

.tile__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-normal) var(--ease-out);
}

.tile:hover .tile__image {
  transform: scale(1.05);
}

.tile__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(0, 0, 0, 0.5) 0%,
    transparent 25%,
    transparent 50%,
    rgba(0, 0, 0, 0.85) 100%);
  transition: background var(--duration-normal) var(--ease-out);
}

.tile:hover .tile__overlay {
  background: linear-gradient(to bottom,
    rgba(0, 0, 0, 0.6) 0%,
    transparent 25%,
    transparent 40%,
    rgba(0, 0, 0, 0.92) 100%);
}

.tile__top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-3);
}

.tile__meta {
  font: 500 0.75rem/1 var(--font-body);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.tile__tag {
  font: var(--weight-bold) 0.75rem/1 var(--font-headline);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.tile__kicker {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  padding: 0 var(--space-4) var(--space-4);
  font: var(--weight-extrabold) clamp(1.25rem, 3vw, 2rem)/1.1 var(--font-headline);
  text-transform: uppercase;
  text-align: center;
  text-wrap: balance;
  pointer-events: none;
}

.tile__bottom {
  position: absolute;
  top: 50%;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-inline: var(--space-3);
}

.tile__headline {
  font-family: var(--font-headline);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  line-height: 1.05;
  font-size: clamp(1.25rem, 1.8vw + 0.4rem, 1.75rem);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Large tile (hero) */
.tile--large .tile__headline {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 3rem);
}

.tile--large .tile__tag {
  font-size: 0.8125rem;
}

.tile--large .tile__kicker {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.tile--large .tile__meta {
  font-size: 0.75rem;
}
