/*
Theme Name: Nalar Siyasah
Theme URI: https://nalarsiyasah.com
Author: Nalar Siyasah
Author URI: https://nalarsiyasah.com
Description: A refined WordPress theme for academic discourse on Islamic politics in Indonesia. Features Islamic geometric patterns, bilingual typography (Arabic/Latin), article organization by author and topic, and embedded video support for YouTube and Rumble.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nalar-siyasah
Tags: blog, education, custom-header, custom-menu, featured-images, threaded-comments, translation-ready
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
*/

/* ═══════════════════════════════════════
   CSS VARIABLES & RESET
   ═══════════════════════════════════════ */
:root {
  --ns-forest: #0F1A12;
  --ns-forest-mid: #1a2e1a;
  --ns-forest-light: #243524;
  --ns-gold: #d4a853;
  --ns-gold-dim: rgba(212, 168, 83, 0.2);
  --ns-cream: #faf8f2;
  --ns-cream-dark: #f5f0e8;
  --ns-border: #e8e0d0;
  --ns-text: #2a2a2a;
  --ns-text-light: #555;
  --ns-text-muted: #999;
  --ns-danger: #a33;
  --ns-font-display: 'Cormorant Garamond', Georgia, serif;
  --ns-font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --ns-font-arabic: 'Amiri', 'Traditional Arabic', serif;
  --ns-max-width: 1100px;
  --ns-content-width: 780px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--ns-cream);
  color: var(--ns-text);
  font-family: var(--ns-font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ns-forest-mid);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--ns-gold);
}

img {
  max-width: 100%;
  height: auto;
}

/* ═══════════════════════════════════════
   GEOMETRIC PATTERN OVERLAY
   ═══════════════════════════════════════ */
.ns-pattern-overlay {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23d4a853' stroke-width='0.5' opacity='0.12'%3E%3Cpath d='M40 0 L80 40 L40 80 L0 40Z'/%3E%3Ccircle cx='40' cy='40' r='20'/%3E%3Cpath d='M20 20 L60 20 L60 60 L20 60Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px 80px;
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════
   HEADER
   ═══════════════════════════════════════ */
.site-header {
  background: linear-gradient(175deg, var(--ns-forest) 0%, var(--ns-forest-mid) 60%, var(--ns-forest-light) 100%);
  color: var(--ns-cream-dark);
  position: relative;
  overflow: hidden;
}

.site-header .header-inner {
  position: relative;
  z-index: 1;
  max-width: var(--ns-max-width);
  margin: 0 auto;
  padding: 20px 24px 0;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.site-branding {
  cursor: pointer;
}

.site-branding .bismillah {
  font-family: var(--ns-font-arabic);
  font-size: 14px;
  color: var(--ns-gold);
  letter-spacing: 3px;
  margin-bottom: 4px;
  direction: rtl;
}

.site-title {
  font-family: var(--ns-font-display);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  margin: 0;
  letter-spacing: 1px;
  line-height: 1.2;
}

.site-title a {
  color: var(--ns-cream-dark);
}
.site-title a:hover {
  color: var(--ns-gold);
}

.site-description {
  font-family: var(--ns-font-body);
  font-size: 15px;
  color: rgba(245, 240, 232, 0.7);
  font-weight: 300;
  padding: 12px 0 20px;
  margin: 0;
}

.header-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--ns-gold) 0%, transparent 50%, var(--ns-gold) 100%);
}

/* ═══════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════ */
.main-navigation {
  font-family: var(--ns-font-body);
}

.main-navigation ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.main-navigation li a {
  display: block;
  padding: 6px 14px;
  color: var(--ns-cream-dark);
  font-size: 14px;
  font-weight: 400;
  border: 1px solid rgba(212, 168, 83, 0.25);
  border-radius: 6px;
  background: rgba(245, 240, 232, 0.07);
  transition: all 0.2s;
}

.main-navigation li a:hover,
.main-navigation li.current-menu-item a {
  background: var(--ns-gold);
  color: var(--ns-forest);
  font-weight: 600;
  border-color: var(--ns-gold);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  padding: 6px 14px;
  background: rgba(245, 240, 232, 0.1);
  color: var(--ns-cream-dark);
  border: 1px solid rgba(212, 168, 83, 0.3);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--ns-font-body);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  .main-navigation ul {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 12px 0;
    border-top: 1px solid rgba(212, 168, 83, 0.2);
    margin-top: 12px;
  }
  .main-navigation.toggled ul {
    display: flex;
  }
  .main-navigation li a {
    border: none;
    background: none;
    padding: 8px 0;
    font-size: 15px;
    opacity: 0.8;
  }
  .main-navigation li a:hover {
    background: none;
    color: var(--ns-gold);
    opacity: 1;
  }
}

/* ═══════════════════════════════════════
   TOPIC BAR (Categories)
   ═══════════════════════════════════════ */
.topic-bar {
  background: var(--ns-cream);
  border-bottom: 1px solid var(--ns-border);
  overflow-x: auto;
  white-space: nowrap;
  padding: 10px 24px;
  -webkit-overflow-scrolling: touch;
}

.topic-bar::-webkit-scrollbar {
  height: 4px;
}
.topic-bar::-webkit-scrollbar-thumb {
  background: var(--ns-gold);
  border-radius: 2px;
}

.topic-bar a {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid var(--ns-forest-mid);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 6px;
  color: var(--ns-forest-mid);
  transition: all 0.2s;
}
.topic-bar a:hover,
.topic-bar a.current {
  background: var(--ns-forest-mid);
  color: #fff;
}

.topic-bar .search-form {
  display: inline-block;
  margin-left: 12px;
  vertical-align: middle;
}

.topic-bar .search-field {
  padding: 6px 14px;
  border: 1px solid #d0c8b8;
  border-radius: 20px;
  font-size: 13px;
  background: #fff;
  outline: none;
  width: 160px;
  font-family: var(--ns-font-body);
  transition: border-color 0.2s;
}
.topic-bar .search-field:focus {
  border-color: var(--ns-gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}

/* ═══════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════ */
.site-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 24px 60px;
}

.section-label {
  font-family: var(--ns-font-display);
  font-size: 13px;
  color: var(--ns-gold);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════
   FEATURED ARTICLES (Sticky Posts)
   ═══════════════════════════════════════ */
.featured-articles {
  margin-bottom: 40px;
}

.featured-card {
  display: block;
  padding: 24px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--ns-forest-mid) 0%, var(--ns-forest-light) 100%);
  border-radius: 12px;
  color: var(--ns-cream-dark);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s;
}
.featured-card:hover {
  transform: translateY(-2px);
  color: var(--ns-cream-dark);
}

.featured-card .ns-pattern-overlay {
  background-size: 60px 60px;
  opacity: 0.3;
}

.featured-card .card-inner {
  position: relative;
  z-index: 1;
}

.featured-card .topic-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.featured-card .topic-tag {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--ns-gold-dim);
  color: var(--ns-gold);
  font-weight: 500;
}

.featured-card .entry-title {
  font-family: var(--ns-font-display);
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.3;
  color: var(--ns-cream-dark);
}

.featured-card .entry-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(245, 240, 232, 0.75);
  margin: 0;
}

.featured-card .entry-meta {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(245, 240, 232, 0.5);
}

.featured-card .entry-meta .video-badge {
  color: rgba(245, 240, 232, 0.6);
}

/* ═══════════════════════════════════════
   ARTICLE CARDS (Archive)
   ═══════════════════════════════════════ */
.article-card {
  padding: 20px 0;
  border-bottom: 1px solid var(--ns-border);
}

.article-card .topic-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.article-card .topic-tag {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 500;
  background: rgba(26, 46, 26, 0.08);
  color: var(--ns-forest-mid);
}

.article-card .video-badge {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 12px;
  background: #fff0f0;
  color: #c33;
}

.article-card .entry-title {
  font-family: var(--ns-font-display);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.3;
}

.article-card .entry-title a {
  color: var(--ns-forest-mid);
}
.article-card .entry-title a:hover {
  color: var(--ns-gold);
}

.article-card .entry-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ns-text-light);
  margin: 0 0 8px;
}

.article-card .entry-meta {
  font-size: 12px;
  color: var(--ns-text-muted);
}

.article-card .entry-meta a {
  color: var(--ns-text-muted);
}
.article-card .entry-meta a:hover {
  color: var(--ns-gold);
}

/* Post thumbnails in cards */
.article-card .post-thumbnail {
  float: right;
  margin: 0 0 12px 20px;
  width: 160px;
  height: 110px;
  border-radius: 8px;
  overflow: hidden;
}
.article-card .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 520px) {
  .article-card .post-thumbnail {
    float: none;
    width: 100%;
    height: 180px;
    margin: 0 0 12px 0;
  }
}

/* ═══════════════════════════════════════
   SINGLE ARTICLE
   ═══════════════════════════════════════ */
.single-post .entry-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ns-border);
}

.single-post .topic-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.single-post .topic-tag {
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 12px;
  font-weight: 500;
  color: #fff;
  background: var(--ns-forest-mid);
}

.single-post .entry-title {
  font-family: var(--ns-font-display);
  font-size: clamp(26px, 5vw, 36px);
  font-weight: 700;
  color: var(--ns-forest-mid);
  line-height: 1.25;
  margin: 0 0 16px;
}

.author-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ns-forest-mid), var(--ns-gold));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--ns-font-display);
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-info .author-name {
  font-weight: 600;
  color: var(--ns-forest-mid);
  font-size: 14px;
}

.author-info .post-date {
  font-size: 12px;
  color: var(--ns-text-muted);
}

/* Article body */
.entry-content {
  font-family: var(--ns-font-body);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ns-text);
  max-width: var(--ns-content-width);
}

.entry-content p {
  margin: 0 0 20px;
}

.entry-content h2 {
  font-family: var(--ns-font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--ns-forest-mid);
  margin: 36px 0 16px;
}

.entry-content h3 {
  font-family: var(--ns-font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ns-forest-mid);
  margin: 28px 0 12px;
}

.entry-content blockquote {
  border-left: 4px solid var(--ns-gold);
  padding: 16px 24px;
  margin: 24px 0;
  background: rgba(212, 168, 83, 0.06);
  font-style: italic;
  color: var(--ns-text-light);
}

.entry-content ul,
.entry-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.entry-content li {
  margin-bottom: 6px;
}

.entry-content a {
  color: var(--ns-gold);
  text-decoration: underline;
  text-decoration-color: rgba(212, 168, 83, 0.4);
  text-underline-offset: 3px;
}
.entry-content a:hover {
  text-decoration-color: var(--ns-gold);
}

.entry-content img {
  border-radius: 8px;
  margin: 20px 0;
}

/* Featured image on single */
.single-post .post-thumbnail {
  margin-bottom: 28px;
  border-radius: 12px;
  overflow: hidden;
  max-height: 420px;
}

.single-post .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ═══════════════════════════════════════
   VIDEO EMBEDS
   ═══════════════════════════════════════ */
.ns-video-section {
  margin-top: 32px;
}

.ns-video-section h3 {
  font-family: var(--ns-font-display);
  font-size: 20px;
  color: var(--ns-forest-mid);
  border-bottom: 2px solid var(--ns-gold);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.ns-video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 24px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ns-video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ═══════════════════════════════════════
   SIDEBAR WIDGETS
   ═══════════════════════════════════════ */
.sidebar {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--ns-border);
}

.widget {
  margin-bottom: 32px;
}

.widget-title {
  font-family: var(--ns-font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ns-forest-mid);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ns-gold);
}

.widget ul {
  list-style: none;
}

.widget ul li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(232, 224, 208, 0.5);
}

.widget ul li a {
  font-size: 14px;
  color: var(--ns-text-light);
}
.widget ul li a:hover {
  color: var(--ns-gold);
}

/* ═══════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 32px 0;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--ns-border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--ns-forest-mid);
  transition: all 0.2s;
}

.pagination a:hover {
  background: var(--ns-forest-mid);
  color: #fff;
  border-color: var(--ns-forest-mid);
}

.pagination .current {
  background: var(--ns-forest-mid);
  color: #fff;
  border-color: var(--ns-forest-mid);
}

/* ═══════════════════════════════════════
   COMMENTS
   ═══════════════════════════════════════ */
.comments-area {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--ns-border);
}

.comments-title {
  font-family: var(--ns-font-display);
  font-size: 22px;
  color: var(--ns-forest-mid);
  margin-bottom: 24px;
}

.comment-list {
  list-style: none;
}

.comment-body {
  padding: 20px;
  margin-bottom: 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--ns-border);
}

.comment-meta {
  font-size: 13px;
  color: var(--ns-text-muted);
  margin-bottom: 8px;
}

.comment-author .fn {
  font-weight: 600;
  color: var(--ns-forest-mid);
}

.comment-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}

.comment-respond {
  margin-top: 32px;
}

.comment-form label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: var(--ns-forest-mid);
  margin-bottom: 6px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d0c8b8;
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--ns-font-body);
  background: #fff;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--ns-gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.15);
}

.comment-form .submit {
  padding: 10px 24px;
  background: var(--ns-forest-mid);
  color: var(--ns-cream-dark);
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--ns-font-body);
  transition: background 0.2s;
}

.comment-form .submit:hover {
  background: var(--ns-gold);
  color: var(--ns-forest);
}

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
.site-footer {
  background: var(--ns-forest);
  color: rgba(245, 240, 232, 0.5);
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
}

.site-footer .footer-arabic {
  font-family: var(--ns-font-arabic);
  font-size: 18px;
  color: var(--ns-gold);
  margin-bottom: 8px;
  direction: rtl;
}

.site-footer .footer-copy {
  margin-top: 4px;
}

/* ═══════════════════════════════════════
   ARCHIVE HEADERS
   ═══════════════════════════════════════ */
.archive-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ns-gold);
}

.archive-title {
  font-family: var(--ns-font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--ns-forest-mid);
  margin: 0;
}

.archive-description {
  font-size: 15px;
  color: var(--ns-text-light);
  margin-top: 8px;
}

/* ═══════════════════════════════════════
   404 & EMPTY STATES
   ═══════════════════════════════════════ */
.ns-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ns-text-muted);
}

.ns-empty-state .emoji {
  font-size: 48px;
  margin-bottom: 16px;
}

.ns-empty-state p {
  font-size: 16px;
}

/* ═══════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════ */
.ns-btn-primary {
  display: inline-block;
  padding: 10px 24px;
  background: var(--ns-forest-mid);
  color: var(--ns-cream-dark);
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--ns-font-body);
  transition: background 0.2s;
  text-decoration: none;
}
.ns-btn-primary:hover {
  background: var(--ns-gold);
  color: var(--ns-forest);
}

.ns-btn-secondary {
  display: inline-block;
  padding: 10px 20px;
  background: transparent;
  color: var(--ns-forest-mid);
  border: 1px solid #d0c8b8;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--ns-font-body);
  text-decoration: none;
  transition: all 0.2s;
}
.ns-btn-secondary:hover {
  border-color: var(--ns-gold);
  color: var(--ns-gold);
}

.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* ═══════════════════════════════════════
   SCREEN READER TEXT (Accessibility)
   ═══════════════════════════════════════ */
.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;
}

/* ═══════════════════════════════════════
   WP BLOCK EDITOR ALIGNMENT
   ═══════════════════════════════════════ */
.alignwide {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.alignfull {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
  max-width: 100vw;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.wp-block-image figcaption {
  font-size: 13px;
  color: var(--ns-text-muted);
  text-align: center;
  margin-top: 8px;
}
