/* ============================================================
   U8 Division – Racing Dark Theme
   Based on design brief: iRacing / motorsport aesthetic
   Fonts: Barlow Condensed (headings) + Inter (body)
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --u8-red:        #DC143C;
  --u8-red-dark:   #a50e2d;
  --u8-red-glow:   rgba(220, 20, 60, .25);
  --u8-bg:         #0D1117;
  --u8-surface:    #161B22;
  --u8-surface-2:  #1c2128;
  --u8-border:     #30363D;
  --u8-text:       #C9D1D9;
  --u8-muted:      #8B949E;
  --u8-white:      #F0F6FC;
  --u8-nav-h:      60px;
  --u8-radius:     3px;          /* Sharp, racing corners */
  --u8-radius-lg:  6px;
  --font-heading:  'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body:     'Inter', system-ui, sans-serif;
}

/* ── Bootstrap dark mode overrides ────────────────────────── */
[data-bs-theme="dark"] {
  --bs-body-bg:          var(--u8-bg);
  --bs-body-color:       var(--u8-text);
  --bs-card-bg:          var(--u8-surface);
  --bs-border-color:     var(--u8-border);
  --bs-secondary-color:  var(--u8-muted);
  color-scheme: dark;
}

/* ── Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  background: var(--u8-bg);
  color: var(--u8-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--u8-white);
  line-height: 1.15;
}

/* Body text stays non-italic */
p, li, td, .card-text { font-style: normal; }

a { color: var(--u8-red); }
a:hover { color: #ff3355; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--u8-bg); }
::-webkit-scrollbar-thumb { background: var(--u8-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--u8-red); }

/* ══════════════════════════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════════════════════════ */
.site-nav {
  background: rgba(13, 17, 23, .96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--u8-border);
  height: var(--u8-nav-h);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.site-nav .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Brand logo — matches mockup: U8 bold italic red + Division silver */
.navbar-brand {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: -.01em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .25rem;
}

.brand-u8 {
  color: var(--u8-red);
  position: relative;
  display: inline-block;
  padding-right: .1em;
}

/* Speed-slash mark on U8 (replicates the design mockup diagonal lines) */
.brand-u8::after {
  content: '';
  position: absolute;
  top: 10%;
  right: -4px;
  width: 2px;
  height: 80%;
  background: var(--u8-red);
  transform: skewX(-12deg);
  opacity: .6;
}

.brand-division {
  color: #d0d8e0;
  font-weight: 700;
  letter-spacing: .04em;
}

.navbar-brand:hover .brand-u8     { color: #ff3355; }
.navbar-brand:hover .brand-division { color: var(--u8-white); }

/* Red indicator line under navbar on scroll */
.site-nav::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--u8-red) 0%, transparent 60%);
}

/* ══════════════════════════════════════════════════════════════
   HERO SECTION
   ══════════════════════════════════════════════════════════════ */
.hero-section {
  position: relative;
  overflow: hidden;
  min-height: 0;
  border: 1px solid var(--u8-border);
  border-radius: var(--u8-radius-lg);

  /* Gradient — real hero image goes in assets/img/hero-bg.jpg */
  background:
    linear-gradient(105deg,
      rgba(13,17,23,.98) 0%,
      rgba(13,17,23,.85) 45%,
      rgba(13,17,23,.4)  75%,
      rgba(13,17,23,.15) 100%
    ),
    linear-gradient(135deg, #0d1117 0%, #1a0a10 50%, #0d1117 100%);
  background-size: cover;
  background-position: center;
}

/* Speed lines overlay on hero */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    108deg,
    transparent 0px,
    transparent 38px,
    rgba(220, 20, 60, .035) 38px,
    rgba(220, 20, 60, .035) 39px
  );
  pointer-events: none;
  z-index: 0;
}

/* Red bottom accent line */
.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--u8-red) 0%, transparent 70%);
}

.hero-section > * { position: relative; z-index: 1; }

.hero-section h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  text-shadow: 0 2px 20px rgba(0,0,0,.8);
}

/* ══════════════════════════════════════════════════════════════
   ARTICLE CARDS  — sharp corners, red top stripe
   ══════════════════════════════════════════════════════════════ */
.article-card {
  background: var(--u8-surface);
  border: 1px solid var(--u8-border) !important;
  border-radius: var(--u8-radius) !important;
  border-top: 2px solid var(--u8-red) !important;
  transition: border-color .2s, transform .25s, box-shadow .25s;
  position: relative;
  overflow: hidden;
}

.article-card:hover {
  border-color: var(--u8-red) !important;
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(220, 20, 60, .18), 0 4px 12px rgba(0,0,0,.4);
}

/* Speed-stripe on card hover */
.article-card::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--u8-red), transparent);
  transition: left .5s ease;
  pointer-events: none;
}
.article-card:hover::after { left: 150%; }

/* Image wrapper */
.article-card__img-wrap { overflow: hidden; }
.article-card__img-wrap img {
  height: 210px;
  width: 100%;
  object-fit: cover;
  transition: transform .5s ease;
  display: block;
}
.article-card__img-wrap--sm img { height: 160px; }
.article-card:hover .article-card__img-wrap img { transform: scale(1.06); }

/* Featured card — wider image */
.article-card--featured .article-card__img-wrap img { height: 360px; }
@media (max-width: 768px) {
  .article-card--featured .article-card__img-wrap img { height: 220px; }
}

/* ── Badges / Category tags ─────────────────────────────────── */
.badge {
  border-radius: 2px !important;
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .25em .6em;
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS — sharp, aggressive racing style
   ══════════════════════════════════════════════════════════════ */
.btn {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-radius: var(--u8-radius) !important;
  transition: all .2s ease;
}

.btn-danger {
  background: var(--u8-red);
  border-color: var(--u8-red);
  color: #fff;
  position: relative;
  overflow: hidden;
}

/* Diagonal sweep on hover */
.btn-danger::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.15) 50%, transparent 70%);
  transition: left .35s ease;
}
.btn-danger:hover::before { left: 100%; }

.btn-danger:hover {
  background: #ff1a3e;
  border-color: #ff1a3e;
  box-shadow: 0 0 20px var(--u8-red-glow);
  transform: translateY(-1px);
}
.btn-danger:active { transform: translateY(0); }

.btn-outline-secondary {
  border-color: var(--u8-border);
  color: var(--u8-muted);
  background: transparent;
}
.btn-outline-secondary:hover {
  background: var(--u8-surface-2);
  border-color: var(--u8-muted);
  color: var(--u8-white);
}

.btn-outline-danger {
  border-color: var(--u8-red);
  color: var(--u8-red);
}
.btn-outline-danger:hover {
  background: var(--u8-red);
  color: #fff;
  box-shadow: 0 0 16px var(--u8-red-glow);
}

/* Category filter pills */
.btn-sm.btn-danger, .btn-sm.btn-outline-secondary {
  border-radius: 2px !important;
  font-size: .72rem;
  padding: .25rem .7rem;
}

/* ══════════════════════════════════════════════════════════════
   ARTICLE DETAIL PAGE
   ══════════════════════════════════════════════════════════════ */
.article-excerpt {
  font-size: 1.1rem;
  color: var(--u8-muted);
  border-left: 3px solid var(--u8-red);
  padding-left: 1.25rem;
  font-style: italic;
  margin-bottom: 2rem;
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--u8-text);
}
.article-content h2 {
  font-size: 1.6rem;
  border-left: 3px solid var(--u8-red);
  padding-left: .75rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.article-content h3     { font-size: 1.3rem; margin-top: 2rem; }
.article-content p      { margin-bottom: 1.5rem; }
.article-content img    { max-width: 100%; border-radius: var(--u8-radius-lg); }
.article-content a      { color: var(--u8-red); }
.article-content strong { color: var(--u8-white); }
.article-content blockquote {
  border-left: 3px solid var(--u8-red);
  padding-left: 1rem;
  color: var(--u8-muted);
  font-style: italic;
  margin: 1.5rem 0;
}

/* Gallery thumbnails */
.gallery-thumb {
  position: relative;
  display: block;
  border-radius: var(--u8-radius);
  overflow: hidden;
  border: 1px solid var(--u8-border);
  transition: border-color .2s;
}
.gallery-thumb__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform .4s ease, opacity .2s;
  display: block;
}
.gallery-thumb:hover {
  border-color: var(--u8-red);
  box-shadow: 0 4px 20px var(--u8-red-glow);
}
.gallery-thumb:hover .gallery-thumb__img {
  transform: scale(1.07);
  opacity: .85;
}

.img-expand-hint {
  display: block;
  text-align: center;
  font-size: .75rem;
  color: var(--u8-muted);
  margin-top: .4rem;
  font-family: var(--font-heading);
  font-style: italic;
  letter-spacing: .04em;
}

/* ══════════════════════════════════════════════════════════════
   SHARE BUTTONS
   ══════════════════════════════════════════════════════════════ */
.share-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

.btn-share {
  border-radius: 2px !important;
  font-size: .75rem;
  padding: .3rem .9rem;
  border: 1px solid var(--u8-border);
  color: var(--u8-muted);
  background: transparent;
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  transition: all .2s;
  cursor: pointer;
}
.btn-share:hover      { background: var(--u8-surface-2); color: #fff; border-color: #555; }
.btn-share--fb:hover  { border-color: #1877f2; color: #1877f2; box-shadow: 0 0 10px rgba(24,119,242,.2); }
.btn-share--wa:hover  { border-color: #25d366; color: #25d366; box-shadow: 0 0 10px rgba(37,211,102,.2); }
.btn-share--x:hover   { border-color: #fff; color: #fff; }
.btn-share--ig:hover  { border-color: #e1306c; color: #e1306c; box-shadow: 0 0 10px rgba(225,48,108,.2); }
.btn-share--copied    { border-color: #2a9d8f !important; color: #2a9d8f !important; }

/* ══════════════════════════════════════════════════════════════
   CARDS (generic Bootstrap)
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--u8-surface) !important;
  border: 1px solid var(--u8-border) !important;
  border-radius: var(--u8-radius-lg) !important;
}

.card-header {
  background: rgba(255,255,255,.025) !important;
  border-bottom: 1px solid var(--u8-border) !important;
  font-size: .88rem;
  font-family: var(--font-heading);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--u8-white) !important;
}

/* ── List group ─────────────────────────────────────────────── */
.list-group-item,
.list-group-item-action {
  background: var(--u8-surface) !important;
  border-color: var(--u8-border) !important;
  color: var(--u8-text) !important;
  border-radius: 0 !important;
  font-size: .9rem;
}
.list-group-item-action:hover {
  background: var(--u8-surface-2) !important;
  color: var(--u8-white) !important;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb-item + .breadcrumb-item::before { color: var(--u8-border); }
.breadcrumb-item, .breadcrumb-item a { color: var(--u8-muted); font-size: .85rem; text-decoration: none; }
.breadcrumb-item.active { color: var(--u8-text); }
.breadcrumb-item a:hover { color: var(--u8-red); }

/* ── Pagination ─────────────────────────────────────────────── */
.page-link {
  background: var(--u8-surface) !important;
  border-color: var(--u8-border) !important;
  color: var(--u8-muted) !important;
  border-radius: var(--u8-radius) !important;
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 700;
  transition: all .2s;
}
.page-item.active .page-link {
  background: var(--u8-red) !important;
  border-color: var(--u8-red) !important;
  color: #fff !important;
  box-shadow: 0 0 12px var(--u8-red-glow);
}
.page-link:hover:not(.disabled) {
  background: var(--u8-surface-2) !important;
  color: var(--u8-white) !important;
  border-color: var(--u8-red) !important;
}

/* ── Tables ─────────────────────────────────────────────────── */
.table {
  color: var(--u8-text);
  --bs-table-bg: var(--u8-surface);
  --bs-table-hover-bg: var(--u8-surface-2);
  --bs-table-border-color: var(--u8-border);
}
thead th {
  font-family: var(--font-heading);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-size: .78rem;
  color: var(--u8-muted) !important;
  border-bottom: 1px solid var(--u8-border) !important;
  font-weight: 700;
}

/* ── Form controls ──────────────────────────────────────────── */
.form-control, .form-select {
  background: var(--u8-surface-2) !important;
  border-color: var(--u8-border) !important;
  color: var(--u8-text) !important;
  border-radius: var(--u8-radius) !important;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--u8-red) !important;
  box-shadow: 0 0 0 3px rgba(220,20,60,.15) !important;
  background: var(--u8-surface-2) !important;
  color: var(--u8-white) !important;
}
.form-control::placeholder { color: var(--u8-muted); }
.form-label {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--u8-muted);
  margin-bottom: .35rem;
}
.form-text { color: var(--u8-muted); font-size: .78rem; }

/* ── Input group ────────────────────────────────────────────── */
.input-group .btn { border-radius: 0 var(--u8-radius) var(--u8-radius) 0 !important; }
.input-group .form-control { border-radius: var(--u8-radius) 0 0 var(--u8-radius) !important; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  border-radius: var(--u8-radius) !important;
  border-left: 3px solid;
  font-size: .9rem;
}
.alert-success { border-left-color: #2a9d8f; background: rgba(42,157,143,.1) !important; color: #7ee8de !important; }
.alert-danger  { border-left-color: var(--u8-red); background: rgba(220,20,60,.1) !important; color: #ff8099 !important; }
.alert-warning { border-left-color: #f0a500; background: rgba(240,165,0,.1) !important; color: #ffd166 !important; }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-content {
  background: var(--u8-surface) !important;
  border: 1px solid var(--u8-border) !important;
  border-radius: var(--u8-radius-lg) !important;
  border-top: 2px solid var(--u8-red) !important;
}

/* ══════════════════════════════════════════════════════════════
   FOOTER SOCIAL ICONS
   ══════════════════════════════════════════════════════════════ */
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--u8-radius) !important;
  background: var(--u8-surface);
  color: var(--u8-muted);
  font-size: 1.1rem;
  text-decoration: none;
  transition: all .2s;
  border: 1px solid var(--u8-border);
}
.social-icon:hover           { color: #fff; transform: translateY(-3px); border-color: var(--u8-red); background: var(--u8-surface-2); box-shadow: 0 4px 16px var(--u8-red-glow); }
.social-icon--discord:hover  { border-color: #7289da; box-shadow: 0 4px 16px rgba(114,137,218,.25); }
.social-icon--yt:hover       { border-color: #ff0000; box-shadow: 0 4px 16px rgba(255,0,0,.25); }

.site-footer {
  background: rgba(0,0,0,.5);
  border-top: 1px solid var(--u8-border);
  margin-top: auto;
  position: relative;
}
/* Red top line on footer */
.site-footer::before {
  content: '';
  position: absolute;
  top: -1px; left: 0;
  width: 80px; height: 2px;
  background: var(--u8-red);
}
.footer-bottom {
  border-top: 1px solid rgba(48,54,61,.6);
  padding-top: 1rem;
  margin-top: .5rem;
}

/* ══════════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════════ */
.login-page {
  background:
    repeating-linear-gradient(
      108deg,
      transparent 0px, transparent 40px,
      rgba(220,20,60,.025) 40px, rgba(220,20,60,.025) 41px
    ),
    radial-gradient(ellipse at 60% 40%, rgba(220,20,60,.08) 0%, transparent 65%),
    var(--u8-bg);
}
.login-box { width: 100%; max-width: 420px; padding: 1.5rem; }

/* ══════════════════════════════════════════════════════════════
   SPEED LINES utility (apply to sections as needed)
   ══════════════════════════════════════════════════════════════ */
.speed-lines {
  background-image: repeating-linear-gradient(
    108deg,
    transparent 0px, transparent 36px,
    rgba(220,20,60,.04) 36px, rgba(220,20,60,.04) 37px
  );
}

/* ── Category color dot ─────────────────────────────────────── */
.cat-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 1px;
}

/* ── Misc utilities ─────────────────────────────────────────── */
.text-danger  { color: var(--u8-red) !important; }
.text-muted   { color: var(--u8-muted) !important; }
.text-white   { color: var(--u8-white) !important; }
.bg-danger    { background-color: var(--u8-red) !important; }
.border-danger { border-color: var(--u8-red) !important; }
.letter-spacing-2 { letter-spacing: .1em; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 576px) {
  .article-card--featured .article-card__img-wrap img { height: 180px; }
  .hero-section { min-height: 200px; }
  h1, .h1 { font-size: 1.8rem; }
}
