/* ==========================================================
   CRIMSON HERALD THEME — CSS
   Visual DNA: SEOcom-inspired red/navy editorial portal
   ========================================================== */

/* --- CSS Variables --- */
:root {
  --c-red: #D81324;
  --c-red-dark: #b5101e;
  --c-navy: #0B2154;
  --c-navy-light: #122d6b;
  --c-light: #F2F2F2;
  --c-dark: #111111;
  --c-white: #ffffff;
  --c-gray-50: #f9f9f9;
  --c-gray-100: #eeeeee;
  --c-gray-300: #cccccc;
  --c-gray-500: #777777;
  --c-gray-700: #444444;
  --c-text: #333333;
  --c-text-light: rgba(255,255,255,.7);

  --ff-heading: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --ff-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius-sharp: 3px;
  --radius-feature: 40px 3px 3px 3px;
  --radius-icon: 0 0 40px 0;

  --shadow-card: 0 2px 40px rgba(0,0,0,.07);
  --shadow-lift: 0 8px 50px rgba(0,0,0,.12);

  --transition: .35s ease;
  --max-w: 1200px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-white);
  overflow-x: hidden;
}

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

a { color: var(--c-red); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--c-red-dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--c-dark);
}

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

/* --- Utility --- */
.badge-label {
  display: inline-block;
  background: var(--c-red);
  color: var(--c-white);
  padding: 2px 12px;
  border-radius: var(--radius-sharp);
  font-size: .85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  font-family: var(--ff-heading);
  font-size: .95rem;
  font-weight: 600;
  border-radius: var(--radius-sharp);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--c-red);
  color: var(--c-white);
}
.btn-primary:hover {
  background: var(--c-red-dark);
  color: var(--c-white);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(216,19,36,.3);
}

.btn-outline {
  background: transparent;
  color: var(--c-navy);
  border: 2px solid var(--c-navy);
}
.btn-outline:hover {
  background: var(--c-navy);
  color: var(--c-white);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--c-white);
  border: 2px solid rgba(255,255,255,.4);
}
.btn-ghost:hover {
  border-color: var(--c-white);
  background: rgba(255,255,255,.1);
  color: var(--c-white);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* --- Skip Nav --- */
.skip-nav {
  position: absolute;
  top: -100px;
  left: 10px;
  background: var(--c-navy);
  color: var(--c-white);
  padding: 8px 16px;
  z-index: 10000;
  border-radius: var(--radius-sharp);
}
.skip-nav:focus { top: 10px; color: var(--c-white); }

/* ===========================
   HEADER / NAVIGATION
   =========================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--c-red);
  transition: background var(--transition), box-shadow var(--transition);
}

.site-header.scrolled {
  background: var(--c-red);
  box-shadow: 0 2px 20px rgba(0,0,0,.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.site-logo {
  font-family: var(--ff-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--c-white);
  text-decoration: none;
}
.site-logo:hover { color: var(--c-white); }

.main-nav { display: flex; align-items: center; gap: 8px; }

.main-nav a {
  color: rgba(255,255,255,.7);
  padding: 6px 16px;
  font-size: .95rem;
  font-weight: 500;
  border-radius: var(--radius-sharp);
  transition: var(--transition);
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--c-white);
  background: rgba(255,255,255,.12);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--c-white);
  margin: 5px 0;
  border-radius: 2px;
  transition: var(--transition);
}

.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px,6px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-6px); }

@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .main-nav {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    background: var(--c-navy);
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    transform: translateX(100%);
    transition: transform .4s ease;
    z-index: 999;
  }
  .main-nav.open { transform: translateX(0); }

  .main-nav a {
    font-size: 1.2rem;
    padding: 14px 24px;
    width: 80%;
    text-align: center;
  }
}

/* ===========================
   HERO (Home)
   =========================== */
.hero {
  position: relative;
  background: var(--c-red);
  padding: 80px 0 60px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(11,33,84,.25) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.08) 0%, transparent 40%);
  pointer-events: none;
  animation: heroPulse 10s ease-in-out infinite alternate;
}

@keyframes heroPulse {
  0% { opacity: .6; }
  100% { opacity: 1; }
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-text { position: relative; z-index: 1; }

.hero-text h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  color: var(--c-white);
  margin-bottom: 20px;
  line-height: 1.15;
}

.hero-text h1 .highlight {
  display: inline;
  background: var(--c-navy);
  padding: 2px 14px;
  border-radius: var(--radius-sharp);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,.85);
  margin-bottom: 28px;
  line-height: 1.65;
}
.hero-subtitle p { margin: 0 0 8px; }

.hero-cta .btn { margin-right: 12px; margin-bottom: 8px; }

.hero-visual {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual .decorative-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 360px;
}

.decorative-grid .cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sharp);
  animation: fadeUp .6s ease both;
}
.decorative-grid .cell:nth-child(1) { background: rgba(255,255,255,.12); animation-delay: .1s; }
.decorative-grid .cell:nth-child(2) { background: rgba(255,255,255,.2); animation-delay: .2s; border-radius: var(--radius-feature); }
.decorative-grid .cell:nth-child(3) { background: rgba(255,255,255,.08); animation-delay: .3s; }
.decorative-grid .cell:nth-child(4) { background: var(--c-navy); animation-delay: .15s; }
.decorative-grid .cell:nth-child(5) { background: rgba(255,255,255,.25); animation-delay: .25s; }
.decorative-grid .cell:nth-child(6) { background: rgba(255,255,255,.1); animation-delay: .35s; border-radius: 3px 3px 3px 40px; }
.decorative-grid .cell:nth-child(7) { background: rgba(255,255,255,.15); animation-delay: .2s; }
.decorative-grid .cell:nth-child(8) { background: rgba(255,255,255,.06); animation-delay: .3s; }
.decorative-grid .cell:nth-child(9) { background: var(--c-navy); opacity: .6; animation-delay: .4s; border-radius: 3px 40px 3px 3px; }

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

@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .hero { padding: 60px 0 50px; }
}

/* ===========================
   SECTION UTILITY
   =========================== */
.section { padding: 70px 0; }
.section-navy { background: var(--c-navy); color: var(--c-white); }
.section-navy h2, .section-navy h3, .section-navy h4 { color: var(--c-white); }
.section-light { background: var(--c-light); }
.section-red { background: var(--c-red); color: var(--c-white); }
.section-red h2 { color: var(--c-white); }

.section-header {
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 12px;
}

.section-header p {
  color: var(--c-gray-500);
  max-width: 620px;
  font-size: 1.05rem;
}

.section-navy .section-header p { color: var(--c-text-light); }

/* ===========================
   LATEST POSTS (Home)
   =========================== */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.post-card {
  background: var(--c-white);
  border-radius: var(--radius-feature);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: var(--transition);
}
.post-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lift);
}

.post-card-img {
  position: relative;
  overflow: hidden;
  height: 200px;
  background: var(--c-light);
}
.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.post-card:hover .post-card-img img { transform: scale(1.05); }

.post-card-body { padding: 28px 28px 24px; }

.post-card-date {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--c-red);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.post-card-title {
  font-size: 1.15rem;
  margin-bottom: 10px;
}
.post-card-title a { color: var(--c-dark); }
.post-card-title a:hover { color: var(--c-red); }

.post-card-excerpt {
  color: var(--c-gray-500);
  font-size: .92rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.post-card-link {
  font-weight: 600;
  font-size: .88rem;
  color: var(--c-navy);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.post-card-link:hover { color: var(--c-red); gap: 10px; }
.post-card-link::after { content: "→"; }

/* Featured (first) post - span full width */
.post-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--radius-feature);
}
.post-card.featured .post-card-img { height: 100%; min-height: 280px; }
.post-card.featured .post-card-body { padding: 36px 36px 32px; display: flex; flex-direction: column; justify-content: center; }
.post-card.featured .post-card-title { font-size: 1.5rem; }

@media (max-width: 768px) {
  .posts-grid { grid-template-columns: 1fr; }
  .post-card.featured { grid-template-columns: 1fr; }
  .post-card.featured .post-card-img { min-height: 200px; }
}

/* ===========================
   TOPICS
   =========================== */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.topic-card {
  position: relative;
  padding: 36px 28px 28px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-feature);
  transition: var(--transition);
  overflow: hidden;
}

.topic-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 60px; height: 60px;
  background: var(--c-red);
  border-radius: var(--radius-icon);
  opacity: .5;
  transition: var(--transition);
}
.topic-card:hover::before { width: 80px; height: 80px; opacity: .7; }
.topic-card:hover { transform: translateY(-6px); background: rgba(255,255,255,.1); }

.topic-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.topic-card .topic-desc {
  color: var(--c-text-light);
  font-size: .92rem;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}
.topic-card .topic-desc p { margin: 0 0 6px; }

@media (max-width: 900px) { .topics-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 550px) { .topics-grid { grid-template-columns: 1fr; } }

/* ===========================
   FAQ
   =========================== */
.faq-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.faq-item {
  background: var(--c-white);
  border-radius: var(--radius-feature);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: var(--transition);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: .98rem;
  color: var(--c-dark);
  gap: 12px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--ff-body);
}
.faq-question:hover { color: var(--c-red); }
.faq-question:focus { outline: 2px solid var(--c-red); outline-offset: -2px; }

.faq-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-red);
  color: var(--c-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  transition: transform var(--transition);
}
.faq-item.open .faq-icon { transform: rotate(45deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, padding .3s ease;
}
.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-answer-inner {
  padding: 0 24px 20px;
  color: var(--c-gray-500);
  font-size: .93rem;
  line-height: 1.65;
}
.faq-answer-inner p { margin: 0 0 8px; }
.faq-answer-inner p:last-child { margin-bottom: 0; }

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

/* ===========================
   BANNER STRIP (red divider)
   =========================== */
.banner-strip {
  background: var(--c-red);
  padding: 48px 0;
  text-align: center;
}
.banner-strip h2 {
  color: var(--c-white);
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  margin-bottom: 16px;
}
.banner-strip p { color: rgba(255,255,255,.8); margin-bottom: 20px; }

/* ===========================
   BLOG INDEX
   =========================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

@media (min-width: 1000px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .blog-grid { grid-template-columns: 1fr; } }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 48px; flex-wrap: wrap; }

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-sharp);
  font-weight: 600;
  font-size: .9rem;
  transition: var(--transition);
}

.pagination a {
  background: var(--c-light);
  color: var(--c-navy);
}
.pagination a:hover {
  background: var(--c-red);
  color: var(--c-white);
}
.pagination a.active,
.pagination span.active {
  background: var(--c-navy);
  color: var(--c-white);
  pointer-events: none;
}

.pagination .prev-next { font-size: .85rem; }

/* ===========================
   SINGLE POST
   =========================== */
.post-header {
  background: var(--c-red);
  padding: 80px 0 50px;
  color: var(--c-white);
}
.post-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--c-white);
  margin-bottom: 12px;
}
.post-meta {
  font-size: .9rem;
  color: rgba(255,255,255,.7);
}

.post-cover {
  margin: -30px auto 40px;
  max-width: 900px;
  border-radius: var(--radius-feature);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  position: relative;
  z-index: 2;
}
.post-cover img { width: 100%; display: block; }

.post-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

.post-content h2, .post-content h3, .post-content h4 {
  margin-top: 2em;
  margin-bottom: .6em;
}

.post-content p { margin-bottom: 1.2em; }
.post-content ul, .post-content ol { margin-bottom: 1.2em; padding-left: 1.4em; }
.post-content li { margin-bottom: .4em; }
.post-content img { border-radius: var(--radius-sharp); margin: 1.6em 0; }
.post-content blockquote {
  border-left: 4px solid var(--c-red);
  margin: 1.6em 0;
  padding: .8em 1.2em;
  color: var(--c-gray-700);
  background: var(--c-gray-50);
  border-radius: 0 var(--radius-sharp) var(--radius-sharp) 0;
}

.post-excerpt-block {
  font-size: 1.1rem;
  color: var(--c-gray-700);
  border-left: 4px solid var(--c-red);
  padding: .5em 1.2em;
  margin-bottom: 2em;
  line-height: 1.6;
}

/* ===========================
   PAGE (generic)
   =========================== */
.page-header {
  background: var(--c-red);
  padding: 80px 0 50px;
  color: var(--c-white);
}
.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--c-white);
}

.page-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 20px 60px;
}
.page-content h2, .page-content h3 { margin-top: 1.8em; margin-bottom: .6em; }
.page-content p { margin-bottom: 1.2em; }
.page-content ul, .page-content ol { margin-bottom: 1.2em; padding-left: 1.4em; }
.page-content li { margin-bottom: .4em; }
.page-content img { border-radius: var(--radius-sharp); margin: 1.4em 0; }

/* ===========================
   FOOTER
   =========================== */
.site-footer {
  background: var(--c-navy);
  color: var(--c-text-light);
  padding: 56px 0 0;
}

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

.footer-brand .site-logo { margin-bottom: 14px; display: inline-block; }
.footer-brand p { color: var(--c-text-light); font-size: .93rem; line-height: 1.6; max-width: 340px; }

.footer-col h4 {
  color: var(--c-white);
  font-size: 1rem;
  margin-bottom: 18px;
  font-weight: 700;
}

.footer-nav a {
  display: block;
  color: var(--c-text-light);
  padding: 5px 0;
  font-size: .93rem;
  transition: var(--transition);
  position: relative;
  padding-left: 16px;
}
.footer-nav a::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--c-red);
  font-weight: bold;
}
.footer-nav a:hover { color: var(--c-white); padding-left: 20px; }

.footer-contact a {
  color: var(--c-text-light);
  display: block;
  padding: 4px 0;
  font-size: .93rem;
}
.footer-contact a:hover { color: var(--c-white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .85rem;
}

.footer-bottom-links a {
  color: var(--c-text-light);
  margin-left: 18px;
  font-size: .85rem;
}
.footer-bottom-links a:hover { color: var(--c-white); }

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-bottom-links a { margin: 0 9px; }
}

/* ===========================
   BACK TO TOP
   =========================== */
.back-to-top {
  position: fixed;
  bottom: 36px;
  right: 36px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sharp);
  background: var(--c-red);
  color: var(--c-white);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  border: none;
  z-index: 500;
  transition: var(--transition);
}
.back-to-top:hover { background: var(--c-red-dark); transform: translateY(-3px); }
.back-to-top.visible { display: flex; }

/* ===========================
   ANIMATIONS (scroll reveal)
   =========================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Focus visible for keyboard nav */
:focus-visible {
  outline: 2px solid var(--c-red);
  outline-offset: 2px;
}
