:root {
  --blog-bg: #0b1120;
  --blog-page-bg: #0a1628;
  --blog-panel: #121b2e;
  --blog-panel-soft: rgba(255, 255, 255, 0.045);
  --blog-border: rgba(255, 255, 255, 0.1);
  --blog-text: #e5edf7;
  --blog-muted: #93a4b8;
  --blog-accent: #3b82f6;
  --blog-green: #22c55e;
  --blog-amber: #f59e0b;
  --blog-red: #ef4444;
  --blog-ink: #06111f;
  --blog-page-muted: #5d6c80;
  --blog-page-line: rgba(59, 130, 246, 0.18);
}

* { box-sizing: border-box; }

html { background: var(--blog-bg); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--blog-bg);
  color: var(--blog-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.blog-page {
  background: var(--blog-page-bg);
  color: var(--blog-text);
}

a { color: inherit; }

.hidden { display: none !important; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: 0.75rem;
  z-index: 10000;
  transform: translateY(-150%);
  border-radius: 999px;
  background: #fff;
  color: #1d4ed8;
  padding: 0.75rem 1rem;
  font-weight: 850;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.blog-shell,
.article-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 96px;
}

body.blog-page .blog-shell {
  width: 100%;
  padding: 0 0 clamp(4rem, 8vw, 7rem);
}

.blog-hero {
  padding: 38px 0 26px;
  border-bottom: 1px solid var(--blog-border);
}

.blog-hero-compact { max-width: 760px; }

body.blog-page .blog-hero {
  max-width: none;
  display: grid;
  align-items: center;
  min-height: 300px;
  padding: clamp(4.5rem, 7vw, 6rem) clamp(1rem, 4vw, 4rem) clamp(3rem, 5vw, 4.5rem);
  color: #fff;
  background: #071426;
  border-bottom: 1px solid rgba(147, 197, 253, 0.16);
}

body.blog-page .blog-hero__copy {
  width: min(1120px, 100%);
  margin: 0 auto;
  border-top: 1px solid rgba(147, 197, 253, 0.3);
  border-bottom: 1px solid rgba(147, 197, 253, 0.3);
  padding: clamp(1.5rem, 3vw, 2.25rem) 0;
}

.blog-kicker {
  margin: 0 0 8px;
  color: #8cc5ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

body.blog-page .blog-kicker {
  color: #dbeafe;
}

.blog-hero h1,
.writer-header h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

body.blog-page .blog-hero h1 {
  max-width: 980px;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1;
  font-weight: 950;
}

.blog-hero p:not(.blog-kicker),
.writer-dashboard-top p,
.panel-heading p {
  margin: 14px 0 0;
  color: var(--blog-muted);
  line-height: 1.65;
}

body.blog-page .blog-hero p:not(.blog-kicker) {
  max-width: 740px;
  color: rgba(239, 246, 255, 0.9);
  font-size: clamp(1rem, 1.25vw, 1.14rem);
  line-height: 1.65;
}

.blog-toolbar {
  padding: 24px 0;
}

body.blog-page .blog-toolbar {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.25rem) 0;
}

.blog-search {
  display: grid;
  gap: 8px;
  max-width: 560px;
  color: var(--blog-muted);
  font-size: 13px;
  font-weight: 700;
}

body.blog-page .blog-search {
  max-width: none;
  grid-template-columns: auto minmax(220px, 560px);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #93a4b8;
}

body.blog-page .blog-search span {
  color: #e5edf7;
  font-size: 1.05rem;
}

.blog-search input,
.meta-grid input,
.meta-grid select,
.social-panel textarea,
.summary-editor,
.closing-editor {
  width: 100%;
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
  color: var(--blog-text);
  padding: 12px 14px;
  font: inherit;
  outline: none;
}

body.blog-page .blog-search input {
  border-color: rgba(147, 197, 253, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--blog-text);
  min-height: 52px;
}

.blog-search input:focus,
.meta-grid input:focus,
.meta-grid select:focus,
.post-title-input:focus,
.summary-editor:focus,
.closing-editor:focus,
.social-panel textarea:focus,
.body-editor:focus {
  border-color: rgba(59, 130, 246, .72);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.blog-status {
  color: var(--blog-muted);
  padding: 20px 0;
}

body.blog-page .blog-status {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  color: #93a4b8;
}

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

body.blog-page .blog-grid {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

.blog-card,
.writer-card {
  overflow: hidden;
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  background: var(--blog-panel-soft);
  text-decoration: none;
}

body.blog-page .blog-card {
  grid-template-columns: minmax(240px, 34%) minmax(0, 1fr);
  border-color: rgba(147, 197, 253, 0.16);
  background: rgba(255, 255, 255, 0.045);
  color: var(--blog-text);
}

.blog-card {
  display: grid;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.blog-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, .45);
  background: rgba(255, 255, 255, .07);
}

body.blog-page .blog-card:hover {
  border-color: rgba(96, 165, 250, 0.44);
  background: rgba(255, 255, 255, 0.07);
}

.blog-card-image,
.writer-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #182238;
  object-fit: cover;
  display: block;
}

body.blog-page .blog-card-image {
  height: 100%;
  min-height: 220px;
  background: #16243a;
  aspect-ratio: auto;
}

.image-placeholder {
  display: grid;
  place-items: center;
  color: var(--blog-muted);
  font-weight: 700;
}

body.blog-page .image-placeholder {
  color: #93c5fd;
}

.blog-card-body,
.writer-card-body {
  padding: 16px;
}

body.blog-page .blog-card-body {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.1rem, 2.4vw, 1.75rem);
}

.blog-card h2,
.writer-card h3 {
  margin: 0;
  color: #fff;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: 0;
}

body.blog-page .blog-card h2 {
  color: #fff;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  line-height: 1.12;
}

.blog-type,
.status-badge,
.editor-mode-label,
.writer-role-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.blog-type {
  margin: 12px 0;
  background: rgba(59, 130, 246, .14);
  color: #9cc8ff;
  border: 1px solid rgba(59, 130, 246, .22);
}

body.blog-page .blog-type {
  background: rgba(59, 130, 246, 0.16);
  color: #bfdbfe;
  border-color: rgba(147, 197, 253, 0.24);
}

.status-badge.draft {
  background: rgba(245, 158, 11, .14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, .24);
}

.status-badge.published {
  background: rgba(34, 197, 94, .14);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, .24);
}

.blog-card-summary {
  color: #c7d2df;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.blog-page .blog-card-summary {
  color: #cbd7e6;
  display: block;
  overflow: visible;
  line-height: 1.65;
  margin: 0.25rem 0 1rem;
}

.blog-card-meta,
.article-meta {
  color: var(--blog-muted);
  font-size: 13px;
}

body.blog-page .blog-card-meta {
  color: #93a4b8;
}

.writer-social-preview {
  margin: 12px 0 0;
  color: #c7d2df;
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.writer-social-preview strong {
  color: #fbbf24;
}

.article-shell {
  max-width: 840px;
}

.article-hero {
  width: 100%;
  max-height: 520px;
  border-radius: 8px;
  object-fit: cover;
  background: #182238;
}

.article-gallery {
  display: flex;
  gap: 10px;
  margin: 14px 0 32px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.article-gallery button {
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.article-gallery img {
  width: 120px;
  height: 82px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.article-title {
  color: #fff;
  font-size: clamp(34px, 7vw, 60px);
  line-height: 1.02;
  letter-spacing: 0;
  margin: 0 0 14px;
}

.article-summary {
  font-weight: 800;
  font-size: 20px;
  line-height: 1.65;
}

.article-body,
.article-closing {
  color: #d8e2ee;
  font-size: 18px;
  line-height: 1.8;
}

.article-body h1,
.article-body h2,
.article-body h3 {
  color: #fff;
  margin-top: 1.7em;
  letter-spacing: 0;
}

.article-body a { color: #93c5fd; }

.article-rule {
  border: 0;
  border-top: 1px solid var(--blog-border);
  margin: 28px 0;
}

.article-closing { font-style: italic; }

.blog-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, .92);
  display: grid;
  place-items: center;
  padding: 24px;
}

.blog-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.blog-lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
}

.blog-loading {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background: var(--blog-bg);
  color: var(--blog-muted);
}

.blog-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(59, 130, 246, .16);
  border-top-color: var(--blog-accent);
  border-radius: 50%;
  animation: blogSpin .8s linear infinite;
}

@keyframes blogSpin { to { transform: rotate(360deg); } }

.writer-header,
.writer-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.writer-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--blog-border);
}

.writer-header > div { flex: 1; }

.writer-header h1 { font-size: clamp(28px, 4vw, 44px); }

.writer-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 38px;
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--blog-muted);
  font-size: 13px;
  font-weight: 800;
}

.writer-role-badge {
  background: rgba(59, 130, 246, .14);
  color: #bfdbfe;
  border: 1px solid rgba(59, 130, 246, .24);
}

.writer-shell { padding: 28px 0 120px; }

.writer-dashboard-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.writer-dashboard-top h2,
.panel-heading h2,
.image-block h3 {
  margin: 0;
  color: #fff;
  letter-spacing: 0;
}

.blog-btn {
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  padding: 11px 16px;
  color: var(--blog-text);
  background: rgba(255, 255, 255, .055);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.blog-btn-primary {
  border-color: rgba(59, 130, 246, .65);
  background: var(--blog-accent);
  color: #fff;
}

.blog-btn-secondary {
  border-color: rgba(59, 130, 246, .35);
  background: rgba(59, 130, 246, .13);
  color: #bfdbfe;
}

.blog-btn-danger {
  border-color: rgba(239, 68, 68, .4);
  background: rgba(239, 68, 68, .13);
  color: #fecaca;
}

.blog-btn-ghost { background: transparent; }

.blog-btn-disabled {
  cursor: not-allowed;
  opacity: .48;
  color: var(--blog-muted);
}

.writer-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.writer-card-actions .blog-btn {
  padding: 8px 11px;
  font-size: 13px;
}

.editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.editor-mode-label {
  background: rgba(255, 255, 255, .06);
  color: var(--blog-muted);
  border: 1px solid var(--blog-border);
}

.editor-header-panel,
.editor-panel {
  border: 1px solid var(--blog-border);
  border-radius: 8px;
  background: var(--blog-panel-soft);
  padding: 22px;
  margin-bottom: 18px;
}

.title-label,
.structured-label,
.meta-grid label {
  display: grid;
  gap: 8px;
  color: var(--blog-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.post-title-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--blog-border);
  background: transparent;
  color: #fff;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.05;
  padding: 10px 0 16px;
  outline: none;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.inline-message {
  border-radius: 8px;
  padding: 12px 14px;
  color: #dbeafe;
  background: rgba(59, 130, 246, .12);
  border: 1px solid rgba(59, 130, 246, .22);
}

.inline-message.error {
  color: #fecaca;
  background: rgba(239, 68, 68, .12);
  border-color: rgba(239, 68, 68, .24);
}

.image-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 20px;
}

.image-drop {
  display: grid;
  place-items: center;
  min-height: 86px;
  margin: 12px 0;
  border: 1px dashed rgba(148, 163, 184, .45);
  border-radius: 8px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, .08);
  cursor: pointer;
  font-weight: 800;
}

.cover-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #182238;
  color: var(--blog-muted);
}

.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  min-height: 112px;
  padding-bottom: 8px;
}

.gallery-thumb {
  position: relative;
  flex: 0 0 128px;
  height: 96px;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--blog-border);
}

.gallery-thumb button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .68);
  color: #fff;
  cursor: pointer;
}

.upload-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.upload-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--blog-accent);
}

.summary-editor {
  margin: 10px 0 18px;
  font-weight: 800;
  line-height: 1.6;
}

.editor-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--blog-border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #10192c;
}

.editor-toolbar button {
  border: 1px solid var(--blog-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
  color: var(--blog-text);
  padding: 7px 10px;
  cursor: pointer;
  font-weight: 800;
}

.body-editor {
  min-height: 520px;
  border: 1px solid var(--blog-border);
  border-radius: 0 0 8px 8px;
  background: rgba(255, 255, 255, .035);
  color: #eaf2fc;
  padding: 24px;
  outline: none;
  font-size: 18px;
  line-height: 1.75;
}

.body-editor h1,
.body-editor h2,
.body-editor h3 {
  color: #fff;
  letter-spacing: 0;
}

.closing-editor {
  margin-top: 10px;
  font-style: italic;
  line-height: 1.6;
}

.social-panel h2 span {
  margin-left: 8px;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fbbf24;
  background: rgba(245, 158, 11, .12);
  border: 1px solid rgba(245, 158, 11, .22);
  font-size: 11px;
  text-transform: uppercase;
}

.social-panel textarea {
  resize: vertical;
  line-height: 1.6;
}

.save-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px max(16px, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--blog-border);
  background: rgba(11, 17, 32, .94);
  backdrop-filter: blur(16px);
}

.save-bar span {
  flex: 1;
  color: var(--blog-muted);
}

.ara-site-footer {
  background: #071426;
  color: #fff;
  border-top: 1px solid rgba(147, 197, 253, 0.18);
}

.ara-site-footer__inner {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.2rem 0;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.1fr) auto;
  gap: 1.5rem;
  align-items: start;
}

.ara-site-footer strong {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
}

.ara-site-footer p {
  margin: 0.4rem 0 0;
  color: rgba(226, 238, 255, 0.72);
  font-size: 0.9rem;
  line-height: 1.55;
}

.ara-site-footer__mission {
  max-width: 440px;
}

.ara-site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem 1rem;
}

.ara-site-footer__links a {
  color: rgba(226, 238, 255, 0.86);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.ara-site-footer__links a:hover {
  color: #fff;
}

.ara-site-footer__legal {
  grid-column: 1 / -1;
  padding-top: 1rem;
  border-top: 1px solid rgba(147, 197, 253, 0.12);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ara-site-footer__legal a {
  color: rgba(226, 238, 255, 0.9);
  font-weight: 800;
  text-decoration: none;
}

.ara-site-footer__legal a:hover {
  color: #fff;
}

.ara-site-footer__legal-links {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

@media (max-width: 760px) {
  .blog-shell,
  .article-shell,
  .writer-header,
  .writer-shell {
    width: min(100% - 24px, 1120px);
  }

  .writer-header,
  .writer-dashboard-top,
  .panel-heading,
  .save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .meta-grid,
  .image-layout {
    grid-template-columns: 1fr;
  }

  .save-bar {
    padding: 12px;
  }

  body.blog-page .blog-hero {
    min-height: 250px;
    padding: 4.5rem 1rem 2.75rem;
  }

  body.blog-page .blog-search {
    grid-template-columns: 1fr;
  }

  body.blog-page .blog-card {
    grid-template-columns: 1fr;
  }

  body.blog-page .blog-card-image,
  body.blog-page .blog-card-body {
    min-height: 0;
  }

  body.blog-page .blog-card-image {
    aspect-ratio: 16 / 10;
  }

  .ara-site-footer__inner {
    grid-template-columns: 1fr;
  }

  .ara-site-footer__links {
    justify-content: flex-start;
  }
}
