/* ============================================================
   The Same Old Argument — style.css
   Editorial / deadpan presentation. Typographic-focused, muted,
   clean.  Looks like a serious tech-publication essay.
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: #fafaf8;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ----- Sticky Era Bar -------------------------------------- */
.era-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 48px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid #e8e8e8;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ----- Era Pills ------------------------------------------- */
.era-pills-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Fade hint on the right edge to indicate more content */
.era-pills-wrapper::after {
  content: "\203A";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  z-index: 2;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 18px;
  font-weight: 700;
  color: #999;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.95) 50%);
  transition: opacity 0.3s ease;
}

.era-pills-wrapper.scrolled-end::after {
  opacity: 0;
}

.era-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  overflow-x: auto;
  white-space: nowrap;

  /* Hide scrollbar across browsers */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.era-pills::-webkit-scrollbar {
  display: none;
}

.era-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.era-pill:hover {
  background: #f0f0f0;
}

.era-pill.active {
  background: #1a1a1a;
  color: #fff;
}

.era-pill.active:hover {
  background: #1a1a1a;
}

/* ----- Essay Layout ---------------------------------------- */
main {
  max-width: 680px;
  margin: 0 auto;
  padding: 80px 20px 40px;
}

/* ----- Essay Typography ------------------------------------ */
h1.essay-title {
  font-family: "Lora", Georgia, "Times New Roman", serif;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 32px;
  color: #1a1a1a;
  text-transform: capitalize;
}

.byline {
  font-style: italic;
  font-size: 0.95rem;
  color: #888;
  margin-bottom: 40px;
}

.essay-body p {
  font-family: "Lora", Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  line-height: 1.75;
  margin-bottom: 1.5em;
  color: #2a2a2a;
}

/* ----- Swappable Tokens ------------------------------------ */
.token {
  border-bottom: 2px solid #b8a9c9;
  background-color: rgba(184, 169, 201, 0.1);
  padding: 0 2px;
  border-radius: 2px;
  transition: background-color 0.4s ease, opacity 0.15s ease;
  cursor: default;
}

/* Animation: highlight pulse before swap */
.token.highlighting {
  background-color: #fff3cd;
}

/* Animation: text fades out during swap */
.token.swapping {
  opacity: 0;
}

/* ----- Historical Context Section -------------------------- */
.historical-context {
  display: none;
  margin-top: 40px;
  border-top: 1px solid #e0e0e0;
  padding-top: 30px;
}

.historical-context h2 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 16px;
}

.context-content blockquote {
  border-left: 3px solid #ddd;
  padding-left: 16px;
  font-family: "Lora", Georgia, "Times New Roman", serif;
  font-style: italic;
  color: #555;
  margin-bottom: 16px;
  line-height: 1.65;
}

.fun-fact {
  background: #f8f8f5;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.55;
}

/* ----- The Point Section ----------------------------------- */
.the-point {
  margin-top: 48px;
  background: #f5f5f0;
  padding: 40px 24px;
  border-radius: 8px;
}

.the-point blockquote {
  font-family: "Lora", Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  line-height: 1.6;
  color: #333;
  text-align: center;
  font-style: italic;
  border-left: none;
  padding: 0;
  margin: 0;
}

/* ----- Share Section --------------------------------------- */
.share-section {
  margin-top: 32px;
  text-align: center;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.share-buttons button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.share-buttons button:hover {
  opacity: 0.88;
  filter: brightness(1.08);
}

.share-buttons button:active {
  opacity: 0.76;
}

#share-copy {
  background: #1a1a1a;
  color: #fff;
}

#share-x {
  background: #000;
  color: #fff;
}

#share-linkedin {
  background: #0077b5;
  color: #fff;
}

.copied-tooltip {
  position: relative;
  display: inline-block;
  font-size: 0.8rem;
  color: #888;
  opacity: 0;
  transition: opacity 0.25s ease;
  margin-left: 4px;
}

.copied-tooltip.show {
  opacity: 1;
}

/* ----- Footer ---------------------------------------------- */
footer {
  margin-top: 60px;
  padding: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: #aaa;
}

footer a {
  color: #aaa;
  text-decoration: underline;
  text-underline-offset: 2px;
}

footer a:hover {
  color: #888;
}

/* ----- Mobile Responsive ----------------------------------- */
@media (max-width: 640px) {
  main {
    padding: 72px 16px 24px;
  }

  h1.essay-title {
    font-size: 1.8rem;
  }

  .essay-body p {
    font-size: 1.1rem;
  }

  .era-pill {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    font-size: 14px;
  }

  .the-point {
    padding: 32px 20px;
  }

  .the-point blockquote {
    font-size: 1.1rem;
  }

  .share-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .share-buttons button {
    width: 100%;
  }
}

/* ----- Print ----------------------------------------------- */
@media print {
  .era-bar,
  .share-section {
    display: none !important;
  }

  main {
    padding-top: 0;
    max-width: 100%;
  }

  .token {
    border-bottom: none;
  }

  .the-point {
    background: none;
    border: 1px solid #ccc;
  }
}
