/* Blog (public) */

*, *::before, *::after {
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1000px 700px at 18% 28%, rgba(232,169,77,0.16), rgba(232,169,77,0) 60%),
    radial-gradient(950px 850px at 72% 55%, rgba(232,169,77,0.12), rgba(232,169,77,0) 62%),
    radial-gradient(700px 700px at 85% 18%, rgba(255,255,255,0.035), rgba(255,255,255,0) 58%),
    radial-gradient(1400px 1000px at 50% 45%, rgba(0,0,0,0) 35%, rgba(0,0,0,0.62) 78%, rgba(0,0,0,0.88) 100%),
    linear-gradient(180deg, var(--bg) 0%, #14100b 58%, #0f0c07 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--white);
  font-family: 'Barlow', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

.blog-hero {
  padding: 72px 0 24px;
}

.blog-title {
  font-size: clamp(1.3rem, 2.3vw, 1.95rem);
  letter-spacing: -0.02em;
  margin: 0;
}

.blog-subtitle {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.75);
  max-width: 60ch;
}

.blog-list {
  padding: 24px 0 84px;
}

.blog-cards {
  display: grid;
  gap: 18px;
}

.blog-card {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 26px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

@media (max-width: 980px) {
  .blog-card {
    grid-template-columns: 1fr;
  }
}

.blog-card__media {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
}

.blog-card__img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

.blog-card__img--placeholder {
  width: 100%;
  min-height: 220px;
  background:
    radial-gradient(600px 240px at 30% 30%, rgba(232, 169, 77, 0.18), rgba(232, 169, 77, 0) 55%),
    rgba(0, 0, 0, 0.22);
}

.blog-card__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.blog-card__title {
  font-size: 1.25rem;
  margin: 0;
}

.blog-card__header {
  display: grid;
  gap: 12px;
}

.blog-card__title a {
  color: inherit;
  text-decoration: none;
}

.blog-card__title a:hover {
  text-decoration: underline;
}

.blog-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.blog-card__avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: rgba(26, 21, 16, 0.95);
  background: rgba(232, 169, 77, 0.9);
  border: 1px solid rgba(232, 169, 77, 0.35);
  flex: 0 0 auto;
}

.blog-card__category {
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
}

.blog-card__dot {
  opacity: 0.6;
}

.blog-card__excerpt {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.blog-card__tags,
.blog-article__tags {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-tag {
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.8);
}

.blog-card__footer {
  margin-top: 14px;
}

.blog-readmore {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 10px 14px;
  border-radius: 12px;
}

.blog-readmore:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.blog-readmore--primary {
  border-color: rgba(232, 169, 77, 0.45);
  background: rgba(232, 169, 77, 0.95);
  color: #1a1510;
  font-weight: 900;
  padding: 12px 18px;
}

.blog-readmore--primary:hover {
  filter: brightness(1.06);
  border-color: rgba(232, 169, 77, 0.6);
}

.blog-pagination {
  margin-top: 26px;
}

.blog-pagination__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 12px 14px;
}

.blog-page-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.blog-page-link:hover {
  text-decoration: underline;
}

.blog-page-disabled {
  color: rgba(255, 255, 255, 0.45);
}

.blog-page-status {
  color: rgba(255, 255, 255, 0.65);
}

.blog-article__header {
  padding: 72px 0 22px;
}

.blog-back {
  display: inline-block;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}

.blog-back:hover {
  text-decoration: underline;
}

.blog-article__title {
  margin: 0;
  font-size: clamp(1.3rem, 2.3vw, 1.95rem);
  letter-spacing: -0.02em;
}

.blog-article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.7);
}

.blog-article__excerpt {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.65;
  max-width: 70ch;
}

.blog-article__body {
  padding: 20px 0 84px;
}

.blog-content {
  padding: 18px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.75;
}

.blog-content > :first-child {
  margin-top: 0;
}

.blog-content h1,
.blog-content h2,
.blog-content h3 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 1.2em 0 0.5em;
}

.blog-content h1 { font-size: 1.9rem; }
.blog-content h2 { font-size: 1.55rem; }
.blog-content h3 { font-size: 1.25rem; }

.blog-content p {
  margin: 0.9em 0;
}

.blog-content a {
  color: rgba(255, 214, 128, 0.95);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-content a:hover {
  color: rgba(255, 214, 128, 1);
}

.blog-content ul,
.blog-content ol {
  margin: 0.9em 0;
  padding-left: 1.25em;
}

.blog-content li {
  margin: 0.35em 0;
}

.blog-content blockquote {
  margin: 1em 0;
  padding: 0.8em 1em;
  border-left: 3px solid rgba(255, 214, 128, 0.6);
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
}

.blog-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  padding: 0.15em 0.35em;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-content pre {
  margin: 1.1em 0;
  padding: 14px 16px;
  border-radius: 16px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.blog-content pre code {
  padding: 0;
  border: 0;
  background: transparent;
}

.blog-empty {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 22px;
  color: rgba(255, 255, 255, 0.85);
}

/* Blog show: content + sidebar */

.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 26px;
  align-items: start;
}

@media (max-width: 980px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }
}

.blog-featured {
  margin: 0 0 16px;
}

.blog-featured__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.15);
}

.blog-sidebar {
  display: grid;
  gap: 18px;
}

.blog-widget {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.blog-widget__header {
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.55);
  border-bottom: 2px solid rgba(232, 169, 77, 0.85);
}

.blog-widget__title {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.95);
}

.blog-widget__body {
  padding: 14px 16px;
}

.blog-muted {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
}

/* Comments */

.blog-comments-wrap {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.blog-comments-box {
  padding: 18px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-comments-box--form {
  background: rgba(0, 0, 0, 0.2);
}

.blog-comments__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.blog-comments__title {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.blog-comments__count {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
}

.blog-comments__list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 12px;
}

.blog-comment {
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.12);
}

.blog-comment__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.blog-comment__name {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 800;
}

.blog-comment__body {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.7;
}

.blog-flash {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(232, 169, 77, 0.22);
  background: rgba(232, 169, 77, 0.08);
  color: rgba(255, 255, 255, 0.92);
}

.blog-comment-form__title {
  margin: 0;
  font-size: 1.25rem;
}

.blog-comment-form__hint {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.65);
}

.blog-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 700px) {
  .blog-form-grid {
    grid-template-columns: 1fr;
  }
}

.blog-form-field {
  margin-top: 14px;
}

.blog-form-grid .blog-form-field {
  margin-top: 0;
}

.blog-label {
  display: inline-block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
}

.blog-input,
.blog-textarea {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.92);
  padding: 10px 12px;
  outline: none;
}

.blog-textarea {
  resize: vertical;
}

.blog-input:focus,
.blog-textarea:focus {
  border-color: rgba(232, 169, 77, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 169, 77, 0.12);
}

.blog-input--error {
  border-color: rgba(255, 120, 120, 0.55);
}

.blog-error {
  margin-top: 8px;
  color: rgba(255, 170, 170, 0.95);
  font-size: 0.95rem;
}

.blog-form-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 10px 14px;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

/* Search */

.blog-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.blog-search__input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.92);
  padding: 10px 12px;
  outline: none;
}

.blog-search__input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.blog-search__input:focus {
  border-color: rgba(232, 169, 77, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 169, 77, 0.12);
}

.blog-search__button {
  border-radius: 12px;
  border: 1px solid rgba(232, 169, 77, 0.45);
  background: rgba(232, 169, 77, 0.95);
  color: #1a1510;
  font-weight: 800;
  padding: 10px 14px;
  cursor: pointer;
}

.blog-search__button:hover {
  filter: brightness(1.06);
}

.blog-search__button:focus-visible {
  outline: 2px solid rgba(232, 169, 77, 0.8);
  outline-offset: 3px;
}

.blog-admin-actions {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.blog-admin-edit {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.blog-admin-edit__icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  flex-shrink: 0;
}

/* Categories */

.blog-categories {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-categories li + li {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.blog-categories a {
  display: block;
  padding: 10px 2px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
}

.blog-categories a:hover {
  color: rgba(255, 214, 128, 1);
}

/* Latest posts */

.blog-latest {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.blog-latest__item {
  border-radius: 14px;
}

.blog-latest__link {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.12);
}

.blog-latest__link:hover {
  border-color: rgba(232, 169, 77, 0.25);
}

.blog-latest__thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
}

.blog-latest__title {
  font-weight: 800;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.95);
}

.blog-latest__meta {
  margin-top: 6px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
}

/* Accessibility */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Threaded Comments — Instagram-style */

.thread-comments {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.thread-comment {
  position: relative;
}

.thread-comment__body {
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.12);
}

.thread-comment__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.thread-comment__name {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 800;
}

.thread-comment__time {
  color: rgba(255, 255, 255, 0.55);
}

.thread-comment__text {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.7;
}

.thread-comment__actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.thread-comment__reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 0;
  transition: color 0.15s ease;
}

.thread-comment__reply-btn:hover {
  color: rgba(255, 255, 255, 0.9);
}

.thread-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.thread-comment__reply-form {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(232, 169, 77, 0.2);
  background: rgba(0, 0, 0, 0.22);
  animation: thread-fade-in 0.2s ease;
}

@keyframes thread-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.thread-comment__replies {
  position: relative;
  margin-top: 4px;
  margin-left: 24px;
  padding-left: 16px;
}

.thread-comment__replies::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

.thread-comment__replies .thread-comment__replies::before {
  background: rgba(255, 255, 255, 0.06);
}

.thread-comment__replies .thread-comment__replies {
  margin-left: 20px;
}

.thread-comment__replies--flat {
  margin-left: 0;
  padding-left: 0;
}

.thread-comment__replies--flat::before {
  display: none;
}

.thread-comment__replies--flat .thread-comment__body {
  border-left: 2px solid rgba(232, 169, 77, 0.3);
  border-radius: 0 14px 14px 0;
}

@media (max-width: 700px) {
  .thread-comment__replies {
    margin-left: 16px;
    padding-left: 12px;
  }

  .thread-comment__replies .thread-comment__replies {
    margin-left: 12px;
  }
}

/* Comment delete button */

.thread-comment__delete-form {
  display: inline;
  margin: 0;
}

.thread-comment__delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 120, 120, 0.8);
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
  transition: color 0.15s ease;
}

.thread-comment__delete-btn:hover {
  color: rgba(255, 120, 120, 1);
}

.thread-comment__delete-btn .thread-icon {
  opacity: 0.8;
}

/* SweetAlert-style confirmation modal */

.sa-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sa-modal--open {
  opacity: 1;
  pointer-events: auto;
}

.sa-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
}

.sa-modal__card {
  position: relative;
  width: 90%;
  max-width: 420px;
  padding: 32px 28px 28px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 18, 22, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
  transform: scale(0.92) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sa-modal--open .sa-modal__card {
  transform: scale(1) translateY(0);
}

.sa-modal__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(232, 169, 77, 0.12);
  color: rgba(232, 169, 77, 0.9);
}

.sa-modal__icon svg {
  width: 28px;
  height: 28px;
}

.sa-modal__title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.01em;
}

.sa-modal__text {
  margin: 0 0 24px;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.65);
}

.sa-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.sa-modal__btn {
  flex: 1;
  padding: 11px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.sa-modal__btn--cancel {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.sa-modal__btn--cancel:hover {
  background: rgba(255, 255, 255, 0.14);
}

.sa-modal__btn--confirm {
  color: #fff;
  background: rgba(232, 169, 77, 0.9);
  border-color: rgba(232, 169, 77, 0.5);
}

.sa-modal__btn--confirm:hover {
  background: rgba(232, 169, 77, 1);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232, 169, 77, 0.25);
}

.sa-modal__btn--confirm:active {
  transform: translateY(0);
}
