/* ═══════════════════════════════════════════════════════════════════
   Akhbarino — Frontend Styles (v2.8.0)
   Modern minimal channel + archive UI
═══════════════════════════════════════════════════════════════════ */

.akh-canvas-wrap,
.akh-canvas-wrap * { box-sizing: border-box; }
.akh-canvas-wrap { padding: 0; margin: 0; }

/* ── Theme tokens ────────────────────────────────────────────────── */
.akhbarino-channel {
  --bg: var(--akh-bg);
  --surface: var(--akh-surface);
  --bubble: var(--akh-bubble);
  --text: var(--akh-text);
  --muted: var(--akh-muted);
  --primary: var(--akh-primary);
  --border: var(--akh-border);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 8px rgba(16,24,40,.04);
  --shadow-md: 0 8px 24px rgba(16,24,40,.06);
  --shadow-lg: 0 20px 50px rgba(16,24,40,.08);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 0 0 48px;
  font-feature-settings: "ss01", "ss02";
}
.akhbarino-channel[data-theme="dark"] {
  --bg: var(--akh-dark-bg);
  --surface: var(--akh-dark-surface);
  --bubble: var(--akh-dark-bubble);
  --text: var(--akh-dark-text);
  --muted: var(--akh-dark-muted);
  --primary: var(--akh-dark-primary);
  --border: var(--akh-dark-border);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.4);
}

/* ── Cover banner ────────────────────────────────────────────────── */
.akh-cover {
  position: relative;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto 24px;
  height: 280px;
  overflow: hidden;
  border-radius: 0 0 28px 28px;
}
.akh-cover__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.akh-cover__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.08) 40%, rgba(0,0,0,.55) 100%);
}
.akh-cover__caption {
  position: absolute;
  bottom: 24px;
  right: 32px;
  left: 32px;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}

/* ── Layout shell ────────────────────────────────────────────────── */
.akh-channel-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.akh-channel-shell.has-cover {
  margin-top: -80px;
  position: relative;
  z-index: 2;
}

/* ── Surfaces (shared card styling) ──────────────────────────────── */
.akh-sidebar-card,
.akh-header,
.akh-channel-intro,
.akh-messages,
.akh-empty,
.akh-message-bubble,
.akh-archive-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.akh-sidebar-card {
  padding: 24px;
  position: sticky;
  top: 24px;
  box-shadow: var(--shadow-md);
}
.akh-sidebar-avatar {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bubble) 0%, var(--border) 100%);
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 18px;
}
.akh-sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.akh-sidebar-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
}
.akh-sidebar-subtitle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}
.akh-sidebar-text {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.85;
  font-size: 14px;
}
.akh-sidebar-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0;
  padding: 14px;
  background: var(--bubble);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.akh-sidebar-stats > div {
  text-align: center;
  padding: 6px 4px;
}
.akh-sidebar-stats strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}
.akh-sidebar-stats span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.akh-sidebar-actions {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}
.akh-sidebar-actions .akh-btn {
  width: 100%;
}

/* ── Main column ─────────────────────────────────────────────────── */
.akh-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}

/* ── Header ──────────────────────────────────────────────────────── */
.akh-header {
  padding: 22px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.akh-header__text { min-width: 0; flex: 1; }
.akh-header__title {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.akh-header__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.akh-header__meta .akh-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.18);
}
.akh-header__meta .akh-sep { opacity: .4; margin: 0 2px; }
.akh-header-actions,
.akh-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
.akh-header-actions > *,
.akh-actions > * {
  flex: 0 0 auto !important;
}
/*   lock content   */
/* ── Locked Content (VIP) ────────────────────────────────────────── */
.akh-locked-channel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.akh-lock-box {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 32px;
}
.akh-lock-box .akh-btn {
  margin-top: 16px;
  padding: 14px 28px;
  font-size: 15px;
}
.akh-message-is-locked {
  position: relative;
  overflow: hidden;
}
.akh-message-is-locked .akh-message-inner-content {
  filter: blur(8px);
  opacity: 0.5;
  user-select: none;
  pointer-events: none;
}
.akh-message-lock-overlay {
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 50px); /* فوتر پیام را باز میگذارد */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: linear-gradient(180deg, rgba(var(--surface),0) 0%, var(--bubble) 50%, var(--bubble) 100%);
}
.akh-lock-overlay-content {
  text-align: center;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-width: 320px;
  width: 90%;
  transform: translateY(20px);
}
.akh-lock-overlay-content svg {
  margin-bottom: 12px;
  color: var(--muted);
}
.akh-lock-overlay-content strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--text);
}
.akh-lock-overlay-content p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 16px;
}
.akh-lock-overlay-content .akh-btn {
  width: 100%;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.akh-btn,
.akh-header-btn,
.akh-load-more,
.akh-copy-button {
  appearance: none;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 14px;
  background: var(--primary);
  color: var(--bg);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.akh-btn:hover,
.akh-header-btn:hover,
.akh-load-more:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(17,17,17,.16);
}
.akh-btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.akh-theme-toggle {
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  background: transparent !important;
  border: 1.5px solid var(--border) !important;
  color: var(--text) !important;
  display: inline-grid !important;
  place-items: center !important;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  padding: 5px !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
}
.akh-theme-toggle:hover {
  background: var(--bubble) !important;
  border-color: var(--muted) !important;
}
.akh-theme-toggle svg,
.akh-theme-toggle img {
  width: 20px !important;
  height: 20px !important;
  display: block !important;
}

/* ── Channel intro / media blocks ────────────────────────────────── */
.akh-channel-intro {
  padding: 24px;
  display: grid;
  gap: 18px;
}
.akh-intro-text { line-height: 1.95; color: var(--text); }
.akh-intro-text p:first-child { margin-top: 0; }
.akh-intro-text p:last-child { margin-bottom: 0; }

.akh-channel-media {
  display: grid;
  gap: 16px;
}
.akh-channel-media__item {
  background: var(--bubble);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.akh-channel-media__item--video { padding: 0; overflow: hidden; background: #000; border-color: transparent; }
.akh-channel-media__item--video .akh-video-caption {
  padding: 12px 16px;
  margin: 0;
  background: var(--bubble);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ── Messages timeline ───────────────────────────────────────────── */
.akh-messages {
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.akh-messages__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px dashed var(--border);
}
.akh-messages__label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.akh-messages__count {
  background: var(--bubble);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.akh-messages__list {
  display: grid;
  gap: 16px;
}

/* ── Single message bubble ───────────────────────────────────────── */
.akh-message-bubble {
  padding: 22px 24px;
  background: var(--akh-message-bg, var(--bubble));
  position: relative;
  border-radius: var(--radius-md);
  transition: transform .15s ease, box-shadow .15s ease;
}
.akh-message-bubble:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.akh-message-badge {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(17,17,17,.07);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}
.akhbarino-channel[data-theme="dark"] .akh-message-badge {
  background: rgba(255,255,255,.08);
}
.akh-message-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
}
.akh-message-photo {
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.akh-message-photo img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-height: 560px !important;
  max-width: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: 0 auto !important;
}
@media (max-width: 768px) {
  .akh-message-photo img {
    max-height: 440px !important;
  }
}
@media (max-width: 480px) {
  .akh-message-photo img {
    max-height: 360px !important;
  }
}
.akh-message-text {
  line-height: 1.95;
  color: var(--text);
  font-size: 15px;
}
.akh-message-text p:first-child { margin-top: 0; }
.akh-message-text p:last-child { margin-bottom: 0; }
.akh-message-meta {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

/* ── Cards inside a message ──────────────────────────────────────── */
.akh-download-box,
.akh-product-card,
.akh-user-card-block,
.akh-player-card,
.akh-code-card {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bubble);
}
.akh-download-box,
.akh-product-card { display: grid; gap: 10px; }
.akh-product-badge {
  display: inline-flex;
  align-self: start;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(17,17,17,.07);
  font-size: 12px;
  font-weight: 700;
}
.akh-product-price { font-size: 20px; font-weight: 800; }
.akh-code-card pre {
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: transparent;
  margin: 0 0 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
}
.akh-copy-button { padding: 8px 14px; font-size: 12px; }
.akh-custom-html { margin-top: 16px; }
.akh-player-bar {
  height: 6px;
  background: rgba(17,17,17,.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0;
}
.akh-player-bar span {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
}
.akh-player-time {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ── Photo caption ───────────────────────────────────────────────── */
.akh-photo-caption {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ── Video ───────────────────────────────────────────────────────── */
.akh-video-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}
.akh-video-wrap video {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: contain;
}
.akh-video-wrap--iframe {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}
.akh-video-wrap--iframe iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.akh-video-caption {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ── Audio player ────────────────────────────────────────────────── */
.akh-audio-player {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bubble);
  display: grid;
  gap: 10px;
}
.akh-audio-player__head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.akh-audio-player__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--bg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.akh-audio-player__text { display: grid; gap: 2px; min-width: 0; }
.akh-audio-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.akh-audio-artist {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.akh-audio-player audio {
  width: 100%;
  border-radius: 8px;
}

/* ── Empty state ─────────────────────────────────────────────────── */
.akh-empty {
  padding: 48px 24px;
  text-align: center;
}
.akh-empty__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 24px;
  background: var(--bubble);
  color: var(--muted);
  display: grid;
  place-items: center;
}
.akh-empty h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}
.akh-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ── Load more ───────────────────────────────────────────────────── */
.akh-load-more-wrap { text-align: center; padding: 16px 0 8px; }
.akh-is-hidden { display: none !important; }

/* ── Archive ─────────────────────────────────────────────────────── */
.akh-archive {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px;
}
.akh-archive-head { text-align: center; margin-bottom: 32px; }
.akh-archive-head h1 {
  margin: 0 0 10px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.akh-archive-head p { margin: 0; color: #667085; font-size: 15px; }
.akh-archive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.akh-archive-card {
  padding: 22px 24px;
  color: inherit;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.akh-archive-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.akh-archive-card__title {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 6px;
}
.akh-archive-card__subtitle { color: #667085; margin-bottom: 10px; font-size: 13px; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .akh-channel-shell { grid-template-columns: 1fr; }
  .akh-sidebar-card { position: static; }
  .akh-archive-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .akhbarino-channel { padding: 0 0 32px; }
  .akh-cover { height: 200px; border-radius: 0; margin-bottom: 16px; }
  .akh-cover__caption { right: 16px; left: 16px; bottom: 16px; font-size: 14px; }
  .akh-channel-shell { padding: 0 14px; gap: 14px; }
  .akh-channel-shell.has-cover { margin-top: -40px; }
  .akh-header { padding: 18px; }
  .akh-header__title { font-size: 22px; }
  .akh-sidebar-stats { grid-template-columns: repeat(3, 1fr); }
  .akh-archive { padding: 20px 14px; }
  .akh-archive-grid { grid-template-columns: 1fr; }
  .akh-archive-head h1 { font-size: 26px; }
  .akh-message-bubble { padding: 18px 18px; }
  .akh-message-title { font-size: 17px; }
  .akh-sidebar-card,
  .akh-header,
  .akh-channel-intro,
  .akh-messages,
  .akh-empty,
  .akh-message-bubble,
  .akh-archive-card { border-radius: var(--radius-md); }
}
