/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  background: #efe6d5;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.15) 1px, transparent 0),
    radial-gradient(circle at 2px 2px, rgba(0, 0, 0, 0.1) 1px, transparent 0),
    linear-gradient(45deg, transparent 25%, rgba(0, 0, 0, 0.02) 25%, rgba(0, 0, 0, 0.02) 50%, transparent 50%, transparent 75%, rgba(0, 0, 0, 0.02) 75%);
  background-size: 20px 20px, 40px 40px, 15px 15px;
  background-position: 0 0, 0 0, 0 0;
  min-height: 100vh;
  line-height: 1.65;
  color: #1a1a1a;
  opacity: 0;
  animation: fadeIn 0.8s ease-in-out forwards;
  overflow-x: hidden;
}

.site-header,
.site-footer,
.news-container {
  background: #fffaf0;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Header Styles */
.site-header {
  padding: 2rem;
  margin-top: 24px;
  font-family: 'Inter', sans-serif;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid #68470047;
  border-bottom: none;
}

/* Footer Styles */
.site-footer {
  padding: 2rem;
  margin-bottom: 24px;
  font-family: 'Inter', sans-serif;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid #68470047;

}

.footer-content {
  max-width: 100%;
  text-align: left;
}

.site-footer h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 1.5rem 0;
  color: #111111;
}

.contact-info {
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.contact-info p {
  margin: 0.5rem 0;
  color: #222222;
}

.contact-info strong {
  color: #111111;
  font-weight: 700;
  font-size: 0.9rem;
}

.publication-info {
  color: #000000;
  font-size: 0.85rem;
  margin-top: 1rem !important;
  font-weight: 500;
}

.site-footer a {
  color: #111111;
  text-decoration: none;
  transition: background-color 0.3s ease;
  border: 1px solid transparent;
  padding: 0.2rem 0.4rem;
}

.site-footer a:hover {
  background: #fff1c1;
  border: 1px solid #111111;
}

.social-links {
  display: flex;
  gap: 0.5rem;
  justify-content: start;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #111111;
  background: transparent;
  color: #111111;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.2rem 0.4rem;
  transition: background-color 0.3s ease;
}

.social-link:hover {
  background: #fff1c1;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-text {
  font-size: 0.8rem;
}

/* Remove the newspaper divider */
.site-footer::before {
  display: none;
}

/* Responsive Footer */
@media (max-width: 768px) {
  .site-footer {
    padding: 1.5rem 1rem;
  }

  .site-footer h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }

  .contact-info p {
    font-size: 0.9rem;
  }

  .social-links {
    gap: 0.4rem;
  }

  .social-link {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* Header Styles */

.masthead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0rem;
  flex-direction: column;
}

.masthead-logo {
  height: 72px;
  width: auto;
  position: relative;
  margin-bottom: -32px;
}

.masthead-text h1 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3rem;
  text-align: center;
}

.masthead-text p {
  margin: 0;
  font-size: 0.9rem;
}


/* Form Elements */
select,
input {
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  border: 1px solid #111111;
  background: #f7f0e1;
  transition: background 0.2s ease;
  font-family: inherit;
  height: 40px;
  box-sizing: border-box;
}

select:focus,
input:focus {
  outline: none;
  background: #fffaf0;
}

/* Active Source Indicator */
.active-source {
  text-align: center;
  font-size: 14px;
  margin: 0;
  color: #000000;
}

/* Top News Slider */
.top-news-slider {
  grid-column: span 12;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1px;
  align-items: start;
}

/* Force explicit placement to avoid unintended full-width behavior */
.top-news-slider>.slider-container {
  grid-column: 1 / 2;
}

/* .top-news-slider>.cartoon-container {
  grid-column: 2 / 3;
} */

.slider-container {
  position: relative;
  border: none;
  overflow: hidden;
  box-shadow: none;
  width: 100%;
}

/* Cartoon Container */
.cartoon-container {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: none;
}

.cartoon-container h2 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #111111;
  margin: 0 0 1rem 0;
  text-align: center;
  border-bottom: 2px solid #111111;
  padding-bottom: 0.5rem;
  width: 100%;
}

.cartoon-item {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.cartoon-item img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #111111;
  filter: grayscale(100%) contrast(110%);
  transition: filter 0.3s ease;
}

.cartoon-item img:hover {
  filter: grayscale(80%) contrast(120%);
}

.cartoon-watermark {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.cartoon-watermark:hover {
  opacity: 0.9;
}

.cartoon-watermark img {
  width: 60px;
  height: auto;
  border: none;
  filter: none;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}


.slider-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  width: 100%;
  align-items: center;
}

.slider-slide {
  min-width: 100%;
  display: flex;
  align-items: flex-start;
  position: relative;
  flex-direction: row-reverse;
  padding: 20px;
}

.slider-slide img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-left: 2rem;
  filter: grayscale(100%) contrast(110%);
  flex-shrink: 0;
}

.slider-content {
  flex: 1;
}

.slider-content h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 1rem 0;
  color: #111111;
  line-height: 1.2;
}

.slider-content p {
  font-size: 1.1rem;
  color: #333333;
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

.slider-content .slider-meta {
  font-size: 0.9rem;
  color: #666666;
  margin: 0 0 1rem 0;
}

.slider-content .slider-read-more {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: #111111;
  color: #fffaf0;
  text-decoration: none;
  font-weight: 700;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.slider-content .slider-read-more:hover {
  background: #333333;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(17, 17, 17, 0.5);
  color: #fffaf0;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.slider-btn:hover {
  background: rgba(17, 17, 17, 1);
  transform: translateY(-50%) scale(1.1);
}

.slider-prev {
  left: 20px;
}

.slider-next {
  right: 20px;
}

.slider-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(17, 17, 17, 0.3);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.slider-dot.active {
  background: #111111;
  transform: scale(1.2);
}

.slider-dot:hover {
  background: rgba(17, 17, 17, 0.6);
}

/* News Container */
.news-container {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1px;
  padding: 0 0 24px;
  margin: 0 auto;
  max-width: 1200px;
  border: 1px solid #68470047;
  border-bottom: none;
  background: #fffaf0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.08) 1px, transparent 0),
    linear-gradient(90deg, transparent 98%, rgba(0, 0, 0, 0.05) 100%);
  background-size: 25px 25px, 100% 1px;
  background-position: 0 0, 0 0;
}

/* Card Styles */
.card {
  background: #fffaf0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.06) 1px, transparent 0),
    linear-gradient(90deg, transparent 99%, rgba(0, 0, 0, 0.03) 100%);
  background-size: 30px 30px, 100% 1px;
  background-position: 0 0, 0 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: none;
  position: relative;
  grid-column: span 4;
  border: 0px solid #111111;
}

/* Mobile-first: Single column on small screens */
@media (max-width: 1024px) {
  .top-news-slider {
    grid-template-columns: 1fr;
  }

  .top-news-slider>.cartoon-container {
    border-left: 1px solid #68470047;
  }

  .news-container {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .card {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
    width: 100%;
  }
}

/* Force single column on all mobile devices */
@media (max-width: 768px) {
  .news-container {
    grid-template-columns: 1fr !important;
    display: block !important;
  }

  .card {
    /* display: block !important; */
    width: 100% !important;
    margin-bottom: 1rem;
  }
}

.card::before {
  display: none;
}

.card:hover {
  background: #fffef52d;
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  margin-bottom: 0.75rem;
  filter: grayscale(100%) contrast(110%);
}

.card:hover img {
  filter: grayscale(90%) contrast(120%);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #111111;
  line-height: 1.3;
  font-family: 'Playfair Display', Georgia, serif;
}

.card p {
  font-size: 0.95rem;
  color: #222222;
  margin-bottom: 0.75rem;
}

.card>a {
  margin-top: auto;
  color: #111111;
  font-weight: 700;
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  background: transparent;
  text-align: left;
  border: 1px solid #111111;
}

.card>a::before {
  content: none;
}

.card a:hover {
  background: #fff1c1;
}

.card small {
  font-size: 0.85rem;
  color: #000000;
  margin-bottom: 1rem;
  font-weight: 500;
}

/* Load More Button */
.load-more {
  text-align: center;
  margin: 2rem 1rem;
}

.load-more button {
  padding: 0.6rem 1.5rem;
  font-size: 1rem;
  border: 1px solid #111111;
  background: transparent;
  color: #111111;
  cursor: pointer;
  font-weight: 700;
}

.load-more button::before {
  content: none;
}

.load-more button:hover {
  background: #fff1c1;
}

.load-more button:active {
  transform: translateY(-1px);
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, .3);
  border-radius: 0;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Empty State Styling */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #000000;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.empty-state p {
  font-size: 1rem;
  opacity: 0.7;
  max-width: 400px;
  margin: 0 auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: #000000;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #333333;
}

/* Responsive Design */
@media (max-width: 768px) {
  header {
    font-size: 2rem;
    padding: 1.5rem 1rem;
  }


  .top-news-slider {
    margin: 0;
    padding: 0;
    grid-template-columns: 1fr;
    gap: 1px;
  }

  .cartoon-container {
    border-left: 1px solid #68470047;
    border-top: none;
  }

  .slider-slide {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
    height: auto;
    min-height: 300px;
  }

  .slider-slide img {
    width: 150px;
    height: 150px;
    margin: 0 0 1rem 0;
  }

  .slider-content h2 {
    font-size: 1.5rem;
  }

  .slider-content p {
    font-size: 1rem;
  }

  .slider-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .slider-prev {
    left: 10px;
  }

  .slider-next {
    right: 10px;
  }

  .news-container {
    grid-template-columns: 1fr;
    /* padding: 1rem; */
    gap: 1.5rem;
    /* border: none; */
    margin: 0;
  }

  .card {
    padding: 1.25rem;
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }

  .card img {
    height: 200px;
  }

  .card h3 {
    font-size: 1.1rem;
    line-height: 1.3;
  }

  .card p {
    font-size: 0.9rem;
  }

  .active-source {
    margin: 1rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  header {
    font-size: 1.5rem;
    padding: 1rem 0.5rem;
  }

  .masthead {
    flex-direction: column;
    text-align: center;
  }

  .masthead-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 0.5rem;
  }

  .masthead-text h1 {
    font-size: 1.5rem;
    margin: 0.25rem 0;
  }

  .masthead-text p {
    font-size: 0.8rem;
    margin: 0.25rem 0;
  }


  select,
  input {
    width: 100%;
    max-width: 100%;
    font-size: 0.9rem;
    padding: 0.5rem;
  }

  .news-container {
    /* padding: 0.5rem; */
    gap: 1rem;
  }

  .card {
    padding: 1rem;
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }

  .card img {
    height: 150px;
  }

  .card h3 {
    font-size: 1rem;
    line-height: 1.2;
  }

  .card p {
    font-size: 0.85rem;
  }

  .card small {
    font-size: 0.75rem;
  }

  .card>a {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }

  .slider-slide {
    padding: 1rem;
    min-height: 250px;
    align-items: center;
  }

  .slider-slide img {
    width: 120px;
    height: 120px;
  }

  .slider-content h2 {
    font-size: 1.2rem;
  }

  .slider-content p {
    font-size: 0.9rem;
  }

  .slider-btn {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }

  .slider-prev {
    left: 5px;
  }

  .slider-next {
    right: 5px;
  }

  .site-footer {
    padding: 1rem 0.5rem;
  }

  .site-footer h2 {
    font-size: 1.1rem;
  }

  .contact-info p {
    font-size: 0.85rem;
  }

  .social-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }

  .load-more {
    margin: 1rem 0.5rem;
  }

  .load-more button {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.9rem;
  }
}

/* Additional mobile optimizations */
@media (max-width: 600px) {
  .news-container {
    margin: 0;
    /* padding: 0.5rem; */
    grid-template-columns: 1fr !important;
  }

  .card {
    margin-bottom: 0;
    grid-column: span 1 !important;
    grid-row: span 1 !important;
    width: 100%;
  }

  .top-news-slider {
    margin: 0;
    grid-template-columns: 1fr;
    gap: 1px;
  }

  .cartoon-container {
    border-left: 1px solid #68470047;
    border-top: none;
    padding: 1rem;
  }

  .cartoon-container h2 {
    font-size: 1rem;
  }
  
  .cartoon-watermark img {
    width: 45px;
  }

  .slider-container {
    margin: 0;
  }
}


/* Drawer styles */
#drawerOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 1090;
}

#drawerOverlay.active {
  opacity: 1;
  pointer-events: auto;
}

#drawerPanel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(560px, 100%);
  background: #fffdf7;
  color: #232323;
  box-shadow: -12px 0 24px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 1100;
  display: flex;
  flex-direction: column;
}

#drawerPanel.active {
  transform: translateX(0);
}

#drawerCloseBtn {
  align-self: flex-end;
  margin: 8px 8px 0 0;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 28px;
  cursor: pointer;
}

#drawerContent {
  padding: 16px 20px 24px;
  overflow: auto;
}

#drawerContent img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  margin-bottom: 12px;
}

#drawerContent iframe {
  background: #f9f9f9;
  position: relative;
}

#drawerContent iframe::before {
  content: "Loading article...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #666;
  font-style: italic;
}