/* ============================================================
   Elite Agent — Base CSS
   Design system: variables, typography, colours, resets.
   Mobile-first. All sizes default to phone layout.
   ============================================================ */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-news); }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
table { border-collapse: collapse; width: 100%; }

/* ---- Custom Properties ---- */
:root {
  /* Fonts — primary names */
  --font-headline: 'Playfair Display', Georgia, serif;
  --font-ui: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Source Serif 4', Georgia, serif;

  /* Aliases (prototype compat) */
  --serif: var(--font-headline);
  --sans: var(--font-ui);
  --body-serif: var(--font-body);

  /* Core palette */
  --black: #1a1a1a;
  --grey-800: #3d3d3d;
  --grey-600: #666;
  --grey-400: #999;
  --grey-300: #bbb;
  --grey-200: #ddd;
  --grey-100: #f0f0f0;
  --grey-50: #f8f8f8;
  --white: #fff;
  --warm-cream: #faf8f5;

  /* Category accents */
  --accent-news: #0066cc;
  --accent-opinion: #8b2252;
  --accent-franchise: #cc6600;
  --accent-features: #006644;
  --accent-tech: #4a00b4;
  --accent-celeb: #b40060;
  --accent-supplier: #555;
  --accent-podcast: #1a8870;
  --accent-international: #884400;
  --accent-leadership: #2255aa;
  --accent-pm: #0077aa;
  --accent-commercial: #336655;
  --accent-events: #aa4400;
  --accent-movers: #6644aa;

  /* Accent fallback */
  --accent-primary: var(--accent-news);

  /* Layout */
  --content-width: 1200px;
  --max-width: var(--content-width);
  --article-width: 680px;
  --sidebar-width: 300px;
  --gutter: 24px;
  --side-padding: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --speed-fast: 150ms;
  --speed-normal: 250ms;
}

/* ---- Base typography ---- */
body {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Article body uses serif */
.article-body,
.entry-content {
  font-family: var(--font-body);
  line-height: 1.6;
}

/* Headlines — Playfair Display */
h1, h2, h3, .headline-xl, .headline-lg, .headline-md {
  font-family: var(--font-headline);
  font-weight: 700;
  color: var(--black);
  line-height: 1.2;
}

h1, .headline-xl {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

h2, .headline-lg {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

h3, .headline-md {
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 6px;
}

/* Small headlines use UI font */
h4, h5, h6, .headline-sm {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--black);
  margin-bottom: 4px;
}

/* UI text — Source Sans 3 */
.ui-text,
nav, label, .byline, .timestamp, .category-label,
.section-title, .btn, .tag {
  font-family: var(--font-ui);
}

/* ---- Links ---- */
.article-body a,
.entry-content a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--speed-fast) var(--ease);
}

.article-body a:hover,
.entry-content a:hover {
  color: var(--black);
}

/* ---- Category label (text-only per prototype) ---- */
.category-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 6px;
}

/* Filled pill variant */
.category-label--filled {
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  background: var(--accent-primary);
  color: var(--white);
}

.category-label--outline {
  background: transparent;
  border: 1px solid;
  padding: 2px 6px;
}

/* ---- Excerpt ---- */
.excerpt {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--grey-800);
  margin-bottom: 8px;
}

/* ---- Partner / Promoted badges ---- */
.badge--partner,
.badge--promoted {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  line-height: 1;
  margin-bottom: 6px;
}

.badge--partner {
  background: var(--grey-100);
  color: var(--grey-600);
  border: 1px solid var(--grey-200);
}

.badge--promoted {
  background: #fff8e6;
  color: #997a00;
  border: 1px solid #e6d280;
}

/* ---- Section titles ---- */
.section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--black);
  margin-bottom: 20px;
  display: inline-block;
}

.section-title a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  transition: color var(--speed-fast) var(--ease);
}

.section-title a:hover {
  color: var(--grey-600);
}

.section-title .arrow {
  font-size: 14px;
}

/* ---- Byline ---- */
.byline {
  font-size: 14px;
  color: var(--grey-600);
  line-height: 1.4;
}

.byline a {
  color: var(--black);
  font-weight: 600;
}

.byline a:hover {
  color: var(--accent-primary);
}

.byline__separator {
  margin: 0 6px;
  color: var(--grey-300);
}

/* ---- Timestamp ---- */
.timestamp {
  font-size: 12px;
  font-weight: 500;
  color: var(--grey-400);
}

/* ---- NEW badge (news ticker) ---- */
.badge--new {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 5px;
  background: #cc0000;
  color: var(--white);
  border-radius: 2px;
  margin-right: 6px;
  line-height: 1;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 3px;
  transition: all var(--speed-fast) var(--ease);
}

.btn--primary {
  background: var(--accent-primary);
  color: var(--white);
}

.btn--primary:hover {
  color: var(--white);
  filter: brightness(0.9);
  transform: scale(1.05);
}

.btn--outline {
  border: 1px solid var(--grey-300);
  color: var(--black);
}

.btn--outline:hover {
  border-color: var(--black);
}

/* ---- Tags ---- */
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  background: var(--grey-100);
  color: var(--grey-600);
  border-radius: 2px;
  transition: background var(--speed-fast) var(--ease);
}

.tag:hover {
  background: var(--grey-200);
  color: var(--black);
}

/* ---- Share buttons ---- */
.share-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--grey-200);
  border-bottom: 1px solid var(--grey-200);
}

.share-buttons__label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-400);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grey-100);
  color: var(--grey-600);
  transition: all var(--speed-fast) var(--ease);
}

.share-btn:hover {
  background: var(--black);
  color: var(--white);
}

/* ---- Source attribution ---- */
.source-attribution {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--grey-400);
  font-style: italic;
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--grey-200);
}

/* ---- Image captions ---- */
figcaption,
.wp-caption-text {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--grey-400);
  margin-top: 8px;
  line-height: 1.4;
}

/* ---- Pull quotes ---- */
blockquote,
.wp-block-quote {
  font-family: var(--font-headline);
  font-size: 22px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.3;
  padding: 16px 0 16px 20px;
  border-left: 3px solid var(--accent-primary);
  margin: 24px 0;
  color: var(--black);
}

blockquote p {
  margin: 0;
}

blockquote cite,
.wp-block-quote cite {
  display: block;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  color: var(--grey-600);
  margin-top: 8px;
}

/* ---- Story image container ---- */
.story-image {
  background: var(--grey-100);
  aspect-ratio: 16/9;
  margin-bottom: 12px;
  overflow: hidden;
}

.story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Utility: visually hidden ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---- Utility: container ---- */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--side-padding);
}

/* ---- Utility: clearfix ---- */
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* ---- Accessibility: skip to content ---- */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  background: var(--black);
  color: var(--white);
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 0 4px 4px;
  transition: top var(--speed-fast) var(--ease);
}
.skip-to-content:focus {
  top: 0;
  color: var(--white);
}

/* ---- Responsive embeds (articles) ---- */
.article-body iframe,
.article-body video,
.article-body embed,
.article-body object {
  max-width: 100%;
}

.article-body .wp-block-embed__wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.article-body .wp-block-embed__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ---- Responsive tables (articles) ---- */
.article-body .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}

.article-body table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
}

.article-body th,
.article-body td {
  padding: 10px 14px;
  border: 1px solid var(--grey-200);
  font-family: var(--font-ui);
  font-size: 14px;
  text-align: left;
}

.article-body th {
  background: var(--grey-50);
  font-weight: 600;
}

.article-body tr:nth-child(even) {
  background: var(--grey-50);
}
