/* ============================================================
   The Tech Tribune — Demo Publisher Site
   Shared Stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg: #f5f5f5;
  --color-surface: #ffffff;
  --color-header: #1a2332;
  --color-header-text: #ffffff;
  --color-accent: #3d9168;
  --color-accent-dark: #2e7050;
  --color-text: #1a1a1a;
  --color-muted: #666;
  --color-border: #e0e0e0;
  --color-tag: #e8f5ef;
  --color-tag-text: #2e7050;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --radius: 6px;
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
  --container: 1200px;
}

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-dark); text-decoration: underline; }

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

/* ---- Layout ---- */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.page-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  padding: 30px 0;
}

.main-content { min-width: 0; }
.sidebar { min-width: 0; }

/* ---- Header ---- */

header {
  background: var(--color-header);
  color: var(--color-header-text);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-logo {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

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

nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
}

nav ul li a {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}

nav ul li a:hover {
  color: #fff;
  text-decoration: none;
}

/* ---- Leaderboard Ad Zone ---- */

.ad-leaderboard-wrap {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 10px 0;
  text-align: center;
}

.ad-label {
  font-size: 10px;
  color: #bbb;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* ---- Ad slot base styles ---- */

[data-oa-ads] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border: 1px dashed #ccc;
  overflow: hidden;
  vertical-align: top;
}

[data-oa-ads][data-oa-rendered] {
  background: transparent;
  border: none;
}

[data-oa-ads]:not([data-oa-rendered])::before {
  content: attr(data-oa-ads);
  font-size: 11px;
  color: #aaa;
  font-style: italic;
  padding: 8px;
  text-align: center;
}

/* Explicit sizing for each slot type */
[data-oa-ads*="728x90"]  { width: 728px; height: 90px; max-width: 100%; }
[data-oa-ads*="300x250"] { width: 300px; height: 250px; max-width: 100%; }
[data-oa-ads*="160x600"] { width: 160px; height: 600px; max-width: 100%; }
[data-oa-ads*="320x50"]  { width: 320px; height: 50px; max-width: 100%; }

/* ---- Hero ---- */

.hero {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.hero-image {
  background: linear-gradient(135deg, #1a2332 0%, #3d9168 100%);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
}

.hero-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-tag {
  display: inline-block;
  background: var(--color-tag);
  color: var(--color-tag-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
  color: var(--color-text);
}

.hero-title a { color: var(--color-text); }
.hero-title a:hover { color: var(--color-accent); text-decoration: none; }

.hero-excerpt {
  color: var(--color-muted);
  font-size: 15px;
  margin-bottom: 16px;
}

.hero-meta {
  font-size: 13px;
  color: var(--color-muted);
}

/* ---- Section heading ---- */

.section-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-muted);
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

/* ---- Article cards ---- */

.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.article-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.article-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }

.card-image {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.card-body { padding: 16px; }

.card-tag {
  display: inline-block;
  background: var(--color-tag);
  color: var(--color-tag-text);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 7px;
  border-radius: 3px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
}

.card-title a { color: var(--color-text); }
.card-title a:hover { color: var(--color-accent); text-decoration: none; }

.card-excerpt {
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.card-meta {
  font-size: 12px;
  color: #aaa;
}

/* ---- In-feed ad ---- */

.in-feed-ad {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  border: 1px solid var(--color-border);
  grid-column: 1 / -1;
}

/* ---- Sidebar ---- */

.sidebar-widget {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.sidebar-widget .section-heading { margin-top: 0; }

.sidebar-articles { list-style: none; }

.sidebar-articles li {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-articles li:last-child { border-bottom: none; }

.sidebar-articles .art-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 3px;
}

.sidebar-articles .art-title a { color: var(--color-text); }
.sidebar-articles .art-title a:hover { color: var(--color-accent); text-decoration: none; }

.sidebar-articles .art-meta {
  font-size: 12px;
  color: #aaa;
}

.sidebar-ad-wrap {
  text-align: center;
}

/* ---- Mobile banner (shown only on small screens) ---- */
.mobile-ad-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.95);
  border-top: 1px solid var(--color-border);
  padding: 6px;
  text-align: center;
  z-index: 200;
}

/* ---- Article page ---- */

.article-header {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.article-tag {
  display: inline-block;
  background: var(--color-tag);
  color: var(--color-tag-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 14px;
}

.article-title {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 14px;
  color: var(--color-text);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--color-muted);
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-header), var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.article-body {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.article-body p { margin-bottom: 18px; font-size: 17px; line-height: 1.75; }
.article-body h2 { font-size: 22px; font-weight: 800; margin: 28px 0 14px; }
.article-body h3 { font-size: 18px; font-weight: 700; margin: 22px 0 10px; }
.article-body ul, .article-body ol { margin: 0 0 18px 22px; }
.article-body li { font-size: 17px; line-height: 1.75; margin-bottom: 6px; }
.article-body blockquote {
  border-left: 4px solid var(--color-accent);
  padding: 12px 20px;
  margin: 20px 0;
  background: var(--color-tag);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-muted);
}

.article-body .in-article-ad {
  margin: 28px auto;
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px;
  background: #fafafa;
}

/* ---- Footer ---- */

footer {
  background: var(--color-header);
  color: rgba(255,255,255,0.6);
  padding: 40px 0 20px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 30px;
}

.footer-brand .site-logo { font-size: 20px; margin-bottom: 10px; display: block; }

.footer-col h4 {
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul li a { color: rgba(255,255,255,0.5); font-size: 14px; }
.footer-col ul li a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
  .page-wrap { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-ad-bar { display: block; }
  body { padding-bottom: 70px; }
}

@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; }
  .hero-image { min-height: 180px; }
  .articles-grid { grid-template-columns: 1fr; }
  .article-title { font-size: 24px; }
  .article-body p { font-size: 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  nav ul { gap: 14px; }
  [data-oa-ads*="728x90"] { width: 100%; }
}
