/* The AI Brief - Professional Newsletter Styling */

:root {
  /* Colors */
  --primary-blue: #1e3a8a;
  --secondary-blue: #3b82f6;
  --accent-blue: #60a5fa;
  --light-blue: #eff6ff;
  --dark-gray: #1f2937;
  --medium-gray: #6b7280;
  --light-gray: #f3f4f6;
  --border-gray: #e5e7eb;
  --white: #ffffff;
  --black: #000000;
  --success-green: #10b981;
  --warning-orange: #f59e0b;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  
  /* Layout */
  --max-width: 48rem;
  --border-radius: 0.5rem;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--dark-gray);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* General Link Styles - NO UNDERLINES ANYWHERE */
a {
  text-decoration: none !important;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: none !important;
}

a:focus {
  text-decoration: none !important;
}

a:active {
  text-decoration: none !important;
}

a:visited {
  text-decoration: none !important;
}

/* Override browser default link styles */
a:-webkit-any-link {
  text-decoration: none !important;
}

a:-moz-any-link {
  text-decoration: none !important;
}

a:any-link {
  text-decoration: none !important;
}

/* Ensure no underlines on any nested elements */
a * {
  text-decoration: none !important;
}

/* Additional fallback for stubborn browsers */
a, a:link, a:visited, a:hover, a:active, a:focus {
  text-decoration: none !important;
  border-bottom: none !important;
  text-decoration-line: none !important;
  text-decoration-style: none !important;
  text-decoration-color: transparent !important;
}

/* Force override any potential CSS framework or browser defaults */
* a {
  text-decoration: none !important;
}

/* WebKit specific overrides */
a::-webkit-any-link {
  text-decoration: none !important;
}

/* Universal selector override for maximum compatibility */
*:any-link {
  text-decoration: none !important;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 640px) {
  .container {
    padding: 0 var(--space-6);
  }
}

/* Header */
.header {
  padding: var(--space-8) 0;
  border-bottom: 1px solid var(--border-gray);
  margin-bottom: var(--space-8);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.logo h1 {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--primary-blue);
  margin-bottom: var(--space-2);
}

.logo h1 a {
  text-decoration: none;
  color: inherit;
}

.tagline {
  font-size: var(--font-size-sm);
  color: var(--medium-gray);
  font-weight: 400;
}

.header-meta {
  text-align: right;
}

.date {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--medium-gray);
  margin-bottom: var(--space-3);
}

.actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.subscribe-btn {
  background-color: var(--secondary-blue);
  color: var(--white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--font-size-sm);
  transition: background-color 0.2s ease;
}

.subscribe-btn:hover {
  background-color: var(--primary-blue);
}

.archive-link {
  color: var(--medium-gray);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.archive-link:hover {
  color: var(--secondary-blue);
}

@media (max-width: 639px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  
  .header-meta {
    text-align: center;
  }
  
  .logo h1 {
    font-size: var(--font-size-2xl);
  }
}

/* Hero Section - Two Column Layout */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
  align-items: start;
}

@media (max-width: 768px) {
  .hero-section {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  
  /* On mobile, insights come first */
  .hero-section .executive-summary {
    order: 1;
  }
  
  .hero-section .top-story {
    order: 2;
  }
}

/* Executive Summary */
.executive-summary {
  background-color: var(--white);
  border-top: 1px solid var(--border-gray);
  border-bottom: 1px solid var(--border-gray);
  padding: var(--space-8) 0;
  margin-bottom: var(--space-12);
}

.executive-summary h2 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--dark-gray);
  margin-bottom: var(--space-6);
  letter-spacing: -0.02em;
}

/* Top Story in hero section */
.hero-section .top-story {
  margin-bottom: 0;
}

/* Top Story (Standalone) */
.top-story {
  margin-bottom: var(--space-12);
}

.hero-section .top-story .section-header h2 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--dark-gray);
  margin-bottom: var(--space-4);
}

.insights-list {
  list-style: none;
}

.insights-list li {
  position: relative;
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
  color: var(--dark-gray);
  font-size: var(--font-size-lg);
  line-height: 1.6;
}

.insights-list li:before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--secondary-blue);
  font-weight: 700;
  font-size: 1.2em;
  line-height: 1.4;
}

.insights-list li:last-child {
  margin-bottom: 0;
}

.insights-list a {
  color: var(--secondary-blue);
  font-weight: 600;
  text-decoration: none;
}

.insights-list a:hover {
  color: var(--primary-blue);
  text-decoration: none;
}

/* Sections */
.section {
  margin-bottom: var(--space-12);
}

.section-header {
  margin-bottom: var(--space-6);
}

.section-header h2 {
  font-size: var(--font-size-2xl);
  font-weight: 600;
  color: var(--dark-gray);
  margin-bottom: var(--space-2);
}

.section-description {
  color: var(--medium-gray);
  font-size: var(--font-size-sm);
}

/* Stories */
.story {
  background-color: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: var(--border-radius);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.story:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-blue);
}

.featured-story {
  border: none;
  background-color: transparent;
  padding: 0;
  margin-bottom: var(--space-8);
}

.featured-story:hover {
  box-shadow: none;
  border-color: transparent;
}

.featured-story .story-title {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

.featured-story .summary {
  font-size: var(--font-size-lg);
  color: var(--medium-gray);
  line-height: 1.6;
}

.story-header {
  margin-bottom: var(--space-4);
}

.story-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: var(--space-2);
}

.story-title a {
  color: var(--dark-gray);
  text-decoration: none;
  transition: color 0.2s ease;
}

.story-title a:hover {
  color: var(--secondary-blue);
}

.story-meta {
  display: flex;
  flex-wrap: wrap; /* Allow wrapping if many sources */
  justify-content: flex-start;
  align-items: center;
  gap: var(--space-2); /* Smaller gap since we have a separator */
  font-size: var(--font-size-xs);
  color: var(--medium-gray);
  margin-top: var(--space-2);
}

.story-meta a {
  color: var(--medium-gray);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
}

.story-meta a:hover {
  color: var(--primary-blue);
  text-decoration: underline !important; 
}

.source {
  font-weight: 500;
  color: var(--secondary-blue);
}



.summary {
  color: var(--dark-gray);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.story:last-child .summary {
  margin-bottom: 0;
}

/* TL;DR and expandable summary styling */
.tldr-text {
  color: var(--dark-gray);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.story-details {
  margin-top: var(--space-2);
}

.read-more-btn {
  cursor: pointer;
  color: var(--secondary-blue);
  font-size: 0.9rem;
  font-weight: 500;
  list-style: none;
  user-select: none;
  display: inline-block;
  padding: var(--space-1) 0;
  transition: color 0.2s ease;
}

.read-more-btn::-webkit-details-marker {
  display: none;
}

.read-more-btn:hover {
  color: var(--primary-blue);
}

/* Hide the button after expanding (one-way) */
.story-details[open] .read-more-btn {
  display: none;
}

.full-text {
  margin-top: var(--space-2);
}

/* Analysis Box (Why It Matters callout) */
.analysis-box {
  background-color: var(--light-blue);
  border-left: 3px solid var(--secondary-blue);
  border-radius: calc(var(--border-radius) / 2);
  padding: var(--space-4);
  margin-top: var(--space-4);
}

.analysis-box p {
  margin: 0;
  color: var(--dark-gray);
  line-height: 1.6;
}

/* Analysis */
.analysis {
  background-color: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: var(--border-radius);
  padding: var(--space-4);
  margin-top: var(--space-4);
}

.analysis h4 {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--primary-blue);
  margin-bottom: var(--space-3);
}

.analysis p {
  margin-bottom: var(--space-3);
}

.analysis p:last-child {
  margin-bottom: 0;
}

.analysis ul {
  padding-left: var(--space-4);
  margin-bottom: var(--space-3);
}

.analysis li {
  margin-bottom: var(--space-1);
}

/* Stakeholders */
.stakeholders {
  margin-top: var(--space-3);
  font-size: var(--font-size-sm);
}

.stakeholder {
  display: inline-block;
  background-color: var(--light-gray);
  color: var(--dark-gray);
  padding: var(--space-1) var(--space-2);
  border-radius: calc(var(--border-radius) / 2);
  font-size: var(--font-size-xs);
  font-weight: 500;
  margin-right: var(--space-2);
  margin-top: var(--space-1);
}

/* Stories Grid */
.stories-grid {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .stories-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

.stories-list .story {
  border-left: 3px solid var(--accent-blue);
}

.industry-updates .story + .story {
  margin-top: var(--space-6);
}

/* Quick Hits */
.quick-hits-list {
  list-style: none;
}

.quick-hit {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-gray);
  transition: background-color 0.2s ease;
}

.quick-hit:hover {
  background-color: var(--light-gray);
}

.quick-hit:last-child {
  border-bottom: none;
}

.quick-hit-title {
  font-weight: 600;
  color: var(--dark-gray);
  text-decoration: none;
  font-size: var(--font-size-base);
  display: block;
  margin-bottom: var(--space-1);
  transition: color 0.2s ease;
}

.quick-hit-title:hover {
  color: var(--secondary-blue);
}

.quick-hit-source {
  font-size: var(--font-size-xs);
  color: var(--secondary-blue);
  font-weight: 500;
  display: block;
  margin-bottom: var(--space-2);
  text-decoration: none;
}

.quick-hit-source:hover {
  color: var(--primary-blue);
}

.quick-hit-summary {
  font-size: var(--font-size-sm);
  color: var(--medium-gray);
  line-height: 1.5;
}

/* Newsletter CTA */
.newsletter-cta {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
  color: var(--white);
  text-align: center;
  padding: var(--space-12) var(--space-6);
  border-radius: var(--border-radius);
  margin: var(--space-16) 0;
}

.cta-content h2 {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.cta-content p {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-6);
  opacity: 0.9;
}

.cta-button-large {
  display: inline-block;
  background-color: var(--white);
  color: var(--primary-blue);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--font-size-lg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: var(--space-4);
}

.cta-button-large:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.cta-disclaimer {
  font-size: var(--font-size-sm);
  opacity: 0.8;
}

/* Footer */
.footer {
  background-color: var(--light-gray);
  padding: var(--space-12) 0 var(--space-8);
  margin-top: var(--space-16);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: grid;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

@media (min-width: 640px) {
  .footer-content {
    padding: 0 var(--space-6);
  }
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-section h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--dark-gray);
  margin-bottom: var(--space-3);
}

.footer-section p {
  color: var(--medium-gray);
  margin-bottom: var(--space-3);
}

.footer-section a {
  color: var(--secondary-blue);
  text-decoration: none;
}

.footer-section a:hover {
  color: var(--primary-blue);
}

.cta-button {
  display: inline-block;
  background-color: var(--primary-blue);
  color: #ffffff;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s ease;
  border: 2px solid var(--primary-blue);
  opacity: 1;
}

.cta-button:hover {
  background-color: var(--white);
  color: var(--primary-blue);
  border-color: var(--primary-blue);
  text-shadow: none;
}

.social-links {
  display: flex;
  gap: var(--space-3);
}

.social-link {
  color: var(--medium-gray);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.social-link:hover {
  color: var(--secondary-blue);
}

/* Social Sharing Buttons */
.social-sharing {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4) var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  border-bottom: 1px solid var(--border-gray);
}

.header-meta .share-section {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}

.share-label {
  font-size: var(--font-size-sm);
  color: var(--medium-gray);
  font-weight: 500;
}

.share-buttons {
  display: flex;
  gap: var(--space-2);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: 6px;
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid var(--border-gray);
  background-color: var(--white);
  color: var(--medium-gray);
}

.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.share-twitter {
  background-color: #1da1f2;
  color: var(--white);
  border-color: #1da1f2;
}

.share-twitter:hover {
  background-color: #1a91da;
  border-color: #1a91da;
}

.share-linkedin {
  background-color: #0077b5;
  color: var(--white);
  border-color: #0077b5;
}

.share-linkedin:hover {
  background-color: #006399;
  border-color: #006399;
}

.share-email {
  background-color: #ea4335;
  color: var(--white);
  border-color: #ea4335;
}

.share-email:hover {
  background-color: #d33b2c;
  border-color: #d33b2c;
}

.share-copy {
  background-color: var(--light-gray);
  color: var(--dark-gray);
  border-color: var(--border-gray);
}

.share-copy:hover {
  background-color: var(--secondary-blue);
  color: var(--white);
  border-color: var(--secondary-blue);
}

.share-copy.copied {
  background-color: #10b981;
  color: var(--white);
  border-color: #10b981;
}

@media (max-width: 768px) {
  .social-sharing {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
  }
  
  .share-buttons {
    width: 100%;
    justify-content: center;
  }
  
  .share-btn {
    padding: var(--space-2);
    min-width: 44px;
    height: 44px;
  }
  
  .share-btn svg {
    width: 18px;
    height: 18px;
  }
  
  .share-btn:not(.share-copy) {
    /* Hide text on mobile, show only icons */
    font-size: 0;
  }
}

.footer-bottom {
  grid-column: 1 / -1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) 0;
  border-top: 1px solid var(--border-gray);
  text-align: center;
  color: var(--medium-gray);
  font-size: var(--font-size-sm);
}

.build-stamp {
  margin-top: 8px;
  font-size: 11px;
  font-family: monospace;
  color: var(--medium-gray);
  opacity: 0.6;
}

/* Development Banner */
.dev-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  margin: 20px 0;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

@media (min-width: 640px) {
  .footer-bottom {
    padding: var(--space-6) var(--space-6) 0;
  }
}

/* Success Page */
.success-page {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding: var(--space-12) 0;
}

.success-content {
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: var(--space-12);
  box-shadow: var(--shadow-md);
}

.success-icon {
  font-size: 4rem;
  margin-bottom: var(--space-6);
}

.success-content h1 {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--primary-blue);
  margin-bottom: var(--space-4);
}

.success-subtitle {
  font-size: var(--font-size-lg);
  color: var(--medium-gray);
  margin-bottom: var(--space-8);
}

.what-happens-next {
  margin-bottom: var(--space-8);
}

.what-happens-next h2 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--dark-gray);
  margin-bottom: var(--space-6);
}

.next-steps {
  display: grid;
  gap: var(--space-6);
  text-align: left;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.step-number {
  background-color: var(--secondary-blue);
  color: var(--white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--font-size-sm);
  flex-shrink: 0;
}

.step-content h3 {
  font-weight: 600;
  color: var(--dark-gray);
  margin-bottom: var(--space-1);
}

.step-content p {
  color: var(--medium-gray);
  font-size: var(--font-size-sm);
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-8);
}

.success-social {
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-gray);
}

.success-social p {
  color: var(--medium-gray);
  margin-bottom: var(--space-3);
}

.success-social .social-links {
  justify-content: center;
}

@media (max-width: 639px) {
  .success-content {
    padding: var(--space-8);
  }
  
  .success-content h1 {
    font-size: var(--font-size-2xl);
  }
  
  .step {
    flex-direction: column;
    text-align: center;
  }
}

/* Print Styles */
@media print {
  .header-meta .actions,
  .newsletter-cta,
  .footer {
    display: none;
  }
  
  .story {
    border: 1px solid var(--border-gray);
    margin-bottom: var(--space-4);
    break-inside: avoid;
  }
  
  .story-title a {
    color: var(--dark-gray) !important;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus {
  outline: 2px solid var(--secondary-blue);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-gray: #000000;
    --medium-gray: #000000;
  }
}

/* Constrain generated story images to be less intrusive */
.story-image-small {
  margin-bottom: var(--space-4);
  width: 100%;
  display: flex;
  justify-content: center;
  background-color: var(--light-gray);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.story-image-small img {
  display: block;
  max-width: 100%;
  max-height: 320px; /* Constrain vertical height */
  width: auto;       /* Allow width to adjust to maintain aspect ratio */
  object-fit: contain; /* Ensure entire image is visible without cropping */
  margin: 0 auto;
}

/* Remove bullet points from Executive Summary and Key Takeaways */
.executive-summary ul,
.takeaways ul {
  list-style: none;
  padding-left: 0;
  margin-top: var(--space-2);
}

.executive-summary li,
.takeaways li {
  margin-bottom: var(--space-2);
  position: relative;
}
