/* ===== STICKY FOOTER LAYOUT ===== */

/* Flexbox layout to push footer to bottom */
body.flex-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

main.flex-main {
  flex: 1;
}

.article-detail-content {
  text-align: left;
  width: 100%;
  padding-left: 0;
}
.article-detail-figure {
  max-width: 600px;
  margin: 0 !important;
  padding: 0 !important;
  display: block;
  text-align: left;
  align-self: stretch;
}
.article-detail-image {
  display: block;
  width: 100%;
  border-radius: 4px;
  margin: 0 !important;
}

/* Strong override for Bulma's .content figure centering */
.content .article-detail-figure {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Add space below the image so the description is visually separated */
.article-detail-figure {
  margin-bottom: 0.5rem !important;
}
.article-detail-content {
  text-align: left;
}
.article-detail-figure {
  max-width: 600px;
  margin: 0;
  display: block;
  text-align: left;
}
.article-detail-image {
  display: block;
  width: 100%;
  border-radius: 4px;
  margin: 0;
}
/* Article Detail Content Flex Alignment */
.article-detail-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
/* Article Card Styles */
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-content .media {
  flex: 1;
}

.card-content .level {
  margin-top: auto;
}

.article-card-image {
  object-fit: cover;
  object-position: center;
  width: 100%;
  height: 100%;
  display: block;
}

.article-meta {
  font-size: 0.875rem;
  color: #7a7a7a;
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-weight: 500;
}

/* ===== FOOTER STYLES ===== */

.footer-custom {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #ecf0f1;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.footer-top {
  padding: 60px 20px 40px;
  border-bottom: 1px solid rgba(236, 240, 241, 0.1);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Brand Section */
.footer-brand {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.footer-logo h3 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 15px 0;
  background: linear-gradient(135deg, #3498db 0%, #2ecc71 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.footer-description {
  font-size: 14px;
  line-height: 1.6;
  color: #bdc3c7;
  margin-bottom: 20px;
}

.footer-social {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(52, 152, 219, 0.2);
  border-radius: 50%;
  color: #3498db;
  transition: all 0.3s ease;
  text-decoration: none;
}

.social-icon:hover {
  background: #3498db;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

/* Footer Sections */
.footer-section {
  display: flex;
  flex-direction: column;
}

.footer-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 20px 0;
  color: #3498db;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  padding-bottom: 10px;
}

.footer-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, #3498db 0%, #2ecc71 100%);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: #bdc3c7;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
  display: inline-block;
  position: relative;
}

.footer-links a::before {
  content: '→';
  position: absolute;
  left: -20px;
  opacity: 0;
  transition: all 0.3s ease;
  color: #2ecc71;
}

.footer-links a:hover {
  color: #3498db;
  padding-left: 20px;
}

.footer-links a:hover::before {
  opacity: 1;
  left: -15px;
}

/* Newsletter Section */
.footer-newsletter {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.footer-newsletter p {
  font-size: 14px;
  color: #bdc3c7;
  margin-bottom: 15px;
  line-height: 1.5;
}

.footer-form {
  margin-top: 10px;
}

.footer-input-group {
  display: flex;
  background: rgba(52, 152, 219, 0.1);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(52, 152, 219, 0.3);
  transition: all 0.3s ease;
}

.footer-input-group:focus-within {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.footer-input-group input {
  flex: 1;
  padding: 12px 15px;
  background: transparent;
  border: none;
  color: #ecf0f1;
  font-size: 14px;
  outline: none;
}

.footer-input-group input::placeholder {
  color: #95a5a6;
}

.footer-input-group button {
  padding: 12px 20px;
  background: #3498db;
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-input-group button:hover {
  transform: translateX(2px);
  box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
}

/* Footer Bottom */
.footer-bottom {
  background: rgba(0, 0, 0, 0.2);
  padding: 25px 20px;
  border-top: 1px solid rgba(236, 240, 241, 0.1);
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-bottom-content p {
  font-size: 13px;
  color: #95a5a6;
  margin: 0;
}

.footer-bottom-links {
  display: flex;
  gap: 25px;
}

.footer-bottom-links a {
  font-size: 13px;
  color: #95a5a6;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-bottom-links a:hover {
  color: #3498db;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .footer-top {
    padding: 40px 20px 30px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-bottom-content {
    justify-content: center;
    text-align: center;
  }

  .footer-bottom-links {
    justify-content: center;
  }
}

/* Article Detail Styles */
.article-detail-figure {
  max-width: 600px;
  margin: 1.5rem 0; /* match Bulma's .mb-4 spacing above image */
  display: block;
}

.article-detail-image {
  display: block;
  width: 100%;
  border-radius: 4px;
}

/* Ensure the figure directly following the meta paragraph (.mb-4) has equal
   top and bottom spacing to match the paragraph above. This targets the
   common structure: <p class="mb-4">...</p><figure class="article-detail-figure"> */
.content p.mb-4 + figure.article-detail-figure {
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

/* ===== INFINITE SCROLL ANIMATION ===== */

/* Subtle fade and slide in animation for newly loaded articles */
@keyframes fadeInSlide {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Apply animation to article cards when they load */
.column.article-fade-in {
  will-change: transform, opacity;
  animation: fadeInSlide 0.5s ease-out forwards;
}

/* Smooth container transitions during filtering */
#articles-container {
  transition: opacity 0.2s ease-out;
}

/* Loading indicator styles */
.loading-indicator {
  display: none;
  text-align: center;
  padding: 2rem;
}

.loading-indicator.active {
  display: block;
}

/* ===== CATEGORY FILTERS ===== */

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.filter-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #f0f0f0;
  color: #333;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  white-space: nowrap;
}

.filter-btn:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
  background: #3498db;
  color: white;
  box-shadow: 0 2px 6px rgba(52, 152, 219, 0.2);
}

.filter-btn-reset {
  background: #e0e0e0;
  color: #333;
  font-weight: 600;
}

.filter-btn-reset:hover {
  background: #d0d0d0;
}

.filter-btn-reset.active {
  background: #2c3e50;
  color: white;
}

/* Category-specific active colors */
.filter-btn[data-category-index="1"].active {
  background: #1a5f8c;
  color: white;
  box-shadow: 0 2px 6px rgba(26, 95, 140, 0.3);
}

.filter-btn[data-category-index="2"].active {
  background: #d67c3b;
  color: white;
  box-shadow: 0 2px 6px rgba(214, 124, 59, 0.3);
}

.filter-btn[data-category-index="3"].active {
  background: #6b9bd1;
  color: white;
  box-shadow: 0 2px 6px rgba(107, 155, 209, 0.3);
}

.filter-btn[data-category-index="4"].active {
  background: #c44536;
  color: white;
  box-shadow: 0 2px 6px rgba(196, 69, 54, 0.3);
}

.filter-btn[data-category-index="5"].active {
  background: #2ecc71;
  color: white;
  box-shadow: 0 2px 6px rgba(46, 204, 113, 0.3);
}

.filter-btn[data-category-index="6"].active {
  background: #9b59b6;
  color: white;
  box-shadow: 0 2px 6px rgba(155, 89, 182, 0.3);
}

.filter-btn[data-category-index="7"].active {
  background: #f39c12;
  color: white;
  box-shadow: 0 2px 6px rgba(243, 156, 18, 0.3);
}

.filter-btn[data-category-index="8"].active {
  background: #1abc9c;
  color: white;
  box-shadow: 0 2px 6px rgba(26, 188, 156, 0.3);
}

.filter-btn[data-category-index="9"].active {
  background: #3498db;
  color: white;
  box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

@media (max-width: 768px) {
  .category-filters {
    gap: 8px;
  }

  .filter-btn {
    padding: 8px 14px;
    font-size: 13px;
  }
}

/* ===== COMMENT STYLES ===== */

.comment-image {
  max-width: 100%;
  max-height: 400px;
  height: auto;
  border-radius: 8px;
  margin-top: 1rem;
  display: block;
}

/* ===== BUTTON STYLES ===== */

/* Override Bulma's primary button color to match footer dark blue theme */
.button.is-primary {
  background-color: #1a5f8c;
  color: white;
  border: none;
  transition: all 0.3s ease;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem;
}

.button.is-primary .icon {
  display: none !important;
}

.button.is-primary:hover {
  background-color: #0d3a57;
  box-shadow: 0 4px 12px rgba(26, 95, 140, 0.3);
}

.button.is-primary:active {
  background-color: #0a2d45;
}

/* Logout form styling */
.logout-form {
  margin: 0;
}

/* Increase spacing for load more button */
.has-text-centered.mt-8 {
  margin-top: 4rem !important;
}

/* ===== ADMIN ARTICLE CARD CONTROLS ===== */

.article-admin-form {
  padding: 1rem;
  background-color: #f5f5f5;
  border-top: 1px solid #ddd;
}

.article-admin-form-group {
  margin-bottom: 0.5rem;
}

.article-admin-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-admin-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.article-admin-button {
  padding: 0.5rem 1rem;
  background-color: #1a5f8c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* ===== CONTACT FORM STYLES ===== */

.contact-form-container {
  max-width: 600px;
  margin: 0 auto;
}

.contact-form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  font-size: 1rem;
}

.contact-form-input:focus {
  border-color: #3273dc;
  box-shadow: 0 0 0 0.125em rgba(50, 115, 220, 0.25);
  outline: none;
}

/* ===== CONTACT SUCCESS STYLES ===== */

.contact-success-container {
  max-width: 600px;
  margin: 2rem auto;
  text-align: center;
}

.contact-success-checkmark {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.contact-success-message {
  margin-bottom: 2rem;
}

/* Archive page container */
.container-archive {
  max-width: 700px;
  margin: 0 auto;
}

.container-archive .content {
  display: flex;
  justify-content: center;
  padding: 0;
}

.container-archive .content ul {
  list-style-type: disc;
  text-align: left;
  padding-left: 1.5rem;
  margin: 0;
}
