:root {
  --bg: #ffffff;
  --text: #15223a;
  --muted: #5d6a82;
  --line: #dde2ea;
  --brand: #2d5fd4;
  --brand-strong: #1d46a5;
  --surface-soft: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(1480px, calc(100% - 2.4rem));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.topbar-content {
  min-height: 92px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
}

.menu {
  display: flex;
  justify-content: center;
  gap: 1rem;
  align-items: center;
}

.menu a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
}

.menu a.active,
.menu a:hover {
  color: var(--brand-strong);
}

.account-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.account-menu-btn {
  position: relative;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-strong);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.account-menu-btn:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
  box-shadow: 0 10px 18px rgba(29, 70, 165, 0.12);
}

.account-menu-btn i {
  font-size: 1.15rem;
}

.account-menu-notification {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #be123c;
  border: 2px solid #fff;
}

.account-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 160px;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(21, 34, 58, 0.14);
  z-index: 20;
}

.account-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  text-align: left;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.account-menu-item:hover {
  background: var(--surface-soft);
  color: var(--brand-strong);
}

.account-admin-badge {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.35rem;
  background: #be123c;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.account-notification-btn {
  position: relative;
}

.account-notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.28rem;
  background: #be123c;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  border: 2px solid #fff;
}

.comment-notifications-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(360px, calc(100vw - 2rem));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(21, 34, 58, 0.14);
  z-index: 21;
  overflow: hidden;
}

.comment-notifications-head {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.comment-notifications-head h4 {
  margin: 0;
  font-size: 0.95rem;
}

.comment-notifications-list {
  max-height: 320px;
  overflow: auto;
}

.comment-notification-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #eef2fb;
  background: #fff;
  text-align: left;
  padding: 0.72rem 0.85rem;
  cursor: pointer;
}

.comment-notification-item:last-child {
  border-bottom: 0;
}

.comment-notification-item:hover {
  background: #fff;
}

.comment-notification-item.is-unread {
  background: #fff;
}

.comment-notification-item-title {
  margin: 0 0 0.2rem;
  color: var(--text);
  font-size: 0.88rem;
}

.comment-notification-item-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.menu-btn {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  width: 42px;
  height: 42px;
}

.main-content {
  padding-block: 2rem 2.8rem;
}

.tab-section {
  display: none;
}

.tab-section.active {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: 1.65fr 0.95fr;
  gap: 2.2rem;
  align-items: center;
  padding: 2.6rem 0 2rem;
}

.hero-kicker {
  margin: 0;
  color: var(--brand-strong);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  font-size: 0.8rem;
}

.hero h1 {
  margin: 0.15rem 0 0.65rem;
  font-family: "IBM Plex Serif", serif;
  font-size: clamp(2.7rem, 5.6vw, 4.25rem);
  line-height: 1.12;
}

.hero p {
  font-size: 1.22rem;
  max-width: 900px;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.hero-logo {
  width: min(100%, 350px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 20px;
  margin-inline: auto;
}

.section-block {
  margin-top: 1rem;
}

#inicio .section-block {
  margin-top: 0.5rem;
}

.section-block h2 {
  margin: 0 0 0.7rem;
  font-family: "IBM Plex Serif", serif;
  font-size: 2.15rem;
}

#inicio .section-block h2 {
  font-size: 1.9rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.post-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  background: #fff;
}

.post-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
}

.post-meta {
  margin: 0.55rem 0 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.post-card h3 {
  margin: 0;
}

.post-summary {
  color: var(--muted);
  margin: 0.4rem 0 0.7rem;
}

.read-more-btn,
.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-strong);
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.read-more-btn:hover,
.ghost-btn:hover {
  border-color: var(--brand);
}

.reading-text {
  padding: 0 2rem;
}

.reading-text p {
  color: var(--muted);
  margin: 0;
  white-space: pre-wrap;
  text-align: justify;
}

.reading-text p + p {
  margin-top: 1rem;
}

.about-image {
  margin: 1.5rem 0;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  max-height: 500px;
  object-fit: cover;
}

.social-links {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--brand-strong);
}

.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}

.footer-icons {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.footer-icons a {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #111;
  display: grid;
  place-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-icons a:hover {
  opacity: 0.75;
}

.article-content {
  margin-top: 0.8rem;
}

.article-content h2 {
  margin: 0.7rem 0 0.35rem;
  font-family: "IBM Plex Serif", serif;
}

.article-title {
  color: var(--text);
}

.article-title.is-metallic {
  background: linear-gradient(120deg, #424242 0%, #c7c7c7 22%, #6a6a6a 40%, #f0f0f0 56%, #7b7b7b 72%, #d6d6d6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.45);
}

.article-content p {
  color: var(--muted);
}

.article-summary {
  font-size: 1.08rem;
  color: var(--text);
}

.article-body img {
  margin: 0.75rem 0;
  border-radius: 10px;
}

.article-body strong {
  color: var(--text);
}

.article-references {
  margin-top: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 0.9rem 1rem;
}

.article-references h3 {
  margin: 0 0 0.55rem;
  font-family: "IBM Plex Serif", serif;
  font-size: 1.1rem;
}

.article-references ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.article-references li + li {
  margin-top: 0.35rem;
}

.article-engagement,
.article-comments {
  margin-top: 1.4rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(21, 34, 58, 0.06);
}

.article-engagement-head,
.article-comments-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.article-engagement-head h3,
.article-comments-head h3 {
  margin: 0;
  font-family: "IBM Plex Serif", serif;
  font-size: 1.35rem;
}

.article-engagement-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.article-engagement-stats span {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-strong);
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.article-reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.engagement-btn-comment.is-active {
  background: rgba(45, 95, 212, 0.09);
  border-color: rgba(45, 95, 212, 0.42);
  color: var(--brand-strong);
}

.engagement-btn-comment.is-active i {
  color: var(--brand-strong);
}

.comment-panel {
  margin-top: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-10px);
  transition: max-height 0.45s ease, opacity 0.3s ease, transform 0.3s ease, margin-top 0.3s ease;
  pointer-events: none;
}

.comment-panel.is-open {
  margin-top: 1rem;
  max-height: 760px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.comment-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.comment-panel-actions {
  display: flex;
  justify-content: flex-start;
}

.engagement-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 0.62rem 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.engagement-btn:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
  box-shadow: 0 10px 18px rgba(29, 70, 165, 0.12);
}

.engagement-btn.is-active {
  background: rgba(45, 95, 212, 0.09);
  border-color: rgba(45, 95, 212, 0.4);
  color: var(--brand-strong);
}

.engagement-btn i {
  color: var(--brand-strong);
}

.engagement-btn:disabled {
  opacity: 0.78;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.post-card-reactions .engagement-btn {
  position: relative;
  overflow: visible;
}

.post-card-reactions .engagement-btn.is-animating {
  transform: scale(1.06);
}

.reaction-burst {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-size: 0.95rem;
  font-weight: 700;
  opacity: 0;
  animation: reactionBurst 0.72s ease-out forwards;
  animation-delay: var(--delay, 0s);
}

.reaction-burst.is-heart {
  color: #e11d48;
}

.reaction-burst.is-star {
  color: #f59e0b;
}

@keyframes reactionBurst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  16% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -36px))) scale(1.15);
  }
}

/* Fundo totalmente branco */
body,
.topbar,
.site-footer,
.section-block,
.auth-block,
.admin-panel-col,
.admin-editor-page,
.article-engagement,
.article-comments,
.article-references,
.post-card,
.support-section,
.support-methods,
.qrcode-wrapper,
.comment-notifications-head,
.comment-notification-item,
.comment-notification-item.is-unread,
.comment-notification-item:hover {
  background: #fff !important;
  background-image: none !important;
}

.article-comments {
  margin-bottom: 0.35rem;
}

.comment-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.comment-subtab-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-strong);
  border-radius: 12px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.comment-subtab-btn:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
}

.comment-subtab-btn.is-active {
  background: rgba(45, 95, 212, 0.1);
  border-color: rgba(45, 95, 212, 0.4);
}

.comment-subtab-close {
  margin-left: auto;
}

.comment-subtab-panel {
  display: none;
}

.comment-subtab-panel.is-open {
  display: block;
}

.article-comments-head-inline {
  margin-bottom: 0.8rem;
}

.comment-form {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.comment-form-note {
  margin: 0;
  color: var(--brand-strong);
  font-weight: 600;
}

.comment-form label {
  font-weight: 700;
  font-size: 0.92rem;
}

.comment-form input,
.comment-form textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.82rem;
  font: inherit;
  resize: vertical;
  background: #fff;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 95, 212, 0.12);
}

.comment-list {
  display: grid;
  gap: 0.7rem;
}

.comment-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.8rem 0.9rem;
}

.comment-item.is-reply {
  border-left: 4px solid rgba(45, 95, 212, 0.62);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.comment-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.comment-item-head-main {
  display: grid;
  gap: 0.2rem;
}

.comment-item-head strong {
  color: var(--brand-strong);
}

.comment-item-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.comment-item-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.comment-item-actions .ghost-btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
}

.comment-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.comment-like-btn .fa-heart {
  color: #c22a39;
}

.comment-like-btn.is-active {
  border-color: rgba(194, 42, 57, 0.28);
  background: rgba(194, 42, 57, 0.08);
  color: #b31f30;
}

.comment-reply-indicator {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 0.14rem 0.55rem;
  background: rgba(45, 95, 212, 0.1);
  color: var(--brand-strong);
  font-size: 0.75rem;
  font-weight: 700;
}

.comment-replies {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.75rem;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(45, 95, 212, 0.18);
}

.comment-item-text.is-hidden {
  display: none;
}

.comment-edit-form {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.comment-edit-form textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  resize: vertical;
  min-height: 90px;
}

.comment-edit-form textarea:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 95, 212, 0.12);
}

.auth-block {
  max-width: 520px;
  margin-inline: auto;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: 0 14px 40px rgba(21, 34, 58, 0.08);
  animation: loginCardIn 0.45s ease-out;
}

.auth-block.admin-mode {
  max-width: 100%;
  padding: 1.1rem;
  background:
    radial-gradient(circle at 0% 0%, rgba(45, 95, 212, 0.09), transparent 36%),
    radial-gradient(circle at 100% 0%, rgba(29, 70, 165, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.auth-form {
  display: grid;
  gap: 0.62rem;
}

.auth-form label {
  font-weight: 700;
  font-size: 0.92rem;
}

.auth-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.68rem 0.78rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(45, 95, 212, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.auth-form button[type="submit"] {
  margin-top: 0.35rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.auth-form button[type="submit"]:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 8px 18px rgba(29, 70, 165, 0.16);
}

.auth-form button[type="submit"].is-loading {
  opacity: 0.75;
  pointer-events: none;
}

.auth-form button[type="submit"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.32), transparent 58%);
  transform: scale(0);
  opacity: 0;
}

.auth-form button[type="submit"]:active::after {
  animation: buttonRipple 0.35s ease-out;
}

.auth-actions {
  margin-top: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

/* Support Section (Apoiar-se) */
.support-section {
  padding: 1rem 0;
}

.support-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  align-items: start;
}

.support-text h2 {
  font-family: "IBM Plex Serif", serif;
  font-size: 2rem;
  margin: 0 0 1rem 0;
}

.support-text p {
  color: var(--muted);
  margin: 0 0 1rem 0;
  line-height: 1.7;
}

.support-methods {
  background: var(--surface-soft);
  padding: 1.2rem;
  border-radius: 12px;
  margin: 1.2rem 0;
}

.support-methods h3 {
  margin: 0 0 0.8rem 0;
  font-size: 1.1rem;
  color: var(--brand);
}

.support-methods ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.support-methods li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.6rem 0;
  color: var(--text);
  font-size: 0.95rem;
}

.support-methods i {
  color: var(--brand);
  font-size: 1.1rem;
  min-width: 20px;
}

.support-qrcode {
  position: sticky;
  top: 100px;
}

.qrcode-wrapper {
  background: var(--surface-soft);
  padding: 1.5rem;
  border-radius: 12px;
  border: 2px solid var(--line);
  text-align: center;
}

.qrcode-wrapper h3 {
  margin: 0 0 1rem 0;
  color: var(--brand);
  font-size: 1rem;
  font-weight: 700;
}

.qrcode-container {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

.qrcode-container img {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qrcode-label {
  margin: 1rem 0 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

.admin-posts-panel {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  animation: fadePanelIn 0.45s ease-out;
}

.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.2rem 0 1rem;
}

.admin-tab-link {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.6rem 0.95rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.admin-tab-link:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
  color: var(--brand-strong);
  box-shadow: 0 10px 18px rgba(29, 70, 165, 0.08);
}

.admin-tab-link.active {
  background: rgba(45, 95, 212, 0.09);
  border-color: rgba(45, 95, 212, 0.42);
  color: var(--brand-strong);
}

.admin-tab-panels {
  display: block;
}

.admin-tab-panel {
  animation: fadePanelIn 0.3s ease-out;
}

.admin-panel-grid-single {
  grid-template-columns: 1fr;
}

.admin-card-hero,
.admin-card-quiet {
  min-height: 220px;
}

.admin-card-hero {
  display: grid;
  align-content: start;
  gap: 0.7rem;
}

.admin-card-hero h4,
.admin-card-quiet h4,
.admin-social-card h4 {
  margin-bottom: 0.2rem;
}

.admin-social-card {
  display: grid;
  gap: 0.2rem;
}

.admin-interactions-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.admin-interactions-subtab-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.45rem 0.82rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.admin-interactions-subtab-btn.is-active {
  border-color: rgba(45, 95, 212, 0.42);
  background: rgba(45, 95, 212, 0.1);
  color: var(--brand-strong);
}

.admin-interactions-panel {
  display: block;
}

.admin-interactions-panel.hidden {
  display: none;
}

.admin-interactions-comments-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.6rem;
}

.admin-comment-post-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fbff;
  padding: 0.75rem;
}

.admin-comment-post-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.admin-comment-post-head h5 {
  margin: 0;
}

.admin-comment-post-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.5rem;
}

.admin-comment-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.65rem;
}

.admin-comment-item.is-reply {
  border-left: 4px solid rgba(45, 95, 212, 0.62);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.admin-comment-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  color: var(--muted);
}

.admin-comment-item-head-main {
  display: grid;
  gap: 0.2rem;
}

.admin-comment-item-text {
  margin: 0.45rem 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-comment-item-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.admin-comment-item-actions .comment-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-comment-item-actions .comment-like-btn .fa-heart {
  color: #c22a39;
}

.admin-comment-item-actions .comment-like-btn.is-active {
  border-color: rgba(194, 42, 57, 0.28);
  background: rgba(194, 42, 57, 0.08);
  color: #b31f30;
}

.admin-comment-replies {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.75rem;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(45, 95, 212, 0.18);
}

.admin-comment-reply-form {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.admin-comment-reply-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem;
  resize: vertical;
}

.admin-posts-panel h3 {
  margin: 0 0 0.75rem;
}

.admin-panel-header {
  margin-bottom: 0.9rem;
}

.admin-panel-header p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.admin-panel-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1rem;
  align-items: start;
}

.admin-panel-col {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(21, 34, 58, 0.06);
}

.admin-panel-editor,
.admin-panel-list {
  padding: 0.9rem;
}

.admin-panel-sidebar {
  padding: 0.9rem;
  display: grid;
  gap: 0.8rem;
}

.admin-sidebar-card {
  display: grid;
  gap: 0.5rem;
}

.admin-sidebar-card h4 {
  margin: 0 0 0.5rem;
  font-family: "IBM Plex Serif", serif;
  font-size: 1rem;
}

.admin-sidebar-card button {
  width: 100%;
}

.admin-access-card {
  border-top: 1px dashed var(--line);
  padding-top: 0.8rem;
}

.admin-metric-value {
  margin: 0.2rem 0 0.55rem;
  font-family: "IBM Plex Serif", serif;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--brand-strong);
  font-weight: 700;
}

.admin-panel-editor h4,
.admin-panel-list h4 {
  margin: 0 0 0.7rem;
  font-family: "IBM Plex Serif", serif;
}

.admin-post-form {
  display: grid;
  gap: 0.5rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.admin-post-form textarea,
.admin-post-form input,
.admin-post-form select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.admin-post-form textarea {
  resize: vertical;
}

.hidden-editor-source {
  display: none;
}

.post-body-editor {
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.82rem;
  font: inherit;
  background: #fff;
  line-height: 1.6;
}

.post-body-editor:empty::before {
  content: attr(data-placeholder);
  color: #9aa7bb;
}

.post-body-editor:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 95, 212, 0.12);
}

.admin-posts-view-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.admin-posts-view-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-strong);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.admin-posts-view-btn.is-active {
  border-color: rgba(45, 95, 212, 0.42);
  background: rgba(45, 95, 212, 0.1);
}

.editor-context-menu {
  position: fixed;
  z-index: 1200;
  display: none;
  align-items: center;
  gap: 0.18rem;
  padding: 0.28rem;
  border-radius: 8px;
  border: 1px solid #c8ced9;
  background: linear-gradient(180deg, #f7f8fb 0%, #edf1f7 100%);
  box-shadow: 0 8px 20px rgba(22, 35, 58, 0.2);
}

.editor-context-menu.open {
  display: inline-flex;
}

.editor-context-select {
  height: 30px;
  border: 1px solid #bcc5d4;
  border-radius: 6px;
  background: #f8fafc;
  color: #1b2b47;
  font-size: 0.8rem;
  padding: 0 0.55rem;
  min-width: 108px;
}

.editor-context-select-size {
  min-width: 52px;
}

.editor-context-separator {
  width: 1px;
  height: 22px;
  background: #cdd5e2;
  margin: 0 0.18rem;
}

.editor-context-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #233a5e;
  border-radius: 6px;
  min-width: 28px;
  height: 28px;
  padding: 0 0.36rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.84rem;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.editor-context-btn:hover {
  border-color: #aebad1;
  background: #f5f8fd;
  transform: translateY(-1px);
}

.editor-context-btn:active {
  transform: translateY(0);
}

.editor-context-btn-color {
  color: #d31e27;
}

.editor-context-color {
  width: 30px;
  height: 30px;
  border: 1px solid #bcc5d4;
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
  padding: 2px;
}

.admin-format-toolbar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: -0.1rem;
}

.admin-format-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
}

.admin-post-form input:focus,
.admin-post-form select:focus,
.admin-post-form textarea:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 95, 212, 0.12);
}

.admin-featured {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.image-preview {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  display: grid;
  gap: 0.5rem;
}

.image-preview img {
  max-height: 300px;
  object-fit: cover;
  border-radius: 8px;
}

.admin-post-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.admin-post-list-wrap {
  margin-top: 0;
}

.admin-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.admin-editor-page {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 14px 34px rgba(21, 34, 58, 0.1);
  animation: fadePanelIn 0.35s ease-out;
}

.admin-editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.admin-editor-topbar h2 {
  margin: 0;
  font-family: "IBM Plex Serif", serif;
}

.admin-post-form-full {
  padding: 0.2rem;
}

.admin-editor-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.admin-post-list {
  display: grid;
  gap: 0.65rem;
}

.admin-post-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem;
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 0.7rem;
  align-items: center;
  animation: itemFadeIn 0.35s ease-out both;
  animation-delay: calc(var(--row, 0) * 45ms);
}

.admin-post-thumb {
  width: 92px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.admin-post-info h5 {
  margin: 0;
  font-size: 0.95rem;
}

.admin-post-info p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-post-status {
  display: inline-block;
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--line);
  color: var(--brand-strong);
  background: #fff;
}

.admin-post-status.status-published {
  border-color: rgba(4, 108, 78, 0.28);
  color: #046c4e;
  background: rgba(4, 108, 78, 0.08);
}

.admin-post-status.status-scheduled {
  border-color: rgba(217, 119, 6, 0.3);
  color: #9a3412;
  background: rgba(217, 119, 6, 0.1);
}

.admin-post-status.status-archived {
  border-color: rgba(93, 106, 130, 0.32);
  color: #3f4f68;
  background: rgba(93, 106, 130, 0.12);
}

.admin-post-status.status-trash {
  border-color: rgba(190, 24, 93, 0.32);
  color: #9d174d;
  background: rgba(190, 24, 93, 0.12);
}

.admin-post-item-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  gap: 0.35rem;
}

.admin-post-item .ghost-btn {
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.admin-post-item .ghost-btn:hover {
  transform: translateY(-1px);
}

.post-attachments-editor {
  margin-top: 0.4rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 0.75rem;
  background: rgba(45, 95, 212, 0.03);
}

.post-attachments-editor h4 {
  margin: 0 0 0.2rem;
  font-family: "IBM Plex Serif", serif;
}

.post-attachments-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.post-attachment-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.55rem;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.7rem;
}

.post-attachment-preview {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f5f8;
  border: 1px solid var(--line);
}

.post-attachment-meta {
  display: grid;
  gap: 0.35rem;
}

.post-attachment-meta strong {
  font-size: 0.9rem;
}

.post-attachment-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.post-attachment-controls select,
.post-attachment-controls input[type="range"] {
  width: 100%;
}

.article-attachments {
  margin-top: 1rem;
  display: grid;
  gap: 0.9rem;
}

.article-attachment {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem;
  background: #fff;
}

.article-attachment.align-left {
  margin-right: auto;
}

.article-attachment.align-center {
  margin-inline: auto;
}

.article-attachment.align-right {
  margin-left: auto;
}

.article-attachment img,
.article-attachment video {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.article-attachment a {
  text-decoration: none;
  color: var(--brand-strong);
  font-weight: 700;
}

@keyframes loginCardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes buttonRipple {
  from {
    transform: scale(0);
    opacity: 1;
  }
  to {
    transform: scale(1.6);
    opacity: 0;
  }
}

@keyframes fadePanelIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes itemFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modern clean refresh */
:root {
  --bg: #f2f5fb;
  --text: #0f172a;
  --muted: #5f6b83;
  --line: #d6dfef;
  --brand: #1566d7;
  --brand-strong: #0e4fa9;
  --surface-soft: #f7f9fe;
  --surface-card: #ffffff;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-soft: 0 10px 30px rgba(13, 31, 66, 0.08);
  --shadow-hover: 0 18px 40px rgba(13, 31, 66, 0.16);
}

body {
  background:
    radial-gradient(circle at 10% -5%, rgba(21, 102, 215, 0.14), transparent 35%),
    radial-gradient(circle at 90% 0%, rgba(9, 159, 136, 0.1), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, #f2f5fb 55%, #eef2f9 100%);
  min-height: 100vh;
}

.topbar {
  backdrop-filter: blur(14px);
  background: rgba(248, 251, 255, 0.8);
  border-bottom: 1px solid rgba(214, 223, 239, 0.85);
}

.brand {
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  filter: drop-shadow(0 5px 10px rgba(21, 102, 215, 0.22));
}

.menu a {
  position: relative;
  padding: 0.45rem 0.2rem;
  font-weight: 700;
  transition: color 0.25s ease;
}

.menu a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.28rem;
  height: 2px;
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.24s ease;
  background: linear-gradient(90deg, #11a38e 0%, #1566d7 100%);
}

.menu a.active::after,
.menu a:hover::after {
  transform: scaleX(1);
}

.main-content {
  padding-block: 2.2rem 3rem;
}

.tab-section.active {
  animation: fadePanelIn 0.35s ease-out;
}

.hero {
  border: 0;
  border-radius: 0;
  padding: 2.6rem 0 2rem;
  background: transparent;
  box-shadow: none;
}

.hero h1 {
  letter-spacing: -0.03em;
}

.hero-logo {
  width: min(100%, 300px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 20px;
  animation: floatLogo 5.5s ease-in-out infinite;
}

.section-block h2 {
  letter-spacing: -0.02em;
}

.posts-grid {
  gap: 1.4rem;
}

.post-card {
  border: 1px solid rgba(214, 223, 239, 0.95);
  border-radius: var(--radius-lg);
  padding: 1rem;
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
  animation: itemFadeIn 0.45s ease-out both;
  display: flex;
  flex-direction: column;
}

.post-card:nth-child(2) {
  animation-delay: 45ms;
}

.post-card:nth-child(3) {
  animation-delay: 90ms;
}

.post-card:nth-child(4) {
  animation-delay: 130ms;
}

.post-card:hover {
  transform: translateY(-6px);
  border-color: rgba(21, 102, 215, 0.35);
  box-shadow: var(--shadow-hover);
}

.post-image {
  border-radius: 12px;
  margin-bottom: 0.5rem;
}

.post-card-actions {
  margin-top: auto;
  display: grid;
  gap: 0.7rem;
}

.post-card-reactions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.post-card-reactions .engagement-btn {
  flex: 1;
  min-width: 100px;
  padding: 0.5rem 0.6rem;
  font-size: 0.82rem;
}

.engagement-btn-like,
.engagement-btn-favorite {
  font-size: 0.82rem;
}

.read-more-btn,
.ghost-btn,
.engagement-btn,
.admin-tab-link {
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
}

.read-more-btn {
  border-color: #0f5fcf;
  background: linear-gradient(140deg, #1268dd 0%, #0e56b8 100%);
  color: #fff;
  box-shadow: 0 9px 20px rgba(16, 89, 191, 0.25);
}

.read-more-btn:hover {
  transform: translateY(-2px);
  border-color: #0d4ea6;
  box-shadow: 0 14px 26px rgba(16, 89, 191, 0.3);
}

.ghost-btn {
  background: #fff;
  border-color: rgba(153, 169, 199, 0.65);
  color: #134ea0;
}

.ghost-btn:hover,
.engagement-btn:hover,
.admin-tab-link:hover {
  transform: translateY(-2px);
}

.auth-block,
.admin-panel-col,
.admin-editor-page,
.article-engagement,
.article-comments,
.article-references,
.post-attachments-editor,
.qrcode-wrapper,
.support-methods {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(214, 223, 239, 0.92);
  box-shadow: var(--shadow-soft);
}

.auth-block,
.admin-editor-page,
.admin-panel-col {
  background: #fff;
}

.article-content .post-image {
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(13, 31, 66, 0.18);
}

.article-body p {
  margin: 0 0 1rem;
  color: #344765;
}

.article-engagement,
.article-comments {
  background: #fff;
}

.admin-panel-grid {
  gap: 1.15rem;
}

.admin-post-item {
  border-radius: 14px;
  border: 1px solid rgba(214, 223, 239, 0.94);
  background: #fff;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.admin-post-item:hover {
  transform: translateY(-3px);
  border-color: rgba(21, 102, 215, 0.35);
  box-shadow: 0 12px 24px rgba(13, 31, 66, 0.14);
}

.admin-post-thumb {
  border-radius: 10px;
}

.admin-post-form textarea,
.admin-post-form input,
.admin-post-form select,
.auth-form input,
.comment-form input,
.comment-form textarea,
.comment-edit-form textarea {
  border-radius: 12px;
  border: 1px solid rgba(175, 190, 217, 0.72);
  background: #fff;
}

.site-footer {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
}

.footer-icons a {
  border-radius: 12px;
  border-color: rgba(175, 190, 217, 0.75);
  color: #124e9f;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.footer-icons a:hover {
  opacity: 1;
  transform: translateY(-2px);
  border-color: rgba(21, 102, 215, 0.45);
  box-shadow: 0 10px 20px rgba(13, 31, 66, 0.12);
}

@keyframes floatLogo {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-6px);
  }
  100% {
    transform: translateY(0px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .support-content {
    grid-template-columns: 1fr;
  }

  .support-qrcode {
    position: static;
  }

  .qrcode-wrapper {
    margin-top: 1.5rem;
  }

  .admin-post-item {
    grid-template-columns: 1fr;
  }

  .admin-panel-grid {
    grid-template-columns: 1fr;
  }

  .admin-editor-inline-grid {
    grid-template-columns: 1fr;
  }

  .post-attachment-item {
    grid-template-columns: 1fr;
  }

  .post-attachment-controls {
    grid-template-columns: 1fr;
  }

  .admin-post-thumb {
    width: 100%;
    height: 150px;
  }

  .admin-post-item-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-engagement-head,
  .article-comments-head {
    flex-direction: column;
  }

  .article-engagement-stats {
    justify-content: flex-start;
  }
}

@media (max-width: 1240px) {
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 740px) {
  .menu-btn {
    display: inline-grid;
    place-items: center;
  }

  .menu {
    display: none;
    position: absolute;
    top: 72px;
    left: 1rem;
    right: 1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .menu.open {
    display: flex;
  }

  .account-menu {
    width: 100%;
    justify-content: flex-start;
  }

  .account-menu-dropdown {
    left: 0;
    right: auto;
  }

  .comment-notifications-panel {
    left: 0;
    right: auto;
    width: min(360px, calc(100vw - 2.5rem));
  }

  .topbar-content {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }

  .article-engagement,
  .article-comments {
    padding: 0.9rem;
  }

  .article-reaction-row {
    flex-direction: column;
  }

  .engagement-btn {
    width: 100%;
    justify-content: center;
  }

  .comment-item-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
