/* ==========================================================================
   MERGED BLOG STYLES – Index + Single Article
   Combines both provided designs without breaking either layout
   Final version – ready to upload / use
   ========================================================================== */

:root {
  --primary: #000000;
  --accent: #3b82f6;
  --surface: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --bg: #f8fafc;
  --text: #000000;
  --gray-light: #f8f9fa;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --transition: all 0.4s cubic-bezier(0.23,1,0.32,1);

  --footer-bg: #ffffff;
  --footer-text: #1f2937;
  --footer-text-muted: #6b7280;
  --footer-accent: #1d4ed8;
  --footer-border: rgba(0,0,0,0.08);
  --footer-hover: #3b82f6;
  --badge-bg: rgba(0,0,0,0.03);
  --badge-border: rgba(0,0,0,0.10);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  background: #f8fafc;
  background-image: radial-gradient(#cbd5e1 0.2px, transparent 1px);
  background-size: 20px 20px;
}

/* ── NAVIGATION ────────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6%;
  z-index: 1000;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.12);
  transition: var(--transition);
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -1.2px;
  color: var(--text);
}

.logo img {
  height: 8rem;
  width: auto;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo:hover img {
  transform: scale(1.04);
  opacity: 0.92;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  position: relative;
  padding: 8px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
  transform: translateX(-50%);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn {
  height: 38px;
  padding: 0 18px 0 18px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(16px);
  color: #fff;
  white-space: nowrap;
  background: #000000;
  text-decoration: none;
}

.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px;
  z-index: 1001;
}

.menu-toggle span {
  width: 28px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(9px, 8px); }
.menu-toggle.open span:nth-child(2) { opacity: 0; transform: translateX(20px); }
.menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(9px, -8px); }

.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
  font-size: 2.8rem;
  font-weight: 400;
  letter-spacing: -1.5px;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-30px);
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateY(0);
}

.mobile-menu a {
  color: var(--text);
  text-decoration: none;
  opacity: 0.85;
  transition: all 0.4s ease;
}

.mobile-menu a:hover {
  opacity: 1;
  transform: scale(1.06);
}

.body-no-scroll {
  overflow: hidden !important;
  height: 100vh !important;
}

/* ── SHARED ────────────────────────────────────────────────────────────── */
.container {
  margin: 0 auto;
  padding-left: 6%;
  padding-right: 6%;
}

/* ── BLOG INDEX / LIST PAGE ────────────────────────────────────────────── */
.header {
  padding: 6.5rem 6% 4rem;
  text-align: center;
}

.header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -1.4px;
  line-height: 1.05;
  margin-bottom: 1.2rem;
  color: #0f172a;
}

.header p {
  font-size: 1.25rem;
  color: #475569;
  max-width: 600px;
  margin: 0 auto;
}

.featured-post {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  background: #F0F0F0;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 4rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.featured-post:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.featured-img {
  height: 400px;
  background-size: cover;
  background-position: center;
}

.featured-content {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1rem;
  width: fit-content;
  letter-spacing: 0.5px;
}

.featured-content h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  color: #0f172a;
}

.featured-content p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 1rem;
  line-height: 1.6;
}

.meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.main-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  margin-bottom: 4rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.post-card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s;
  position: relative;
}

.post-card:hover {
  transform: translateY(-4px);
}

.post-card .img-wrapper {
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 1rem;
  background: var(--surface);
}

.post-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  transition: transform 0.4s;
}

.post-card:hover img {
  transform: scale(1.05);
}

.post-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.post-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.post-link,
.post-title-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.post-title-link:hover {
  color: var(--accent);
}

.post-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.post-head h3 {
  flex: 1;
  margin: 0 0 0.5rem;
}

.share-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text-main);
  cursor: pointer;
  flex: 0 0 auto;
  transition: all 0.2s ease;
}

.share-toggle:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.share-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 200px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.5rem;
  display: none;
  z-index: 10;
}

.share-menu.open {
  display: block;
}

.share-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.65rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  text-align: left;
  color: var(--text-main);
  font-size: 0.92rem;
}

.share-menu button:hover {
  background: var(--surface);
}

.sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
}

.sidebar-section {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.sidebar-section h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8125rem;
  transition: all 0.2s;
  cursor: pointer;
  background: white;
}

.tag:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.sidebar-section input {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
}

.sidebar-section button {
  width: 100%;
  background: var(--primary);
  color: white;
  padding: 0.75rem;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}

.sidebar-section button:hover {
  background: #1f2937;
}

.newsletter-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* ── SINGLE ARTICLE PAGE ───────────────────────────────────────────────── */
.article-hero {
  position: relative;
  height: 60vh;
  min-height: 450px;
  overflow: hidden;
  margin-top: 70px;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem 6%;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  color: white;
}

.hero-overlay h1 {
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
  max-width: 900px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9375rem;
  opacity: 0.95;
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.share-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.05rem 0 1.25rem;
  border-bottom: 1px solid var(--border);
}

.share-label {
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.25rem;
  font-size: 0.95rem;
}

.share-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-1px);
}

.article-container {
  margin: 0 auto;
  padding: 3rem 6%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 4rem;
}

.article-content {
  font-size: 1.0625rem;
  color: #475569;
  line-height: 1.75;
}

.article-intro {
  font-size: 1.1875rem;
  font-weight: 500;
  color: #101010;
  margin-bottom: 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.7;
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 2.5rem 0 1.25rem;
  line-height: 1.3;
  color: var(--primary);
}

.article-figure {
  margin: 2.5rem 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.article-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.article-figure figcaption {
  padding: 1rem 1.25rem;
  background: var(--surface);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  line-height: 1.5;
}

.article-closure {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
  padding: 2rem 0 1rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  text-align: center;
  line-height: 1.6;
}

.article-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
}

.sidebar-widget {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.sidebar-widget h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--primary);
}

.related-posts {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.related-post {
  display: flex;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s;
}

.related-post:hover {
  transform: translateX(4px);
}

.related-post img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.related-info h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.375rem;
}

.related-info time {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.is-invalid{
    border-color : red !important;
}
.valid{
    border-color : #ddd;
}

/* ── FOOTER ────────────────────────────────────────────────────────────── */

/* ── RESPONSIVE ────────────────────────────────────────────────────────── */

/* Navigation */
@media (max-width: 1024px) {
  .nav-right { display: none; }
  .menu-toggle { display: flex; }
  nav { padding: 0 4%; }
  .article-hero {height: 45vh; min-height: 300px;}
}

/* Blog index */
@media (max-width: 1200px) {
  .container { padding-left: 4%; padding-right: 4%; }
  .header h1 { padding-top: 30px; }
  .featured-content h2 { font-size: 1.75rem; }
}

@media (max-width: 768px) {
  .container { padding-left: 3%; padding-right: 3%; }
  .header { padding: 120px 4% 40px; }
  .header h1 { font-size: 2rem; }
  .header p { font-size: 1rem; margin-bottom: 5rem; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-img { height: 250px; }
  .featured-content { padding: 2rem; }
  .featured-content h2 { font-size: 1.5rem; }
  .main-layout { grid-template-columns: 1fr; gap: 2rem; }
  .posts-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .sidebar { position: static; }
  .article-hero {height: 50vh; min-height: 350px;}
}

@media (max-width: 480px) {
  .container { padding-left: 2%; padding-right: 2%; }
  .header { padding: 80px 5% 30px; }
  .header h1 { font-size: 1.8rem; margin-bottom: 1rem; }
  .header p { font-size: 0.95rem; margin-bottom: 3rem; }
  .featured-img { height: 200px; }
  .featured-content { padding: 1.5rem; }
  .featured-content h2 { font-size: 1.25rem; }
  .featured-content p { font-size: 0.9375rem; }
  .post-card h3 { font-size: 1rem; }
  .post-card p { font-size: 0.875rem; }
  .article-hero {height: 30vh; min-height: 280px;}
}

@media (max-width: 480px) {
  .article-hero {height: 30vh; min-height: 250px;}
}

/* Article page */
@media (max-width: 1200px) {
  .hero-overlay h1 { font-size: 2.25rem; }
  .article-container { gap: 3rem; padding: 4%; }
}

@media (max-width: 780px) {
  .article-hero { height: 50vh; min-height: 350px; }
  .hero-overlay { padding: 2rem 4%; }
  .hero-overlay h1 { font-size: 1.875rem; }
  .article-container { grid-template-columns: 1fr; padding: 2.5rem 3%; gap: 2.5rem; }
  .article-content { font-size: 1rem; }
  .article-intro { font-size: 1.0625rem; }
  .article-sidebar { position: static; }
}

@media (max-width: 468px) {
  .article-hero { height: 45vh; min-height: 300px; }
  .hero-overlay { padding: 1.5rem 5%; }
  .hero-overlay h1 { font-size: 1.5rem; }
  .article-meta { font-size: 0.8125rem; flex-wrap: wrap; }
  .article-container { padding: 2rem 2%; }
  .article-content { font-size: 0.9375rem; }
  .article-intro { font-size: 1rem; }
  .article-content h2 { font-size: 1.375rem; }
  .related-post img { width: 70px; height: 70px; }
  .related-info h4 { font-size: 0.875rem; }
}