/* =============================================
   THEBLOGSPOST.COM - Main Stylesheet
   Modern Navy + Electric Blue + White Theme
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

:root {
  --primary: #0b1426;
  --primary-mid: #122040;
  --accent: #2563eb;
  --accent2: #06b6d4;
  --accent-glow: rgba(37,99,235,0.18);
  --bg: #f0f4fa;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #dde6f5;
  --shadow: 0 4px 24px rgba(37,99,235,0.09);
  --shadow-hover: 0 12px 40px rgba(37,99,235,0.18);
  --radius: 14px;
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

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

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary);
}

/* ===================== HEADER ===================== */
header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 24px rgba(37,99,235,0.22);
  border-bottom: 2px solid var(--accent);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 68px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo .logo-the {
  color: var(--accent2);
  font-style: italic;
}

.logo .logo-blogs {
  color: #fff;
}

.logo .logo-post {
  background: var(--accent);
  color: #fff;
  padding: 2px 10px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

nav a {
  color: rgba(255,255,255,0.75);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 7px 14px;
  border-radius: 6px;
  transition: all 0.2s;
  font-weight: 500;
  letter-spacing: 0.2px;
}

nav a:hover,
nav a.active {
  background: var(--accent);
  color: #fff;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  width: 26px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}

/* ===================== TICKER / BREAKING NEWS ===================== */
.news-ticker {
  background: var(--accent);
  color: #fff;
  padding: 8px 0;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.ticker-label {
  background: var(--accent2);
  color: var(--primary);
  padding: 2px 14px;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-track {
  overflow: hidden;
  flex: 1;
}

.ticker-inner {
  display: inline-flex;
  gap: 48px;
  animation: ticker-scroll 35s linear infinite;
  white-space: nowrap;
  padding-left: 32px;
}

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

.ticker-inner span::before {
  content: '●';
  margin-right: 12px;
  opacity: 0.6;
  font-size: 0.6rem;
}

/* ===================== HERO ===================== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 55%, #1a3a6e 100%);
  color: #fff;
  padding: 80px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(37,99,235,0.25) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(6,182,212,0.15) 0%, transparent 50%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg);
  clip-path: polygon(0 100%, 100% 100%, 100% 40%, 0 100%);
}

.hero h2 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 400;
  margin-bottom: 18px;
  position: relative;
  line-height: 1.2;
  font-style: italic;
}

.hero p {
  font-size: 1.05rem;
  opacity: 0.82;
  max-width: 600px;
  margin: 0 auto 30px;
  position: relative;
  font-weight: 400;
}

.hero-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  padding: 14px 34px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.5px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  text-transform: uppercase;
}

.hero-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(37,99,235,0.45);
  color: #fff !important;
}

/* ===================== FEATURED BANNER ===================== */
.featured-banner {
  background: linear-gradient(90deg, var(--primary-mid) 0%, #1e3a6e 100%);
  padding: 11px 24px;
  text-align: center;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.9);
  font-weight: 500;
  border-bottom: 1px solid rgba(37,99,235,0.3);
}

.featured-banner a {
  color: var(--accent2) !important;
  font-weight: 700;
  margin-left: 6px;
}

/* ===================== CATEGORY BADGES ROW ===================== */
.category-nav {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 10px 24px;
}

.category-nav a {
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  border: 1.5px solid var(--border);
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.category-nav a:hover,
.category-nav a.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===================== MAIN LAYOUT ===================== */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.main-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

/* ===================== SECTION TITLE ===================== */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--primary);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
  font-style: italic;
}

/* ===================== TOP POSTS GRID ===================== */
.top-posts-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.top-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.top-post-card {
  background: var(--bg);
  border-radius: 10px;
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.2s;
}

.top-post-card:hover {
  background: var(--primary);
  border-left-color: var(--accent2);
  transform: translateX(4px);
  box-shadow: var(--shadow-hover);
}

.top-post-card:hover .top-post-num,
.top-post-card:hover .top-post-title {
  color: #fff;
}

.top-post-num {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  min-width: 28px;
  font-style: italic;
}

.top-post-title {
  font-size: 0.87rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
  transition: color 0.2s;
}

/* ===================== BLOG POST CARDS ===================== */
.post-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
  border: 1px solid var(--border);
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.post-card img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
}

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

.post-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.post-category {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.post-category.cat-news      { background: #dc2626; }
.post-category.cat-technology { background: #7c3aed; }
.post-category.cat-seo        { background: #059669; }
.post-category.cat-excel      { background: #0891b2; }

.post-date {
  font-size: 0.8rem;
  color: var(--text-light);
}

.post-card h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--primary);
  margin-bottom: 10px;
  line-height: 1.3;
  font-style: italic;
}

.post-card h2 a {
  color: var(--primary);
}

.post-card h2 a:hover {
  color: var(--accent);
}

.post-card p {
  color: var(--text-light);
  font-size: 0.93rem;
  margin-bottom: 18px;
  line-height: 1.68;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff !important;
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
  letter-spacing: 0.3px;
}

.read-more:hover {
  background: var(--primary);
  transform: translateX(3px);
  color: #fff !important;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
  position: sticky;
  top: 90px;
}

.widget {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
}

.widget h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--primary);
  margin-bottom: 14px;
  font-style: italic;
}

.about-widget img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
  border: 3px solid var(--accent);
}

.widget ul {
  list-style: none;
}

.widget ul li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.91rem;
}

.widget ul li:last-child {
  border-bottom: none;
}

.widget ul li a {
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.widget ul li a:hover {
  color: var(--accent);
}

.cat-count {
  background: var(--bg);
  color: var(--text-light);
  font-size: 0.73rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

/* Search widget */
.search-form {
  display: flex;
  gap: 8px;
}

.search-form input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg);
}

.search-form input:focus {
  border-color: var(--accent);
  background: #fff;
}

.search-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}

.search-form button:hover {
  background: var(--primary);
}

/* ===================== SINGLE POST PAGE ===================== */
.post-single {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.post-single-hero {
  width: 100%;
  height: 380px;
  object-fit: cover;
  display: block;
}

.post-single-body {
  padding: 36px;
}

.post-single-body h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 400;
  color: var(--primary);
  margin: 16px 0;
  line-height: 1.25;
  font-style: italic;
}

.post-single-body .post-content p {
  margin-bottom: 20px;
  font-size: 1.05rem;
  line-height: 1.82;
  color: var(--text);
}

.post-single-body .post-content h2 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  color: var(--primary);
  margin: 32px 0 12px;
  font-style: italic;
  padding-left: 14px;
  border-left: 4px solid var(--accent);
}

.post-single-body .post-content ul {
  padding-left: 22px;
  margin-bottom: 20px;
  color: var(--text);
}

.post-single-body .post-content ul li {
  margin-bottom: 8px;
  font-size: 1rem;
  line-height: 1.65;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-light);
  font-size: 0.86rem;
  margin-bottom: 8px;
  transition: color 0.2s;
  font-weight: 500;
}

.back-link:hover {
  color: var(--accent);
}

/* ===================== ABOUT PAGE ===================== */
.about-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  color: #fff;
  padding: 60px 24px;
  text-align: center;
}

.about-hero h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 400;
  font-style: italic;
}

.about-hero p {
  opacity: 0.75;
  max-width: 500px;
  margin: 12px auto 0;
}

.about-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  margin-top: 40px;
  border: 1px solid var(--border);
}

.about-content h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 12px;
  font-style: italic;
}

.about-content p {
  color: var(--text-light);
  margin-bottom: 18px;
}

/* ===================== CONTACT PAGE ===================== */
.contact-form {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  max-width: 700px;
}

/* ===================== FOOTER ===================== */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.72);
  margin-top: 60px;
  border-top: 3px solid var(--accent);
}

.footer-top {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 400;
  color: #fff;
  margin-bottom: 12px;
  font-style: italic;
}

.footer-logo span {
  color: var(--accent2);
}

.footer-desc {
  font-size: 0.89rem;
  line-height: 1.72;
  margin-bottom: 20px;
}

.footer-col h4 {
  font-family: var(--font-body);
  color: #fff;
  font-size: 0.82rem;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul li a {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-col ul li a:hover {
  color: var(--accent2);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  padding: 16px 24px;
  font-size: 0.84rem;
  color: rgba(255,255,255,0.45);
}

/* ===================== PAGINATION ===================== */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.pagination a,
.pagination span {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.88rem;
  background: var(--card-bg);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: all 0.2s;
  font-weight: 600;
  border: 1px solid var(--border);
}

.pagination a:hover,
.pagination span.current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===================== BREADCRUMB ===================== */
.breadcrumb {
  font-size: 0.81rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--text-light);
}

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

/* ===================== ALERT ===================== */
.alert {
  padding: 14px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.alert-success {
  background: #dbeafe;
  color: #1e40af;
  border-left: 4px solid var(--accent);
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #dc2626;
}

/* ===================== TOPICS SECTION ===================== */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 44px;
}

.topic-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-bottom: 4px solid var(--accent);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  display: block;
}

.topic-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.topic-card .topic-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
  display: block;
}

.topic-card .topic-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--primary);
  font-weight: 400;
  font-style: italic;
  display: block;
  margin-bottom: 6px;
}

.topic-card .topic-desc {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.5;
}

.topic-card.blue   { border-bottom-color: #2563eb; }
.topic-card.purple { border-bottom-color: #7c3aed; }
.topic-card.green  { border-bottom-color: #059669; }
.topic-card.cyan   { border-bottom-color: #0891b2; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .header-inner {
    height: 60px;
  }

  nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border-top: 2px solid var(--accent);
  }

  nav.open {
    display: flex;
  }

  nav a {
    width: 100%;
    text-align: center;
  }

  .hamburger {
    display: flex;
  }

  .footer-top {
    grid-template-columns: 1fr;
  }

  .logo {
    font-size: 1.25rem;
  }

  .top-posts-section {
    padding: 20px;
  }

  .post-single-body {
    padding: 22px;
  }

  .about-content,
  .contact-form {
    padding: 22px;
  }

  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
