/* CLM Newsroom — WordPress Plugin Styles
   Namespaced under .clm-newsroom to avoid theme conflicts.
   ─────────────────────────────────────────────────────── */

/* ── Reset ──────────────────────────────────────────────── */
.clm-newsroom *,
.clm-newsroom *::before,
.clm-newsroom *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.clm-newsroom {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #111827;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 48px;
  line-height: 1.5;
}

/* ── Heading ─────────────────────────────────────────────── */
.clm-newsroom__title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
  padding-bottom: 16px;
  border-bottom: 3px solid #2563eb;
  letter-spacing: -0.02em;
}

/* ── Filter Bar ──────────────────────────────────────────── */
.clm-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.clm-filter-tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  gap: 2px;
}

.clm-tab {
  padding: 7px 18px;
  border: none;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: #64748b;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  font-family: inherit;
}

.clm-tab:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.clm-tab.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  font-weight: 600;
}

.clm-client-select {
  padding: 8px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13.5px;
  color: #374151;
  background: #ffffff;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.clm-client-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.clm-search {
  padding: 8px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13.5px;
  color: #374151;
  background: #ffffff;
  outline: none;
  width: 210px;
  margin-left: auto;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.clm-search:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ── Grid ────────────────────────────────────────────────── */
.clm-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(3, 1fr);
}

.clm-grid--1 { grid-template-columns: 1fr; }
.clm-grid--2 { grid-template-columns: repeat(2, 1fr); }
.clm-grid--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1060px) {
  .clm-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .clm-grid,
  .clm-grid--2,
  .clm-grid--3 { grid-template-columns: 1fr; }
  .clm-filter-bar { gap: 8px; }
  .clm-search { margin-left: 0; width: 100%; }
}

/* ── Card ────────────────────────────────────────────────── */
.clm-card {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.clm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.clm-card[hidden] { display: none; }

/* Card media */
.clm-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}

.clm-card__media--newsfeed {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 45%, #3b82f6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.clm-card__media--editorial {
  background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 45%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.clm-card__media--image {
  background: #f1f5f9;
}

.clm-card__media-icon {
  opacity: 0.35;
  color: #ffffff;
}

.clm-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.clm-card:hover .clm-card__img {
  transform: scale(1.03);
}

/* Type badge */
.clm-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.clm-badge--newsfeed {
  background: rgba(29, 78, 216, 0.88);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.clm-badge--editorial {
  background: rgba(109, 40, 217, 0.88);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Card body */
.clm-card__body {
  padding: 20px 20px 4px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clm-card__meta {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 12px;
  color: #94a3b8;
  flex-wrap: wrap;
}

.clm-card__client {
  font-weight: 600;
  color: #475569;
  font-size: 12px;
}

.clm-card__date {
  font-size: 12px;
  color: #94a3b8;
}

.clm-card__client + .clm-card__date::before {
  content: "·";
  margin: 0 6px;
  color: #cbd5e1;
}

.clm-card__headline {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.4;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.clm-card__excerpt {
  font-size: 13.5px;
  line-height: 1.65;
  color: #64748b;
  flex: 1;
}

.clm-card__companies {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

/* Card footer */
.clm-card__footer {
  padding: 14px 20px 20px;
}

.clm-btn-read {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1.5px solid #2563eb;
  border-radius: 7px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  font-family: inherit;
}

.clm-btn-read:hover {
  background: #2563eb;
  color: #ffffff;
  transform: translateX(2px);
}

/* Tags */
.clm-tag {
  display: inline-block;
  padding: 3px 9px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
}

/* ── Empty state ─────────────────────────────────────────── */
.clm-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 20px;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.clm-empty p {
  font-size: 15px;
}

/* ── Error state ─────────────────────────────────────────── */
.clm-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Modal ───────────────────────────────────────────────── */
.clm-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.clm-modal[hidden] { display: none; }

.clm-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.clm-modal__panel {
  position: relative;
  background: #ffffff;
  border-radius: 18px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: clm-modal-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}

.clm-modal__panel::-webkit-scrollbar { width: 6px; }
.clm-modal__panel::-webkit-scrollbar-track { background: transparent; }
.clm-modal__panel::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }

@keyframes clm-modal-in {
  from { opacity: 0; transform: scale(0.93) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.clm-modal__close {
  position: sticky;
  top: 16px;
  float: right;
  margin: 16px 16px 0 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #475569;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  z-index: 2;
  flex-shrink: 0;
}

.clm-modal__close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.clm-modal__inner {
  padding: 0 32px 40px;
  clear: both;
}

@media (max-width: 600px) {
  .clm-modal__inner { padding: 0 20px 32px; }
}

/* Modal header */
.clm-modal__header {
  margin-bottom: 24px;
}

.clm-modal__header .clm-badge {
  position: static;
  display: inline-block;
  margin-bottom: 14px;
}

.clm-modal__headline {
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 800;
  line-height: 1.3;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.clm-modal__meta {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 13px;
  color: #94a3b8;
  flex-wrap: wrap;
}

.clm-modal__client {
  font-weight: 600;
  color: #475569;
}

.clm-modal__date {
  color: #94a3b8;
}

.clm-modal__client + .clm-modal__date::before {
  content: "·";
  margin: 0 8px;
  color: #cbd5e1;
}

/* Modal image */
.clm-modal__image {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 28px;
  display: block;
}

/* Modal one-liner / intro */
.clm-modal__one-liner p {
  font-size: 17px;
  line-height: 1.7;
  color: #475569;
  font-style: italic;
  border-left: 3px solid #2563eb;
  padding-left: 16px;
  margin-bottom: 24px;
}

/* Modal content sections */
.clm-modal__section {
  margin-bottom: 22px;
}

.clm-modal__section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  margin-bottom: 8px;
  display: block;
}

.clm-modal__section p {
  font-size: 15px;
  line-height: 1.75;
  color: #374151;
  white-space: pre-wrap;
}

/* Full editorial HTML */
.clm-modal__html {
  font-size: 16px;
  line-height: 1.8;
  color: #1e293b;
}

.clm-modal__html h1,
.clm-modal__html h2,
.clm-modal__html h3,
.clm-modal__html h4 {
  color: #0f172a;
  font-weight: 700;
  line-height: 1.3;
  margin: 28px 0 12px;
  letter-spacing: -0.01em;
}

.clm-modal__html h1 { font-size: 1.5em; }
.clm-modal__html h2 { font-size: 1.3em; }
.clm-modal__html h3 { font-size: 1.15em; }

.clm-modal__html p {
  margin-bottom: 16px;
  color: #374151;
}

.clm-modal__html a {
  color: #2563eb;
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.3);
  text-underline-offset: 2px;
}

.clm-modal__html a:hover {
  text-decoration-color: #2563eb;
}

.clm-modal__html ul,
.clm-modal__html ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.clm-modal__html li {
  margin-bottom: 6px;
  color: #374151;
}

.clm-modal__html blockquote {
  border-left: 4px solid #2563eb;
  margin: 24px 0;
  padding: 14px 20px;
  background: #eff6ff;
  border-radius: 0 10px 10px 0;
  font-style: italic;
  color: #1e3a8a;
}

.clm-modal__html strong { color: #0f172a; }

.clm-modal__html img {
  max-width: 100%;
  border-radius: 8px;
  margin: 16px 0;
}

/* Divider */
.clm-modal__divider {
  border: none;
  border-top: 1px solid #f1f5f9;
  margin: 24px 0;
}

/* Companies row */
.clm-modal__companies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* No-results message inside grid */
.clm-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
  font-size: 15px;
}
