/* article template styling  */
:root {
  --author-txt-color: #f3e1cf;
  --font-ml: 1.75rem;
}

#main-wrapper {
  padding-top: var(--padding-m);
}

/* QUICK FIXES*/

.article-wrapper {
  padding-bottom: 10rem;
}

.article-meta-row {
  display: flex;
  flex-direction: column;
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 300;
  font-size: var(--font-s);
  color: var(--text-color);
}

.breadcrumb:hover {
  opacity: 0.7;
}

body.light-mode .meta-category{
color: #244a50;
}

body.light-mode .meta-separator {
color: #244a50;
}

body.light-mode .meta-read-time {
color: #244a50;
}

body.light-mode .progress-bar-container::after {
  background-image: repeating-linear-gradient(
    to right,
    rgba(22, 48, 52, 0.312) 0,
    rgba(22, 48, 52, 0.312) 2px,
    transparent 2px,
    transparent 6px
  );
}

body.light-mode .audio-btn.is-playing {
    background-color: #B4F701;
}

body.light-mode .author-header {
  color: #244a50;
}

body.light-mode .author-name {
  color: #244a50;
}

body.light-mode .author-role {
  color: #244a50;
}

body.light-mode .references-content {
  background: rgba(48, 99, 106, 0.4);
  color: #ffffff;
}

.article-video {
  padding-top: var(--padding-xl);
}

.article-video video {
  width: 100%;
  border-radius: 1.5rem;
  display: block;
}

/******************************* ARTICLE TITLE ****************************/

.article-header {
  padding: var(--padding-l) 0;
}

.article-header h1 {
  font-size: var(--font-xl);
  font-weight: 700;
  line-height: 1.2;
}

.article-title {
  position: relative;
  display: inline-block;
  padding-bottom: var(--padding-xs);
}

.article-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;

  width: 2em;
  height: 0.088em;

  background-color: #cee6e9;
  border-radius: 999px;
}

/******************************* ARTICLE INFO ****************************/

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

.article-date {
  font-size: var(--font-sm);
  font-weight: 300;
  padding-top: var(--padding-m);
}

.article-meta {
  padding: var(--padding-s) 0;
}

.meta-category {
  font-size: 17px;
  color: var(--accent-color);
  font-weight: 700;
}

.meta-read-time {
  font-size: 17px;
  color: var(--accent-color);
  font-weight: 400;
}

.meta-separator {
  color: var(--accent-color);
  font-weight: 300;
}

/******************************* AUDIO STYLING ****************************/

.audio-element {
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(200, 210, 210, 0.4);
  backdrop-filter: blur(6px);
  border: none;
  cursor: pointer;

  transition:
    background 0.3s ease,
    transform 0.3s ease;
}

.audio-btn .bi {
  font-size: 1.5rem;
  color: #244a50;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.audio-player-box {
  flex: 1;
}

.progress-bar-container {
  position: relative;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(200, 210, 210, 0.18);
  cursor: pointer;
}

.progress-bar-filled {
  position: absolute;
  left: 0;
  top: 0;
  width: 0%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(90deg, #b4f701, #d4fe62);
  transition: width 0.1s linear;
  z-index: 1;
}

.progress-bar-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to right,
    #244a50d0 0,
    #244a50d0 2px,
    transparent 2px,
    transparent 6px
  );
  pointer-events: none;
  z-index: 2;
}

.progress-bar-container {
  isolation: isolate;
}

.audio-btn.is-playing {
  background: var(--accent-lime);
}

.audio-btn.is-playing .bi {
  color: #244a50;
}

/******************************* ARTICLE CONTENT ****************************/

.article-text {
  padding: var(--padding-l) 0;
  font-size: var(--font-sm);
  font-weight: 300;
  line-height: 1.5;
}

.article-authors {
  display: flex;
  flex-wrap: nowrap;
  gap: 2rem;
}

.author-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.author-img {
  width: 120px;
  border-radius: 12px;
  flex-shrink: 0;
}

.author-header {
  padding-top: var(--padding-xl);
  padding-bottom: var(--padding-m);
  color: var(--author-txt-color);
  font-weight: 700;
  font-size: var(--font-sm);
  opacity: 0.8;
}

.author-name {
  color: var(--author-txt-color);
  font-weight: 700;
  font-size: var(--font-ml);
  text-transform: uppercase;
  line-height: 1.2;
}

.author-role {
  color: var(--author-txt-color);
  font-weight: 300;
  font-size: var(--font-sm);
  padding-top: var(--padding-xs);
  line-height: 1.2;
}

/* References */

.divider-wrapper {
  display: flex;
  align-items: center;
  padding-top: var(--padding-xl);
}

.article-divider {
  flex-grow: 1;
  height: 1px;
  border: 0;
  background-color: var(--text-color);
  opacity: 0.3;
}

.divider-text {
  margin: 0 1.5rem;
  color: var(--text-color);
  font-size: var(--font-s);
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.5;
  white-space: nowrap;
}

.ref-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  margin-left: 1rem;

  transform-origin: center;

  transition:
    transform 0.35s ease,
    background-color 0.45s ease;
}

.ref-toggle-btn.active {
  transform: rotate(135deg);
  background-color: rgba(180, 247, 1, 0.8);
}

.ref-toggle-btn i {
  font-size: var(--font-m);
  transform: scale(0.8);
  line-height: 1;
}

.references-container {
  max-height: 0;

  overflow: hidden;
  opacity: 0;

  transition:
    max-height 0.4s ease-out,
    opacity 0.4s ease-out,
    margin-bottom 0.4s ease;
}

.references-container.open {
  opacity: 1;

  margin-top: 0.5rem;
  margin-bottom: 4rem;
}

.references-content {
  padding: var(--padding-s);
  border-radius: 12px;
  background: rgba(200, 210, 210, 0.1);
  border: 1px solid rgba(200, 210, 210, 0.2);
  color: var(--text-color);
  line-height: 1.5;
  font-weight: 300;
  white-space: pre-line;
  overflow-wrap: break-word;
}

.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(200, 210, 210, 0.4);
  backdrop-filter: blur(6px);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/******************************* MEDIA QUERIES ****************************/

/* tablet size */

@media (min-width: 768px) {
  .article-wrapper {
    max-width: 500px;
    margin: 0 auto;
  }

  .article-header h1 {
    font-size: 3.5rem;
  }

  .article-authors {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .author-card {
    flex: 0 0 calc((100% - 2rem) / 2);
  }
}

/* desktop size */

@media (min-width: 1024px) {
  .article-meta-row {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .article-meta {
    flex-shrink: 0;
    padding: 0;
  }

  .article-audio {
    flex: 1;
    min-width: 0;
  }

  .article-wrapper {
    max-width: 700px;
    margin: 0 auto;
  }

  .article-header h1 {
    font-size: 3.75rem;
  }
}

/* tv/mega-screen sizes */

@media (min-width: 1440px) {
  .article-wrapper {
    max-width: 850px;
    margin: 0 auto;
  }

  #article-section {
    max-width: 1440px;
    margin: 0 auto;
  }
}

@media (min-width: 1660px) {
  #article-section {
    max-width: 1440px;
    margin: 0 auto;
  }
}
