/*
Theme Name: CosmoRiya
Theme URI: https://cosmoriyaastrology.com/
Author: CosmoRiya Astrology
Author URI: https://cosmoriyaastrology.com/
Description: CosmoRiya Astrology WordPress theme — blog listing and single post templates with header/footer from the CosmoRiya site design.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Text Domain: cosmo
*/

/* Core styles live in assets/css/style.css (enqueued via functions.php). */

.wp-block-image img,
.aligncenter {
  margin-left: auto;
  margin-right: auto;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.blog-card a,
.blog-card-featured a {
  text-decoration: none;
  color: inherit;
}

.blog-card .card-title,
.blog-card-featured .card-title {
  transition: color 0.2s ease;
}

.blog-card:hover .card-title,
.blog-card-featured:hover .card-title {
  color: var(--gold);
}

.blog-pagination .page-numbers {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.25s;
  margin: 0 4px;
}

.blog-pagination .page-numbers.current,
.blog-pagination .page-numbers:hover {
  border-color: rgba(212, 168, 67, 0.4);
  color: var(--gold);
  background: rgba(212, 168, 67, 0.08);
}

.blog-pagination .prev,
.blog-pagination .next {
  width: auto;
  padding: 0 18px;
  border-radius: var(--radius-pill);
}

.post-hero-content .container {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.cosmo-no-posts {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.cosmo-no-posts h2 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin-bottom: 12px;
}

.post-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin-bottom: 16px;
}

.post-header {
  padding: calc(var(--nav-h) + 40px) 20px 20px;
}

.post-header .container {
  max-width: 1100px;
  margin: 0 auto;
}

.post-header .breadcrumb {
  justify-content: flex-start;
  margin-bottom: 20px;
}

.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 10px 20px;
  font-size: 0.82rem;
}

.back-to-blog--bottom {
  margin-top: 28px;
  margin-bottom: 0;
}

.navbar .nav-logo img {
  height: 52px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

@media (max-width: 768px) {
  .navbar .nav-logo img {
    height: 42px;
    max-width: 140px;
  }
}

.post-header-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 500;
  line-height: 1.22;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.post-header .post-hero-meta {
  justify-content: flex-start;
}

.post-featured-thumb {
  margin: 0 0 28px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  background: var(--bg-mid);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-featured-thumb img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  object-position: center;
}

.post-categories .post-tag {
  margin-bottom: 0;
}

.post-main {
  min-width: 0;
}

.post-history {
  margin-bottom: 28px;
}

.post-history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-history-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  font-size: 0.84rem;
}

.post-history-label {
  color: rgba(242, 236, 255, 0.45);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.post-history-value {
  color: var(--text-secondary);
  text-align: right;
}

.post-history-cats a {
  color: var(--gold);
  text-decoration: none;
}

.post-history-cats a:hover {
  text-decoration: underline;
}

.post-toc-inline {
  margin-bottom: 28px;
}

.post-toc-inline .toc-list {
  list-style: none;
}

.toc-level-3 a {
  padding-left: 22px !important;
  font-size: 0.78rem !important;
}

.post-tags-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(242, 236, 255, 0.45);
  margin-right: 6px;
  align-self: center;
}

.sidebar-related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-related-link {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.sidebar-related-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-mid);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.sidebar-related-thumb--empty {
  color: var(--gold);
  font-size: 0.9rem;
}

.sidebar-related-title {
  display: block;
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.35;
}

.sidebar-related-link:hover .sidebar-related-title {
  color: var(--gold);
}

.sidebar-related-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

@media (min-width: 1025px) {
  .post-toc-inline {
    display: none;
  }
}

@media (max-width: 1024px) {
  .cosmo-toc-card {
    display: none;
  }
}

.post-body h2[id],
.post-body h3[id] {
  scroll-margin-top: 110px;
}

/* ============================================================
   Auto styles for normal WordPress editor content
   (lists, tables, quotes — no custom HTML classes needed)
   ============================================================ */

/* Tables — Gutenberg Table block or classic table */
.post-body figure.wp-block-table,
.post-body .wp-block-table {
  margin: 1.8em 0;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
}

.post-body figure.wp-block-table table,
.post-body .wp-block-table table {
  margin: 0;
  border: none;
  background: transparent;
}

.post-body table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1.8em 0;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-secondary);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.post-body table th {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: left;
  padding: 14px 16px;
  background: rgba(212, 168, 67, 0.08);
  border-bottom: 1px solid var(--border-gold);
}

.post-body table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
  line-height: 1.5;
}

.post-body table tr:last-child td {
  border-bottom: none;
}

.post-body table tr:hover td {
  background: rgba(124, 82, 255, 0.06);
}

/* Lists — Bullet / Numbered from editor (7 points = just Ordered List) */
.post-body ul,
.post-body ol,
.post-body .wp-block-list {
  margin: 1.2em 0 1.4em;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-body ul > li,
.post-body ol > li {
  position: relative;
  margin: 0;
  padding: 14px 16px 14px 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.55;
}

.post-body ul > li::before {
  content: '✦';
  position: absolute;
  left: 16px;
  top: 14px;
  color: var(--gold);
  font-size: 0.75rem;
  line-height: 1.55;
}

.post-body ol {
  counter-reset: cosmo-ol;
}

.post-body ol > li {
  counter-increment: cosmo-ol;
  padding-left: 56px;
}

.post-body ol > li::before {
  content: counter(cosmo-ol);
  position: absolute;
  left: 14px;
  top: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--gold));
}

.post-body li > p {
  margin: 0;
}

.post-body li > ul,
.post-body li > ol {
  margin: 12px 0 0;
  gap: 8px;
}

.post-body li > ul > li,
.post-body li > ol > li {
  padding: 10px 14px 10px 40px;
  font-size: 0.88rem;
  background: rgba(0, 0, 0, 0.18);
}

.post-body li > ol > li {
  padding-left: 48px;
}

.post-body li > ol > li::before {
  width: 22px;
  height: 22px;
  top: 10px;
  left: 12px;
  font-size: 0.68rem;
}

/* Quote block from editor */
.post-body blockquote,
.post-body .wp-block-quote {
  margin: 1.8em 0;
  padding: 20px 24px;
  border: none;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: rgba(212, 168, 67, 0.06);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--gold-lt);
  line-height: 1.6;
}

.post-body blockquote p,
.post-body .wp-block-quote p {
  margin: 0;
}

/* Separator / HR */
.post-body hr,
.post-body .wp-block-separator {
  border: none;
  height: 1px;
  margin: 2em 0;
  background: linear-gradient(90deg, transparent, var(--border-glow), var(--border-gold), var(--border-glow), transparent);
}

/* Code */
.post-body pre,
.post-body .wp-block-code {
  margin: 1.5em 0;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.35);
  overflow-x: auto;
  font-size: 0.85rem;
  color: var(--ice);
}

@media (max-width: 640px) {
  .post-body table {
    font-size: 0.82rem;
  }

  .post-body table th,
  .post-body table td {
    padding: 10px 12px;
  }
}
