/* ============================================
   GlanceChronicle.com — Global Stylesheet
   FT-inspired editorial design system
   ============================================ */

/* --- Design Tokens --- */
:root {
  --bg-salmon: #FFF1E5;
  --bg-white: #FFFFFF;
  --ink-black: #1A1A1A;
  --ink-gray: #66605C;
  --ink-light: #95908C;
  --border-tan: #E8DFD3;
  --accent-red: #B22222;
  --cat-tech: #003B5C;
  --cat-ent: #7A2C5C;
  --cat-fin: #0E4D3C;
  --cat-game: #B22222;
  --font-serif: 'Old Standard TT', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --max-width: 1200px;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-salmon);
  color: var(--ink-black);
  line-height: 1.6;
  font-size: 16px;
}
a { color: var(--cat-tech); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-red); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* --- Layout Helpers --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section { padding: 40px 0; }
.text-center { text-align: center; }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 700; line-height: 1.25; }
h1 { font-size: clamp(28px, 4vw, 42px); }
h2 { font-size: clamp(22px, 3vw, 32px); }
h3 { font-size: clamp(18px, 2.5vw, 24px); }
.serif { font-family: var(--font-serif); }
.mono { font-family: var(--font-mono); }

/* --- Masthead --- */
.masthead {
  background: var(--ink-black);
  color: var(--bg-salmon);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.masthead-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 22px;
  color: var(--bg-salmon);
  letter-spacing: 0.5px;
}
.logo span { color: var(--accent-red); }
.nav { display: flex; gap: 24px; align-items: center; }
.nav a {
  color: var(--bg-salmon);
  font-size: 14px;
  font-weight: 500;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.nav a:hover, .nav a.active { opacity: 1; color: var(--bg-salmon); border-bottom: 2px solid var(--accent-red); }
.nav-toggle { display: none; background: none; border: none; color: var(--bg-salmon); font-size: 24px; cursor: pointer; }

/* --- Category Badges --- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
}
.badge-tech { background: var(--cat-tech); }
.badge-ent { background: var(--cat-ent); }
.badge-fin { background: var(--cat-fin); }
.badge-game { background: var(--cat-game); }
.badge a { color: #fff; }

/* --- Hero Section (Homepage) --- */
.hero {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-tan);
  padding: 40px 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 32px;
}
.hero-main { }
.hero-main .hero-img {
  width: 100%;
  height: 380px;
  background: var(--cat-tech);
  border-radius: var(--radius);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 48px;
}
.hero-main h1 { margin-bottom: 12px; }
.hero-main .excerpt { font-size: 18px; color: var(--ink-gray); margin-bottom: 16px; line-height: 1.7; }
.hero-meta { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--ink-light); }
.hero-side { display: flex; flex-direction: column; gap: 20px; }
.hero-side-item {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-tan);
}
.hero-side-item:last-child { border-bottom: none; }
.hero-side-item h3 { font-size: 17px; margin: 8px 0 6px; }
.hero-side-item .meta { font-size: 12px; color: var(--ink-light); }

/* --- Section Title --- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink-black);
}
.section-title h2 { font-size: 24px; }
.section-title .count { font-size: 13px; color: var(--ink-light); }
.section-title a { font-size: 13px; font-weight: 600; }

/* --- Article Grid --- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.article-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.article-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.article-card .card-img {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.25);
  font-size: 36px;
}
.article-card .card-body { padding: 16px 18px; }
.article-card .card-body .badge { margin-bottom: 8px; }
.article-card h3 { font-size: 17px; margin-bottom: 8px; line-height: 1.35; }
.article-card h3 a { color: var(--ink-black); }
.article-card h3 a:hover { color: var(--accent-red); }
.article-card .card-meta { font-size: 12px; color: var(--ink-light); }
.article-card .card-excerpt { font-size: 14px; color: var(--ink-gray); margin-top: 8px; line-height: 1.5; }

/* --- Category Section --- */
.cat-section { padding: 36px 0; border-top: 1px solid var(--border-tan); }
.cat-section .article-grid { grid-template-columns: repeat(4, 1fr); }
.cat-section .article-card .card-img { height: 140px; }
.cat-section .article-card h3 { font-size: 15px; }

/* --- Article Page --- */
.article-page { padding: 40px 0; }
.article-header { max-width: 800px; margin: 0 auto 32px; text-align: left; }
.article-header .badge { margin-bottom: 16px; }
.article-header h1 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 16px; line-height: 1.3; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  color: var(--ink-gray);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-tan);
}
.article-meta .author { font-weight: 600; color: var(--ink-black); }
.article-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-light); }
.article-hero-img {
  max-width: 800px;
  margin: 0 auto 32px;
  height: 400px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.2);
  font-size: 56px;
}
.article-body {
  max-width: 800px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink-black);
}
.article-body p { margin-bottom: 20px; }
.article-body h2 { margin: 32px 0 16px; font-size: 24px; }
.article-body h3 { margin: 28px 0 12px; font-size: 20px; }
.article-body blockquote {
  border-left: 4px solid var(--accent-red);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--bg-white);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-gray);
}
.article-body ul, .article-body ol {
  margin: 16px 0 20px 20px;
  list-style: disc;
}
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 8px; }
.article-source {
  max-width: 800px;
  margin: 32px auto 0;
  padding: 20px;
  background: var(--bg-white);
  border-radius: var(--radius);
  border-left: 4px solid var(--cat-tech);
  font-size: 14px;
}
.article-source strong { display: block; margin-bottom: 6px; }
.article-tags {
  max-width: 800px;
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--bg-white);
  border: 1px solid var(--border-tan);
  font-size: 13px;
  color: var(--ink-gray);
}
.tag:hover { border-color: var(--accent-red); color: var(--accent-red); }
.article-footer-meta {
  max-width: 800px;
  margin: 32px auto 0;
  padding: 20px 0;
  border-top: 1px solid var(--border-tan);
  font-size: 13px;
  color: var(--ink-light);
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

/* --- Related Articles --- */
.related { padding: 40px 0; border-top: 1px solid var(--border-tan); }
.related .article-grid { grid-template-columns: repeat(3, 1fr); }

/* --- News Listing Page --- */
.listing-page { padding: 40px 0; }
.listing-header { margin-bottom: 32px; }
.listing-header h1 { margin-bottom: 8px; }
.listing-header .count { font-size: 14px; color: var(--ink-light); }
.featured-article {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.featured-article .featured-img {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.2);
  font-size: 48px;
}
.featured-article .featured-body { padding: 32px; }
.featured-article .featured-body h2 { margin: 12px 0 12px; }
.featured-article .featured-body p { color: var(--ink-gray); margin-bottom: 16px; }

/* --- Pagination --- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; }
.pagination a, .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}
.pagination a { background: var(--bg-white); border: 1px solid var(--border-tan); color: var(--ink-black); }
.pagination a:hover { border-color: var(--ink-black); }
.pagination .active { background: var(--ink-black); color: #fff; }

/* --- Search Page --- */
.search-page { padding: 40px 0; }
.search-box {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.search-box input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid var(--border-tan);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font-sans);
  background: var(--bg-white);
  outline: none;
  transition: border-color 0.2s;
}
.search-box input:focus { border-color: var(--ink-black); }
.search-box button {
  padding: 14px 28px;
  background: var(--accent-red);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.search-box button:hover { opacity: 0.9; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-chip {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-chip.active { background: var(--ink-black); color: #fff; }
.filter-chip:not(.active) { background: var(--bg-white); border: 1px solid var(--border-tan); color: var(--ink-black); }
.search-results { }
.search-result-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border-tan);
}
.search-result-item h3 a { color: var(--cat-tech); font-size: 16px; }
.search-result-item .meta { font-size: 13px; color: var(--ink-light); margin-top: 4px; }
.search-result-item .snippet { font-size: 14px; color: var(--ink-gray); margin-top: 6px; }
.no-results { text-align: center; padding: 60px 0; color: var(--ink-light); }

/* --- Compliance Pages --- */
.compliance-page { padding: 40px 0; }
.compliance-content {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 40px 48px;
  box-shadow: var(--shadow);
}
.compliance-content h1 { margin-bottom: 8px; }
.compliance-content .updated { font-size: 13px; color: var(--ink-light); margin-bottom: 32px; }
.compliance-content h2 { margin: 32px 0 12px; font-size: 22px; }
.compliance-content p { margin-bottom: 16px; color: var(--ink-gray); }
.compliance-content ul { margin: 12px 0 20px 20px; list-style: disc; }
.compliance-content li { margin-bottom: 8px; color: var(--ink-gray); }

/* --- Contact Form --- */
.contact-form { max-width: 600px; margin: 0 auto; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-tan);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font-sans);
  background: var(--bg-salmon);
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--ink-black); }
.form-group textarea { min-height: 150px; resize: vertical; }
.form-submit {
  padding: 14px 32px;
  background: var(--ink-black);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.form-submit:hover { opacity: 0.9; }

/* --- Footer --- */
.footer {
  background: var(--ink-black);
  color: var(--bg-salmon);
  padding: 48px 0 24px;
  margin-top: 60px;
}
.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}
.footer-brand .logo { margin-bottom: 12px; }
.footer-brand p { font-size: 13px; opacity: 0.7; line-height: 1.6; }
.footer-col h4 { font-family: var(--font-sans); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; opacity: 0.9; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--bg-salmon); font-size: 13px; opacity: 0.7; }
.footer-col a:hover { opacity: 1; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 24px 0;
  border-top: 1px solid rgba(255,241,229,0.15);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  opacity: 0.5;
}

/* --- Newsletter --- */
.newsletter {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  margin: 40px 0;
  box-shadow: var(--shadow);
}
.newsletter h2 { margin-bottom: 8px; }
.newsletter p { color: var(--ink-gray); margin-bottom: 24px; }
.newsletter-form { display: flex; gap: 12px; max-width: 480px; margin: 0 auto; }
.newsletter-form input {
  flex: 1;
  padding: 12px 18px;
  border: 1px solid var(--border-tan);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
}
.newsletter-form button {
  padding: 12px 24px;
  background: var(--accent-red);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-light);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--ink-gray); }
.breadcrumb span { opacity: 0.5; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-section .article-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-article { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--ink-black); padding: 20px; gap: 16px; }
  .nav-toggle { display: block; }
  .article-grid { grid-template-columns: 1fr; }
  .cat-section .article-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .compliance-content { padding: 24px 20px; }
  .newsletter-form { flex-direction: column; }
  .search-box { flex-direction: column; }
}
