/* Unified Newsletter List Template Styles */

/* Base foundations matching the detail template */
:root {
  --size-step--1: clamp(0.80rem, calc(0.78rem + 0.08vw), 0.84rem);
  --size-step-0: clamp(1rem, calc(0.96rem + 0.22vw), 1.13rem);
  --size-step-1: clamp(1.25rem, calc(1.16rem + 0.43vw), 1.5rem);
  --size-step-2: clamp(1.56rem, calc(1.41rem + 0.76vw), 2rem);
  --size-step-3: clamp(1.95rem, calc(1.71rem + 1.24vw), 2.66rem);
  --size-step-4: clamp(2.44rem, calc(2.05rem + 1.93vw), 3.55rem);
}

html {
  font-size: 16px;
}

body {
  background: white;
  color: black;
  font-family: 'body-font', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5rem;
  font-kerning: normal;
  -moz-font-feature-settings: "kern", "liga", "clig", "calt";
  font-feature-settings: "kern", "liga", "clig", "calt";
}

.newsletter-list-page {
  background: white;
}

/* Site loader consistent with detail template */
.site-loader {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: white;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.no-scroll {
  overflow: hidden;
}

/* Header styles matching detail template */
.newsletter-header {
  background: white;
  border-bottom: 1px solid #e9ecef;
  position: relative;
}

.main-header {
  padding: 15px 0;
}

.main-header.mobile {
  display: none;
}

.main-header h1 {
  font-family: 'heading-font', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: rgb(var(--heading-font-color));
  margin: 0;
  font-size: var(--size-step-3);
  font-weight: 600;
}

.main-logo img,
.mobile-logo-wrap img {
  max-height: 60px;
  width: auto;
}

.social-icons ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

.social-icons a {
  color: rgb(var(--primary-colour));
  font-size: 20px;
  transition: color 0.3s ease;
}

.social-icons a:hover {
  color: rgb(var(--secondary-colour));
}

.sub-header {
  background: rgb(var(--subheading-background));
  color: rgb(var(--subheading-font-color));
  padding: 12px 20px;
}

.sub-header ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 20px;
}

.sub-header .left-block ul {
  justify-content: flex-start;
}

.sub-header .right-block ul {
  justify-content: flex-end;
}

.sub-header #google_translate_element .goog-te-gadget {
  font-size: 0;
  height: 44px;
}

.sub-header #google_translate_element .goog-te-gadget .goog-te-combo {
  font-family: 'body-font', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  font-size: 0.875rem;
  border-radius: 0;
  padding: .565rem 1rem;
  background: var(--subheading-background);
  color: white;
  appearance: none;
  border: 1px solid white;
}

.sub-header #google_translate_element .goog-te-gadget span {
  display: none;
}

.sub-header .select-box {
  position: relative;
}

.sub-header .select-box:after {
  font-family: "Font Awesome 6 Free";
  content: "\f107";
  float: right;
  color: white;
  position: absolute;
  font-weight: 600;
  right: 12px;
  top: 10px;
}

.newsletter-title {
  font-weight: 500;
  font-size: var(--size-step-0);
}

.btn-outline {
  border: 1px solid white;
  color: white;
  text-decoration: none;
  border-radius: 0;
  font-size: 14px;
  transition: all 0.3s ease;
  padding: 0.76rem 1rem;
}

.btn-outline:hover {
  background: rgb(var(--primary-colour));
  color: white;
}

/* Main content styles */
.main-content.newsletter-list {
  padding: 60px 0;
  min-height: 60vh;
}

.newsletter-archive-content {
  margin: 0 auto;
}

.archive-intro {
  margin-bottom: 50px;
}

.archive-intro h2 {
  font-family: 'heading-font', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: rgb(var(--heading-font-color));
  font-size: var(--size-step-4);
  font-weight: 600;
  margin-bottom: 20px;
}

.archive-intro .lead {
  font-size: var(--size-step-1);
  color: #6c757d;
  line-height: 1.6;
}

/* Newsletter sections */
.newsletter-section {
  margin-bottom: 40px;
}

.section-title {
  font-family: 'heading-font', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: var(--size-step-2);
  font-weight: 600;
  color: rgb(var(--primary-colour));
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgb(var(--neutral-colour));
}

/* Newsletter cards */
.newsletter-card {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.newsletter-card:hover,
.newsletter-card.card-hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.newsletter-card .card-body {
  padding: 20px;
  min-height: 80px;
}

/* Latest edition cards - dark theme */
.latest-edition-card {
  background: rgb(var(--primary-colour));
  border: none;
  color: white;
}

.latest-edition-card .card-title,
.latest-edition-card .card-subtitle,
.latest-edition-card .card-subtitle small {
  color: white;
}

.latest-edition-card .card-icon {
  color: rgba(255, 255, 255, 0.9);
}

.latest-edition-card .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.latest-edition-card .btn-outline-light:hover {
  background: white;
  color: rgb(var(--primary-colour));
  border-color: white;
}

/* Earlier edition cards - light theme */
.earlier-edition-card {
  background: linear-gradient(135deg, rgb(var(--neutral-colour)), #e6eaf0);
  border: 1px solid rgba(var(--neutral-colour), 0.3);
  color: rgb(var(--primary-colour));
}

.earlier-edition-card .card-title {
  color: rgb(var(--primary-colour));
}

.earlier-edition-card .card-subtitle,
.earlier-edition-card .card-subtitle small {
  color: rgba(var(--primary-colour), 0.7);
}

.earlier-edition-card .card-icon {
  color: rgba(var(--primary-colour), 0.6);
}

.earlier-edition-card .btn-outline-primary {
  border-color: rgb(var(--primary-colour));
  color: rgb(var(--primary-colour));
  background: rgba(var(--primary-colour), 0.05);
}

.earlier-edition-card .btn-outline-primary:hover {
  background: rgb(var(--primary-colour));
  color: white;
  border-color: rgb(var(--primary-colour));
}

/* Card components */
.card-icon {
  width: 50px;
  text-align: center;
  margin-right: 20px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-content {
  flex: 1;
  min-width: 0; /* Prevents flex item from overflowing */
}

.card-title {
  font-size: var(--size-step-1);
  font-weight: 600;
  margin-bottom: 5px;
  word-wrap: break-word;
}

.card-subtitle {
  font-size: var(--size-step--1);
  opacity: 0.8;
  margin: 0;
}

.card-action {
  margin-left: 20px;
  flex-shrink: 0;
}

/* Empty state */
.text-center .fa-newspaper {
  opacity: 0.3;
}

/* Footer styles matching detail template */
.footer {
  background: rgb(var(--neutral-colour));
  color: rgb(var(--primary-colour));
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-logo img {
  max-height: 80px;
  width: auto;
}

.footer h4 {
  font-family: 'heading-font', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: rgb(var(--primary-colour));
  font-size: var(--size-step-1);
  font-weight: 600;
  margin-bottom: 10px;
}

.footer p {
  margin-bottom: 8px;
  font-size: var(--size-step--1);
}

.footer a {
  color: rgb(var(--primary-colour));
  text-decoration: none;
}

.footer a:hover {
  color: rgb(var(--secondary-colour));
  text-decoration: underline;
}

.social-block ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.social-block a {
  display: inline-block;
  width: 40px;
  height: 40px;
  background: rgba(var(--primary-colour), 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(var(--primary-colour));
  font-size: 16px;
  transition: all 0.3s ease;
}

.social-block a:hover {
  background: rgb(var(--primary-colour));
  color: white;
  transform: translateY(-2px);
}

.footer-bottom {
  border-top: 1px solid rgba(var(--primary-colour), 0.1);
  margin-top: 30px;
  padding-top: 20px;
}

.footer-bottom p {
  font-size: 12px;
  opacity: 0.8;
  margin: 0;
}

/* Responsive design */
@media (max-width: 768px) {
  .main-header.desktop {
    display: none;
  }

  .main-header.mobile {
    display: block;
  }

  .main-header.mobile h1 {
    font-size: var(--size-step-2);
    margin-top: 10px;
    text-align: center;
  }

  .sub-header .left-block,
  .sub-header .right-block {
    text-align: center;
  }

  .sub-header .row > div {
    margin-bottom: 10px;
  }

  .main-content.newsletter-list {
    padding: 40px 0;
  }

  .archive-intro {
    margin-bottom: 40px;
  }

  .archive-intro h2 {
    font-size: var(--size-step-3);
  }

  .archive-intro .lead {
    font-size: var(--size-step-0);
  }

  .newsletter-card .card-body {
    padding: 16px;
    flex-direction: column;
    text-align: center;
  }

  .card-icon {
    margin-right: 0;
    margin-bottom: 15px;
    font-size: 30px;
  }

  .card-content {
    margin-bottom: 15px;
  }

  .card-action {
    margin-left: 0;
  }

  .section-title {
    font-size: var(--size-step-1);
  }
}

@media (max-width: 576px) {
  .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
  }

  .archive-intro h2 {
    font-size: var(--size-step-2);
  }

  .card-title {
    font-size: var(--size-step-0);
  }

  .newsletter-section {
    margin-bottom: 30px;
  }
}

/* Print styles */
@media print {
  .site-loader,
  .social-icons,
  .btn-outline,
  .card-action {
    display: none !important;
  }

  .newsletter-card {
    break-inside: avoid;
    border: 1px solid #000 !important;
    margin-bottom: 10px;
  }

  .latest-edition-card,
  .earlier-edition-card {
    background: white !important;
    color: black !important;
  }
}

/* Animation utilities */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.newsletter-card {
  animation: fadeInUp 0.5s ease-out;
}

.newsletter-card:nth-child(even) {
  animation-delay: 0.1s;
}

/* Focus styles for accessibility */
.newsletter-card:focus,
.btn:focus,
.social-icons a:focus,
.footer a:focus {
  outline: 2px solid rgb(var(--secondary-colour));
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .newsletter-card {
    border-width: 2px;
  }

  .latest-edition-card {
    background: rgb(var(--primary-colour)) !important;
  }

  .earlier-edition-card {
    background: white !important;
    border-color: rgb(var(--primary-colour)) !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .newsletter-card,
  .btn,
  .social-icons a,
  .social-block a {
    transition: none;
    animation: none;
  }

  .newsletter-card:hover,
  .newsletter-card.card-hover {
    transform: none;
  }
}
