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

body {
  margin: 0;
  font-family: sans-serif;
  background-color: #f8f9fb;
  color: #111;
}

.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 0;
    font-family: sans-serif;
}

.article-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 16px;
    border-bottom: 1px solid rgba(0,0,0,.2);
}

#article-title {
    text-align: left;
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 32px;
}

.article-summary {
    text-align: left;
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.5;
    font-size: 18px;
    color: #444;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    width: 100%;
    max-width: 100%;
}

.article-date {
    color: rgba(0,0,0,.6);
    margin: 2px 0 0;
    padding: 0;
}

.dot {
    margin: 0 6px;
}

@media(max-width:600px) {
    .published-text {
        display: none;
    }
    #article-title {
        font-size: 28px;
    }
}

@media(max-width:465px) {
    #article-title {
        font-size: 25px;
    }
}

@media(max-width:400px) {
    .meta-topic {
        display: none;
    }
    #article-title {
        font-size: 22px;
    }
}

.article-content{
    display: block;
    
    padding-top: 18px;
    color: #2a2a2a;
}

.article-image-wrapper {
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   margin: 0;
}

.article-image-inner {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
}

.article-image-inner img {
  display: block;
  height: auto;
  max-height: 600px;
  width: 100%;
  max-width: 600px;
}

.caption {
    margin: 8px 0px 0;
    color: #444;
    font-style: italic;
    font-size: 14px;
}

@media (max-width: 616px) {
    .caption {
        margin: 6px 16px 0;
    }
}

@media (max-width: 500px) {
    .caption {
        font-size: 12px;
    }
}

.article-content::after,
.article-body::after {
  content: "";
  display: table;
  clear: both;
}

.article-body {
    text-align: justify;
    padding: 0 16px;
}

.article-body p:last-of-type {
  margin-bottom: 0;
}

.article-container p {
    line-height: 1.7;
    font-size: 1.1rem;
    
}

@media (max-width: 500px) {
    .article-container p {
        line-height: 1.5;
    }
}


.article-pg-btm {
    padding: 0 16px;
}

/*Modern Rating*/
.article-cta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    max-width:100%;
    width:100%;
}

.article-cta, .related-articles {
  border-top: 1px solid rgba(0, 0, 0, 0.2); /* subtle line */
}

.reaction-bubble-container {
    max-width:100%;
  width: 100%;
}

.reaction-bubbles {
  /*display: grid;*/
  /*grid-template-columns: repeat(auto-fit, minmax(60px, 60px));*/
  display: flex;
  gap: 20px;
  justify-content: center;
  max-width: 100%;
  padding: 0 10px;
  overflow: visible;
}

.reaction-btn {
  font-size: 1.8rem;
  border: 2px solid #ccc;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  padding: 12px;
  width: 60px;
  height: 60px;
  line-height: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 0 0 transparent;
}

@media (max-width: 530px) {
  .reaction-bubbles {
    /*grid-template-columns: repeat(3, 60px);*/
    /*gap: 20px;*/
    gap: 15px;
  }

  .reaction-btn {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
    padding: 8px;
  }
}

@media (max-width: 430px) {
  .reaction-bubbles {
    gap: 10px;
  }

  .reaction-btn {
    padding: 6px;
  }
}

@media (max-width: 385px) {
  .reaction-bubbles {
    gap: 5px;
    flex-wrap: wrap;
    padding: 0;
  }

  .reaction-btn {
    padding: 6px;
  }
}

.reaction-btn:hover {
  transform: scale(1.1);
  border-color: #666;
}

.reaction-count {
  font-size: 16px;
  font-weight: 600;
  margin-top: 8px;
  color: #666;
}

@media (max-width: 500px) {
  .reaction-count {
    gap: 6px;
  }
}

@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.reaction-btn.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
  animation: pop 0.3s ease;
}

#reaction-mindblown.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
  animation: pop 0.3s ease;
}


@keyframes shake {
  0% { transform: translateX(0); }
  15% { transform: translateX(-4px); }
  30% { transform: translateX(4px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

#reaction-angry.active {
  transform-origin: center;
  animation: shake 0.4s ease;
}

#join-header {
    margin-top: 40px;
    padding: 0 8px;
}

@media (max-width: 500px) {
    #join-header {
        margin-top: 30px;
        padding: 0;
    }   
}

#joinBtn{
    display: block;
    padding: 8px 30px;
    font-size: 18px;
    font-weight: bold;
    background-color: rgb(9, 10, 66);
    color: white;
    cursor: pointer;
    border-radius: 20px;
    border: 2px solid rgb(215, 180, 20);
    transition: all 0.3s ease;
}

#joinBtn:hover{
    background-color: #005bb5;
    color: #f2f2f2;
    transform: scale(1.05);
}


/*Suggested Articles*/
.related-articles {
    margin-top: 30px;
}

.suggested-article-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-title {
    font-size: 23px;
    margin: 19px 10px 12px;
    color: #64748b;
}

.topic-link {
  font-weight: 600;
  text-decoration: underline;
  color: inherit;
}

.topic-link:hover {
  color: var(--accent-color, #0073e6);
  text-decoration: underline;
}

.suggested-article-card {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.07);
  transition: text-decoration 0.2s ease;
  height: 160px;
}

@media (max-width: 699px) {
    .suggested-article-card {
       min-height: 120px;
    }
}

.suggested-article-card:hover .suggested-article-title{
  text-decoration: underline;
}

.suggested-article-image {
  width: 160px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
  flex-grow: 0;
}

.card-body {
    margin-right: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    gap:10px;
}

.suggested-article-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;  
  font-size: 20px;
  margin: 0;
  font-weight: bold;
  text-align: left;
  color: #2a2a2a;
}

.suggested-article-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
  color: #444;
  margin: 0;
  line-height: 1.4;
  text-align: left;
}

.card-body .meta {
    color: rgba(0,0,0,.6);
    margin: 2px 0 0;
    padding: 0;
    text-transform: uppercase;
    font-size: 14px;
}

@media (max-width: 600px) {
  .suggested-article-card {
    height: 150px;
    max-height: 150px;
  }
  .suggested-article-title {
    -webkit-line-clamp: 4;
  }
  .suggested-article-summary {
    display: none;
  }
}

@media (max-width: 550px) {
  .suggested-article-title {
    font-size: 18px;
  }
}

@media (max-width: 500px) {
  .section-title {
    font-size: 20px;
  }
  
  .suggested-article-card {
    height: 130px;
    max-height: 130px;
  }

  .suggested-article-image {
    width: 115px;
  }

  .suggested-article-title {
    font-size: 16px;
  }
}

@media (max-width: 400px) {
  .suggested-article-title {
    font-size: 15px;
  }
  .suggested-article-title {
    -webkit-line-clamp: 5;
  }
  .dot {
    margin: 0 3px;
  }
  .card-body .meta {
    font-size: 12px;
  }
}

.return-home-cta {
    text-align: center;
    margin: 30px 0;
}

.return-home-link {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 600;
    /*background-color: #fefefe;*/
    color: #1a202c;
    text-decoration: none;
    padding: 10px 30px;
    border: 2px solid #1a202c;
    border-radius: 10px;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.return-home-link:hover {
    background-color: #1a202c;
    color: #ffffff;
    border-color: #1a202c;
}