/* =========================================================
   CodexAIT News — design tokens
   Palette: Navy #0F1E42 (ink), Red #C21E2C (masthead/accent),
            Paper #FAF9F6 (background), Slate #5B6472 (muted text)
   Type: "Newsreader" (headline serif) + "Inter" (UI/body sans)
   ========================================================= */
:root{
  --ink:      #0F1E42;
  --ink-2:    #16294F;
  --red:      #C21E2C;
  --red-dark: #9E1620;
  --paper:    #FAF9F6;
  --paper-2:  #F1EEE7;
  --slate:    #5B6472;
  --line:     #E4E0D6;
  --white:    #ffffff;
  --radius:   4px;
  --serif: "Newsreader", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}

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

h1,h2,h3,h4,.headline{
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

:focus-visible{
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}

/* ---------- Top utility bar ---------- */
.topbar{
  background: var(--ink);
  color: #C7CEDD;
  font-size: .8rem;
}
.topbar-inner{
  display:flex; justify-content: space-between; align-items:center;
  padding: 6px 0;
}
.topbar-links a{ color:#C7CEDD; margin-left: 18px; }
.topbar-links a:hover{ color: #fff; }

/* ---------- Main nav ---------- */
.main-nav{
  background: var(--white);
  border-bottom: 3px solid var(--ink);
  padding: 10px 0;
}
.main-nav-list{ gap: 6px; }
.main-nav .nav-link{
  color: var(--ink);
  font-weight: 600;
  font-size: .93rem;
  padding: 8px 14px !important;
  border-radius: var(--radius);
}
.main-nav .nav-link:hover{ color: var(--red); }
.main-nav .nav-link.active{ color: var(--red); }

.search-form{ gap: 0; }
.search-form .form-control{
  border: 1px solid var(--line);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: .88rem;
  min-width: 180px;
}
.search-form .btn{
  background: var(--ink);
  color: #fff;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.search-form .btn:hover{ background: var(--red); }

/* ---------- Breaking ticker ---------- */
.ticker-bar{
  background: var(--red);
  color: #fff;
  display:flex;
  align-items:center;
  overflow:hidden;
}
.ticker-tag{
  background: var(--red-dark);
  padding: 9px 16px;
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .04em;
  white-space: nowrap;
  flex-shrink:0;
}
.ticker-track-wrap{ overflow:hidden; flex:1; }
.ticker-track{
  display:flex;
  gap: 48px;
  white-space:nowrap;
  animation: ticker 32s linear infinite;
  padding: 9px 0;
  font-size: .88rem;
}
.ticker-track a{ color:#fff; }
.ticker-track a:hover{ text-decoration: underline; }
@keyframes ticker{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}

/* ---------- Hero ---------- */
.hero-section{ padding: 34px 0 10px; }
.hero-lead{
  position:relative;
  border-radius: var(--radius);
  overflow:hidden;
  min-height: 420px;
  display:flex;
  align-items:flex-end;
  background-size: cover;
  background-position:center;
  color:#fff;
}
.hero-lead::after{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(15,30,66,0) 30%, rgba(15,30,66,.92) 100%);
}
.hero-lead .hero-body{ position:relative; z-index:1; padding: 28px; }
.hero-lead .eyebrow{
  background: var(--red); color:#fff; padding: 4px 10px; border-radius: 2px;
  font-size:.72rem; font-weight:800; letter-spacing:.04em;
}
.hero-lead h1{ font-size: 2rem; color:#fff; margin: 12px 0 8px; }
.hero-lead p{ color:#DCE1EC; max-width: 60ch; }

.hero-side-item{
  display:flex; gap:14px; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.hero-side-item:first-child{ padding-top: 0; }
.hero-side-item img{
  width: 96px; height: 72px; object-fit:cover; border-radius: var(--radius); flex-shrink:0;
  background: var(--paper-2);
}
.hero-side-item h3{ font-size: 1rem; margin:0 0 4px; }
.hero-side-item:hover h3{ color: var(--red); }
.hero-side-item .meta{ font-size:.78rem; color: var(--slate); }

/* ---------- Section headers ---------- */
.section-head{
  display:flex; align-items:baseline; justify-content:space-between;
  border-bottom: 2px solid var(--ink);
  margin: 46px 0 22px;
  padding-bottom: 8px;
}
.section-head h2{ font-size: 1.5rem; margin:0; }
.section-head .see-all{ font-size:.85rem; font-weight:600; color: var(--red); white-space:nowrap; }
.section-head .see-all:hover{ text-decoration: underline; }

/* ---------- News cards ---------- */
.news-card{
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow:hidden;
  height:100%;
  display:flex; flex-direction:column;
  transition: box-shadow .18s ease, transform .18s ease;
}
.news-card:hover{ box-shadow: 0 10px 24px rgba(15,30,66,.1); transform: translateY(-2px); }
.news-card img{
  width:100%; height:170px; object-fit:cover; background: var(--paper-2);
}
.news-card .card-body{ padding: 16px; display:flex; flex-direction:column; flex:1; }
.news-card .source-tag{
  font-size:.7rem; font-weight:800; letter-spacing:.03em; color: var(--red); text-transform: uppercase;
}
.news-card h3{ font-size: 1.05rem; margin: 8px 0; }
.news-card p{ color: var(--slate); font-size:.88rem; margin-bottom: 10px; flex:1; }
.news-card .meta{ font-size:.76rem; color: var(--slate); border-top:1px solid var(--line); padding-top:10px; }

/* ---------- Blog cards ---------- */
.blog-card{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  height: 100%;
  display:flex; flex-direction:column;
}
.blog-card img{ width:100%; height:190px; object-fit:cover; background: var(--paper-2); }
.blog-card .card-body{ padding: 18px; display:flex; flex-direction:column; flex:1; }
.blog-card .cat-pill{
  display:inline-block; background: var(--paper-2); color: var(--ink);
  font-size:.72rem; font-weight:700; padding: 3px 10px; border-radius: 20px; margin-bottom:10px; width:fit-content;
}
.blog-card h3{ font-size: 1.15rem; margin-bottom:8px; }
.blog-card h3 a:hover{ color: var(--red); }
.blog-card .excerpt{ color: var(--slate); font-size:.9rem; flex:1; }
.blog-card .meta{ font-size:.78rem; color: var(--slate); margin-top:12px; }

/* ---------- Buttons ---------- */
.btn-brand{
  background: var(--red); color:#fff; border:none; font-weight:700; border-radius: var(--radius);
  padding: 10px 22px;
}
.btn-brand:hover{ background: var(--red-dark); color:#fff; }
.btn-outline-ink{
  border:1px solid var(--ink); color: var(--ink); font-weight:600; border-radius: var(--radius);
}
.btn-outline-ink:hover{ background: var(--ink); color:#fff; }

/* ---------- Sidebar ---------- */
.sidebar-block{
  background: var(--white); border:1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 24px;
}
.sidebar-block h4{ font-size:1.05rem; border-bottom:2px solid var(--ink); padding-bottom:10px; margin-bottom:14px; }
.sidebar-post{ display:flex; gap:12px; padding: 10px 0; border-bottom:1px dashed var(--line); }
.sidebar-post:last-child{ border-bottom:none; }
.sidebar-post .num{ font-family: var(--serif); font-size:1.4rem; color: var(--red); width:28px; flex-shrink:0; }
.sidebar-post h5{ font-size:.9rem; margin:0; }

/* ---------- Blog detail ---------- */
.article-hero img{ width:100%; max-height: 440px; object-fit:cover; border-radius: var(--radius); }
.article-body{ font-family: var(--serif); font-size: 1.12rem; color:#232c40; max-width: 74ch; }
.article-body p{ margin-bottom: 1.3em; }
.article-meta{ color: var(--slate); font-size:.9rem; }

/* ---------- Forms ---------- */
.form-control:focus, .form-select:focus{
  border-color: var(--ink); box-shadow: 0 0 0 3px rgba(15,30,66,.12);
}
.auth-card{
  max-width: 440px; margin: 60px auto; background:#fff; border:1px solid var(--line);
  border-radius: var(--radius); padding: 34px;
}

/* ---------- Footer ---------- */
.site-footer{ background: var(--ink); color:#C7CEDD; padding: 50px 0 20px; margin-top: 60px; }
.site-footer h6{ color:#fff; font-weight:700; margin-bottom:14px; letter-spacing:.02em; }
.footer-about{ font-size:.88rem; color:#B7BFD1; }
.footer-links{ list-style:none; padding:0; margin:0; }
.footer-links li{ margin-bottom:8px; }
.footer-links a{ color:#B7BFD1; font-size:.88rem; }
.footer-links a:hover{ color:#fff; }
.site-footer hr{ border-color:#2A3B63; margin: 30px 0 16px; }
.footer-bottom{ font-size:.82rem; color:#8E97AC; }

/* ---------- Utility ---------- */
.badge-cat{ background: var(--paper-2); color: var(--ink); font-weight:700; }
.empty-state{ text-align:center; padding: 60px 20px; color: var(--slate); }

@media (max-width: 991px){
  .hero-lead{ min-height: 320px; }
  .hero-lead h1{ font-size: 1.5rem; }
  .search-form{ margin-top: 14px; width:100%; }
}
@media (max-width: 767px){
  .topbar-links a{ margin-left: 10px; }
  .section-head h2{ font-size: 1.25rem; }
}
