/*
 * Newsletter – Front-end Styles (LTR base)
 * Font: Cairo (Google Fonts)
 * RTL overrides live in frontend-rtl.css (auto-loaded by WordPress in RTL mode).
 */

/* ── Cairo font ────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800;900&display=swap');

/* ── CSS Custom Properties ─────────────────────────────────────────────────── */
.nl-wrapper {
  --nl-teal:       #166164;
  --nl-teal-dark:  #0f4749;
  --nl-teal-mid:   #1d7a7e;
  --nl-teal-light: rgba(22, 97, 100, .08);
  --nl-gold:       #85724d;
  --nl-gold-hover: #70603f;
  --nl-cream:      #f3efe6;
  --nl-white:      #ffffff;
  --nl-text:       #4a4a4a;
  --nl-muted:      #888888;
  --nl-border:     #e0e0e0;

  box-sizing: border-box;
  font-family: 'Cairo', sans-serif;
  color: var(--nl-text);
  unicode-bidi: embed;
}

.nl-wrapper *,
.nl-wrapper *::before,
.nl-wrapper *::after {
  box-sizing: inherit;
  font-family: 'Cairo', sans-serif;
}

/* ── Featured Newsletter ─────────────────────────────────────────────────────── */
.nl-featured-paper {
  background: var(--nl-cream);
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  margin-bottom: 64px;
  box-shadow: 0 8px 40px rgba(22, 97, 100, .10);
  transition: transform .3s, box-shadow .3s;
}
.nl-featured-paper:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 50px rgba(22, 97, 100, .15);
}

/* Thumbnail column */
.nl-fp-thumb {
  position: relative;
  background: linear-gradient(145deg, var(--nl-teal) 0%, var(--nl-teal-mid) 100%);
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.nl-fp-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nl-fp-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent 60%, rgba(243, 239, 230, .15));
  pointer-events: none;
}

/* Featured badge */
.nl-fp-badge {
  position: absolute;
  top: 22px;
  left: 22px;
  right: auto;
  z-index: 2;
  background: var(--nl-gold);
  color: #fff;
  border-radius: 100px;
  padding: 5px 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-family: 'Cairo', sans-serif;
}

/* Featured thumbnail placeholder */
.nl-fp-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: .5;
  z-index: 1;
}
.nl-fp-placeholder svg {
  width: 56px;
  height: 56px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.4;
}
.nl-fp-placeholder span {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

/* Body column */
.nl-fp-body {
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nl-fp-issue {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--nl-muted);
  margin-bottom: 8px;
}

.nl-fp-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--nl-teal);
  line-height: 1.35;
  margin: 0 0 14px;
}

.nl-fp-desc {
  font-size: 14px;
  color: var(--nl-text);
  line-height: 1.85;
  margin: 0 0 28px;
  flex: 1;
}

.nl-fp-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.nl-fp-meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nl-muted);
}
.nl-fp-meta-item svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Featured CTA button */
.nl-btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--nl-teal);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0 28px;
  height: 48px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  text-decoration: none;
  align-self: flex-start;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.nl-btn-pdf:hover,
.nl-btn-pdf:focus-visible {
  background: var(--nl-teal-dark);
  transform: translateY(-1px);
  color: #fff;
  outline: none;
}
.nl-btn-pdf svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ── Category Tabs ──────────────────────────────────────────────────────────── */
.nl-cat-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.nl-cat-tab {
  padding: 7px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  border: 1.5px solid var(--nl-border);
  color: var(--nl-muted);
  background: var(--nl-white);
  cursor: pointer;
  min-height: 36px;
  line-height: 1.4;
  transition: color .2s, background .2s, border-color .2s;
}
.nl-cat-tab:hover,
.nl-cat-tab.active,
.nl-cat-tab:focus-visible {
  color: var(--nl-teal);
  border-color: var(--nl-teal);
  background: var(--nl-teal-light);
  outline: none;
}

/* ── Newsletters Grid ───────────────────────────────────────────────────────── */
.nl-papers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* ── Newsletter Card ────────────────────────────────────────────────────────── */
.nl-paper-card {
  background: var(--nl-white);
  border: 1.5px solid var(--nl-border);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform .28s, box-shadow .28s, border-color .28s;
}
.nl-paper-card:hover,
.nl-paper-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(22, 97, 100, .12);
  border-color: rgba(22, 97, 100, .25);
  outline: none;
}

/* Thumbnail */
.nl-paper-thumb {
  position: relative;
  height: 200px;
  background: linear-gradient(145deg, var(--nl-teal) 0%, var(--nl-teal-mid) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.nl-paper-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Per-card colour variations */
.nl-paper-card:nth-child(2)  .nl-paper-thumb { background: linear-gradient(145deg, #0f4749 0%, #166164 100%); }
.nl-paper-card:nth-child(3)  .nl-paper-thumb { background: linear-gradient(145deg, #2c1f0e 0%, #85724d 100%); }
.nl-paper-card:nth-child(4)  .nl-paper-thumb { background: linear-gradient(145deg, #166164 0%, #1d7a7e 100%); }
.nl-paper-card:nth-child(5)  .nl-paper-thumb { background: linear-gradient(145deg, #4a3820 0%, #85724d 100%); }
.nl-paper-card:nth-child(6)  .nl-paper-thumb { background: linear-gradient(145deg, #0a3739 0%, #166164 100%); }
.nl-paper-card:nth-child(7)  .nl-paper-thumb { background: linear-gradient(145deg, #166164 0%, #0f4749 100%); }
.nl-paper-card:nth-child(8)  .nl-paper-thumb { background: linear-gradient(145deg, #85724d 0%, #4a3820 100%); }
.nl-paper-card:nth-child(9)  .nl-paper-thumb { background: linear-gradient(145deg, #0a3739 0%, #1d7a7e 100%); }
.nl-paper-card:nth-child(10) .nl-paper-thumb { background: linear-gradient(145deg, var(--nl-teal) 0%, var(--nl-teal-mid) 100%); }
.nl-paper-card:nth-child(11) .nl-paper-thumb { background: linear-gradient(145deg, #0f4749 0%, #166164 100%); }
.nl-paper-card:nth-child(12) .nl-paper-thumb { background: linear-gradient(145deg, #2c1f0e 0%, #85724d 100%); }

/* Card thumbnail placeholder */
.nl-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: .45;
}
.nl-card-placeholder svg {
  width: 38px;
  height: 38px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.5;
}
.nl-card-placeholder span {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

/* Issue badge on thumbnail – LTR: top-left */
.nl-issue-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  right: auto;
  z-index: 3;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .30);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  border-radius: 100px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  letter-spacing: .05em;
  white-space: nowrap;
}

/* Card body */
.nl-paper-body {
  padding: 24px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.nl-paper-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--nl-muted);
  margin-bottom: 10px;
}
.nl-paper-date svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.nl-paper-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--nl-teal);
  line-height: 1.45;
  margin-bottom: 10px;
}

.nl-paper-excerpt {
  font-size: 13px;
  color: var(--nl-text);
  line-height: 1.75;
  flex: 1;
  margin-bottom: 20px;
}

.nl-paper-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  border-top: 1px solid var(--nl-border);
  padding-top: 16px;
}

/* "Read Issue" button */
.nl-btn-view {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--nl-teal-light);
  color: var(--nl-teal);
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  height: 34px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.nl-paper-card:hover .nl-btn-view {
  background: var(--nl-teal);
  color: #fff;
}
.nl-btn-view svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Empty state ────────────────────────────────────────────────────────────── */
.nl-no-results {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--nl-muted);
  padding: 48px 0;
  font-size: 15px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .nl-featured-paper { grid-template-columns: 1fr 1fr; }
  .nl-papers-grid    { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (max-width: 860px) {
  .nl-featured-paper { grid-template-columns: 1fr; }
  .nl-fp-thumb       { min-height: 220px; max-height: 280px; }
  .nl-fp-body        { padding: 28px 24px; }
}

@media (max-width: 768px) {
  .nl-papers-grid { grid-template-columns: 1fr; }
  .nl-cat-tabs    { gap: 6px; margin-bottom: 28px; }
  .nl-cat-tab     { font-size: 12px; padding: 6px 14px; }
}

@media (max-width: 600px) {
  .nl-featured-paper { border-radius: 16px; margin-bottom: 40px; }
  .nl-fp-title       { font-size: 20px; }
  .nl-fp-desc        { font-size: 13px; }
  .nl-btn-pdf        { width: 100%; justify-content: center; height: 50px; }
  .nl-paper-card     { border-radius: 16px; }
}

@media (max-width: 400px) {
  .nl-fp-thumb      { min-height: 180px; }
  .nl-fp-meta       { gap: 12px; }
  .nl-fp-meta-item  { font-size: 12px; }
  .nl-cat-tab       { font-size: 11px; padding: 5px 10px; }
}
