/* ====== GLOBAL STYLES ====== */
/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #000;
  --secondary-color: #333;
  --text-color: #333;
  --light-text: #666;
  --bg-color: #fff;
  --light-bg: #f9f9f9;
  --border-color: #eee;
  --accent-color: #000;
  --white: #fff;
  --black: #000;
  --transition: all 0.3s ease;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  overflow-x: hidden;
}

/* Container for centered content */
.container {
  width: 100%;
  padding: 0 1rem;
  margin: 0 auto;
}

/* Responsive container widths */
@media (min-width: 640px) {
  .container {
    max-width: 640px;
    padding: 0 1.5rem;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
    padding: 0 2rem;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

@media (min-width: 1536px) {
  .container {
    max-width: 1400px;
  }
}

/* ====== SECTION HEADINGS ====== */
.section-heading,
.filter-section h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--black);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  padding-bottom: 0.5rem;
}

.section-heading::after,
.filter-section h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: var(--black);
}

@media (min-width: 768px) {
  .section-heading,
  .filter-section h3 {
    font-size: 2rem;
    margin-bottom: 2rem;
  }

  .section-heading::after,
  .filter-section h3::after {
    width: 100px;
  }
}

@media (min-width: 1024px) {
  .section-heading,
  .filter-section h3 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
  }
}

/* logo */

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px 0; /* reduce top & bottom space */
  height: 7.5rem; /* ensures it wraps the image */
}

.logo {
  max-width: 100%;
  height: auto;
  width: 200px; /* increase image size as needed */
  display: block;
  
}


/* ====== BLOG TITLE SECTION ====== */
.blog-title {
  text-align: center;
  font-family: "Rubik", sans-serif;
  font-style: normal;
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0.5rem 0;
  color: var(--black);
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .blog-title {
    font-size: 2rem;
    margin: 1.25rem 0;
  }
}

@media (min-width: 1024px) {
  .blog-title {
    font-size: 2.5rem;
    margin: 1.875rem 0;
  }
}

/* ====== NAVIGATION BAR ====== */
.navbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 1rem 0;
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
}

.navbar a {
  margin: 0.5rem;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
  transition: var(--transition);
}

.navbar a:hover {
  color: var(--black);
}

@media (min-width: 768px) {
  .navbar a {
    margin: 0 1rem;
    font-size: 0.875rem;
  }
}

/* loading animation */

.loading-animation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
}

.loading-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--black);
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .loading-dot {
    width: 10px;
    height: 10px;
  }

  .loading-animation {
    gap: 6px;
  }
}

/* ====== HERO SECTION ====== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  margin: 2rem auto;
  position: relative;
  overflow: hidden;
  background-color: var(--light-bg);
  border-radius: 0.75rem;
  width: calc(100% - 2rem);
}

.hero::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.5rem;
  background-image: radial-gradient(circle, #ddd 1px, transparent 1px);
  background-size: 1.25rem 1.25rem;
  opacity: 0.6;
  z-index: 0;
  border: 1px dashed #ccc;
  border-radius: 0.5rem;
}

.hero-text {
  flex: 1;
  padding: 1.5rem;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 0.5rem;
  position: relative;
  z-index: 1;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05);
  width: 100%;
  text-align: center;
}

.hero-text p:first-child {
  font-size: 0.875rem;
  color: var(--light-text);
  margin-bottom: 1.25rem;
  font-weight: 600;
}

.hero-text h2 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  color: var(--black);
}

.hero-text p:last-of-type {
  font-size: 0.875rem;
  color: var(--light-text);
  margin-bottom: 1.875rem;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.hero-image {
  flex: 1;
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 1.5rem;
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
  border: 0.5rem solid var(--white);
}

@media (min-width: 768px) {
  .hero {
    padding: 3rem 1.5rem;
    margin: 2.5rem auto;
  }

  .hero-text {
    padding: 2rem;
  }

  .hero-text h2 {
    font-size: 2.25rem;
  }

  .hero-text p:first-child,
  .hero-text p:last-of-type {
    font-size: 1rem;
  }
}

@media (min-width: 1024px) {
  .hero {
    flex-direction: row;
    padding: 5rem 2rem;
    margin: 2.5rem auto;
  }

  .hero-text {
    text-align: left;
    padding: 3rem;
    margin-bottom: 0;
  }

  .hero-text h2 {
    font-size: 3rem;
  }

  .hero-image {
    margin-top: 0;
    margin-left: 2rem;
  }

  .hero::before {
    top: 1.25rem;
    left: 1.25rem;
    right: 1.25rem;
    bottom: 1.25rem;
    background-size: 1.5rem 1.5rem;
  }
}

/* ====== ENHANCED CATEGORY SECTION ====== */
.filter-section {
  padding: 3rem 0;
  width: 100%;
  position: relative;
}

.filter-section .container {
  padding: 0 1rem;
}

.category-scroll-container {
  width: 100%;
  position: relative;
  padding: 1rem 0;
}

.category-links {
  display: flex;
  gap: 1.5rem;
  padding: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-links::-webkit-scrollbar {
  display: none;
}

.category-link {
  position: relative;
  font-size: 2rem;
  color: var(--white);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  text-decoration: none;
  min-width: 220px;
  height: 320px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
  padding: 20px;
  scroll-snap-align: start;
  flex-shrink: 0;
}

.category-link span {
  font-size: 1.25rem;
  font-weight: 800;
  text-align: left;
  color: white;
  z-index: 2;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px 15px;
  border-radius: 6px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

/* Hover effects */
.category-link:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.category-link:hover span {
  background: rgba(0, 0, 0, 0.7);
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .category-link {
    min-width: 180px;
    height: 180px;
  }

  .category-link span {
    font-size: 1.1rem;
    padding: 8px 12px;
  }
}

@media (min-width: 768px) {
  .filter-section {
    padding: 5rem 0;
  }

  .category-links {
    gap: 2rem;
    padding: 1rem 2rem;
  }

  .category-link {
    min-width: 260px;
    height: 260px;
  }

  .category-link span {
    font-size: 1.5rem;
  }
}

/* Category-specific background images */
.category-link[data-category="Technical"] {
  background-image: url("https://images.unsplash.com/photo-1555066931-4365d14bab8c?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80");
}

.category-link[data-category="Srilanka"] {
  background-image: url("/img/srilanka-img.jpg");
}

.category-link[data-category="News"] {
  background-image: url("/img/news.jpg");
}

.category-link[data-category="Film"] {
  background-image: url("https://images.unsplash.com/photo-1516035069371-29a1b244cc32?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=80");
}

.category-link[data-category="Sport"] {
  background-image: url("/img/sport.png");
}

@media (min-width: 1024px) {
  .category-links {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    gap: 2.5rem;
    padding: 1rem;
  }

  .category-link {
    min-width: 280px;
    height: 280px;
    max-width: 300px;
  }

  .category-link span {
    font-size: 1.6rem;
  }
}

/* ====== MOST VIEWED EPISODES SECTION ====== */
.most-viewed {
  padding: 3rem 1rem;
  text-align: center;
  background-color: var(--white);
}

/* Horizontal Scroll Container */
.episodes-horizontal-scroll {
  overflow-x: auto;
  padding: 1rem 0 2rem;
  scrollbar-width: thin;
  scrollbar-color: var(--black) #f1f1f1;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin: 0 auto;
}

.episodes-horizontal-scroll::-webkit-scrollbar {
  height: 0.5rem;
}

.episodes-horizontal-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 0.5rem;
}

.episodes-horizontal-scroll::-webkit-scrollbar-thumb {
  background: var(--black);
  border-radius: 0.5rem;
}

/* Episodes Container */
.episodes-container {
  display: flex;
  gap: 1rem;
  padding-bottom: 1rem;
  width: max-content;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Episode Card */
.episode-card {
  min-width: 180px;
  max-width: 220px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.episode-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

/* Episode Image */
.episode-image-container {
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.episode-author-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.episode-card:hover .episode-author-image {
  transform: scale(1.05);
}

/* Episode Content */
.episode-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.episode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.episode-author {
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
  margin: 0;
}

.episode-tag {
  background: var(--black);
  color: var(--white);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 1rem;
}

.episode-title {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-color);
  margin: 0 0 16px 0;
  text-align: center;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding-top: 2.5rem;
  padding-bottom: 1.5rem;
}

.episode-divider {
  border: 0;
  height: 1px;
  background: #eee;
  margin: 0 0 16px 0;
  width: 100%;
}

.episode-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.episode-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.episode-category {
  background: #f5f5f5;
  color: var(--black);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  text-transform: capitalize;
  margin: 1rem;
}

.episode-date {
  font-size: 0.75rem;
  color: var(--light-text);
  margin: 0;
}

.episode-link {
  display: inline-block;
  color: var(--black);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--black);
  padding-bottom: 2px;
  transition: color 0.3s ease, border-color 0.3s ease;
  font-size: 0.875rem;
  margin-top: 8px;
  align-self: center;
  margin: 1rem;
}

.episode-link:hover {
  color: #555;
  border-color: #555;
}

/* Tablet Styles */
@media (min-width: 768px) {
  .most-viewed {
    padding: 4rem 1.5rem;
  }

  .episodes-container {
    gap: 1.5rem;
    padding: 0 1.5rem;
  }

  .episode-card {
    min-width: 300px;
  }

  .episode-image-container {
    height: 200px;
  }

  .episode-title {
    font-size: 1.1rem;
    min-height: 80px;
  }
}

/* Desktop Styles */
@media (min-width: 1024px) {
  .most-viewed {
    padding: 5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
  }

  .episodes-container {
    gap: 2rem;
  }

  .episode-card {
    min-width: 320px;
  }

  .episode-image-container {
    height: 220px;
  }

  .episode-title {
    font-size: 1.2rem;
  }
}

/* No Scrollbar for Mobile */
@media (max-width: 480px) {
  .episodes-horizontal-scroll {
    padding-bottom: 1rem;
  }

  .episodes-container {
    padding: 0 0.5rem;
  }

  .episode-card {
    min-width: 260px;
  }
}

/* ====== BUTTON STYLES ====== */
.read-btn {
  background-color: var(--black);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 0.25rem;
  display: inline-block;
  text-align: center;
}

.read-btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-0.125rem);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
}

/* ====== FOOTER STYLES ====== */
.footer {
  background-color: var(--black);
  color: var(--white);
  padding: 2rem 1rem 1.5rem;
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.footer-nav a {
  color: var(--white);
  text-decoration: none;
  font-size: 1.5rem;
  transition: opacity 0.3s;
}

.footer-nav a:hover {
  opacity: 0.8;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.footer-links a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: opacity 0.3s;
}

.footer-links a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.newsletter {
  max-width: 100%;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
}

.newsletter h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.25rem;
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
}

.newsletter-button {
  background-color: var(--white);
  color: var(--black);
  border: none;
  padding: 0.75rem 2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.newsletter-button:hover {
  background-color: #ddd;
}

.copyright {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .footer {
    padding: 3rem 1.5rem 1.5rem;
  }

  .footer-nav {
    margin-bottom: 2rem;
  }

  .footer-links {
    margin-bottom: 2rem;
  }

  .footer-links a {
    font-size: 0.9rem;
  }

  .newsletter {
    max-width: 30rem;
    margin-bottom: 2rem;
  }

  .newsletter h3 {
    font-size: 1.125rem;
  }

  .newsletter-form {
    flex-direction: row;
  }

  .newsletter-input {
    font-size: 0.875rem;
  }

  .newsletter-button {
    font-size: 0.875rem;
  }

  .copyright {
    font-size: 0.875rem;
  }
}
