*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: sans-serif;
  background-color: #f8f9fb;;
  color: #111;
}

.external-source-credit {
    font-size: 0.95rem;
    color: #4b5563; /* Gray-700 vibe */
    margin-bottom: 1rem;
}

.external-source-link {
    display: inline-block;
    margin-left: 0.25rem;
    padding: 0.2rem 0.5rem;
    background-color: #f9fafb; /* very soft neutral background */
    color: #374151; /* cool dark gray text */
    border: 1px solid #64748b; /* light gray border */
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.external-source-link:hover {
    background-color: #e5e7eb; /* slightly darker gray hover */
    color: #111827; /* slightly darker text on hover */
    border-color: #d7b414;
}

.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    font-family: sans-serif;
}

#article-title {
    text-align: left;
    margin-top: 0;
    margin-bottom: 6px;
    padding: 0 10px;
}

.article-summary {
    margin: 16px 0 0px;
    padding: 0 10px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px 8px;
}

.article-date {
    color: rgba(0,0,0,.6);
    margin: 2px 0 0;
    padding: 0;
}

@media(max-width:600px) {
    .published-text {
        display: none;
    }
}

@media(max-width:465px) {
    .meta-topic {
        display: none;
    }
}

.article-content{
    display: block;
    overflow: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,.2);
}

.article-content::after,
.article-body::after {
  content: "";
  display: table;
  clear: both;
}

.article-image-wrapper {
   margin: 0 40px 10px 0;
}

.article-image-inner {
  display: inline-block;
  border-radius: 10px;
  overflow: hidden;
}

.article-image-inner img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 320px;
}

.image-caption {
  font-size: 15px;
  color: #444;
  margin-top: 4px;
  padding: 0 6px;
  text-align: left;
  font-style: italic;
}

@media (min-width: 700px) {
    .article-image-wrapper {
       display: inline-block;
       max-width:65%;
       float: left;
    }
}

@media (max-width: 699px) {
    .article-image-wrapper {
       text-align: center;
       margin: 0 0 10px 0;
       float: none;
    }
}

.article-body {
    text-align: justify;
    padding: 0 4px 4px;
}

.article-body p:first-of-type {
  margin-top: 0;
}

.article-container p {
    /*margin-bottom: 20px;*/
    line-height: 1.7;
    font-size: 16px;
}

.external-article-footer {
    margin-top: 12px;
    text-align: center;
    padding-bottom: 20px;
}

.external-original-link {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    color: #334155; /* cool slate gray */
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border: 1px solid #64748b; /* muted darker blue-gray */
    background-color: #f9fafb; /* soft neutral background */
    border-radius: 8px;
    transition: all 0.3s ease;
}

.external-original-link:hover {
    background-color: #334155;
    color: #ffffff;
    border-color: #64748b;
}

/*Modern Rating and Subscribe*/

.article-cta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.article-cta, .related-articles {
  border-top: 1px solid rgba(0, 0, 0, 0.2); /* subtle line */
  /*padding-top: 10px;*/
  /*margin-top: 10px;*/
}

.reaction-bubbles {
  display: flex;
  gap: 15px;
}

.reaction-btn {
  font-size: 1.8rem;
  border: 2px solid #ccc;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  padding: 0.75rem;
  width: 60px;
  height: 60px;
  line-height: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 0 0 transparent;
}

.reaction-btn:hover {
  transform: scale(1.1);
  border-color: #666;
}

@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

#reaction-up.active,
#reaction-heart.active,
#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-down.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
  transform-origin: center;
  animation: shake 0.4s ease;
}

#joinBtn{
    display: block;
    margin-bottom: 20px;
    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;
}