body {
  margin: 0;
  padding: 0;
  background-color: #f9f7f1;
}

/* -----------------------------
   Headings & Links
------------------------------ */

h2 a {
  color: inherit;
  text-decoration: none;
  text-align: center;
}

h2 a:hover {
  text-decoration: underline;
}

/* -----------------------------
   Layout
------------------------------ */

.container {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px;
}

.content {
  flex: 0.5;
}

/* -----------------------------
   Article Container
------------------------------ */

.article {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.65;
  flex: 1;
  max-width: 780px;
  margin: 0 auto;
  background: linear-gradient(#f5f0eb, #f3ebe2);
  padding-left: 150px;
  padding-right: 150px;
  border: 1px solid #ddd;
  border-radius: 5px;
  color: #2b2b2b;
  text-rendering: optimizeLegibility;
}

/* Main title */
.article h1 {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-align: center;
  margin-bottom: 12px;
  color: #1f1f1f;
}

/* Author / subtitle */
.article h4 {
  text-align: center;
  font-weight: 500;
  color: #444;
  margin-bottom: 25px;
}

.continue-link-wrapper {
  text-align: center;
  width: 100%;
  margin: 20px 0;
}

.continue-link {
  display: inline-block;
  font-size: 17px;
  font-weight: 500;
  color: #2f2f2f;
  text-decoration: none;
}

.continue-link:hover {
  text-decoration: underline;
}

/* -----------------------------
   Summary Section
------------------------------ */

.summary-box {
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  padding: 15px 0;
  margin-bottom: 30px;
}

.summary-title {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: #3a3a3a;
}

.summary-text {
  text-align: center;
  font-size: 18px;
  font-weight: 400;
  color: #555;
  max-width: 80%;
  margin: 0 auto 20px;
  line-height: 1.5;
  display: block;
}

/* -----------------------------
   Article Paragraphs
------------------------------ */

.article article:not(.summary-text) {
  font-size: 20px;
  line-height: 1.65;
  margin-bottom: 1.1em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 50;
  line-clamp: 50;
  overflow: hidden;
  hyphens: auto;
}

/* Subtle emphasis for first paragraph */
.article article:first-of-type:not(.summary-text) {
  font-size: 21px;
  line-height: 1.6;
}

/* -----------------------------
   Sidebar
------------------------------ */

.sidebar {
  flex-basis: 600px;
  background: linear-gradient(#f5f0eb, #f3ebe2);
  padding: 20px;
  margin-left: 75px;
  border: 1px solid #ddd;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 45px;
}

.sidebar img {
  max-width: 100%;
  max-height: 100%;
}

.small-box {
  width: 485px;
  height: 5em;
  background: transparent;
  color: #3a3a3a;
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  margin-bottom: 30px;
  text-align: center;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  box-sizing: border-box;
  padding: 10px 15px;
}

/* Sidebar headlines */
.sidebar .headline {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 600;
  color: #2f2f2f;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.sidebar .headline:hover {
  color: #000;
  text-decoration: underline;
}

/* -----------------------------
   Responsive Adjustments
------------------------------ */

@media (max-width: 1999px) {
  .content {
    flex: 0.2;
  }

  .sidebar {
    gap: 30px;
  }
}

@media (max-width: 1600px) {
  .container {
    flex-direction: column;
    align-items: stretch;
  }

  .sidebar {
    margin: 150px;
    margin-top: 75px;
  }

  .article {
    padding-left: 100px;
    padding-right: 100px;
    margin-left: 150px;
    margin-right: 150px;
  }
}

@media (max-width: 1000px) {
  .container {
    flex-direction: column;
    align-items: stretch;
  }

  .article {
    padding-left: 10px;
    padding-right: 10px;
    margin-left: 15px;
    margin-right: 15px;
  }

  .article h1 {
    font-size: 32px;
    line-height: 1.2;
  }

  .sidebar {
    padding-left: 10px;
    padding-right: 10px;
    margin-left: 15px;
    margin-right: 15px;
  }

  /* -----------------------------
     Mobile fixes for sidebar headlines
  ------------------------------ */
  .small-box {
    width: 100%; /* full width of sidebar */
    max-width: 485px; /* keep desktop max */
    height: 6em; /* uniform height */
    padding: 10px 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
  }

  .sidebar .headline {
    font-size: 15px; /* slightly smaller for long text */
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3; /* limit to 3 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto; /* optional soft hyphenation */
    text-align: center; /* keep text centered */
  }
}
