* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: #ffffff;
  overflow-x: hidden;
  position: relative;
  height: 100%;
  width: 100%;
}

#carousel-wrapper {
  position: absolute;
  width: 100vw;
}

#carousel {
  display: flex;
  align-items: stretch;
  gap: 24px; /* Must match the gap value in scrollByCard() in main.js */
  padding: 24px;
  overflow-x: auto;
  overflow-y: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  min-height: 100dvh;
}

#carousel::-webkit-scrollbar {
  display: none;
}

.card {
  flex: 0 0 90vw;              
  min-height: 95dvh;
  height: auto;
  scroll-snap-align: center;
  background-color: #ffffff;
  border-radius: clamp(0.9rem, 0.9vw, 10rem);

  display: flex;
  flex-direction: column;

  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.nav-btn {
  position: fixed;
  top: 50%;
  z-index: 10;
  transform: translateY(-50%);
  background: #003f87;
  border: clamp(.1rem, .2vw, 1rem) solid #6c7987;
  color: white;
  font-size: clamp(1rem, 1.4vw, 6rem);
  width: clamp(4rem, 5vw, 60rem);
  height: clamp(4rem, 5vw, 60rem);
  border-radius: clamp(1rem, 1.3vw, 6rem);
  cursor: pointer;
  font-family: pt-serif-bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn.left {
  left: clamp(.2rem, .5vw, 2rem);
  text-align: right;
  padding: clamp(2rem, 2.5vw, 5rem);
}

.nav-btn.right {
  right: clamp(.2rem, .5vw, 2rem);
  text-align: left;
  padding: clamp(2rem, 2.5vw, 5rem);
}

.WelcomeBar{
    background-color: #003f87;
    border-radius: clamp(0.9rem, 0.9vw, 10rem);
    display: flex;                
    align-items: center;          
    position: relative;               
    padding: clamp(0.5rem, 1vw, 4rem);
    justify-content: space-between;
    min-height: 200px;
}

.WelcomeBar img {
    width: clamp(10rem, 10vw, 75rem);
    height: auto;
}

.WelcomeBar h1{
    position: absolute;          
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-family: Montserrat;
    font-size: clamp(0.7rem, 1.7vw, 7rem);
    text-align: center;
}

.highlight {
  font-size: clamp(0.1rem, 3vw, 12rem);
  font-weight: bold;
}

.donate{
  width: clamp(6rem, 10vw, 40rem);
  display: flex;
  justify-content: center;
  margin-right: clamp(0rem, 1vw, 3rem);
  flex-direction: column;
}

.donate-button {
  display: block;
  width: 100%;
  background-color: #bad80a;
  color: #003f87;
  border: 0.5px solid transparent;
  border-radius: clamp(.4rem, 1vw, 4rem);
  font-family: pt-serif-bold;
  font-size: clamp(0.4rem, 1vw, 4rem);
  cursor: pointer;
  transition: background-color 0.75s ease, transform 0.3s ease;
  margin-bottom: 10px;
}

.donate-button:hover {
  background-color: White;
  border-color:#003f87;
  color: #003f87;
  transform: translateY(-3px);
}

.comment-scroll{
  color: #003f87;
  background-color: White;
  border: 2px solid transparent;
  border-radius: clamp(.4rem, 1vw, 4rem);
  font-family: pt-serif-bold;
  font-size: clamp(0.5rem, 1vw, 4rem);
  transition: background-color 0.75s ease, transform 0.3s ease;
  cursor: pointer;
  padding-top: 0px;
  padding-bottom: 0px;
  margin-top: clamp(.01rem, .2vw, 1rem);
}

.comment-scroll:hover {
  background-color: #f0fae7;
  color: #003f87;
  transform: translateY(-3px);
}

.donate-button:active {
  transform: translateY(0);
}

.introduction{
  margin-bottom: -1vw;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.introduction h1{
  color: #003f87;
  font-family: Montserrat;
  font-size: clamp(1rem, 3vw, 11rem);
}

.introduction h2{
  color: black;
  font-family: Fira_sans;
  font-size: clamp(1rem, 2.3vw, 10rem);
  border-top: clamp(.07rem, .2vw, .7rem) solid black;
  border-bottom: clamp(.07rem, .2vw, .7rem) solid black;
  width: 70%;
}

.content {
  display: flex;
  flex-direction: row;
  margin:0 auto 24px auto;
}

/* When no PDF exists we center the text/image block instead of splitting 50/50 */
.content:has(.pdf.missing) {
  display:block;
  justify-content: center;
}

.content:has(.pdf.missing) .textAndImage {
  max-width: 800px;
  margin: 0 auto;
  align-items: center;
}

.textAndImage{
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: auto auto auto auto;
}

.MainImage {
  width: 70%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
  margin: 0px auto 24px auto;
}

.timelineText {
  display: flex;
  flex-direction: column;
  border: 2px solid #003f87;
  box-shadow: 0px 3px 6px rgba(0,0,0,0.4);
  padding: 5px;
  width: 90%;
  margin: auto;
}

.timelineText p {
  font-family: pt-serif;
  font-size: clamp(0.7rem, 1.3vw, 4.5rem);
  text-align: center;
}

.sources{
  font-family: pt-serif;
  font-size: clamp(0.5rem, 0.6vw, 3rem);
  text-align: center;
  width: 90%;
  margin: 10px auto auto auto;
}

.pdf {
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  position: relative;
}

/* Pseudo-element overlay shown behind the PDF embed while it loads */
.pdf:not(.missing)::after {
  content: "Loading Newspaper...";
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: Montserrat;
  font-size: clamp(1rem, 2vw, 3rem);
  font-weight: bold;
  color: #003f87;
  text-align: center;
  z-index: 0;
  pointer-events: none;
  animation: pulseOpacity 1.5s infinite ease-in-out;
}

.newspaper{
  font-family: Montserrat;
  font-size: clamp(0.9rem, 2vw, 8rem);
  font-weight: 1000;
  color: #bad80a;
  text-align:center;
  margin-bottom: 0px;
}

.newspaperPdf {
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
  height: 100vh;
  width: 35vw;
  position: relative;
  z-index: 1;
  background-color: #ffffff;
}

.comment-panel {
  margin: 0.5vw 50px 1vw 50px;
  padding: clamp(.5rem, 0.8vw, 3rem);
  border-radius: 12px;
  border: 1px solid #ddd;
  background: white;
}

.comment-panel textarea {
  width: 100%;
  height: clamp(5rem, 7vw, 50rem);
  resize: none;
  border-radius: 8px;
  border: 1px solid #ccc;
  padding: 0.5rem;
  margin-bottom: clamp(.4rem, .5vw, 2rem);
  font-size: clamp(.6rem, 1vw, 4rem);
  font-family: pt-serif;
}

.submit-comment {
  padding: clamp(.2rem, 0.5vw, 2rem) 0.75vw;
  border-radius: clamp(.2rem, .3vw, 2rem);
  border: none;
  background: #007bff;
  color: white;
  cursor: pointer;
  font-size: clamp(0.6rem, 1vw, 4rem);
}

.submit-comment:hover {
  background: #0056b3;
}

.char-count {
  text-align: right;
  font-size: clamp(.5rem, 1vw, 4rem);
  color: #666;
  margin-bottom: 0.3vw;
}

.comment-status {
  font-family: pt-serif;
  font-size: 1.5rem;
  font-weight: bold;
  color: #003f87;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.comment-status.show {
  opacity: 1;
}

.comment-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comment-display {
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  margin: 0px 50px;
  font-family: pt-serif;
  font-size: clamp(0.5rem, 0.8vw, 4rem);
}

.comment {
  padding: 8px;
  margin-bottom: 8px;
  border: 3px solid #003f87;
  border-radius: 5px;
  background-color: #ffffff;
}

.comment-text {
  margin: 0;
}

.comment-meta {
  font-size: 0.8em;
  color: #0056b3;
}

.footer {
  margin-top: auto;
  padding: 0.5rem 1rem;
  text-align: center;
  font-family: pt-serif;
  font-size: clamp(0.5rem, 0.8vw, 4rem);
  color: #ffffff;
  background-color: #003f87;
  border-radius: 0 0 clamp(0.9rem, 0.9vw, 10rem) clamp(0.9rem, 0.9vw, 10rem);
}

@font-face {
  font-family: Fira_sans;
  src: url('../fonts/Fira_sans/FiraSans-Regular.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: Montserrat;
  src: url('../fonts/Montserrat/Montserrat-Black.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: pt-serif;
  src: url('../fonts/pt-serif/PTF55F.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: pt-serif-bold;
  src: url('../fonts/pt-serif/PTF75F.ttf') format('truetype');
  font-display: swap;
}

@keyframes pulseOpacity {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* Media queries for different screens */
@media (max-width: 768px){
  .WelcomeBar{
    gap: 1rem;
    min-height: 90px;
  }
  .WelcomeBar h1{
    position: static;    
    transform: none;
  }
  .WelcomeBar img {
    width: clamp(5rem, 10vw, 75rem);
    height: auto;
  }
  .content{
    flex-direction: column;
    margin: 1vw -5vw 0 -5vw;
  }
  .textAndImage{
    width: 80%;
    align-items: center;
    margin: auto;
  }
  .MainImage{
    max-height: 90vh;
  }
  .timelineText{
    width: 80%;
    margin: auto auto;
  }
  .pdf{
    width: 100%;
    height: 100%;
    margin: auto auto;
  }
  .newspaper{
    margin-top: 25px;
  }
  .newspaperPdf{
    width: 80vw;
    height: 55vh;
    margin-bottom: 25px;
  }
  .donate{
    width:20%;
  }
  .donate-button{
    font-size:clamp(.4rem, 1vw, 1rem);
    width:clamp(4rem, 11vw, 30rem);
  }
  .comment-dropdown{
    width:50%;
    align-items: center;
    margin: auto auto auto auto;
  }
}