/* =====================
   AI & Automation Chronicle
   ===================== */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* ScienceDirect-inspired color palette */
  --blue:        #0062A3;   /* Primary blue — buttons, links */
  --blue-dark:   #004D8A;   /* Hover state */
  --blue-light:  #E8F3FB;   /* Light blue tint */
  --orange:      #E04D14;   /* Elsevier accent orange */
  --orange-light:#FDF0EB;   /* Light orange tint */

  --white:       #FFFFFF;
  --bg:          #FFFFFF;   /* Main page background */
  --bg-beige:    #E2DDD0;   /* Warm beige — hero/sections */
  --bg-light:    #F5F5F5;   /* Light gray — stats/alt rows */
  --text-dark:   #1A1A1A;   /* Primary text */
  --text-mid:    #3D3D3D;   /* Body text */
  --text-gray:   #666666;   /* Secondary / meta text */
  --text-light:  #999999;   /* Muted */
  --card-bg:     #FFFFFF;
  --border:      #DCDCDC;
  --border-dark: #BDBDBD;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:    0 12px 40px rgba(0,0,0,0.10);
  --shadow-hover: 0 8px 28px rgba(0,0,0,0.13);

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  background-color: var(--bg);
  color: var(--text-dark);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.2;
}

/* ---- READING PROGRESS BAR ---- */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--orange);
  width: 0%;
  z-index: 200;
  transition: width 0.1s linear;
}

/* ---- NAVBAR ---- */
nav {
  background-color: var(--white);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.nav-brand {
  color: var(--text-dark);
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-brand span {
  color: var(--orange);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-gray);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
  padding: 0.25rem 0;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--orange);
  transition: width var(--transition);
  border-radius: 2px;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--text-dark);
}

/* ---- HERO ---- */
.hero {
  background: var(--bg-beige);
  color: var(--text-dark);
  padding: 5rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-dark);
}

.hero h1 span {
  color: var(--orange);
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-gray);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
  font-family: 'Inter', Arial, sans-serif;
}

.badge {
  display: inline-block;
  background: var(--orange-light);
  color: var(--orange);
  border: 1px solid rgba(224, 77, 20, 0.25);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1.4rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: 'Inter', Arial, sans-serif;
}

/* ---- STATS BAR ---- */
.stats-bar {
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1.4rem 2rem;
}

.stats-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
  font-family: Georgia, serif;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 30px;
  background: var(--border);
}

/* ---- MAIN CONTAINER ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.5rem 2rem;
}

/* ---- SECTION HEADER ---- */
.section-header {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.01em;
}

.section-subtitle {
  color: var(--text-gray);
  font-size: 0.925rem;
  margin-top: 0.6rem;
}

.divider {
  width: 36px;
  height: 3px;
  background: var(--orange);
  margin: 0.65rem 0 0;
  border-radius: 2px;
}

/* ---- TABS ---- */
.tabs-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.7rem 1.5rem 0.8rem;
  cursor: pointer;
  position: relative;
  transition: color var(--transition);
  text-align: left;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--orange);
  border-radius: 2px 2px 0 0;
  transition: width var(--transition);
}

.tab-btn:hover .tab-title {
  color: var(--text-dark);
}

.tab-btn.active .tab-title {
  color: var(--text-dark);
}

.tab-btn.active::after {
  width: 100%;
}

.tab-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'Inter', Arial, sans-serif;
  color: var(--text-gray);
  letter-spacing: 0.01em;
  transition: color var(--transition);
}

.tab-subtitle {
  display: block;
  font-size: 0.72rem;
  font-family: 'Inter', Arial, sans-serif;
  color: var(--text-light);
  font-weight: 400;
  margin-top: 0.1rem;
  letter-spacing: 0.01em;
}

/* ---- PAPER CARDS ---- */
.papers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.paper-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.paper-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--blue);
}

.paper-card-placeholder {
  width: 100%;
  height: 170px;
  background: var(--bg-beige);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.paper-card-body {
  padding: 1.35rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.paper-week {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.45rem;
  font-family: 'Inter', Arial, sans-serif;
}

.paper-card-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.55rem;
  line-height: 1.4;
}

.paper-card-body p {
  font-size: 0.875rem;
  color: var(--text-gray);
  line-height: 1.65;
  margin-bottom: 1.2rem;
  flex: 1;
  font-family: 'Inter', Arial, sans-serif;
}

.paper-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.775rem;
  color: var(--text-gray);
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ---- TAGS ---- */
.tag {
  background: var(--blue-light);
  color: var(--blue);
  padding: 0.18rem 0.6rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-family: 'Inter', Arial, sans-serif;
}

.tag.green  { background: #EAF7EE; color: #1A7A40; }
.tag.purple { background: #F3EEFF; color: #6528C8; }
.tag.orange { background: var(--orange-light); color: var(--orange); }

.read-time {
  font-size: 0.775rem;
  color: var(--text-light);
}

/* ---- NEWSLETTER SECTION ---- */
.newsletter-section {
  background: var(--bg-beige);
  border-top: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-dark);
  padding: 4.5rem 2rem;
  text-align: center;
}

.newsletter-inner {
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-section h2 {
  color: var(--text-dark);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.newsletter-section h2 span {
  color: var(--orange);
}

.newsletter-section p {
  color: var(--text-gray);
  font-size: 0.975rem;
  margin-bottom: 2rem;
  line-height: 1.65;
  font-family: 'Inter', Arial, sans-serif;
}

.newsletter-form {
  display: flex;
  gap: 0.65rem;
  max-width: 440px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-dark);
  background: var(--white);
  color: var(--text-dark);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.newsletter-form input::placeholder {
  color: var(--text-light);
}

.newsletter-form input:focus {
  border-color: var(--blue);
}

.newsletter-form button {
  padding: 0.7rem 1.35rem;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}

.newsletter-form button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.newsletter-note {
  font-size: 0.775rem;
  color: var(--text-light);
  margin-top: 1rem;
  font-family: 'Inter', Arial, sans-serif;
}

/* ---- ABOUT PAGE ---- */
.about-section {
  max-width: 760px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.about-section h2 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-dark);
}

.about-section h2 span {
  color: var(--orange);
}

.about-section p {
  color: var(--text-mid);
  font-size: 0.975rem;
  margin-bottom: 1.2rem;
  line-height: 1.85;
  font-family: 'Inter', Arial, sans-serif;
}

.skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 2rem;
}

.skill-tag {
  background: var(--white);
  color: var(--text-dark);
  padding: 0.3rem 0.8rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border-dark);
  font-family: 'Inter', Arial, sans-serif;
}

/* ---- BREADCRUMB ---- */
.breadcrumb {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 2rem;
}

.breadcrumb-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-gray);
  font-family: 'Inter', Arial, sans-serif;
}

.breadcrumb-inner a {
  color: var(--text-gray);
  text-decoration: none;
  transition: color var(--transition);
}

.breadcrumb-inner a:hover {
  color: var(--blue);
}

.breadcrumb-sep {
  color: var(--border-dark);
}

.breadcrumb-current {
  color: var(--text-dark);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}

/* ---- SINGLE POST ---- */
.post-header {
  background: var(--bg-beige);
  color: var(--text-dark);
  padding: 4rem 2rem 3rem;
  text-align: center;
  border-bottom: 1px solid var(--border-dark);
}

.post-header-inner {
  position: relative;
  z-index: 1;
}

.post-header .post-week {
  color: var(--blue);
  font-size: 0.775rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  display: block;
  font-family: 'Inter', Arial, sans-serif;
}

.post-header h1 {
  font-size: 2.1rem;
  font-weight: 700;
  max-width: 760px;
  margin: 0 auto 1.2rem;
  line-height: 1.25;
  color: var(--text-dark);
}

.post-header-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: var(--text-gray);
  font-size: 0.85rem;
  font-family: 'Inter', Arial, sans-serif;
}

.post-header-tags {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.post-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
}

.post-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 2.5rem 0 0.75rem;
  color: var(--text-dark);
}

.post-body p {
  color: var(--text-mid);
  font-size: 0.975rem;
  line-height: 1.85;
  margin-bottom: 1.1rem;
  font-family: 'Inter', Arial, sans-serif;
}

.post-body ul {
  padding-left: 1.5rem;
  margin-bottom: 1.1rem;
}

.post-body ul li {
  color: var(--text-mid);
  font-size: 0.975rem;
  line-height: 1.85;
  margin-bottom: 0.5rem;
  font-family: 'Inter', Arial, sans-serif;
}

.post-body em {
  font-style: italic;
}

.paper-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--blue);
  color: var(--white);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  transition: background var(--transition);
  font-family: 'Inter', Arial, sans-serif;
}

.paper-link:hover {
  background: var(--blue-dark);
}

/* ---- SHARE SECTION ---- */
.share-section {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 2rem 2.5rem;
  border-top: 1px solid var(--border);
}

.share-section h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: 'Inter', Arial, sans-serif;
}

.share-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition), transform var(--transition);
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.share-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.share-btn.linkedin {
  background: #0A66C2;
  color: var(--white);
}

.share-btn.twitter {
  background: #000000;
  color: var(--white);
}

.share-btn.copy {
  background: var(--white);
  color: var(--text-dark);
  border: 1px solid var(--border-dark);
}

/* ---- POST NAVIGATION ---- */
.post-nav {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem;
}

.post-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-gray);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
  font-family: 'Inter', Arial, sans-serif;
}

.post-nav a:hover {
  color: var(--blue);
}

/* ---- FOOTER ---- */
footer {
  background: #1C1C1C;
  color: #999999;
  text-align: center;
  padding: 2.5rem 2rem;
  font-size: 0.84rem;
  border-top: 1px solid rgba(0,0,0,0.2);
  font-family: 'Inter', Arial, sans-serif;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: #808080;
  text-decoration: none;
  font-size: 0.84rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--white);
}

footer p a {
  color: var(--orange);
  text-decoration: none;
}

footer p a:hover {
  opacity: 0.8;
}

/* ---- FOCUS STYLES (Accessibility) ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  .hero { padding: 3.5rem 1.5rem 3rem; }
  .hero h1 { font-size: 1.9rem; }
  .papers-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.82rem; }
  .stats-bar-inner { gap: 1.5rem; }
  .newsletter-form { flex-direction: column; }
  .post-header h1 { font-size: 1.6rem; }
  .about-section { padding: 2.5rem 1.5rem; }
  .post-body { padding: 2rem 1.5rem 1.5rem; }
  .share-section { padding: 1.5rem 1.5rem 2rem; }
  .post-nav { padding: 1rem 1.5rem 3rem; }
  .container { padding: 2.5rem 1.5rem; }
  .breadcrumb { padding: 0.7rem 1.5rem; }
  .breadcrumb-current { max-width: 220px; }
}

@media (max-width: 400px) {
  .hero h1 { font-size: 1.6rem; }
  .stat-number { font-size: 1.2rem; }
}

/* =====================
   TTS Player
   ===================== */
.tts-player {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 2rem 0;
}

.tts-player-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 0.85rem 1.2rem;
  flex-wrap: wrap;
}

.tts-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tts-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.tts-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
}

.tts-duration {
  font-size: 0.78rem;
  color: var(--text-gray);
  background: var(--border);
  border-radius: 20px;
  padding: 0.15rem 0.55rem;
}

.tts-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.tts-btn {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.tts-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tts-btn.tts-play {
  background: var(--blue);
  color: #fff;
}

.tts-btn.tts-play:hover:not(:disabled) {
  background: var(--blue-dark);
}

.tts-btn.tts-stop {
  background: transparent;
  color: var(--text-gray);
  border: 1px solid var(--border-dark);
}

.tts-btn.tts-stop:hover:not(:disabled) {
  background: var(--bg-light);
  color: var(--text-dark);
}

@media (max-width: 600px) {
  .tts-player { padding: 1.5rem 1.5rem 0; }
  .tts-player-inner { flex-direction: column; align-items: flex-start; }
}
