/* =======================================================================
   COLOR PALETTE
   Change a color here and it updates everywhere on the site.
   ======================================================================= */
:root {
  --bg:          #f8f7fc;  /* page background (faint lavender white) */
  --surface:     #ffffff;  /* cards, header, boxes */
  --text:        #14142b;  /* main text (near-black ink) */
  --text-muted:  #4e4b66;  /* secondary text, card descriptions */
  --accent:      #5b4cf0;  /* electric indigo: headings, links */
  --accent-dark: #4336c9;  /* deeper indigo for hover */
  --accent-soft: #eeecfd;  /* pale indigo (hero) */
  --secondary:   #ff6b4a;  /* coral: underlines, dates, hover */
  --secondary-soft: #fff0eb; /* pale coral (hero blend) */
  --highlight:   #10b981;  /* green: key stats, growth numbers */
  --border:      #e6e4f2;  /* soft lavender-gray borders */
  --line:        #14142b;  /* timeline lines */
  --shadow:      rgba(91, 76, 240, 0.10);
}

/* =======================================================================
   GLOBAL RESET
   ======================================================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Keep links from turning default blue/purple */
a {
  color: var(--accent);
}

a:visited {
  color: var(--accent);
}

/* =======================================================================
   BODY
   ======================================================================= */
body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  text-align: center;
}

/* =======================================================================
   HEADER / NAVBAR
   ======================================================================= */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.logo-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
  width: 250px;
}

.logo {
  width: 250px;
  max-width: none;
  height: auto;
  display: block;
}

.nav-right {
  display: flex;
  align-items: center;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
  margin-right: 20px;
}

.nav-links a,
.nav-links a:visited {
  text-decoration: none;
  color: var(--text);
  font-weight: bold;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--secondary);
}

.search-bar {
  padding: 6px 10px;
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.search-bar:focus {
  outline: none;
  border-color: var(--secondary);
}

/* Optional: wrap a key number in <span class="stat"> to make it pop */
.stat {
  color: var(--highlight);
  font-weight: bold;
}

/* =======================================================================
   HERO (HOME PAGE)
   ======================================================================= */
.hero {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(120deg, var(--accent-soft), var(--secondary-soft));
  margin-top: 1rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--accent);
}

/* =======================================================================
   HOME ARTICLE ROWS
   ======================================================================= */
.article-row {
  padding: 1rem 2rem;
}

.scroll-container {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding: 1rem 0;
  scrollbar-width: none;          /* hide scrollbar (Firefox) */
}

.scroll-container::-webkit-scrollbar {
  display: none;                  /* hide scrollbar (Chrome, Safari) */
}

/* Infinite row wrapper + arrows (added by carousel.js) */
.carousel {
  position: relative;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--shadow);
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.carousel:hover .carousel-arrow,
.carousel-arrow:focus-visible {
  opacity: 1;
}

.carousel-arrow:hover {
  background: var(--accent);
  color: #fff;
}

.carousel-arrow-left  { left: -8px; }
.carousel-arrow-right { right: -8px; }

/* Touch screens have no hover, so always show the arrows there */
@media (hover: none) {
  .carousel-arrow { opacity: 1; }
}

.article-card,
.article-card:visited {
  flex: 0 0 auto;
  background: var(--surface);
  padding: 1rem;
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);   /* indigo strip across the top */
  border-radius: 10px;
  box-shadow: 0 4px 14px var(--shadow);
  min-width: 250px;
  width: 300px;
  height: 200px;
  display: flex;
  flex-direction: column;   /* stacks title above description */
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* No underlines anywhere inside the boxes, even if they're wrapped in links */
a .article-card,
.article-card a,
.article-card h3,
.article-card p,
a:has(.article-card) {
  text-decoration: none;
}

.article-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.article-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.article-card:hover {
  transform: scale(1.03);
  border-top-color: var(--secondary);   /* strip turns coral */
  box-shadow: 0 10px 24px var(--shadow);
}

.article-card:hover h3 {
  color: var(--accent);
}

/* =======================================================================
   ARTICLES PAGE
   ======================================================================= */
.page-heading,
.timeline-heading {
  position: relative;
  display: inline-block;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 2rem;
}

.page-heading::after,
.timeline-heading::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 60px;
  height: 4px;
  background-color: var(--secondary);
  border-radius: 2px;
}

.articles-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

.articles-grid .article-card {
  width: 280px;
  height: 200px;
  flex: 0 0 280px;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  text-align: center;
}

.articles-grid .article-card:hover {
  transform: translateY(-5px);
}

.articles-grid .article-card h3 {
  margin: 0 0 0.8rem 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
}

.articles-grid .article-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* =======================================================================
   ABOUT PAGE
   ======================================================================= */
.aboutsection {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 2rem;
  gap: 3rem;
  max-width: 900px;
  margin: 0 auto;
  background: transparent;
}

.aboutwebsite,
.aboutme {
  background: var(--surface);
  padding: 2rem 1.5rem;
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 15px;
  box-shadow: 0 4px 12px var(--shadow);
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.aboutwebsite h3,
.aboutme h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--accent);
  font-weight: 700;
}

.aboutwebsite article,
.aboutme article {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-muted);
  font-weight: 500;
}

/* =======================================================================
   TIMELINE PAGE
   ======================================================================= */
.timeline {
  position: relative;
  max-width: 1000px;
  margin: 4rem auto;
  padding: 2rem 0;
}

/* center vertical line */
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 100%;
  background: var(--line);
  z-index: 1;
}

/* timeline items */
.timeline-item {
  position: relative;
  width: 50%;
  padding: 2rem 3rem;
  display: flex;
  align-items: flex-start;
}

.timeline-item.left {
  left: 0;
  text-align: right;
}

.timeline-item.right {
  left: 50%;
  text-align: left;
}

/* text bubble */
.timeline-item .content {
  flex: 1;
  background: var(--surface);
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 2px 6px var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  z-index: 5;
}

.timeline-item .timeline-date {
  font-weight: bold;
  color: var(--secondary);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.timeline-item .timeline-text h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.2rem;
}

.timeline-item .timeline-text p {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
}

/* remove dots */
.timeline-item::before {
  content: none !important;
}

/* connector lines */
.timeline-item::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50%;
  height: 4px;
  background: var(--line);
  z-index: 2;
}

.timeline-item.left::after {
  right: 0;
}

.timeline-item.right::after {
  left: 0;
}

/* =======================================================================
   TIMELINE: TEXT LINKS + PHONES
   ======================================================================= */
.timeline-text a,
.timeline-text a:visited {
  color: inherit;
  text-decoration: none;
}

.timeline-item .content {
  transition: transform 0.2s ease, border-color 0.2s ease;
  border-top: 4px solid var(--accent);
}

.timeline-item .content:hover {
  transform: translateY(-3px);
  border-top-color: var(--secondary);
}

.timeline-item .content:hover h3 {
  color: var(--accent);
}

@media (max-width: 768px) {
  .timeline::before {
    left: 24px;
  }

  .timeline-item,
  .timeline-item.left,
  .timeline-item.right {
    width: 100%;
    left: 0;
    padding: 1rem 1rem 1rem 3.5rem;
    text-align: left;
  }

  .timeline-item.left::after,
  .timeline-item.right::after {
    left: 24px;
    right: auto;
    width: 2rem;
  }
}

/* =======================================================================
   HOME CARDS: MAKE THE WHOLE BOX CLICKABLE
   ======================================================================= */
.article-card > a,
.article-card > a:visited {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

/* =======================================================================
   SEARCH: "NO RESULTS" MESSAGE (added by script.js)
   ======================================================================= */
.no-results {
  display: none;
  width: 100%;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* =======================================================================
   ARTICLE PAGES
   Every article's <body> has class="article-page"
   ======================================================================= */
.article-page {
  --font-reading: Georgia, "Times New Roman", Times, serif;  /* long-form text */
}

.article-page main {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* Title box */
.article-page .hero {
  margin-top: 2rem;
  padding: 2.5rem 2rem;
  border-radius: 14px;
}

.article-page .hero h1 {
  font-size: 2.1rem;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.article-page .hero p {
  color: var(--text-muted);
  font-style: italic;
}

/* Jump-to-section buttons */
.article-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 1.5rem 0;
}

.article-nav a,
.article-nav a:visited {
  text-decoration: none;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: bold;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.article-nav a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Main reading box */
.article-content,
.article-page footer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 4px 14px var(--shadow);
  padding: 2.5rem 2.25rem;
  margin-top: 1.5rem;
  text-align: left;
}

.article-content {
  font-family: var(--font-reading);
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--text);
}

.article-content section {
  scroll-margin-top: 1.5rem;   /* nav jumps don't hug the top edge */
}

.article-content h2 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.6rem;
  color: var(--accent);
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
}

.article-content section:first-child h2 {
  margin-top: 0;
}

.article-content h3 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.2rem;
  color: var(--text);
  margin: 1.5rem 0 0.5rem;
}

.article-content p {
  margin-bottom: 1.1rem;
}

.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}

.article-content a:hover {
  color: var(--secondary);
  text-decoration-color: var(--secondary);
}

.article-content blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1.25rem;
  border-left: 4px solid var(--secondary);
  font-style: italic;
  color: var(--text-muted);
}

/* Highlighted fact boxes (India article) */
.callout {
  background: var(--accent-soft);
  border-left: 5px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 8px;
}

.callout strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--accent);
  font-family: Arial, Helvetica, sans-serif;
}

/* Sources box */
.article-page footer h3 {
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.article-page footer ul {
  list-style: none;
}

.article-page footer li {
  margin-bottom: 0.6rem;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  font-size: 0.95rem;
}

.article-page footer a {
  color: var(--accent);
  text-decoration: none;
}

.article-page footer a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

/* =======================================================================
   SMALL SCREENS
   ======================================================================= */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .nav-right {
    flex-direction: column;
    gap: 0.75rem;
  }

  .nav-links {
    margin-right: 0;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .article-page .hero h1 {
    font-size: 1.6rem;
  }

  .article-content,
  .article-page footer {
    padding: 1.5rem 1.25rem;
  }

  .article-content h2 {
    font-size: 1.35rem;
  }
}
