/* =====================================================
   NEWSLETTER CARDS & ARCHIVE
   ===================================================== */

.newsletter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

/* Individual Newsletter Card */
.newsletter-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

.newsletter-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-left: 3px solid var(--color-accent);
}

.newsletter-card__cover {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  position: relative;
  flex-shrink: 0;
  max-height: 260px;
}

.newsletter-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.newsletter-card:hover .newsletter-card__cover img {
  transform: scale(1.05);
}

.newsletter-card__cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-8);
  text-align: center;
}

.newsletter-card__cover-placeholder .pdf-icon {
  display: block;
  width: 52px;
  height: 52px;
  opacity: 0.75;
  background-color: var(--color-white);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3Cpolyline points='10 9 9 9 8 9'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3Cpolyline points='10 9 9 9 8 9'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  font-size: 0; /* suppress any text/emoji content */
}

.newsletter-card__cover-placeholder .edition-text {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--color-white);
  font-weight: 600;
  line-height: 1.3;
}

/* PDF badge */
.newsletter-card__badge {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  background: var(--color-accent);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* Body */
.newsletter-card__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.newsletter-card__edition {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.newsletter-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

.newsletter-card__description {
  font-size: var(--text-sm);
  color: var(--color-grey-700);
  line-height: 1.7;
  flex: 1;
  margin-bottom: var(--space-4);
}

.newsletter-card__date {
  font-size: var(--text-xs);
  color: var(--color-grey-500);
  margin-bottom: var(--space-4);
}

.newsletter-card__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: auto;
}

.newsletter-card .btn {
  flex: 1;
  justify-content: center;
  font-size: var(--text-xs);
  padding: 0.5rem 0.75rem;
}

/* =====================================================
   NEWSLETTER SUBSCRIBE FORM SECTION
   ===================================================== */

.newsletter-subscribe {
  background: var(--color-primary);
  background-image: url('../../images/gallery/factory-aerial.jpg');
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-10);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.newsletter-subscribe::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, rgba(8,30,20,0.88) 0%, rgba(15,43,31,0.78) 50%, rgba(27,67,50,0.65) 100%);
  pointer-events: none;
  z-index: 0;
}

.newsletter-subscribe > * {
  position: relative;
  z-index: 1;
}

.newsletter-subscribe h2 {
  color: var(--color-white);
  margin-bottom: var(--space-3);
}

.newsletter-subscribe p {
  color: rgba(255,255,255,0.80);
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.subscribe-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  max-width: 680px;
  margin-inline: auto;
}

.subscribe-form input,
.subscribe-form select {
  flex: 1;
  min-width: 180px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.12);
  color: var(--color-white);
  font-size: var(--text-sm);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.subscribe-form input::placeholder {
  color: rgba(255,255,255,0.55);
}

.subscribe-form input:focus,
.subscribe-form select:focus {
  outline: none;
  border-color: var(--color-accent);
  background: rgba(255,255,255,0.18);
}

.subscribe-form select {
  color: rgba(255,255,255,0.90);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.7)' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.25rem;
}

.subscribe-form select option {
  color: var(--color-charcoal);
  background: var(--color-white);
}

.subscribe-form .btn {
  flex-shrink: 0;
}

.subscribe-privacy {
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.50);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* =====================================================
   GRID / LIST VIEW TOGGLE
   ===================================================== */

.view-toggle {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-bottom: var(--space-4);
}

.view-toggle__btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-grey-300);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.view-toggle__btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-grey-500);
  fill: none;
  pointer-events: none;
}

.view-toggle__btn.is-active,
.view-toggle__btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.view-toggle__btn.is-active svg,
.view-toggle__btn:hover svg {
  stroke: var(--color-white);
}

/* =====================================================
   LIST VIEW OVERRIDES
   Toggled by JS adding .is-list-view to #newsletter-grid
   ===================================================== */

.newsletter-grid.is-list-view {
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.newsletter-grid.is-list-view .newsletter-card {
  flex-direction: row;
  max-height: 148px;
}

.newsletter-grid.is-list-view .newsletter-card__cover {
  width: 110px;
  min-width: 110px;
  flex-shrink: 0;
  aspect-ratio: auto;
  max-height: none;
}

.newsletter-grid.is-list-view .newsletter-card__body {
  padding: var(--space-4) var(--space-5);
}

.newsletter-grid.is-list-view .newsletter-card__description {
  display: none;
}

/* On mobile, list view reverts to stacked layout */
@media (max-width: 600px) {
  .newsletter-grid.is-list-view .newsletter-card {
    flex-direction: column;
    max-height: none;
  }
  .newsletter-grid.is-list-view .newsletter-card__cover {
    width: 100%;
    min-width: auto;
  }
}

@media (max-width: 1024px) {
  .newsletter-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .newsletter-grid { grid-template-columns: 1fr; }
  .newsletter-subscribe { padding: var(--space-8) var(--space-6); }
  .subscribe-form { flex-direction: column; }
  .subscribe-form input,
  .subscribe-form select { min-width: auto; }
}

/* =====================================================
   FEATURED NEWSLETTER BANNER
   ===================================================== */

.newsletter-featured {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-8);
  align-items: center;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-10);
  border: 1px solid var(--color-cream-dark);
}

.newsletter-featured__content {
  padding: var(--space-10) var(--space-10) var(--space-10) var(--space-10);
}

.newsletter-featured__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: rgba(212,160,23,0.10);
  border: 1px solid rgba(212,160,23,0.30);
  border-radius: var(--radius-full);
  padding: 0.3em 0.9em;
  margin-bottom: var(--space-5);
}

.newsletter-featured__label::before {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  background: var(--color-accent);
  border-radius: 50%;
}

.newsletter-featured__title {
  font-family: var(--font-heading);
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl));
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

.newsletter-featured__summary {
  font-size: var(--text-base);
  color: var(--color-grey-700);
  line-height: 1.7;
  margin-bottom: var(--space-6);
  max-width: 520px;
}

.newsletter-featured__image {
  height: 100%;
  min-height: 280px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.newsletter-featured__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.newsletter-featured__image .pdf-cover-graphic {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-8);
  text-align: center;
  color: var(--color-white);
  width: 100%;
  height: 100%;
}

.newsletter-featured__image .pdf-cover-logo {
  width: 48px;
  height: 48px;
  opacity: 0.9;
  background-color: var(--color-accent);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3Cpolyline points='10 9 9 9 8 9'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3Cpolyline points='10 9 9 9 8 9'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.newsletter-featured__image .pdf-cover-edition {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-white);
  line-height: 1.3;
}

@media (max-width: 1024px) {
  .newsletter-featured {
    grid-template-columns: 1fr;
  }
  .newsletter-featured__image {
    min-height: 200px;
    order: -1;
  }
}
