/* ==========================================================================
   SOFTWAVE JOURNAL - TECH NEWSPAPER STYLESHEET
   Inspired by eldiario.es (Grid), Marca (Density) & Nvidia (Tech Vibe)
   ========================================================================== */

:root {
  /* Colors - High Contrast Tech Newspaper */
  --bg-page: #ffffff;
  --bg-surface: #ffffff;
  --bg-alt: #f4f4f4;
  --bg-dark: #111111;
  
  --text-main: #000000;
  --text-secondary: #333333;
  --text-muted: #666666;
  
  /* Tech Accents */
  --accent-tech: #00d1c1; /* Vibrant Cyan */
  --accent-alert: #e60000; /* Breaking news red */

  /* AdSense System */
  --ads-bg: #f9f9f9;
  --ads-border: #e0e0e0;
  --ads-text: #888888;

  /* Structure */
  --border-color: #dddddd;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Inter', system-ui, sans-serif;
  
  --container-max: 1240px;
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-tech);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   TOP ALERT BAR (MARCA STYLE)
   ========================================================================== */
.top-alert-bar {
  background-color: var(--accent-alert);
  color: #ffffff;
  padding: 0.5rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.top-alert-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.alert-badge {
  background: #ffffff;
  color: var(--accent-alert);
  padding: 0.15rem 0.5rem;
}

.alert-ticker {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}
.alert-ticker a {
  color: #ffffff;
}
.alert-ticker a:hover {
  text-decoration: underline;
}

.ticker-scroll {
  display: inline-block;
  white-space: nowrap;
  animation: scroll-ticker 30s linear infinite;
}

.ticker-scroll:hover {
  animation-play-state: paused;
}

@keyframes scroll-ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.top-actions {
  display: flex;
  gap: 1rem;
}

.top-actions button {
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.top-actions button:hover {
  color: #000000;
}

/* ==========================================================================
   MAIN HEADER
   ========================================================================== */
.site-header {
  background-color: var(--bg-dark);
  color: #ffffff;
  border-bottom: 4px solid var(--accent-tech);
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}
.logo-group:hover {
  color: #ffffff;
}

.header-logo-img {
  height: 46px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 209, 193, 0.2));
}

.logo-text-block {
  display: flex;
  flex-direction: column;
}

.logo-main {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
  color: #ffffff;
}

.logo-main span {
  color: var(--accent-tech);
}

.logo-sub {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #aaaaaa;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.header-utils {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.search-box {
  display: flex;
  align-items: center;
  background: #222222;
  border: 1px solid #333333;
}
.search-box input {
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  width: 220px;
}
.search-box input:focus {
  outline: none;
  border-color: var(--accent-tech);
}

.subscribe-btn {
  background-color: var(--accent-tech);
  color: var(--bg-dark);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.6rem 1.25rem;
  text-transform: uppercase;
}
.subscribe-btn:hover {
  background-color: #ffffff;
}

/* Navigation Bar */
.nav-bar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-list {
  display: flex;
  list-style: none;
  overflow-x: auto;
}

.nav-item a {
  display: block;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-main);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.nav-item a:hover, .nav-item a.active {
  color: var(--accent-tech);
  border-bottom-color: var(--accent-tech);
}

/* ==========================================================================
   ADSENSE SLOTS
   ========================================================================== */
.adsense-wrapper {
  background-color: var(--ads-bg);
  border: 1px solid var(--ads-border);
  text-align: center;
  padding: 0.5rem;
  margin: 1.5rem 0;
}
.adsense-wrapper.hidden-ad {
  display: none !important;
}

.adsense-label {
  font-size: 0.6rem;
  color: var(--ads-text);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.ads-mock-content {
  background: #ffffff;
  border: 1px solid #eeeeee;
  padding: 1rem;
  display: inline-block;
  min-width: 300px;
}
.ad-brand {
  font-size: 0.7rem;
  font-weight: 700;
  color: #0055ff;
  margin-bottom: 0.25rem;
}
.ad-title {
  font-weight: 800;
  font-size: 1rem;
}



/* ==========================================================================
   NEWSPAPER GRID LAYOUT
   ========================================================================== */
.site-content {
  padding: 0 0 2rem 0;
}

.newspaper-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
}

.main-column {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Sub-Hero Articles Layout */
.sub-hero-list {
  display: flex;
  gap: 1.5rem;
  border-bottom: 2px solid var(--text-main);
  padding-bottom: 2rem;
}

.article-compact {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-tech);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.article-compact h3 {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.article-compact h3 a {
  color: var(--text-main);
}
.article-compact h3 a:hover {
  color: var(--accent-tech);
}

.article-compact .excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Secondary News Grid */
.secondary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.article-card img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
}

.article-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.2;
}

.article-card.featured-card {
  grid-column: span 2;
  background: var(--bg-alt);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.article-card.featured-card img {
  aspect-ratio: 21/9;
  border-radius: 6px;
}

.article-card.featured-card h3 {
  font-size: 1.6rem;
  margin-top: 0.5rem;
}


.pdf-btn {
  display: inline-block;
  border: 2px solid var(--text-main);
  color: var(--text-main);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  margin-top: 0.5rem;
}
.pdf-btn:hover {
  background-color: var(--text-main);
  color: #ffffff;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.widget {
  border: 1px solid var(--border-color);
}

.widget-header {
  background-color: var(--bg-dark);
  color: #ffffff;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 3px solid var(--accent-tech);
}

.widget-content {
  padding: 1rem;
}

.trending-list {
  list-style: none;
  counter-reset: trend-counter;
}

.trending-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}
.trending-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.trending-item::before {
  counter-increment: trend-counter;
  content: counter(trend-counter);
  font-size: 2rem;
  font-weight: 900;
  color: var(--border-color);
  line-height: 1;
}

.trending-item h4 {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
}

.widget-newsletter {
  background-color: var(--bg-dark);
  color: #ffffff;
  border: none;
  border-bottom: 4px solid var(--accent-tech);
}

.widget-newsletter .widget-header {
  background-color: transparent;
  border-bottom: 1px solid #333333;
}

.nl-input {
  width: 100%;
  padding: 0.75rem;
  background: #222222;
  border: 1px solid #444444;
  color: #ffffff;
  margin-bottom: 0.5rem;
}
.nl-input:focus {
  outline: none;
  border-color: var(--accent-tech);
}

.nl-btn {
  width: 100%;
  background-color: var(--accent-tech);
  color: var(--bg-dark);
  padding: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}
.nl-btn:hover {
  background-color: #ffffff;
}

/* ==========================================================================
   ARTICLE READER
   ========================================================================== */
.reader-container {
  max-width: 840px;
  margin: 0 auto;
}

.reader-category {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-tech);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.reader-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 1.5rem;
}

.reader-abstract {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 2rem;
  border-left: 4px solid var(--accent-tech);
  padding-left: 1.5rem;
}

.reader-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  max-height: 480px;
  margin-bottom: 2.5rem;
  border-radius: 4px;
}

.reader-body {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.reader-body img {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  margin: 1.5rem 0;
  border-radius: 4px;
}

.reader-body p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.reader-body .article-h2,
.reader-body h2 {
  color: var(--accent-tech);
  font-size: 1.45rem;
  font-weight: 800;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.reader-body .article-h3,
.reader-body h3 {
  color: var(--text-main);
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.reader-actions {
  display: flex;
  justify-content: space-between;
  border-top: 2px solid var(--text-main);
  padding: 1.5rem 0;
  margin: 3rem 0;
}

/* References Section */
.article-references {
  border-top: 3px solid var(--border-color);
  margin-top: 3rem;
  padding-top: 1rem;
}

.references-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 2rem 0;
  counter-reset: none;
}

.references-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid var(--accent-tech);
  margin-bottom: 0.75rem;
  background-color: var(--bg-alt);
}

.action-btn {
  border: 2px solid var(--text-main);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.8rem;
}
.action-btn:hover {
  background-color: var(--text-main);
  color: #ffffff;
}

/* ==========================================================================
   FOOTER (NVIDIA / CORPORATE STYLE)
   ========================================================================== */
.site-footer {
  background-color: var(--bg-dark);
  color: #ffffff;
  padding: 4rem 0 2rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid #333333;
  padding-bottom: 3rem;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 1rem;
}
.footer-logo span {
  color: var(--accent-tech);
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.75rem;
}

.footer-col a {
  color: #aaaaaa;
  font-size: 0.85rem;
}
.footer-col a:hover {
  color: var(--accent-tech);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  color: #666666;
  font-size: 0.8rem;
}

/* CARRUSEL HERO BANNER */
.carousel-wrapper {
  position: relative;
  width: 100%;
  height: 380px;
  overflow: hidden;
  margin-bottom: 2rem;
  border-radius: 4px;
  background: #000;
}
.carousel-inner {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.4s ease-in-out;
}
.carousel-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.carousel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  color: #fff;
}
.carousel-category {
  display: inline-block;
  background: #00d1c1;
  color: #000;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.carousel-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin: 0;
}
.carousel-controls {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  padding: 0 1rem;
  pointer-events: none;
  box-sizing: border-box;
}
.carousel-btn {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.carousel-btn:hover {
  background: #00d1c1;
  color: #000;
}
/* COOKIE BANNER */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 800px;
  margin: 0 auto;
  background: #111;
  border: 1px solid #333;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  z-index: 9999;
  transform: translateY(150%);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.cookie-banner.show {
  transform: translateY(0);
}
.cookie-content p {
  margin: 0;
  color: #ccc;
  font-size: 0.95rem;
  line-height: 1.5;
}
.cookie-content a {
  color: #00d1c1;
  text-decoration: underline;
}
.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cookie-btn {
  padding: 0.8rem 1.2rem;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.cookie-btn:hover {
  opacity: 0.8;
}
.accept-btn {
  background: #00d1c1;
  color: #000;
}
.reject-btn {
  background: #333;
  color: #fff;
}
@media (max-width: 768px) {
  .cookie-banner {
    flex-direction: column;
    text-align: center;
  }
  .cookie-actions {
    width: 100%;
    justify-content: center;
  }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .newspaper-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  /* Header and Nav */
  .header-main { 
    flex-direction: column; 
    gap: 1rem; 
    text-align: center; 
  }
  .header-utils { 
    width: 100%; 
    justify-content: center;
    flex-wrap: wrap;
  }
  .search-box { width: 100%; }
  .search-box input { width: 100%; }
  .subscribe-btn { width: 100%; text-align: center; }
  .nav-list { padding-bottom: 0.5rem; -webkit-overflow-scrolling: touch; }
  .nav-list::-webkit-scrollbar { display: none; }
  
  /* Top Alert */
  .top-alert-inner { flex-direction: column; gap: 0.5rem; text-align: center; }

  /* Carousel Adjustments */
  .carousel-title { font-size: 1.4rem; }
  .carousel-inner { height: 320px; }
  .carousel-overlay { padding: 1.5rem 1rem 1rem 1rem; }
  .carousel-controls { top: 35%; } /* Move arrows up to avoid overlapping text */
  .carousel-btn { width: 35px; height: 35px; font-size: 1rem; }
  
  /* Grids */
  .secondary-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .sub-hero-list { flex-direction: column; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 0.5rem; }
}
