/* WSJ-Style Layout System based on Design Examples */

/* WSJ Container & Grid Variables */
:root {
  --wsj-header-height: 100px;
  --wsj-content-max-width: 1440px;
  --wsj-sidebar-left-width: 25%;
  --wsj-main-content-width: 50%;
  --wsj-sidebar-right-width: 25%;
  --wsj-gap: 2rem;
  --wsj-container-padding: 1.5rem;
  --wsj-border-color: #e5e7eb;
  --wsj-text-primary: #1f2937;
  --wsj-text-secondary: #6b7280;
  --wsj-serif-font: 'Playfair Display', serif;
  --wsj-sans-font: 'Source Sans Pro', sans-serif;
}

/* WSJ Container System */
.wsj-container {
  max-width: var(--wsj-content-max-width);
  margin: 0 auto;
  padding: 0 var(--wsj-container-padding);
}

/* WSJ 3-Column Grid Layout */
.wsj-grid-3col {
  display: grid;
  grid-template-columns: var(--wsj-sidebar-left-width) var(--wsj-main-content-width) var(--wsj-sidebar-right-width);
  gap: var(--wsj-gap);
  min-height: calc(100vh - var(--wsj-header-height));
}

/* Responsive Grid Adjustments */
@media (max-width: 1200px) {
  .wsj-grid-3col {
    grid-template-columns: 30% 70%;
    grid-template-rows: auto auto;
  }
  
  .wsj-sidebar-right {
    grid-column: 1 / -1;
    order: 3;
  }
  
  .wsj-main-content {
    order: 2;
  }
  
  .wsj-sidebar-left {
    order: 1;
  }
}

@media (max-width: 768px) {
  .wsj-grid-3col {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .wsj-sidebar-left,
  .wsj-main-content,
  .wsj-sidebar-right {
    order: unset;
  }
}

/* Header Block Styles - Based on block-header.png */
.wsj-header {
  background: white;
  border-bottom: 1px solid var(--wsj-border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.wsj-header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: var(--wsj-content-max-width);
  margin: 0 auto;
  padding: 0 var(--wsj-container-padding);
}

.wsj-logo {
  font-family: var(--wsj-serif-font);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--wsj-text-primary);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.wsj-tagline {
  font-family: var(--wsj-sans-font);
  font-size: 0.875rem;
  color: var(--wsj-text-secondary);
  margin-top: 0.25rem;
  text-align: center;
}

.wsj-mobile-menu-toggle {
  display: none;
  position: absolute;
  left: 1rem;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
}

@media (max-width: 768px) {
  .wsj-mobile-menu-toggle {
    display: block;
  }
  
  .wsj-logo {
    font-size: 1.875rem;
  }
}

/* Navigation Block Styles - Based on block-navi.png */
.wsj-navigation {
  background: white;
  border-bottom: 2px solid var(--wsj-border-color);
  padding: 0.75rem 0;
}

.wsj-navigation-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--wsj-content-max-width);
  margin: 0 auto;
  padding: 0 var(--wsj-container-padding);
}

.wsj-nav-menu {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wsj-nav-menu li {
  margin: 0;
}

.wsj-nav-menu a {
  font-family: var(--wsj-sans-font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--wsj-text-primary);
  text-decoration: none;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
  border-bottom: 2px solid transparent;
}

.wsj-nav-menu a:hover,
.wsj-nav-menu a.current {
  color: #dc2626;
  border-bottom-color: #dc2626;
}

.wsj-search-form {
  display: flex;
  align-items: center;
  position: relative;
}

.wsj-search-input {
  width: 280px;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: 1px solid var(--wsj-border-color);
  border-radius: 1.5rem;
  font-size: 0.875rem;
  background: #f9fafb;
  outline: none;
  transition: all 0.2s ease;
}

.wsj-search-input:focus {
  border-color: #dc2626;
  background: white;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.wsj-search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--wsj-text-secondary);
  font-size: 1rem;
}

@media (max-width: 768px) {
  .wsj-navigation-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .wsj-nav-menu {
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .wsj-search-input {
    width: 240px;
  }
}

/* Main Content Block Styles - Based on block-main.png */
.wsj-main-content {
  padding: 2rem 0;
}

.wsj-section-title {
  font-family: var(--wsj-serif-font);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--wsj-text-primary);
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
}

.wsj-section-title::before,
.wsj-section-title::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 80px;
  height: 1px;
  background: var(--wsj-border-color);
}

.wsj-section-title::before {
  left: -100px;
}

.wsj-section-title::after {
  right: -100px;
}

.wsj-latest-news {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.wsj-featured-article {
  grid-column: 1;
  grid-row: 1 / 3;
}

.wsj-featured-article .wsj-article-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.wsj-article-list {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.wsj-article-item {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--wsj-border-color);
}

.wsj-article-item:last-child {
  border-bottom: none;
}

.wsj-article-title {
  font-family: var(--wsj-serif-font);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--wsj-text-primary);
  text-decoration: none;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  display: block;
}

.wsj-article-title:hover {
  color: #dc2626;
}

.wsj-article-meta {
  font-family: var(--wsj-sans-font);
  font-size: 0.75rem;
  color: var(--wsj-text-secondary);
  margin-bottom: 0.5rem;
}

.wsj-article-excerpt {
  font-family: var(--wsj-sans-font);
  font-size: 0.875rem;
  color: var(--wsj-text-secondary);
  line-height: 1.5;
}

.wsj-bottom-articles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.wsj-bottom-article {
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.5rem;
}

.wsj-bottom-article .wsj-article-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 0.25rem;
  margin-bottom: 0.75rem;
}

.wsj-bottom-article .wsj-article-title {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
  .wsj-latest-news {
    grid-template-columns: 1fr;
  }
  
  .wsj-featured-article {
    grid-column: 1;
    grid-row: 1;
  }
  
  .wsj-article-list {
    grid-column: 1;
  }
  
  .wsj-bottom-articles {
    grid-template-columns: 1fr 1fr;
  }
  
  .wsj-section-title::before,
  .wsj-section-title::after {
    display: none;
  }
}

@media (max-width: 480px) {
  .wsj-bottom-articles {
    grid-template-columns: 1fr;
  }
}

/* Most Popular Block Styles - Based on block-mostpopular.png */
.wsj-most-popular {
  background: white;
  padding: 2rem 0;
}

.wsj-popular-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
}

.wsj-popular-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.wsj-popular-item {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--wsj-border-color);
}

.wsj-popular-item:last-child {
  border-bottom: none;
}

.wsj-popular-item .wsj-article-title {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.wsj-popular-item .wsj-article-excerpt {
  font-size: 0.875rem;
  line-height: 1.5;
}

.wsj-popular-featured {
  position: relative;
}

.wsj-popular-featured .wsj-article-image {
  width: 100%;
  height: 350px;
  object-fit: cover;
  border-radius: 0.5rem;
}

.wsj-popular-featured-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
  padding: 2rem;
  border-radius: 0 0 0.5rem 0.5rem;
}

.wsj-popular-featured .wsj-article-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.wsj-popular-featured .wsj-article-title {
  font-size: 1.5rem;
  color: white;
  margin-bottom: 0.75rem;
}

.wsj-popular-related {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.wsj-popular-related-item {
  background: #f9fafb;
  padding: 1rem;
  border-radius: 0.5rem;
}

.wsj-popular-related-item .wsj-article-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .wsj-popular-layout {
    grid-template-columns: 1fr;
  }
  
  .wsj-popular-related {
    grid-template-columns: 1fr;
  }
}

/* Video Block Styles - Based on block-video.png */
.wsj-video-section {
  background: white;
  padding: 2rem 0;
}

.wsj-video-featured {
  position: relative;
  margin-bottom: 2rem;
}

.wsj-video-featured .wsj-video-thumbnail {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 0.5rem;
}

.wsj-video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4rem;
  height: 4rem;
  background: rgba(0, 0, 0, 0.8);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wsj-video-play-button:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: translate(-50%, -50%) scale(1.1);
}

.wsj-video-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 1rem;
  border-radius: 0 0 0.5rem 0.5rem;
}

.wsj-video-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fbbf24;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.wsj-video-title {
  font-family: var(--wsj-serif-font);
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.wsj-video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.wsj-video-item {
  position: relative;
}

.wsj-video-item .wsj-video-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0.5rem;
}

.wsj-video-item .wsj-video-play-button {
  width: 3rem;
  height: 3rem;
  font-size: 1.25rem;
}

.wsj-video-item .wsj-video-title {
  font-size: 1.125rem;
  color: var(--wsj-text-primary);
  margin-top: 0.75rem;
}

.wsj-video-item .wsj-video-meta {
  font-family: var(--wsj-sans-font);
  font-size: 0.75rem;
  color: var(--wsj-text-secondary);
  margin-top: 0.25rem;
}

@media (max-width: 768px) {
  .wsj-video-grid {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Styles */
.wsj-sidebar-left,
.wsj-sidebar-right {
  padding: 2rem 0;
}

.wsj-sidebar-content {
  position: sticky;
  top: calc(var(--wsj-header-height) + 2rem);
}

.wsj-widget {
  background: white;
  border: 1px solid var(--wsj-border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.wsj-widget-title {
  font-family: var(--wsj-serif-font);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--wsj-text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--wsj-border-color);
}

/* Market Data Widget */
.wsj-market-ticker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wsj-ticker-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.wsj-ticker-item:last-child {
  border-bottom: none;
}

.wsj-ticker-symbol {
  font-family: var(--wsj-sans-font);
  font-weight: 600;
  color: var(--wsj-text-primary);
}

.wsj-ticker-price {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--wsj-text-primary);
}

.wsj-ticker-change {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
}

.wsj-ticker-change.positive {
  background: #dcfce7;
  color: #16a34a;
}

.wsj-ticker-change.negative {
  background: #fee2e2;
  color: #dc2626;
}

/* Breaking News Banner */
.wsj-breaking-news {
  background: #dc2626;
  color: white;
  padding: 0.75rem 0;
  position: sticky;
  top: var(--wsj-header-height);
  z-index: 40;
}

.wsj-breaking-content {
  display: flex;
  align-items: center;
  max-width: var(--wsj-content-max-width);
  margin: 0 auto;
  padding: 0 var(--wsj-container-padding);
  gap: 1rem;
}

.wsj-breaking-label {
  background: white;
  color: #dc2626;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.wsj-breaking-text {
  font-family: var(--wsj-sans-font);
  font-size: 0.875rem;
  font-weight: 500;
  flex: 1;
}

.wsj-breaking-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  opacity: 0.9;
  flex-shrink: 0;
}

/* Newsletter Widget */
.wsj-newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wsj-newsletter-input {
  padding: 0.75rem;
  border: 1px solid var(--wsj-border-color);
  border-radius: 0.25rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.wsj-newsletter-input:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.wsj-newsletter-btn {
  background: #dc2626;
  color: white;
  padding: 0.75rem;
  border: none;
  border-radius: 0.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.wsj-newsletter-btn:hover {
  background: #b91c1c;
}

.wsj-newsletter-benefits {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.wsj-benefit {
  font-size: 0.75rem;
  color: var(--wsj-text-secondary);
}

/* Utility Classes */
.wsj-text-center {
  text-align: center;
}

.wsj-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;
}

/* Animation Classes */
.wsj-fade-in {
  animation: wsjFadeIn 0.5s ease-in-out;
}

.wsj-slide-up {
  animation: wsjSlideUp 0.3s ease-out;
}

@keyframes wsjFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes wsjSlideUp {
  from { 
    transform: translateY(20px); 
    opacity: 0; 
  }
  to { 
    transform: translateY(0); 
    opacity: 1; 
  }
}