/* ARTICLE PAGE: reader, markdown body, share buttons, SEO panel */
/* READER */
.reader {
  display: none;
  background: #fff;
  animation: fadeIn .2s ease
}

.reader.open {
  display: block
}

.reader-topbar {
  position: sticky;
  top: 78px;
  z-index: 20;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
  border-bottom: 2px solid var(--red)
}

@media(max-width:900px) {
  .reader-topbar {
    top: 68px
  }
}

.reader-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 60px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px
}

/* Topbar Share Icons */
.topbar-share {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-share .share-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #fff;
  transition: all .15s;
  cursor: pointer;
}

.topbar-share .share-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, .2);
}

.topbar-share .share-btn.tw:hover {
  background: #000;
  border-color: #000;
}

.topbar-share .share-btn.fb:hover {
  background: #1877f2;
  border-color: #1877f2;
}

.topbar-share .share-btn.li:hover {
  background: #0a66c2;
  border-color: #0a66c2;
}

.topbar-share .share-btn.wa:hover {
  background: #25d366;
  border-color: #25d366;
}

.topbar-share .share-btn.cp:hover {
  background: var(--red);
  border-color: var(--red);
}

.topbar-share .share-btn svg {
  width: 14px;
  height: 14px;
}

.reader-actions {
  display: flex;
  gap: 8px
}

.reader-action {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .1);
  border: none;
  border-radius: 4px;
  color: #fff;
  transition: background .15s;
  cursor: pointer
}

.reader-action:hover {
  background: rgba(255, 255, 255, .2)
}

.reader-progress {
  height: 3px;
  background: rgba(255, 255, 255, .1)
}

.reader-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--red);
  transition: width .1s linear
}

.reader-layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 24px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 56px;
  align-items: start
}

@media(max-width:1100px) {
  .reader-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    padding: 28px 20px 24px
  }

  .reader-side {
    position: static !important
  }
}

.reader-main {
  min-width: 0
}

.reader-side {
  position: sticky;
  top: 152px;
  display: flex;
  flex-direction: column;
  gap: 20px
}

.side-card {
  /* background: #fff; */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden
}

.side-card-head {
  padding: 14px 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .05em;
  display: flex;
  align-items: center;
  gap: 8px
}

.side-card-head::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--red);
  border-radius: 2px
}

.side-card-body {
  padding: 16px 18px
}

.side-author {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px
}

.side-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--red));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0
}

.side-author-name {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--text)
}

.side-author-role {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px
}

.side-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-3)
}

.side-stats strong {
  color: var(--text);
  display: block;
  font-size: 15px
}

.side-related {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all .15s
}

.side-related:last-child {
  border-bottom: none;
  padding-bottom: 0
}

.side-related:first-child {
  padding-top: 0
}

.side-related:hover .side-related-title {
  color: var(--red)
}

.side-related-img {
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-3)
}

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

.side-related-body {
  min-width: 0;
  flex: 1
}

.side-related-cat {
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 3px
}

.side-related-title {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  transition: color .15s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden
}

.side-related-meta {
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 4px
}

.reader-head {
  margin-bottom: 28px
}

.reader-category {
  display: inline-block;
  padding: 5px 12px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-radius: 3px;
  margin-bottom: 18px
}

.reader-title {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -.022em;
  color: var(--text);
  margin-bottom: 20px
}

@media(max-width:900px) {
  .reader-title {
    font-size: 34px
  }
}

@media(max-width:640px) {
  .reader-title {
    font-size: 28px
  }
}

.reader-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-3)
}

.reader-author {
  display: flex;
  align-items: center;
  gap: 10px
}

.reader-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--red));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px
}

.reader-author-name {
  color: var(--text);
  font-weight: 600
}

.reader-author-role {
  font-size: 11.5px;
  color: var(--text-3)
}

.reader-meta-sep {
  color: var(--border-2)
}

.reader-meta span {
  display: flex;
  align-items: center;
  gap: 5px
}

/* IN-BODY SHARE ACTIONS (For everyone) */
.share-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.share-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-right: 8px;
}

.share-actions .share-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all .15s;
  cursor: pointer;
}

.share-actions .share-btn:hover {
  transform: translateY(-2px);
  color: #fff;
}

.share-actions .share-btn.tw:hover {
  background: #000;
  border-color: #000;
}

.share-actions .share-btn.fb:hover {
  background: #1877f2;
  border-color: #1877f2;
}

.share-actions .share-btn.li:hover {
  background: #0a66c2;
  border-color: #0a66c2;
}

.share-actions .share-btn.wa:hover {
  background: #25d366;
  border-color: #25d366;
}

.share-actions .share-btn.cp:hover {
  background: var(--navy);
  border-color: var(--navy);
}

.share-actions .share-btn svg {
  width: 16px;
  height: 16px;
}

.reader-figure {
  margin: 0 0 36px
}

.reader-hero-img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 16/9;
  object-fit: cover;
  box-shadow: var(--shadow-sm)
}

.reader-hero-caption {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  margin-top: 10px;
  font-style: italic
}

.md {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.75;
  color: var(--text-2)
}

.md>*:first-child {
  margin-top: 0 !important
}

.md h1 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 900;
  line-height: 1.2;
  color: var(--text);
  margin: 40px 0 16px;
  letter-spacing: -.02em
}

.md h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.3;
  color: var(--text);
  margin: 40px 0 16px;
  letter-spacing: -.015em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border)
}

.md h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin: 32px 0 12px
}

.md h4 {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 10px;
  text-transform: uppercase;
  letter-spacing: .02em
}

.md p {
  margin: 0 0 20px
}

.md strong {
  color: var(--text);
  font-weight: 700
}

.md em {
  color: var(--text)
}

.md a {
  color: var(--red);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px
}

.md a:hover {
  color: var(--red-hover)
}

.md ul,
.md ol {
  margin: 0 0 20px;
  padding-left: 28px;
  font-family: var(--sans);
  font-size: 16px
}

.md li {
  margin-bottom: 8px
}

.md li>p {
  margin: 4px 0
}

.md blockquote {
  margin: 28px 0;
  padding: 20px 24px;
  background: var(--bg-2);
  border-left: 4px solid var(--red);
  font-family: var(--serif);
  font-style: italic;
  color: var(--text);
  font-size: 19px;
  border-radius: 0 4px 4px 0
}

.md code {
  font-family: 'SF Mono', Consolas, 'Courier New', monospace;
  font-size: .88em;
  padding: 2px 6px;
  background: var(--bg-3);
  color: #be185d;
  border-radius: 3px;
  border: 1px solid var(--border)
}

.md pre {
  margin: 24px 0;
  padding: 20px;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid #0f172a
}

.md pre code {
  background: transparent;
  color: inherit;
  border: none;
  padding: 0;
  font-size: inherit
}

.md img {
  width: 100%;
  border-radius: 6px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm)
}

.md hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0
}

.md table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-family: var(--sans);
  font-size: 14.5px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border)
}

.md table th {
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .05em
}

.md table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2)
}

.md table tr:nth-child(even) td {
  background: var(--bg-2)
}

.md table tr:last-child td {
  border-bottom: none
}

.reader-related {
  max-width: 1320px;
  margin: 20px auto 0;
  padding: 40px 24px 80px;
  border-top: 1px solid var(--border)
}

.reader-related h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px
}

.reader-related h3::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--red);
  border-radius: 2px
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px
}

@media(max-width:900px) {
  .related-grid {
    grid-template-columns: 1fr 1fr
  }
}

@media(max-width:560px) {
  .related-grid {
    grid-template-columns: 1fr
  }
}

/* SEO DETAILS PANEL IN READER */
.seo-panel {
  margin: 40px 0;
  padding: 20px 24px;
  background: var(--bg-2);
  border-radius: var(--radius);
  border: 1px solid var(--border)
}

.seo-panel summary {
  cursor: pointer;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px
}

.seo-panel summary::-webkit-details-marker {
  display: none
}

.seo-panel summary::before {
  content: '▶';
  font-size: 10px;
  color: var(--red);
  transition: transform .2s;
  display: inline-block
}

.seo-panel[open] summary::before {
  transform: rotate(90deg)
}

.seo-panel-body {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border)
}

.seo-score-big {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px
}

.seo-score-big span {
  font-size: 14px;
  color: var(--text-3);
  font-weight: 600
}

.seo-field {
  margin-bottom: 14px
}

.seo-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  margin-bottom: 4px
}

.seo-field-value {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word
}

.seo-field-value.mono {
  font-family: 'SF Mono', Consolas, monospace;
  background: var(--bg-3);
  padding: 6px 10px;
  border-radius: 3px;
  font-size: 12px
}

.seo-checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px
}

.seo-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 3px;
  font-size: 12.5px
}

.seo-check.good {
  background: rgba(16, 185, 129, .08)
}

.seo-check.warn {
  background: rgba(245, 158, 11, .08)
}

.seo-check.error {
  background: rgba(200, 16, 46, .06)
}

.seo-check-icon {
  font-weight: 900;
  font-size: 14px
}

.seo-check.good .seo-check-icon {
  color: #10b981
}

.seo-check.warn .seo-check-icon {
  color: #f59e0b
}

.seo-check.error .seo-check-icon {
  color: var(--red)
}

/* AI disclosure under every article */
.ai-note {
  margin: 36px 0 8px;
  padding: 16px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2)
}

.ai-note strong {
  color: var(--text)
}

.ai-note a,
.side-about a {
  color: var(--red);
  font-weight: 600
}

.ai-note a:hover,
.side-about a:hover {
  text-decoration: underline
}

.side-about p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 12px
}

.side-about a {
  display: block;
  font-size: 13px;
  margin-top: 6px
}
