:root {
  --page-bg: #0b1220;
  --card-bg: rgba(15, 23, 42, 0.86);
  --card-border: rgba(148, 163, 184, 0.24);
  --text-main: #e6edf7;
  --text-muted: #9bb2ca;
  --accent: #1e90ff;
  --accent-strong: #0f66c2;
  --success: #1f9d6a;
  --danger: #d14343;
}

* {
  box-sizing: border-box;
}

body.blog-body {
  margin: 0;
  color: var(--text-main);
  font-family: "Manrope", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(14, 165, 233, 0.24), transparent 36%),
    radial-gradient(circle at 82% 80%, rgba(59, 130, 246, 0.2), transparent 34%),
    linear-gradient(145deg, #060d18, #111d32);
  min-height: 100vh;
}

.blog-page {
  max-width: 1180px;
  margin: 110px auto 40px;
  padding: 0 20px;
}

.blog-hero {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 18px;
  margin-bottom: 18px;
}

.blog-header,
.auth-panel-card,
.blog-form,
.blog-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.blog-header {
  padding: 24px;
}

.eyebrow {
  display: inline-block;
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8cc7ff;
}

.blog-header h1 {
  margin: 10px 0;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 55ch;
}

.auth-panel-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-note {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.auth-buttons {
  display: flex;
  gap: 10px;
}

.auth-actions button,
.blog-form button,
.post-actions button {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  color: #f7fbff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  font-weight: 700;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.auth-actions button:hover,
.blog-form button:hover,
.post-actions button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.blog-status {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.6);
  color: #c8daef;
  font-size: 0.94rem;
}

.blog-status.success {
  border-color: rgba(31, 157, 106, 0.45);
  color: #8ae4be;
}

.blog-status.error {
  border-color: rgba(209, 67, 67, 0.45);
  color: #ffadad;
}

.blog-form {
  padding: 20px;
  margin-bottom: 20px;
}

.blog-form h2 {
  margin-top: 0;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.blog-form input,
.blog-form textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 0.95rem;
  background: rgba(2, 6, 23, 0.75);
  color: #f1f5f9;
}

.blog-form input:focus,
.blog-form textarea:focus {
  outline: none;
  border-color: rgba(30, 144, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

.blog-form textarea {
  min-height: 120px;
  resize: vertical;
}

.file-row {
  display: grid;
  gap: 8px;
}

.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.blog-card {
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.3);
}

.blog-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
}

.blog-images img {
  width: 100%;
  height: 102px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.blog-content {
  padding: 8px 14px 14px;
}

.blog-content h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.blog-content p {
  margin: 0;
  color: #d7e6f7;
  line-height: 1.6;
}

.read-more-hint {
  display: inline-block;
  margin-top: 12px;
  color: #8cc7ff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.post-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}

.post-actions .delete-btn {
  background: linear-gradient(135deg, #ef4444, #c12626);
}

body.detail-open {
  overflow: hidden;
}

.blog-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 1150;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.hidden,
.blog-detail-overlay.hidden {
  display: none;
}

.blog-detail-card {
  position: relative;
  width: min(1080px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(8, 15, 28, 0.98), rgba(15, 23, 42, 0.98));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
}

.detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 540px;
}

.detail-media {
  position: relative;
  padding: 26px;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
}

.detail-image-frame {
  min-height: 440px;
  background: rgba(2, 6, 23, 0.75);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-image-frame img {
  width: 100%;
  height: 440px;
  object-fit: cover;
}

.detail-empty {
  color: var(--text-muted);
  font-size: 1rem;
  padding: 30px;
  text-align: center;
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.82);
  color: #eff6ff;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.carousel-control.prev {
  left: 38px;
}

.carousel-control.next {
  right: 38px;
}

.detail-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.detail-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(148, 163, 184, 0.45);
  cursor: pointer;
}

.detail-dot.active {
  background: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}

.detail-copy {
  padding: 34px 30px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.detail-eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: #8cc7ff;
}

.detail-copy h2 {
  margin: 0 0 18px;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1.08;
}

.detail-description {
  margin: 0;
  color: #dbe8f7;
  line-height: 1.9;
  font-size: 1.02rem;
  white-space: pre-wrap;
}

@media (max-width: 950px) {
  .blog-page {
    margin-top: 95px;
  }

  .blog-hero {
    grid-template-columns: 1fr;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-media {
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }
}

@media (max-width: 700px) {
  .blog-list {
    grid-template-columns: 1fr;
  }

  .blog-images {
    grid-template-columns: 1fr;
  }

  .blog-images img {
    height: 180px;
  }

  .blog-detail-overlay {
    padding: 12px;
  }

  .detail-media,
  .detail-copy {
    padding: 18px;
  }

  .detail-image-frame,
  .detail-image-frame img {
    min-height: 260px;
    height: 260px;
  }

  .carousel-control.prev {
    left: 22px;
  }

  .carousel-control.next {
    right: 22px;
  }
}
