/*
 * News Article Page Styles
 * ========================
 * 
 * CUSTOMIZATION GUIDE:
 * --------------------
 * This file uses CSS variables from assets/css/style.css.
 * To customize colors, edit the :root block in style.css.
 * 
 * THEME VARIABLES USED:
 * - --site-bg: Page background (default: #162448)
 * - --text-main: Primary text color (default: #ffffff)
 * - --text-subtle: Secondary text color (default: #cfd8ea)
 * - --accent: Accent/highlight color (default: #0b5ed7)
 * - --card-bg: Article card background (default: #ffffff)
 * - --card-text: Article text color (default: #0b1220)
 * - --radius: Border radius (default: 12px)
 * 
 * CHANGING ARTICLE CONTENT:
 * -------------------------
 * - Edit the <h1 class="article__title"> for the headline
 * - Edit the <article class="article__body"> for main content
 * - Replace img src in .article__hero-image for the hero image
 * 
 * RECOMMENDED IMAGE SIZES:
 * ------------------------
 * - Hero images: >= 1200px wide (16:9 aspect ratio preferred)
 * - Inline images: 800-1200px wide
 */

/* ========================================
   CSS VARIABLES (local overrides)
   ======================================== */
:root {
  --article-max-width: 800px;
  --article-wide-max: 1000px;
  --article-header-bg: #10182a;
}

/* ========================================
   BASE STYLES
   ======================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--site-bg, #162448);
  color: var(--text-main, #ffffff);
  font-family: 'Montserrat', Arial, sans-serif;
  line-height: 1.7;
  min-height: 100vh;
}

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

/* Screen reader only utility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus accessibility */
:focus-visible {
  outline: 2px solid var(--accent, #0b5ed7);
  outline-offset: 2px;
}

/* ========================================
   HEADER
   ======================================== */
.article-header {
  background: var(--article-header-bg, #10182a);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.article-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.article-header__logo-link {
  display: flex;
  align-items: center;
}

.article-header__logo {
  height: 50px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.article-header__nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.article-header__nav-link {
  color: var(--text-main, #ffffff);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.article-header__nav-link:hover,
.article-header__nav-link:focus {
  color: var(--accent, #0b5ed7);
  border-bottom-color: var(--accent, #0b5ed7);
}

.article-header__back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent, #0b5ed7);
  color: var(--accent-contrast, #ffffff);
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.article-header__back-btn:hover,
.article-header__back-btn:focus {
  background: var(--accent-hover, #3373b5);
  transform: translateY(-1px);
}

/* ========================================
   ARTICLE CONTAINER
   ======================================== */
.article-container {
  max-width: var(--article-wide-max);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ========================================
   ARTICLE HERO
   ======================================== */
.article__hero {
  margin-bottom: 2rem;
}

.article__hero-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius, 12px);
  object-fit: cover;
  max-height: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.article__meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-subtle, #cfd8ea);
}

.article__category {
  display: inline-block;
  background: var(--accent, #0b5ed7);
  color: var(--accent-contrast, #ffffff);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.article__date {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.article__read-time {
  opacity: 0.8;
}

/* ========================================
   ARTICLE TITLE
   ======================================== */
.article__title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 1.5rem 0;
  color: var(--text-main, #ffffff);
}

/* ========================================
   ARTICLE BODY (Newspaper Style)
   ======================================== */
.article__body {
  background: var(--card-bg, #ffffff);
  color: var(--card-text, #0b1220);
  padding: 2.5rem;
  border-radius: var(--radius, 12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  line-height: 1.8;
  font-size: 1.05rem;
}

.article__body p {
  margin: 0 0 1.5rem;
}

.article__body p:last-child {
  margin-bottom: 0;
}

.article__body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  color: var(--card-text, #0b1220);
}

.article__body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--card-text, #0b1220);
}

.article__body ul,
.article__body ol {
  margin: 1rem 0 1.5rem;
  padding-left: 1.5rem;
}

.article__body li {
  margin-bottom: 0.5rem;
}

.article__body blockquote {
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--accent, #0b5ed7);
  background: #f0f4f8;
  font-style: italic;
  color: #555;
  border-radius: 0 8px 8px 0;
}

.article__body a {
  color: var(--accent, #0b5ed7);
  text-decoration: underline;
}

.article__body a:hover {
  color: var(--accent-hover, #3373b5);
}

/* Lead paragraph styling */
.article__lead {
  font-size: 1.2rem;
  font-weight: 500;
  color: #444;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ========================================
   ARTICLE FOOTER / SHARE
   ======================================== */
.article__share {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--divider, rgba(255,255,255,0.06));
  text-align: center;
}

.article__share-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-subtle, #cfd8ea);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.article__share-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.article__share-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1c2f52;
  color: var(--text-subtle, #cfd8ea);
  font-size: 1.25rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.article__share-link:hover,
.article__share-link:focus {
  background: var(--accent, #0b5ed7);
  color: var(--accent-contrast, #ffffff);
  transform: translateY(-2px);
}

/* ========================================
   RELATED ARTICLES
   ======================================== */
.article__related {
  margin-top: 4rem;
}

.article__related-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-main, #ffffff);
}

.article__related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.related-card {
  display: flex;
  background: #1c2f52;
  border-radius: var(--radius, 12px);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-card:hover,
.related-card:focus {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.related-card:focus-visible {
  outline: 3px solid var(--accent, #0b5ed7);
  outline-offset: 2px;
}

.related-card__image {
  width: 140px;
  height: 100px;
  object-fit: cover;
  flex-shrink: 0;
}

.related-card__content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.related-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
  color: var(--text-main, #ffffff);
}

.related-card__date {
  font-size: 0.8rem;
  color: var(--text-subtle, #cfd8ea);
  margin-top: 0.5rem;
}

/* ========================================
   FOOTER
   ======================================== */
.article-footer {
  background: #0b1627;
  border-top: 1px solid #2a3f66;
  padding: 3rem 1.5rem;
  text-align: center;
  margin-top: 4rem;
}

.article-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
}

.article-footer__logo {
  height: 60px;
  width: auto;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.article-footer__socials {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.article-footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1c2f52;
  color: var(--text-subtle, #cfd8ea);
  font-size: 1.25rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.article-footer__social-link:hover,
.article-footer__social-link:focus {
  background: var(--accent, #0b5ed7);
  color: var(--accent-contrast, #ffffff);
  transform: translateY(-2px);
}

.article-footer__links {
  margin-bottom: 1.5rem;
}

.article-footer__links a {
  color: var(--text-subtle, #cfd8ea);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.article-footer__links a:hover,
.article-footer__links a:focus {
  color: var(--accent, #0b5ed7);
}

.article-footer__sep {
  color: #2a3f66;
  margin: 0 0.75rem;
}

.article-footer__copy {
  color: var(--text-subtle, #cfd8ea);
  font-size: 0.85rem;
  margin: 0;
  opacity: 0.8;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */
@media (max-width: 991.98px) {
  .article__title {
    font-size: 2rem;
  }

  .article__body {
    padding: 2rem;
  }

  .article__related-grid {
    grid-template-columns: 1fr;
  }
}

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

  .article__title {
    font-size: 1.5rem;
  }

  .article__body {
    padding: 1.5rem;
    font-size: 1rem;
  }

  .article__lead {
    font-size: 1.1rem;
  }

  .article-container {
    padding: 1.5rem 1rem 3rem;
  }

  .related-card {
    flex-direction: column;
  }

  .related-card__image {
    width: 100%;
    height: 150px;
  }
}

/* ========================================
   REDUCED MOTION PREFERENCES
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .article-header__back-btn:hover,
  .article-header__back-btn:focus,
  .related-card:hover,
  .related-card:focus,
  .article__share-link:hover,
  .article__share-link:focus,
  .article-footer__social-link:hover,
  .article-footer__social-link:focus {
    transform: none;
  }
}
