@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;700&family=Noto+Serif+Devanagari:wght@400;700&display=swap");

/* Marathi / Devanagari webfonts: prefer Noto Sans Devanagari for body and Noto Serif Devanagari for headings */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans Devanagari", "Segoe UI", Tahoma, Geneva, Verdana,
    sans-serif;
  background: linear-gradient(135deg, #fff8e1 0%, #ffe0b2 100%);
  min-height: 100vh;
}

/* Improve Devanagari readability: slightly relaxed line-height and subtle letter spacing */
body,
p,
li,
a,
span,
input,
button {
  line-height: 1.7;
  letter-spacing: 0.15px;
}

/* Headings: use a slightly more classical serif for Marathi headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Noto Serif Devanagari", "Noto Sans Devanagari", "Segoe UI",
    sans-serif;
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

/* Make buttons and nav inherit the Marathi font for consistent UI */
button,
nav,
.menu-toggle,
.tab-btn,
.view-more {
  font-family: "Noto Sans Devanagari", "Segoe UI", Tahoma, Verdana, sans-serif;
}

/* Header */
header {
  background: linear-gradient(135deg, #ff6f00 0%, #f57c00 100%);
  color: white;
  padding: 1rem 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  .menu-toggle {
    display: block;
    /* slightly smaller touch target on mobile and centered icon */
    padding: 0.35rem;
    font-size: 1.05rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    /* keep a small offset from the right edge */
    right: 12px;
    top: 10px;
    position: absolute;
    z-index: 1101;
  }
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

/* Logo box (emoji or image) - default desktop size and a smaller mobile size */
.logo {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%; /* make it a circle */
  font-size: 1.6rem; /* emoji sizing */
  background: white; /* white circular background as requested */
  color: #ff6f00; /* make the emoji/icon match brand orange */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

@media (max-width: 768px) {
  .logo {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
  }
}

.title h1 {
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
}

.title p {
  font-size: 0.9rem;
  opacity: 0.9;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Political Leaders Section */
.political-leaders {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.leader-photo-small {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid white;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.leader-photo-small:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.leader-photo-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modal for Leader Photo */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  /* dim + subtle backdrop blur for focus */
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.25s;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  position: relative;
  width: 95%;
  max-width: 920px;
  /* make content fit inside viewport and scroll internally if long */
  max-height: calc(100vh - 64px);
  overflow: auto;
  padding: 18px;
  border-radius: 12px;
  background: #ffffff;
  /* ensure readable text inside modals (fixes white-on-white issues from site theme) */
  color: #222;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  animation: zoomIn 0.22s;
}

.modal-content img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.modal-caption {
  text-align: left;
  color: #333;
  padding: 0.5rem 0 0.75rem 0;
  font-size: 0.95rem;
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 12px;
  color: #333;
  font-size: 26px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
}

.close-modal:hover {
  color: #ff6f00;
  transform: rotate(20deg);
}

/* bottom close button inside modal */
.modal .secondary {
  background: #fff;
  color: #222;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.modal .secondary:hover {
  background: #f7f7f7;
}

/* View more pill button used in posts */
.view-more {
  display: inline-block;
  background: linear-gradient(135deg, #ff6f00, #f57c00);
  color: white;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(255, 111, 0, 0.18);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.view-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(255, 111, 0, 0.22);
}

/* Mobile-friendly adjustments for the view-more pill */
@media (max-width: 480px) {
  .view-more {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: 12px;
    text-align: center;
  }
}

/* Ensure modals always appear above other UI (fixes videos appearing behind) */
.modal {
  z-index: 99999 !important;
}
.modal .modal-content {
  z-index: 100000 !important;
}

/* Video modal: use dark backdrop for focus and ensure the video is on top */
#videoModal .modal-content {
  background: rgba(0, 0, 0, 0.92);
  max-width: 90vw; /* use more screen width for videos */
  max-height: 90vh; /* use more screen height for videos */
}
#videoModal .modal-content video {
  position: relative;
  z-index: 100001;
  width: 100%;
  height: auto;
  max-height: 80vh; /* ensure video doesn't exceed viewport */
}

/* Ensure post detail content inside modal is readable */
.modal-content .post-detail-content,
.modal-content .modal-caption,
.modal-content h2,
.modal-content h3,
.modal-content p,
.modal-content div {
  color: #222;
}

/* Prev / Next buttons inside post detail viewer */
#pmPrev,
#pmNext {
  background: linear-gradient(135deg, #ff6f00, #f57c00);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 111, 0, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
#pmPrev:hover,
#pmNext:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(255, 111, 0, 0.22);
}

/* Make the top-close (×) more visible: circular button with subtle border */
.modal .close-modal {
  position: absolute;
  top: 12px;
  right: 12px;
  color: #333;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.modal .close-modal:hover {
  background: #ff6f00;
  color: #fff;
  transform: rotate(20deg) scale(1.02);
}

/* Bottom Close button in post detail modal: ensure visibility and alignment */
#postDetailCloseBtn {
  background: #fff;
  color: #222;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
#postDetailCloseBtn:hover {
  background: #f7f7f7;
}

/* Compact video thumbnail - enforce rectangular shape and crop posters */
.video-thumb {
  position: relative;
  width: 100%;
  max-width: 620px; /* maintains reasonable max width */
  height: 200px; /* default height for mobile/small screens */
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  display: block;
  cursor: pointer;
  background: #000;
  margin: 0 auto; /* center the thumbnail */
}

/* Inline history video (compact player inside history cards) */
.history-inline-video {
  position: relative;
  width: 100%;
  height: 350px !important;
  background: #000;
  border-radius: 0;
  overflow: hidden;
}

.history-inline-video .history-video-player {
  width: 100%;
  height: 350px;
  display: block;
  object-fit: cover;
  background: black;
  transition: transform 0.3s ease;
}

.history-card:hover .history-inline-video .history-video-player {
  transform: scale(1.05);
}

.history-inline-video .video-play-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 111, 0, 0.9);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  pointer-events: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.history-card:hover .history-inline-video .video-play-overlay {
  background: rgba(255, 111, 0, 1);
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 111, 0, 0.4);
}

@media (max-width: 640px) {
  .history-inline-video {
    max-width: 100%;
  }
}

/* Tablet screens - medium video size */
@media (min-width: 641px) and (max-width: 1023px) {
  .video-thumb {
    height: 280px; /* medium height for tablets */
  }
}

/* Desktop/larger screens - set 350px height as requested */
@media (min-width: 1024px) {
  .video-thumb {
    height: 350px; /* fixed height for web as requested */
  }

  .history-inline-video {
    min-height: 200px; /* ensure adequate height for inline videos */
  }
}

.video-thumb img {
  width: 100%;
  height: 300px;
  object-fit: cover; /* fill the rectangle and crop as needed */
  display: block;
}

.video-thumb .video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  cursor: pointer;
}

.video-thumb .video-play:hover {
  background: rgba(255, 111, 0, 0.9);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Video modal (reuse modal structure) */
/* Video modal: ensure vertical (portrait) videos fit the viewport without internal scrolling */
#videoModal .modal-content {
  max-width: 95%;
  /* leave small margins top/bottom for close button and breathing room */
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: hidden; /* prevent inner scrollbars for tall videos */
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent; /* reduce double-background around video */
}

#videoModal .modal-content video {
  /* Allow the video to grow until it hits viewport limits while preserving aspect ratio */
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 96px);
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 8px;
}

/* Feed post - left thumbnail, right content */
.feed-post.media-left {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.feed-post.media-left .post-media {
  flex: 0 0 260px;
}

.feed-post.media-left .post-content {
  flex: 1 1 auto;
}

@media (max-width: 768px) {
  .feed-post.media-left {
    flex-direction: column;
  }
  .feed-post.media-left .post-media {
    width: 100%;
    flex: none;
  }
}

/* New post-body layout: header stays as single-line; body has left thumbnail and right content */
.feed-post .post-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.feed-post .post-header .post-author > div strong {
  display: inline-block;
}
.feed-post .post-header .post-author p {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
}

.feed-post .post-body {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.feed-post .post-body .post-media {
  flex: 0 0 160px;
}
.feed-post .post-body .post-content {
  flex: 1 1 auto;
}

@media (max-width: 640px) {
  .feed-post .post-body {
    flex-direction: column;
  }
  .feed-post .post-body .post-media {
    width: 100%;
    flex: none;
  }
}

/* History summary: truncate long text with a smooth fade and provide an "expanded" class to show full text */
.history-meta {
  display: flex;
  flex-direction: column;
}

/* History Page Main Layout */
#historyPage {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: slideInUp 0.6s ease-out;
  position: relative;
  z-index: 1;
}

/* Ensure history page has consistent background with rest of site */
body:has(#historyPage) {
  background: linear-gradient(135deg, #fff8e1 0%, #ffe0b2 100%);
  min-height: 100vh;
}

#historyPage .page-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 3px solid #ffe0b2;
  position: relative;
}

#historyPage .page-header::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: #ff6f00;
}

#historyPage .page-header h2 {
  color: #ff6f00;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-family: "Noto Serif Devanagari", serif;
}

#historyPage .page-header p {
  color: #666;
  font-size: 1.1rem;
  margin: 0;
}

/* History List Grid */
.history-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* History Card Styling */
.history-card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 111, 0, 0.1);
  position: relative;
  cursor: pointer;
  animation: fadeInScale 0.6s ease-out;
  animation-fill-mode: both;
}

/* Stagger animation for multiple cards */
.history-card:nth-child(1) {
  animation-delay: 0.1s;
}
.history-card:nth-child(2) {
  animation-delay: 0.2s;
}
.history-card:nth-child(3) {
  animation-delay: 0.3s;
}
.history-card:nth-child(4) {
  animation-delay: 0.4s;
}
.history-card:nth-child(5) {
  animation-delay: 0.5s;
}
.history-card:nth-child(6) {
  animation-delay: 0.6s;
}

.history-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 111, 0, 0.4);
}

.history-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ff6f00, #ffa726);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.history-card:hover::before {
  opacity: 1;
}

/* Add subtle pulse effect on focus */
.history-card:focus {
  outline: none;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  }
  50% {
    box-shadow: 0 8px 25px rgba(255, 111, 0, 0.2);
  }
  100% {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  }
}

/* History Thumbnail */
.history-thumb {
  position: relative;
  width: 100%;
  height: 350px;
  overflow: hidden;
  background: #f5f5f5;
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.history-card:hover .history-thumb img {
  transform: scale(1.05);
}

/* History Card Content */
.history-meta {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-meta h3 {
  color: #333;
  font-size: 1.3rem;
  margin: 0;
  font-weight: 700;
  line-height: 1.4;
  font-family: "Noto Serif Devanagari", serif;
}

.history-period {
  color: #ff6f00 !important;
  font-weight: 600;
  font-size: 0.9rem !important;
  margin: 0 !important;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 111, 0, 0.1);
  border-radius: 20px;
  display: inline-block;
  width: fit-content;
}
.history-summary {
  /* limit to ~3 lines by default */
  max-height: calc(1.6rem * 3.2); /* 3.2 to allow some wrapping */
  overflow: hidden;
  position: relative;
  line-height: 1.6;
  transition: max-height 220ms ease;
  color: #555;
  font-size: 0.98rem;
  margin-top: 0.5rem;
}

.history-summary:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.4rem;
  /* fade to the card background (cards are white) so the end of text softly disappears */
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 1)
  );
  pointer-events: none;
}

.history-card.expanded .history-summary {
  max-height: 1000px; /* effectively show all text */
}

.history-card.expanded .history-summary:after {
  display: none;
}

/* Make the read-more button visually distinct for history entries */
.view-more.view-history {
  background: linear-gradient(135deg, #ff6f00, #ffa726);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(255, 111, 0, 0.3);
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 600;
  margin-top: 1rem;
  transition: all 0.3s ease;
}

.view-more.view-history:hover {
  background: linear-gradient(135deg, #e65100, #ff8f00);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 111, 0, 0.4);
}

/* History Page Responsive Design */
@media (max-width: 768px) {
  #historyPage {
    padding: 1.5rem;
    margin: 1rem;
    border-radius: 10px;
  }

  #historyPage .page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }

  #historyPage .page-header h2 {
    font-size: 2rem;
  }

  .history-list {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .history-card {
    border-radius: 10px;
  }

  /* .history-thumb {
    height: 180px;
  } */

  .history-meta {
    padding: 1.25rem;
  }

  .history-meta h3 {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  #historyPage {
    padding: 1rem;
    margin: 0.5rem;
  }

  #historyPage .page-header h2 {
    font-size: 1.8rem;
  }

  .history-thumb {
    height: 160px;
  }

  .history-meta {
    padding: 1rem;
  }

  .history-summary {
    max-height: calc(1.6rem * 4); /* a little taller on small screens */
  }

  .history-summary:after {
    height: 2.2rem;
  }
}

/* Modal detail readability enhancements for long history text */
#postDetailModal .modal-content .history-detail {
  font-size: 1rem;
  line-height: 1.8;
  color: #222;
  max-width: 760px;
  margin: 0 auto;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .history-summary {
    max-height: calc(1.6rem * 4); /* a little taller on small screens */
  }
  .history-summary:after {
    height: 2.2rem;
  }
}

/* Left compact video panel */
.left-video-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.left-video-item h4 {
  color: #ff6f00;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.left-video-item .video-thumb {
  width: 100%;
  height: 100px;
}

.left-video-item .video-desc {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.5rem;
}

/* Grid for video posts and smaller left-thumbnail layout overrides */
.video-feed-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Loading indicator for infinite scroll */
.loading-indicator {
  grid-column: 1 / -1;
  margin: 1rem 0;
  opacity: 0.8;
  animation: fadeIn 0.3s ease-in;
}

.loading-indicator i.fa-spinner {
  margin-right: 8px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.8;
  }
}

/* Gallery tabs and grid */
.gallery-tabs {
  background: white;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.gallery-tab-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

/* Leader tab buttons: keep single-row on small screens with horizontal scroll */
.leader-tab-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  /* allow horizontal scrolling when tabs overflow */
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 6px; /* small breathing room under buttons */
}
.leader-tab-buttons .tab-btn {
  /* prevent buttons from breaking into multiple lines */
  white-space: nowrap;
  flex: 0 0 auto;
}
.tab-btn {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: all 0.16s ease;
}
.tab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}
.tab-btn.active {
  background: linear-gradient(135deg, #ff6f00, #f57c00);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(255, 111, 0, 0.14);
}
.tab-btn:focus {
  outline: 3px solid rgba(255, 111, 0, 0.12);
  outline-offset: 3px;
}
.gallery-tab-content {
  display: block;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  align-items: start;
}
.gallery-item {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}
.gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  transition: transform 0.18s ease;
}
.gallery-item img:hover {
  transform: scale(1.03);
}
.gallery-item.video-item {
  position: relative;
}
.gallery-item .video-thumb {
  width: 100%;
  /* use 16:9 in gallery: height will be computed from width via aspect-ratio */
  aspect-ratio: 16 / 9;
  display: block;
  border-radius: 0;
}
.gallery-item .video-play {
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  font-size: 1rem;
}

@media (max-width: 900px) {
  .gallery-item img {
    height: 140px;
  }
  .gallery-item .video-thumb {
    aspect-ratio: 16 / 9;
  }
}
@media (max-width: 560px) {
  .gallery-item img,
  .gallery-item .video-thumb {
    height: 120px;
  }
  .gallery-tab-buttons {
    gap: 6px;
  }
  .tab-btn {
    padding: 6px 10px;
    font-size: 0.95rem;
  }

  /* Ensure leader tabs remain a single horizontal row on smaller screens */
  .leader-tab-buttons {
    gap: 6px;
    margin-bottom: 8px;
  }
  .leader-tab-buttons .tab-btn {
    padding: 6px 10px;
    font-size: 0.92rem;
  }
}

/* Additional mobile polish: hide default scrollbar on WebKit but keep it usable */
.leader-tab-buttons::-webkit-scrollbar {
  height: 8px;
}
.leader-tab-buttons::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 6px;
}

/* Make thumbnails in media-left posts compact */
.feed-post.media-left .post-media .video-thumb {
  width: 160px;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16 / 9; /* small rectangular thumbnail */
}
.feed-post.media-left .post-media .video-thumb img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

@media (max-width: 640px) {
  .feed-post.media-left {
    flex-direction: column;
  }
  .feed-post.media-left .post-media .video-thumb {
    width: 100%;
    height: auto;
  }
  .feed-post.media-left .post-media .video-thumb img {
    width: 100%;
    height: auto;
  }

  /* Mobile video play button improvements */
  .video-thumb .video-play {
    width: 64px;
    height: 64px;
    font-size: 1.3rem;
    background: rgba(255, 111, 0, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.9);
  }

  .gallery-item .video-play {
    width: 56px;
    height: 56px;
    font-size: 1.2rem;
    background: rgba(255, 111, 0, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.9);
  }

  .history-inline-video .video-play-overlay {
    width: 70px;
    height: 70px;
    font-size: 1.4rem;
    background: rgba(255, 111, 0, 0.9);
    border: 3px solid rgba(255, 255, 255, 0.9);
  }
}

@keyframes zoomIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: white;
  color: #ff6f00;
  border: none;
  padding: 0.4rem;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s;
}

.menu-toggle:hover {
  transform: scale(1.1);
}

/* Navigation */
nav {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.5rem;
  transition: all 0.3s;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 0.7rem 1.2rem;
  display: block;
  border-radius: 5px;
  transition: all 0.3s;
}

nav a:hover,
nav a.active {
  background: white;
  color: #ff6f00;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .header-top {
    flex-wrap: wrap;
  }

  .logo-section {
    order: 1;
  }

  .header-right {
    order: 2;
  }

  .political-leaders {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
    gap: 0.5rem;
  }

  .leader-photo-small {
    width: 45px;
    height: 45px;
  }

  .menu-toggle {
    display: block;
    /* compact circular toggle on mobile */
    position: absolute;
    top: 10px;
    right: 14px;
    z-index: 1101;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  }

  nav {
    position: fixed;
    /* anchor nav just under the header so the slide-in panel appears from the right-top corner */
    top: 72px;
    right: -100%;
    width: 280px;
    background: linear-gradient(135deg, #ff6f00 0%, #f57c00 100%);
    border-radius: 15px 0 0 15px;
    padding: 2rem 1rem;
    transition: right 0.4s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    z-index: 999;
  }

  nav.active {
    right: 0;
  }

  nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  nav a {
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
  }
}

/* Mobile bottom navigation (mobile-first theme): appears only on small screens and doesn't affect desktop */
.mobile-bottom-nav {
  display: none; /* default hidden */
}

.mobile-bottom-nav .mbtn {
  background: transparent;
  border: none;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  min-width: 48px;
  max-width: 72px;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s;
}

.mobile-bottom-nav .mbtn .icon {
  font-size: 18px;
  line-height: 1;
}

.mobile-bottom-nav .mbtn.active {
  background: linear-gradient(135deg, #ff6f00, #f57c00);
  color: white;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  /* Show the bottom nav on smaller devices */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    background: linear-gradient(135deg, #ffffff, #fff8f0);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    align-items: center;
    justify-content: space-around;
    gap: 6px;
    padding: 6px 8px;
    z-index: 1200;
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.08);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }

  /* Ensure back-to-top floats above the mobile bottom nav */
  .back-to-top {
    z-index: 1300; /* greater than mobile-bottom-nav */
    right: 14px; /* nudge left so it's not exactly at corner when nav visible */
    bottom: 80px; /* sit above the nav (nav height 56 + padding) */
  }

  /* Make space for the fixed nav so content doesn't get hidden underneath */
  body {
    padding-bottom: 72px; /* slightly larger than nav to provide breathing room */
  }

  /* Hide the header sticky space if the compact bottom nav is present and small screens */
  header {
    padding-bottom: 8px;
  }

  /* Prevent the leaders tab buttons from being pushed into extra height: limit their margin-bottom when bottom nav exists */
  .leader-tab-buttons {
    margin-bottom: 6px;
  }

  /* Leader cards responsive adjustments */
  .leaders-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }

  .leader-card {
    padding: 1.5rem;
  }

  .leader-photo {
    width: 120px;
    height: 120px;
  }
}

/* Flashing Notice Board */
.notice-board {
  background: #d32f2f;
  color: white;
  padding: 1rem 2rem;
  overflow: hidden;
  position: relative;
  animation: flash 1.5s infinite;
}

@keyframes flash {
  0%,
  100% {
    background: #d32f2f;
  }
  50% {
    background: #f44336;
  }
}

.notice-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.notice-icon {
  font-size: 1.5rem;
  animation: bell 1s infinite;
}

@keyframes bell {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(15deg);
  }
  75% {
    transform: rotate(-15deg);
  }
}

/* Hero Slider */
.hero-slider {
  position: relative;
  height: 500px;
  overflow: hidden;
}

.slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  background-size: cover;
  background-position: center;
}

.slide.active {
  opacity: 1;
}

.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(255, 111, 0, 0.8) 0%,
    rgba(245, 124, 0, 0.6) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
  text-align: center;
  padding: 2rem;
}

.slide-overlay h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.slide-overlay p {
  font-size: 1.5rem;
  max-width: 600px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.slider-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s;
}

.dot.active {
  background: white;
  transform: scale(1.3);
}

/* Main Container */
.container {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}

/* Home Grid Layout */
.home-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
  position: relative;
  z-index: 1;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Sidebar Widgets */
.sidebar-widget {
  background: white;
  border-radius: 15px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: slideInRight 0.6s ease-out;
  position: relative;
  z-index: 1;
}

.sidebar-widget h3 {
  color: #ff6f00;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  border-bottom: 2px solid #ffe0b2;
  padding-bottom: 0.5rem;
}

.urgent-notice-widget {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  border-left: 5px solid #ff6f00;
}

.notice-item {
  padding: 1rem;
  margin-bottom: 1rem;
  background: white;
  border-radius: 8px;
  border-left: 3px solid #ff6f00;
}

.notice-item h4 {
  color: #ff6f00;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.notice-item p {
  font-size: 0.9rem;
  color: #666;
}

.notice-date {
  font-size: 0.8rem;
  color: #999;
  margin-top: 0.5rem;
}

/* Blog Posts Widget */
.blog-post-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ffe0b2;
}

.blog-post-item:last-child {
  border-bottom: none;
}

.blog-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.blog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-info h4 {
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.blog-info p {
  font-size: 0.8rem;
  color: #999;
}

/* YouTube Widget */
.youtube-widget-item {
  margin-bottom: 1.5rem;
}

.youtube-widget-item:last-child {
  margin-bottom: 0;
}

.video-wrapper-small {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.video-wrapper-small iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-title-small {
  font-size: 0.9rem;
  color: #333;
  font-weight: 600;
}

/* Pages */
.page {
  display: none;
  position: relative;
  z-index: 1;
}

.page.active {
  display: block;
  animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Social Feed */
.feed-post {
  background: white;
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
  animation: slideInLeft 0.6s ease-out;
}

.feed-post:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #ffe0b2;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author-avatar {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #ff6f00, #f57c00);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.post-content h3 {
  color: #ff6f00;
  margin-bottom: 0.5rem;
}

.post-media {
  margin: 1rem 0;
  border-radius: 10px;
  overflow: hidden;
}

.post-media img,
.post-media video {
  width: 100%;
  display: block;
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.about-card {
  background: white
    url("https://images.unsplash.com/photo-1464207687429-7505649dae38?w=800")
    center/cover;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  animation: fadeInScale 0.6s ease-out;
  animation-fill-mode: both;
}

.about-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  z-index: 1;
}

.about-card > * {
  position: relative;
  z-index: 2;
}

.about-card h3 {
  color: #ff6f00;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.about-card:nth-child(1) {
  animation-delay: 0.1s;
}
.about-card:nth-child(2) {
  animation-delay: 0.2s;
}
.about-card:nth-child(3) {
  animation-delay: 0.3s;
}
.about-card:nth-child(4) {
  animation-delay: 0.4s;
}
.about-card:nth-child(5) {
  animation-delay: 0.5s;
}
.about-card:nth-child(6) {
  animation-delay: 0.6s;
}

/* Clickable card styles */
.clickable-card {
  cursor: pointer;
  transition: all 0.3s ease;
}

.clickable-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 16px rgba(255, 111, 0, 0.3);
}

.clickable-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #ff6f00, #f57c00);
  z-index: 3;
}

.card-link-indicator {
  position: relative;
  z-index: 2;
  margin-top: 1rem;
  color: #ff6f00;
  font-weight: 700;
  font-size: 1rem;
  text-align: right;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.clickable-card:hover .card-link-indicator {
  opacity: 1;
}

@media (max-width: 480px) {
  .card-link-indicator {
    font-size: 0.9rem;
  }
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-item {
  position: relative;
  /* default: taller tiles for photos (approx 4:3-ish) */
  padding-bottom: 75%;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: fadeInScale 0.5s ease-out;
  animation-fill-mode: both;
}

/* Videos should appear as 16:9 rectangles; when gallery is the videos tab, reduce padding */
.gallery-grid.gallery-videos .gallery-item {
  padding-bottom: 0px !important; /* 16:9 ratio */
}

/* In case an individual item is marked video-item, support that too */
.gallery-item.video-item {
  padding-bottom: 0px !important;
}

.gallery-item img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
  cursor: zoom-in;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* Leaders */
.leaders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.leader-card {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
  animation: rotateIn 0.6s ease-out;
  animation-fill-mode: both;
}

.leader-card:hover {
  transform: translateY(-10px);
}

.leader-photo {
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, #ff6f00, #f57c00);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.leader-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.leader-card h3 {
  color: #ff6f00;
  margin-bottom: 0.5rem;
}

.leader-card p {
  color: #666;
  margin-bottom: 0.3rem;
}

/* Contact Form */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.contact-info {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: fadeInScale 0.6s ease-out;
  animation-delay: 0.1s;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #fff8e1;
  border-radius: 10px;
}

.info-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #ff6f00, #f57c00);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.contact-form {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: fadeInScale 0.6s ease-out;
  animation-delay: 0.3s;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #ff6f00;
  font-weight: bold;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid #ffe0b2;
  border-radius: 8px;
  font-size: 1rem;
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.submit-btn {
  background: linear-gradient(135deg, #ff6f00, #f57c00);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  width: 100%;
  transition: transform 0.3s;
}

.submit-btn:hover {
  transform: scale(1.05);
}

/* Forms Download */
.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.form-item {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.3s;
  animation: fadeInScale 0.5s ease-out;
  animation-fill-mode: both;
}

.form-item:hover {
  transform: translateY(-5px);
}

.form-icon {
  font-size: 3rem;
  color: #ff6f00;
  margin-bottom: 1rem;
}

.download-btn {
  background: linear-gradient(135deg, #ff6f00, #f57c00);
  color: white;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  margin-top: 1rem;
}

/* Footer */
footer {
  background: linear-gradient(135deg, #ff6f00 0%, #f57c00 100%);
  color: white;
  padding: 2rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.social-icons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-icon {
  width: 40px;
  height: 40px;
  background: white;
  color: #ff6f00;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.3s;
}

.social-icon:hover {
  transform: scale(1.2);
}

.page-header {
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 15px;
  margin-bottom: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.6s ease-out;
  position: relative;
  z-index: 1;
}

.page-header h2 {
  color: #ff6f00;
  font-size: 2rem;
  margin-bottom: 0.3rem;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #ff6f00, #f57c00);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(255, 111, 0, 0.4);
  transition: all 0.3s;
  z-index: 999;
  animation: bounce 2s infinite;
}

.back-to-top.show {
  display: flex;
}

.back-to-top:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 111, 0, 0.6);
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Enhanced Animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-180deg) scale(0);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.activities-list {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Additional spacing for activity cards when rendered in the activities page */
#activitiesPage .activity-card {
  margin-bottom: 1.6rem; /* space between activity cards */
  padding-bottom: 0.8rem; /* small padding inside card to give breathing room */
}

@media (max-width: 640px) {
  #activitiesPage .activity-card {
    margin-bottom: 1.2rem;
    padding: 0.9rem 0.9rem;
  }
}

/* Activity media layout: on small screens place media below content and allow thumbnails to wrap */
.activity-card {
  overflow: visible;
}
.activity-card .activity-media-col {
  flex: 0 0 160px;
}
.activity-card .activity-content {
  flex: 1;
}

@media (max-width: 640px) {
  /* Stack media below content on mobile to avoid long text pushing thumbnails awkwardly */
  .activity-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .activity-card .activity-media-col {
    order: 2;
    width: 100%;
    flex: none;
  }
  .activity-card .activity-content {
    order: 1;
  }
  /* Thumbnails should wrap into multiple per row on small screens */
  .activity-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
  }
  .activity-thumbs img.activity-media-thumb {
    width: calc(50% - 8px);
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
  }
}

@media (min-width: 641px) {
  .activity-thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .activity-thumbs img.activity-media-thumb {
    width: 72px;
    height: 56px;
  }
}

.activity-card {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-left: 5px solid #ff6f00;
  animation: slideInLeft 0.6s ease-out;
  animation-fill-mode: both;
}

.activity-card:nth-child(even) {
  animation-name: slideInRight;
}

.activity-card h3 {
  color: #ff6f00;
  margin-bottom: 1rem;
}

.activity-status {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.status-ongoing {
  background: #4caf50;
  color: white;
}

.status-completed {
  background: #2196f3;
  color: white;
}

.status-upcoming {
  background: #ffc107;
  color: #333;
}

.map-container {
  margin-top: 2rem;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 992px) {
  .home-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: -1;
  }
}

@media (max-width: 768px) {
  /* Base font sizes for mobile */
  body {
    font-size: 1rem;
    line-height: 1.6;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  p,
  li,
  span {
    font-size: 1rem;
  }

  .header-top {
    flex-direction: column;
    padding: 0.5rem 1rem;
  }

  .title h1 {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 0.2rem;
  }

  .title p {
    font-size: 0.85rem;
    text-align: center;
  }

  .logo-section {
    width: 100%;
    justify-content: center;
    padding-right: 60px; /* space for menu toggle */
  }

  .political-leaders {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
  }

  .leader-photo-small {
    width: 45px;
    height: 45px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.8rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .about-card {
    padding: 1.5rem;
  }

  .about-card h3 {
    font-size: 1.3rem;
  }

  .about-card p {
    font-size: 1rem;
    line-height: 1.6;
  }

  .activities-list {
    gap: 1.5rem;
  }

  .activity-card {
    padding: 1.5rem;
  }

  .activity-card h3 {
    font-size: 1.2rem;
  }

  .activity-card p {
    font-size: 0.95rem;
  }

  .hero-slider {
    height: 300px;
  }

  .slide-overlay h2 {
    font-size: 1.5rem;
  }

  .slide-overlay p {
    font-size: 1rem;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }

  /* Position menu toggle to top-right corner on mobile */
  .menu-toggle {
    display: block;
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 1100;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    background: white;
    color: #ff6f00;
  }

  /* Keep header positioned (sticky) so toggle anchors correctly without losing stickiness */
  header {
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  /* Main content padding adjustment */
  .container {
    padding: 1rem;
  }

  .main-content {
    padding: 1rem;
  }

  .sidebar {
    padding: 1rem;
  }

  /* Card padding and font adjustments */
  .card,
  .info-card,
  .post-card {
    padding: 1.2rem;
    font-size: 1rem;
  }

  /* Page header adjustments */
  .page-header {
    padding: 1.2rem 1.5rem;
    margin-bottom: 0.8rem;
  }

  .page-header h2 {
    font-size: 1.5rem;
  }

  .page-header p {
    font-size: 1rem;
  }

  /* Modal content responsive */
  .modal-content {
    width: 95%;
    max-width: 100%;
    padding: 1rem;
    margin: 1rem;
  }

  .modal-caption {
    font-size: 0.9rem;
  }
}

/* Government Schemes specific styles */
.schemes-grid {
  margin-top: 2rem;
}

.scheme-meta {
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
  margin-top: 0.5rem;
}

.view-link {
  color: #ff6f00;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-bottom-color 0.3s;
}

.view-link:hover {
  border-bottom-color: #ff6f00;
}

.no-link {
  color: #999;
  font-style: italic;
}

/* Loading state for schemes */
.schemes-loading {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.schemes-error {
  background: #ffe6e6;
  border: 1px solid #ffb3b3;
  color: #d63031;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

/* Very small screens (mobile phones in portrait) */
@media (max-width: 480px) {
  /* Base typography for small screens */
  body {
    font-size: 0.95rem;
  }

  h1 {
    font-size: 1.3rem;
  }

  h2 {
    font-size: 1.15rem;
  }

  h3 {
    font-size: 1.05rem;
  }

  .title h1 {
    font-size: 1rem;
    line-height: 1.3;
  }

  .title p {
    font-size: 0.75rem;
  }

  .logo {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .political-leaders {
    gap: 0.3rem;
  }

  .leader-photo-small {
    width: 40px;
    height: 40px;
  }

  .leaders-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .leader-card {
    padding: 1rem;
  }

  .leader-photo {
    width: 100px;
    height: 100px;
  }

  .leader-card h3 {
    font-size: 1.1rem;
  }

  .leader-card p {
    font-size: 0.9rem;
  }

  .about-card {
    padding: 1.2rem;
  }

  .about-card h3 {
    font-size: 1.15rem;
  }

  .about-card p {
    font-size: 0.95rem;
  }

  .activity-card {
    padding: 1.2rem;
  }

  .activity-card h3 {
    font-size: 1.1rem;
  }

  .activity-card p {
    font-size: 0.9rem;
  }

  .activity-status {
    font-size: 0.85rem;
    padding: 0.3rem 0.8rem;
  }

  /* Gallery adjustments */
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
  }

  /* Navigation adjustments */
  nav ul li {
    padding: 0.8rem 1rem;
  }

  nav ul li a {
    font-size: 1rem;
  }

  /* Card and content padding */
  .card,
  .info-card {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  /* Page header */
  .page-header {
    padding: 1rem;
    margin-bottom: 0.5rem;
  }

  .page-header h2 {
    font-size: 1.3rem;
    margin-bottom: 0.2rem;
  }

  .page-header p {
    font-size: 0.9rem;
  }

  /* Hero slider */
  .hero-slider {
    height: 250px;
  }

  .slide-overlay h2 {
    font-size: 1.3rem;
  }

  .slide-overlay p {
    font-size: 0.9rem;
  }

  /* Button sizes */
  button,
  .btn {
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
  }

  /* Modal adjustments */
  .modal-content {
    padding: 0.8rem;
    margin: 0.5rem;
  }

  .close-modal {
    font-size: 22px;
    top: 8px;
    right: 8px;
  }
}

/* Temporary debugging: always show mobile nav for testing */
/*
.mobile-bottom-nav {
  display: flex !important;
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  background: linear-gradient(135deg, #ffffff, #fff8f0);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  align-items: center;
  justify-content: space-around;
  gap: 6px;
  padding: 6px 8px;
  z-index: 1200;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.08);
}
*/
