/* Tailwind CSS Configuration - Converted to CSS Variables */
:root {
  --pr-background: #6b7d91;
  --pr-nav: #d8d3c4;
  --pr-primary: #182a38;
  --pr-secondary: #757d7f;
  --pr-text-accent: #eae7db;
  --card-bg: #182a38; /* Updated for dark theme */
  --featured-card-bg: #2d3748; /* Dark color for featured cards only */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Roboto', sans-serif;
  --shadow-custom: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Base Styles */
body {
  background-color: var(--pr-primary);
  font-family: var(--font-body);
  color: var(--pr-text-accent);
  transition: color 0.3s, background-color 0.3s;
}

header {
  background-color: var(--pr-primary) !important;
}

/* Main Content */
main {
  background-color: var(--pr-background);
  border-radius: 1rem;
  margin-top: 1rem;
}

/* Hero Section */
.hero-section {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: transparent;
}

.featured-article-link {
  display: flex;
  flex-direction: column;
  background-color: var(--featured-card-bg);
  border-radius: 0.5rem;
  text-decoration: none;
  overflow: hidden;
  box-shadow: var(--shadow-custom);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-article-link:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.2);
}

.featured-image {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  flex: 3;
}

.featured-content {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.featured-title {
  color: var(--pr-text-accent);
  font-size: 1rem;
  font-weight: bold;
  font-family: var(--font-display);
  margin-bottom: 0.5rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Article List */
.article-list-container {
  padding: 2rem;
  background-color: var(--card-bg);
  border-radius: 0.5rem;
}

.article-list-title {
  font-size: 1.5rem;
  font-weight: bold;
  font-family: var(--font-display);
  margin-bottom: 1.5rem;
  color: var(--pr-text-accent);
  border-bottom: 2px solid var(--pr-nav);
  padding-bottom: 0.5rem;
}

main > .article-list-title {
  padding: 0.25rem 1rem 0.5rem 1rem;
  margin-bottom: 0;
}

.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.article-item {
  background-color: var(--pr-background);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-custom);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.card-main-link {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.article-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.2);
}

.article-item-link {
  display: block;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
  text-decoration: none;
}

.article-item-content {
  padding: 1rem;
  position: relative;
  z-index: 2;
}

.article-item-title {
  font-size: 1.1rem;
  font-weight: bold;
  font-family: var(--font-display);
  color: var(--pr-text-accent);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.article-item-summary {
  font-size: 0.875rem;
  color: var(--pr-nav);
  line-height: 1.4;
}

/* News Ticker */
.news-ticker-container {
  width: 100%;
  padding: 0.75rem 0;
  overflow: hidden;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.news-ticker-container::before,
.news-ticker-container::after {
  content: '';
  position: absolute;
  left: -2px;
  top: -2px;
  background: linear-gradient(
    45deg,
    var(--pr-primary),
    var(--pr-secondary),
    #ffffff,
    var(--pr-secondary),
    var(--pr-primary)
  );
  background-size: 400%;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  z-index: -2; /* Sit behind the ticker content */
  animation: steam 20s linear infinite;
}

.news-ticker-container::after {
  filter: blur(20px);
}

@keyframes steam {
  0% {
    background-position: 0 0;
  }
  50% {
    background-position: 400% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.news-ticker {
  background-color: var(--pr-primary);
  color: var(--card-bg);
  display: inline-block;
  padding-left: 100%;
  animation: scroll-ticker 40s linear infinite;
  white-space: nowrap;
}

.news-ticker li {
  display: inline-block;
  padding: 0 2rem;
  font-size: 0.9rem;
}

@keyframes scroll-ticker {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Custom Scrollbar */
.comment-scroll::-webkit-scrollbar {
  width: 8px;
}
.comment-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}
.comment-scroll::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}
.comment-scroll::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* News Section & Article Styles */
.news-section {
  background-color: var(--pr-primary); /* Changed from white */
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-custom); /* Added shadow */
}
.news-section-title {
  font-weight: bold;
  border-bottom: 2px solid var(--pr-nav); /* Adjusted for contrast */
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  color: var(--pr-text-accent);
}
.news-article {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--pr-nav);
}
.news-article:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.news-article img {
  width: 100%;
  height: auto;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}
.news-article h4 {
  font-weight: bold;
  color: var(--pr-text-accent);
  margin-bottom: 0.25rem;
}
.news-article p {
  font-size: 0.875rem;
  color: var(--pr-nav);
}

/* Card Background and Shadow for Hero Section */
.bg-card-bg {
  background-color: var(--card-bg);
}

.shadow-custom {
  box-shadow: var(--shadow-custom);
}

/* Responsive Styles */
@media (max-width: 768px) {
  /* Header */
  header .container {
    flex-wrap: wrap;
  }
  .main-nav {
    display: flex;
    display: flex;
    width: 100%;
    flex-direction: row;
    flex-direction: row;
    align-items: center;
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    justify-content: center;
    flex-wrap: wrap;
  }
  .main-nav.is-open {
    display: flex;
  }
  .mobile-menu-button {
    display: flex;
  }

  /* Main Content Grids */
  .grid {
    grid-template-columns: 1fr;
  }
  main .grid > div {
    margin-bottom: 1rem;
  }

  /* Hero Section */
  .hero-section {
    grid-template-columns: 1fr 1fr;
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .hero-section {
    grid-template-columns: 1fr;
  }
}

  .featured-article-link:nth-child(2),
  .featured-article-link:nth-child(3) {
    min-height: 200px;
  }

  main {
    margin-top: 0.5rem;
  }

  /* Footer */
  footer .container > div {
    flex-direction: column;
    gap: 1rem;
  }
  .footer-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}

/* Tags Styling */
.tags-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem; /* Add some space below the tags */
}

.featured-content .tags-container {
  margin-top: auto;
  margin-bottom: 0;
}

.featured-content .tag-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
}

.tag-badge {
  display: inline-block;
  background-color: rgba(24, 42, 56, 0.8); /* Use --pr-primary with opacity */
  color: var(--pr-text-accent);
  padding: 0.3rem 0.6rem;
  border-radius: 0.3rem;
  font-size: 0.75rem;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
  border: 1px solid var(--pr-nav);
}

.tag-badge:hover {
  background-color: var(--pr-primary);
  transform: scale(1.05);
}

/* Transparency Modal Styles */
#transparency-modal.flex {
  display: flex;
}

#transparency-modal.hidden {
  display: none;
}

#close-modal-btn {
  font-size: 2.5rem;
  line-height: 1;
}

.transparency-button {
  background-color: var(--pr-secondary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.2s ease;
  cursor: pointer;
  border: 1px solid var(--pr-nav);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.transparency-button:hover {
  background-color: var(--pr-primary);
  transform: translateY(-1px);
}

/* Search button styles */
#search-btn {
  transition: background-color 0.3s ease, box-shadow 0.3s ease,
    transform 0.2s ease;
}

#search-btn:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.transparency-card {
  background-color: var(--pr-background);
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--pr-secondary);
}

.nav-tag {
  display: inline-block;
  background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black */
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease-in-out;
}

.nav-tag:hover {
  background-color: rgba(0, 0, 0, 0.8);
  cursor: pointer;
  transform: scale(2);
  z-index: 1;
}

.search-bar {
  position: relative;
}

.search-bar input {
  padding-right: 2.5rem; /* Make space for the icon */
}

.search-bar .material-icons {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--pr-secondary);
}

.transparency-card h3 {
  font-size: 1.25rem; /* 20px */
}

.transparency-card p {
  font-size: 1.125rem; /* 18px */
}
/* Tooltip Styles */
.tooltip-container {
  position: relative;
  display: inline-block;
}

.tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
  max-width: 300px;
  word-wrap: break-word;
  white-space: normal;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s, visibility 0.3s;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.tooltip-container:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

/* Ensure tooltip appears above other elements */
.tooltip-container input:hover + .tooltip,
.tooltip-container:hover .tooltip {
  visibility: visible;
  opacity: 1;
}
