/**
 * PressFeed front-end styles. Colors, fonts, and radius come from CSS custom
 * properties injected inline from the plugin settings (--pf-*).
 */

.pressfeed {
  --pf-primary: #1a56db;
  --pf-accent: #0e9f6e;
  --pf-text: #1f2937;
  --pf-muted: #6b7280;
  --pf-bg: #ffffff;
  --pf-surface: #f9fafb;
  --pf-radius: 12px;
  /* Typography inherits from the active WordPress theme by default; overridden
     only when a specific font is chosen in Settings. */
  --pf-font: inherit;

  --pf-max: 1180px;
  --pf-article: 840px;

  font-family: var(--pf-font-body);
  color: var(--pf-text);
  background: var(--pf-bg);
  max-width: var(--pf-content-width);
  margin: 0 auto;
  padding: 40px 24px 60px;
  box-sizing: border-box;
}

.pressfeed *,
.pressfeed *::before,
.pressfeed *::after {
  box-sizing: border-box;
}

.pressfeed a {
  color: var(--pf-primary);
  text-decoration: none;
}
.pressfeed a:hover {
  text-decoration: underline;
}

/* ---------- Archive header ---------- */
.pressfeed-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--pf-muted) 25%, transparent);
}
.pressfeed-header h1 {
  font-size: 34px;
  margin: 0 0 6px;
  color: var(--pf-text);
  line-height: 1.15;
}
.pressfeed-header .pressfeed-tagline {
  color: var(--pf-muted);
  font-size: 16px;
  margin: 0;
}

/* Category filter chips */
.pressfeed-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.pressfeed-filter {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--pf-surface);
  color: var(--pf-muted);
  font-size: 13px;
  border: 1px solid color-mix(in srgb, var(--pf-muted) 20%, transparent);
}
.pressfeed-filter:hover,
.pressfeed-filter.is-active {
  background: var(--pf-primary);
  color: #fff;
  text-decoration: none;
  border-color: var(--pf-primary);
}

/* ---------- Cards grid ---------- */
.pressfeed-list.is-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.pressfeed-card-item {
  background: var(--pf-bg);
  border: 1px solid color-mix(in srgb, var(--pf-muted) 18%, transparent);
  border-radius: var(--pf-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pressfeed-card-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}
.pressfeed-card-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--pf-surface);
  overflow: hidden;
}
.pressfeed-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pressfeed-card-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.pressfeed-card-cat {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--pf-accent);
}
.pressfeed-card-title {
  font-size: 19px;
  line-height: 1.3;
  margin: 0;
}
.pressfeed-card-title a {
  color: var(--pf-text);
}
.pressfeed-card-excerpt {
  color: var(--pf-muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  flex: 1;
}
.pressfeed-card-meta {
  font-size: 12px;
  color: var(--pf-muted);
  margin-top: 4px;
}

/* ---------- Magazine layout ---------- */
/* First release is a large feature; the rest form a compact grid. */
.pressfeed-list.is-magazine {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.pressfeed-list.is-magazine .pressfeed-card-item:first-child {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  align-items: stretch;
}
.pressfeed-list.is-magazine .pressfeed-card-item:first-child .pressfeed-card-thumb {
  aspect-ratio: auto;
  height: 100%;
  min-height: 300px;
}
.pressfeed-list.is-magazine .pressfeed-card-item:first-child .pressfeed-card-body {
  justify-content: center;
  padding: 32px 34px;
}
.pressfeed-list.is-magazine .pressfeed-card-item:first-child .pressfeed-card-title {
  font-size: 28px;
}
.pressfeed-list.is-magazine .pressfeed-card-item:first-child .pressfeed-card-excerpt {
  font-size: 15px;
  flex: 0;
}
@media (max-width: 860px) {
  .pressfeed-list.is-magazine {
    grid-template-columns: 1fr 1fr;
  }
  .pressfeed-list.is-magazine .pressfeed-card-item:first-child {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .pressfeed-list.is-magazine {
    grid-template-columns: 1fr;
  }
}

/* Category shown inline with the date/byline meta. */
.pressfeed-meta-cat {
  color: var(--pf-accent);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.03em;
}
.pressfeed-meta-cat:hover {
  text-decoration: none;
  opacity: 0.8;
}

/* ---------- List layout ---------- */
.pressfeed-list.is-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pressfeed-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--pf-muted) 15%, transparent);
  align-items: start;
}
.pressfeed-row .pressfeed-card-thumb {
  border-radius: var(--pf-radius);
  aspect-ratio: 4 / 3;
}
.pressfeed-row-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pressfeed-row .pressfeed-card-title {
  font-size: 21px;
}

/* ---------- Pagination ---------- */
.pressfeed-pagination {
  margin-top: 40px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.pressfeed-pagination .page-numbers {
  padding: 8px 14px;
  border-radius: var(--pf-radius);
  background: var(--pf-surface);
  color: var(--pf-text);
  border: 1px solid color-mix(in srgb, var(--pf-muted) 18%, transparent);
}
.pressfeed-pagination .page-numbers.current {
  background: var(--pf-primary);
  color: #fff;
  border-color: var(--pf-primary);
}

/* ---------- Single ---------- */
.pressfeed-single {
  max-width: var(--pf-article-width);
}
/* Wide style: content uses the full newsroom width. */
.pressfeed-single.is-wide {
  max-width: var(--pf-content-width);
}
.pressfeed-single.is-wide .pressfeed-content,
.pressfeed-single.is-wide .pressfeed-single-meta,
.pressfeed-single.is-wide h1 {
  max-width: var(--pf-article-width);
  margin-left: auto;
  margin-right: auto;
}
.pressfeed-single.is-wide .pressfeed-single-hero {
  margin-bottom: 34px;
}
/* Minimal style: no hero, tighter, text-forward. */
.pressfeed-single.is-minimal {
  max-width: 700px;
}
.pressfeed-single.is-minimal h1 {
  font-size: 32px;
}
.pressfeed-single .pressfeed-single-cat {
  color: var(--pf-accent);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.03em;
}
.pressfeed-single h1 {
  font-size: 38px;
  line-height: 1.15;
  margin: 10px 0 14px;
  color: var(--pf-text);
}
.pressfeed-single-meta {
  color: var(--pf-muted);
  font-size: 14px;
  margin-bottom: 26px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--pf-muted) 20%, transparent);
}
.pressfeed-single-hero {
  margin: 0 0 28px;
  border-radius: var(--pf-radius);
  overflow: hidden;
}
.pressfeed-single-hero img {
  width: 100%;
  height: auto;
  display: block;
}
.pressfeed-content {
  font-size: 17px;
  line-height: 1.75;
  color: var(--pf-text);
}
.pressfeed-content p {
  margin: 0 0 1.3em;
}
.pressfeed-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--pf-radius);
  margin: 10px 0;
}
.pressfeed-content h2,
.pressfeed-content h3 {
  line-height: 1.3;
  margin: 1.6em 0 0.6em;
}
.pressfeed-source {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid color-mix(in srgb, var(--pf-muted) 20%, transparent);
  color: var(--pf-muted);
  font-size: 14px;
}

.pressfeed-back {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--pf-muted);
  font-size: 14px;
}

.pressfeed-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--pf-muted);
}

@media (max-width: 640px) {
  .pressfeed-header h1 {
    font-size: 27px;
  }
  .pressfeed-single h1 {
    font-size: 28px;
  }
  .pressfeed-row {
    grid-template-columns: 1fr;
  }
  .pressfeed-row .pressfeed-card-thumb {
    aspect-ratio: 16 / 9;
  }
}
