/**
 * TextPress Core Stylesheet
 * Ultra-Fast, Beautiful Typography-First WordPress Theme
 * Author: Rifan Muazin (https://gig.web.id)
 */

/* ==========================================================================
   1. Design Tokens & Theme Variables
   ========================================================================== */
:root {
  --tp-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tp-font-serif: 'Newsreader', 'Georgia', 'Cambria', "Times New Roman", Times, serif;
  --tp-font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;

  --tp-bg-primary: #fcfbf9;
  --tp-bg-secondary: #f4f2ee;
  --tp-bg-surface: #ffffff;
  --tp-bg-card: #ffffff;
  --tp-bg-hover: #eae7e1;
  --tp-bg-subtle: #f0ece1;

  --tp-text-primary: #121316;
  --tp-text-secondary: #344054;
  --tp-text-muted: #475467;
  --tp-text-inverse: #ffffff;

  --tp-border-color: #e5e2db;
  --tp-border-subtle: #eeece6;
  --tp-border-focus: #121316;

  --tp-accent: #c0392b;
  --tp-accent-hover: #962d22;
  --tp-accent-subtle: #f9ebea;

  --tp-radius-sm: 4px;
  --tp-radius-md: 8px;
  --tp-radius-lg: 16px;
  --tp-radius-full: 9999px;

  --tp-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --tp-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --tp-shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.09);

  --tp-max-width: 1240px;
  --tp-header-height: 64px;
  --tp-transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --tp-bg-primary: #0e1117;
  --tp-bg-secondary: #161b22;
  --tp-bg-surface: #1b2028;
  --tp-bg-card: #161b22;
  --tp-bg-hover: #222933;
  --tp-bg-subtle: #1f242d;

  --tp-text-primary: #f9fafb;
  --tp-text-secondary: #d0d5dd;
  --tp-text-muted: #98a2b3;
  --tp-text-inverse: #0e1117;

  --tp-border-color: #2b323d;
  --tp-border-subtle: #202630;
  --tp-border-focus: #f0f2f5;

  --tp-accent: #e74c3c;
  --tp-accent-hover: #ff6b5b;
  --tp-accent-subtle: #3a1c18;

  --tp-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --tp-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --tp-shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   2. Reset & Global Styles
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--tp-font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--tp-text-primary);
  background-color: var(--tp-bg-primary);
  transition: background-color 0.25s ease, color 0.25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--tp-transition);
}

a:hover {
  color: var(--tp-accent);
}

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

button, input, textarea, select {
  font: inherit;
}

ul, ol {
  list-style: none;
}

.tp-container {
  width: 100%;
  max-width: var(--tp-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.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 !important;
  width: 1px;
  word-wrap: normal !important;
}

/* ==========================================================================
   3. Breaking News Ticker
   ========================================================================== */
.tp-ticker-wrap {
  background-color: var(--tp-bg-secondary);
  border-bottom: 1px solid var(--tp-border-subtle);
  font-size: 0.8125rem;
  font-weight: 500;
}

.tp-ticker-inner {
  display: flex;
  align-items: center;
  min-height: 38px;
}

.tp-ticker-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--tp-accent);
  color: #ffffff;
  padding: 3px 10px;
  border-radius: var(--tp-radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 14px;
  flex-shrink: 0;
}

.tp-ticker-pulse {
  width: 6px;
  height: 6px;
  background-color: #ffffff;
  border-radius: 50%;
  animation: tp-pulse 1.6s infinite ease-in-out;
}

@keyframes tp-pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.tp-ticker-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 24px;
}

.tp-ticker-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: none;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-ticker-item.tp-active {
  display: flex;
  animation: tp-fadeIn 0.3s ease;
}

@keyframes tp-fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.tp-ticker-time {
  color: var(--tp-text-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.tp-ticker-item a {
  color: var(--tp-text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-ticker-item a:hover {
  color: var(--tp-accent);
}

.tp-ticker-controls {
  display: flex;
  gap: 4px;
  margin-left: 12px;
  flex-shrink: 0;
}

.tp-ticker-btn {
  background: none;
  border: 1px solid var(--tp-border-color);
  color: var(--tp-text-muted);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--tp-transition);
}

.tp-ticker-btn:hover {
  background-color: var(--tp-bg-hover);
  color: var(--tp-text-primary);
}

/* ==========================================================================
   4. Site Header
   ========================================================================== */
.tp-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--tp-bg-surface);
  border-bottom: 1px solid var(--tp-border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--tp-header-height);
}

.tp-header-left, .tp-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tp-icon-btn,
.tp-btn-search,
.tp-theme-toggle {
  background: none;
  border: 1px solid var(--tp-border-color);
  color: var(--tp-text-secondary);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--tp-radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--tp-transition);
}

.tp-icon-btn:hover,
.tp-btn-search:hover,
.tp-theme-toggle:hover {
  background-color: var(--tp-bg-hover);
  color: var(--tp-text-primary);
  border-color: var(--tp-border-focus);
}

.tp-brand {
  display: flex;
  flex-direction: column;
}

.tp-site-title {
  font-family: var(--tp-font-serif);
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--tp-text-primary);
}

.tp-site-desc {
  font-size: 0.72rem;
  color: var(--tp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Primary Navigation */
.tp-primary-nav {
  display: flex;
  align-items: center;
}

.tp-main-menu {
  display: flex;
  align-items: center;
  gap: 22px;
}

.tp-main-menu li a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--tp-text-secondary);
  padding: 6px 0;
  position: relative;
}

.tp-main-menu li a:hover,
.tp-main-menu li.current-menu-item > a {
  color: var(--tp-text-primary);
}

.tp-main-menu li.current-menu-item > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--tp-accent);
}

/* Header Dropdown Search */
.tp-header-search-bar {
  display: none;
  padding: 12px 0 16px;
  background-color: var(--tp-bg-secondary);
  border-bottom: 1px solid var(--tp-border-color);
}

.tp-header-search-bar.tp-open {
  display: block;
  animation: tp-fadeIn 0.2s ease;
}

.tp-header-search-form {
  display: flex;
  align-items: center;
  background-color: var(--tp-bg-surface);
  border: 1px solid var(--tp-border-color);
  border-radius: var(--tp-radius-full);
  padding: 4px 8px 4px 16px;
  box-shadow: var(--tp-shadow-sm);
}

.tp-header-search-input {
  flex: 1;
  border: none;
  background: none;
  color: var(--tp-text-primary);
  font-size: 0.95rem;
  outline: none;
}

.tp-header-search-btn {
  background-color: var(--tp-accent);
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--tp-radius-full);
  font-weight: 600;
  cursor: pointer;
  transition: var(--tp-transition);
}

.tp-header-search-btn:hover {
  background-color: var(--tp-accent-hover);
}

.tp-header-search-close {
  background: none;
  border: none;
  color: var(--tp-text-muted);
  cursor: pointer;
  padding: 8px;
  margin-left: 4px;
}

/* ==========================================================================
   5. Off-Canvas Drawer Menu
   ========================================================================== */
.tp-drawer-overlay,
.tp-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tp-drawer-overlay.tp-open,
.tp-drawer-backdrop.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.tp-drawer,
.tp-drawer-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 360px;
  max-width: 85vw;
  height: 100vh;
  background-color: var(--tp-bg-surface);
  z-index: 999;
  transform: translateX(-100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--tp-shadow-lg);
  border-right: 1px solid var(--tp-border-color);
}

.tp-drawer.tp-open,
.tp-drawer-menu.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.tp-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--tp-border-color);
}

.tp-drawer-title {
  font-family: var(--tp-font-serif);
  font-size: 1.25rem;
  font-weight: 700;
}

.tp-drawer-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.tp-drawer-menu {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tp-drawer-menu li a {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--tp-text-primary);
  display: block;
  padding: 6px 0;
}

.tp-drawer-menu li a:hover {
  color: var(--tp-accent);
  padding-left: 6px;
}

.tp-drawer-quote {
  margin-top: 36px;
  padding: 16px;
  background-color: var(--tp-bg-secondary);
  border-left: 3px solid var(--tp-accent);
  border-radius: var(--tp-radius-sm);
}

.tp-drawer-quote p {
  font-family: var(--tp-font-serif);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--tp-text-secondary);
  line-height: 1.5;
}

.tp-drawer-quote cite {
  display: block;
  font-size: 0.75rem;
  font-family: var(--tp-font-sans);
  font-weight: 600;
  margin-top: 8px;
  color: var(--tp-text-muted);
}

.tp-drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--tp-border-color);
  font-size: 0.8125rem;
  color: var(--tp-text-muted);
}

/* ==========================================================================
   6. Front Page - Stories Bar (Pure Text Pill Cards)
   ========================================================================== */
.tp-stories-section {
  padding: 20px 0 10px;
}

.tp-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--tp-border-color);
  padding-bottom: 8px;
}

.tp-section-title {
  font-family: var(--tp-font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tp-text-primary);
  position: relative;
}

.tp-section-title::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: var(--tp-accent);
}

.tp-stories-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

.tp-story-card {
  flex: 0 0 180px;
  background-color: var(--tp-bg-surface);
  border: 1px solid var(--tp-border-color);
  border-radius: var(--tp-radius-md);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 120px;
  box-shadow: var(--tp-shadow-sm);
  transition: var(--tp-transition);
}

.tp-story-card:hover {
  transform: translateY(-2px);
  border-color: var(--tp-accent);
  box-shadow: var(--tp-shadow-md);
}

.tp-story-category {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tp-accent);
}

.tp-story-card h3 {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--tp-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tp-story-card:hover h3 {
  color: var(--tp-accent);
}

/* ==========================================================================
   7. Front Page - Hero Section (Pure Text-First)
   ========================================================================== */
.tp-hero-section {
  padding: 24px 0 32px;
}

.tp-hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 28px;
  align-items: stretch;
}

.tp-hero-lead {
  background-color: var(--tp-bg-surface);
  border: 1px solid var(--tp-border-color);
  border-radius: var(--tp-radius-lg);
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--tp-shadow-sm);
  transition: var(--tp-transition);
}

.tp-hero-lead:hover {
  border-color: var(--tp-border-focus);
}

.tp-badge-primary {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff;
  background-color: var(--tp-accent);
  padding: 4px 10px;
  border-radius: var(--tp-radius-sm);
  margin-bottom: 16px;
}

.tp-hero-lead-title {
  font-family: var(--tp-font-serif);
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--tp-text-primary);
}

.tp-hero-lead:hover .tp-hero-lead-title a {
  color: var(--tp-accent);
}

.tp-hero-lead-excerpt {
  font-size: 1.05rem;
  color: var(--tp-text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.tp-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--tp-text-muted);
}

.tp-meta-author {
  font-weight: 600;
  color: var(--tp-text-secondary);
}

.tp-meta-sep {
  opacity: 0.6;
}

.tp-meta-reading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Hero Secondary Column */
.tp-hero-secondary {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tp-hero-sub-card {
  background-color: var(--tp-bg-surface);
  border: 1px solid var(--tp-border-color);
  border-radius: var(--tp-radius-md);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--tp-shadow-sm);
  transition: var(--tp-transition);
  flex: 1;
}

.tp-hero-sub-card:hover {
  transform: translateY(-2px);
  border-color: var(--tp-accent);
  box-shadow: var(--tp-shadow-md);
}

.tp-card-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tp-accent);
  margin-bottom: 8px;
}

.tp-hero-sub-card h3 {
  font-family: var(--tp-font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--tp-text-primary);
  margin-bottom: 10px;
}

.tp-hero-sub-card:hover h3 a {
  color: var(--tp-accent);
}

/* ==========================================================================
   8. Front Page - 3-Column Multi-Block Grid
   ========================================================================== */
.tp-grid-section {
  padding: 24px 0 36px;
}

.tp-card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.tp-text-card {
  background-color: var(--tp-bg-surface);
  border: 1px solid var(--tp-border-color);
  border-radius: var(--tp-radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--tp-shadow-sm);
  transition: var(--tp-transition);
}

.tp-text-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--tp-shadow-md);
  border-color: var(--tp-border-focus);
}

.tp-text-card-title {
  font-family: var(--tp-font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 12px;
  color: var(--tp-text-primary);
}

.tp-text-card:hover .tp-text-card-title a {
  color: var(--tp-accent);
}

.tp-text-card-excerpt {
  font-size: 0.9rem;
  color: var(--tp-text-secondary);
  line-height: 1.55;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   9. Front Page - Numbered Trending List
   ========================================================================== */
.tp-trending-section {
  padding: 24px 0 36px;
  background-color: var(--tp-bg-secondary);
  border-top: 1px solid var(--tp-border-color);
  border-bottom: 1px solid var(--tp-border-color);
}

.tp-trending-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.tp-trending-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.tp-trending-num {
  font-family: var(--tp-font-mono);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--tp-text-muted);
  opacity: 0.5;
  flex-shrink: 0;
}

.tp-trending-item:hover .tp-trending-num {
  color: var(--tp-accent);
  opacity: 1;
}

.tp-trending-content h3 {
  font-family: var(--tp-font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
}

.tp-trending-content h3 a {
  color: var(--tp-text-primary);
}

.tp-trending-content h3 a:hover {
  color: var(--tp-accent);
}

.tp-trending-meta {
  font-size: 0.75rem;
  color: var(--tp-text-muted);
}

/* ==========================================================================
   10. Main Feed & Sidebar Layout
   ========================================================================== */
.tp-main-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 36px;
  padding: 40px 20px;
}

.tp-feed-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tp-feed-item {
  background-color: var(--tp-bg-surface);
  border: 1px solid var(--tp-border-color);
  border-radius: var(--tp-radius-md);
  padding: 24px;
  transition: var(--tp-transition);
}

.tp-feed-item:hover {
  border-color: var(--tp-border-focus);
}

.tp-feed-title {
  font-family: var(--tp-font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--tp-text-primary);
}

.tp-feed-title a:hover {
  color: var(--tp-accent);
}

.tp-feed-excerpt {
  font-size: 0.9375rem;
  color: var(--tp-text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

/* Sidebar Styles */
.tp-sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.tp-widget {
  background-color: var(--tp-bg-surface);
  border: 1px solid var(--tp-border-color);
  border-radius: var(--tp-radius-md);
  padding: 24px;
}

.tp-widget-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tp-text-primary);
  margin-bottom: 18px;
  border-bottom: 2px solid var(--tp-accent);
  padding-bottom: 6px;
  display: inline-block;
}

.tp-sidebar-posts-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tp-sidebar-post-item {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--tp-border-subtle);
}

.tp-sidebar-post-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.tp-sidebar-bullet {
  color: var(--tp-accent);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.tp-sidebar-post-info h4 {
  font-family: var(--tp-font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 4px;
}

.tp-sidebar-post-info h4 a {
  color: var(--tp-text-primary);
}

.tp-sidebar-post-info h4 a:hover {
  color: var(--tp-accent);
}

.tp-sidebar-post-meta {
  font-size: 0.75rem;
  color: var(--tp-text-muted);
}

.tp-categories-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tp-category-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
  padding: 4px 0;
}

.tp-category-item a:hover {
  color: var(--tp-accent);
  padding-left: 4px;
}

.tp-category-count {
  font-size: 0.75rem;
  background-color: var(--tp-bg-secondary);
  color: var(--tp-text-muted);
  padding: 2px 8px;
  border-radius: var(--tp-radius-full);
}

/* Sidebar Editorial Quote */
.tp-sidebar-quote {
  background-color: var(--tp-bg-secondary);
  border-left: 3px solid var(--tp-accent);
  padding: 16px;
  border-radius: var(--tp-radius-sm);
}

.tp-sidebar-quote p {
  font-family: var(--tp-font-serif);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--tp-text-secondary);
  line-height: 1.5;
}

.tp-sidebar-quote cite {
  display: block;
  font-size: 0.75rem;
  font-family: var(--tp-font-sans);
  font-weight: 600;
  margin-top: 8px;
  color: var(--tp-text-muted);
}

/* ==========================================================================
   11. Single Post & Article Template
   ========================================================================== */
.tp-single-layout {
  padding-top: 32px;
}

.tp-article-flow {
  max-width: 820px;
}

.tp-single-article {
  background-color: var(--tp-bg-surface);
  border: 1px solid var(--tp-border-color);
  border-radius: var(--tp-radius-lg);
  padding: 40px 48px;
}

.tp-article-header {
  margin-bottom: 28px;
  border-bottom: 1px solid var(--tp-border-color);
  padding-bottom: 24px;
}

.tp-article-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tp-accent);
  margin-bottom: 12px;
}

.tp-article-title {
  font-family: var(--tp-font-serif);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--tp-text-primary);
  margin-bottom: 18px;
}

.tp-article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--tp-text-muted);
}

.tp-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Featured Image (ONLY on Single Post) */
.tp-article-featured-image {
  margin: 0 0 32px 0;
  border-radius: var(--tp-radius-md);
  overflow: hidden;
  border: 1px solid var(--tp-border-color);
}

.tp-article-featured-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.tp-article-featured-image figcaption {
  font-size: 0.8125rem;
  color: var(--tp-text-muted);
  padding: 8px 12px;
  background-color: var(--tp-bg-secondary);
  font-style: italic;
  border-top: 1px solid var(--tp-border-subtle);
}

/* Prose Typography */
.tp-prose {
  font-family: var(--tp-font-serif);
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--tp-text-primary);
}

.tp-prose p {
  margin-bottom: 1.6em;
}

.tp-prose h2, .tp-prose h3, .tp-prose h4 {
  font-family: var(--tp-font-sans);
  color: var(--tp-text-primary);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.8em;
}

.tp-prose h2 { font-size: 1.75rem; }
.tp-prose h3 { font-size: 1.35rem; }
.tp-prose h4 { font-size: 1.15rem; }

.tp-prose blockquote {
  font-family: var(--tp-font-serif);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.6;
  border-left: 4px solid var(--tp-accent);
  padding: 16px 24px;
  margin: 2em 0;
  background-color: var(--tp-bg-secondary);
  border-radius: 0 var(--tp-radius-md) var(--tp-radius-md) 0;
}

.tp-prose ul, .tp-prose ol {
  margin: 1.5em 0;
  padding-left: 28px;
}

.tp-prose ul { list-style: disc; }
.tp-prose ol { list-style: decimal; }

.tp-prose li {
  margin-bottom: 0.5em;
}

.tp-prose pre {
  background-color: var(--tp-bg-secondary);
  border: 1px solid var(--tp-border-color);
  padding: 18px;
  border-radius: var(--tp-radius-md);
  overflow-x: auto;
  font-family: var(--tp-font-mono);
  font-size: 0.875rem;
  margin: 1.8em 0;
}

.tp-prose code {
  font-family: var(--tp-font-mono);
  font-size: 0.875em;
  background-color: var(--tp-bg-secondary);
  padding: 2px 6px;
  border-radius: var(--tp-radius-sm);
  border: 1px solid var(--tp-border-subtle);
}

.tp-prose a {
  color: var(--tp-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tp-prose a:hover {
  text-decoration: none;
}

/* Article Tags */
.tp-article-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--tp-border-color);
}

.tp-tags-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--tp-text-muted);
  text-transform: uppercase;
}

.tp-tag-pill {
  font-size: 0.8125rem;
  background-color: var(--tp-bg-secondary);
  color: var(--tp-text-secondary);
  padding: 4px 12px;
  border-radius: var(--tp-radius-full);
  border: 1px solid var(--tp-border-color);
}

.tp-tag-pill:hover {
  background-color: var(--tp-accent);
  color: #ffffff;
  border-color: var(--tp-accent);
}

/* Article Share Bar */
.tp-article-share {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--tp-border-subtle);
}

.tp-share-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--tp-text-muted);
  text-transform: uppercase;
  margin-right: 6px;
}

.tp-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background-color: var(--tp-bg-secondary);
  border: 1px solid var(--tp-border-color);
  color: var(--tp-text-secondary);
  transition: var(--tp-transition);
}

.tp-share-btn:hover {
  background-color: var(--tp-accent);
  color: #ffffff;
  border-color: var(--tp-accent);
}

/* Author Box */
.tp-author-box {
  display: flex;
  gap: 20px;
  align-items: center;
  background-color: var(--tp-bg-secondary);
  border: 1px solid var(--tp-border-color);
  border-radius: var(--tp-radius-md);
  padding: 24px;
  margin-top: 36px;
}

.tp-author-avatar img {
  border-radius: 50%;
  border: 2px solid var(--tp-border-color);
}

.tp-author-meta h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.tp-author-meta p {
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
  line-height: 1.5;
}

/* Related Posts (Pure Text) */
.tp-related-posts {
  margin-top: 40px;
}

.tp-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 16px;
}

.tp-related-card {
  background-color: var(--tp-bg-surface);
  border: 1px solid var(--tp-border-color);
  border-radius: var(--tp-radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--tp-transition);
}

.tp-related-card:hover {
  border-color: var(--tp-accent);
  transform: translateY(-2px);
}

.tp-related-card h4 {
  font-family: var(--tp-font-serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
}

.tp-related-card h4 a {
  color: var(--tp-text-primary);
}

.tp-related-card h4 a:hover {
  color: var(--tp-accent);
}

/* ==========================================================================
   12. Comments Area
   ========================================================================== */
.tp-comments-area {
  margin-top: 48px;
  background-color: var(--tp-bg-surface);
  border: 1px solid var(--tp-border-color);
  border-radius: var(--tp-radius-lg);
  padding: 36px;
}

.tp-comments-title {
  font-family: var(--tp-font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--tp-border-color);
  padding-bottom: 12px;
}

.tp-comment-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 36px;
}

.tp-comment-list article {
  background-color: var(--tp-bg-secondary);
  border-radius: var(--tp-radius-md);
  padding: 18px;
}

.comment-author img {
  border-radius: 50%;
  float: left;
  margin-right: 12px;
}

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

.comment-content {
  font-size: 0.95rem;
  line-height: 1.6;
  clear: both;
}

.tp-comment-form input[type="text"],
.tp-comment-form input[type="email"],
.tp-comment-form input[type="url"],
.tp-comment-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--tp-border-color);
  background-color: var(--tp-bg-secondary);
  color: var(--tp-text-primary);
  border-radius: var(--tp-radius-md);
  outline: none;
  margin-bottom: 14px;
}

.tp-comment-form input:focus,
.tp-comment-form textarea:focus {
  border-color: var(--tp-border-focus);
}

/* ==========================================================================
   13. Footer & Fully Responsive Newsletter
   ========================================================================== */
.tp-site-footer {
  margin-top: auto;
  background-color: var(--tp-bg-secondary);
  border-top: 1px solid var(--tp-border-color);
  padding: 48px 0 28px;
}

.tp-footer-newsletter {
  background-color: var(--tp-bg-surface);
  border: 1px solid var(--tp-border-color);
  border-radius: var(--tp-radius-lg);
  padding: 36px;
  margin-bottom: 48px;
  box-shadow: var(--tp-shadow-sm);
}

.tp-newsletter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.tp-newsletter-content h3 {
  font-family: var(--tp-font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--tp-text-primary);
}

.tp-newsletter-content p {
  font-size: 0.9375rem;
  color: var(--tp-text-secondary);
}

/* Fully Responsive Newsletter Form */
.tp-newsletter-form {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 380px;
  max-width: 100%;
}

.tp-newsletter-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--tp-border-color);
  background-color: var(--tp-bg-secondary);
  color: var(--tp-text-primary);
  border-radius: var(--tp-radius-md);
  font-size: 0.9375rem;
  outline: none;
  min-width: 0;
}

.tp-newsletter-input:focus {
  border-color: var(--tp-border-focus);
  background-color: var(--tp-bg-surface);
}

.tp-newsletter-btn {
  padding: 12px 22px;
  background-color: var(--tp-accent);
  color: #ffffff;
  border: none;
  border-radius: var(--tp-radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--tp-transition);
}

.tp-newsletter-btn:hover {
  background-color: var(--tp-accent-hover);
}

/* Footer Grid */
.tp-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 36px;
  margin-bottom: 40px;
}

.tp-footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tp-text-primary);
  margin-bottom: 16px;
}

.tp-footer-about-text {
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
  line-height: 1.6;
  margin-top: 10px;
}

.tp-footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tp-footer-links li a {
  font-size: 0.875rem;
  color: var(--tp-text-secondary);
}

.tp-footer-links li a:hover {
  color: var(--tp-accent);
}

.tp-footer-quote {
  font-family: var(--tp-font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--tp-text-secondary);
  line-height: 1.5;
  border-left: 2px solid var(--tp-accent);
  padding-left: 12px;
}

.tp-footer-quote cite {
  display: block;
  font-size: 0.75rem;
  font-family: var(--tp-font-sans);
  font-weight: 600;
  margin-top: 6px;
  color: var(--tp-text-muted);
}

.tp-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--tp-border-subtle);
  font-size: 0.8125rem;
  color: var(--tp-text-muted);
}

.tp-footer-creator a {
  color: var(--tp-accent);
  font-weight: 600;
}

.tp-footer-creator a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   14. Pagination, Buttons, 404, Back to Top
   ========================================================================== */
.tp-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
}

.tp-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--tp-radius-md);
  border: 1px solid var(--tp-border-color);
  background-color: var(--tp-bg-surface);
  color: var(--tp-text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--tp-transition);
}

.tp-pagination .page-numbers.current {
  background-color: var(--tp-accent);
  color: #ffffff;
  border-color: var(--tp-accent);
}

.tp-pagination .page-numbers:hover:not(.current) {
  background-color: var(--tp-bg-hover);
  border-color: var(--tp-border-focus);
}

.tp-btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--tp-radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--tp-transition);
  border: 1px solid transparent;
}

.tp-btn-accent {
  background-color: var(--tp-accent);
  color: #ffffff;
}

.tp-btn-accent:hover {
  background-color: var(--tp-accent-hover);
  color: #ffffff;
}

/* 404 Page */
.tp-404-container {
  padding: 80px 0;
  display: flex;
  justify-content: center;
  text-align: center;
}

.tp-404-inner {
  max-width: 540px;
}

.tp-404-code {
  font-family: var(--tp-font-mono);
  font-size: 6rem;
  font-weight: 800;
  color: var(--tp-accent);
  line-height: 1;
  display: block;
  margin-bottom: 12px;
}

.tp-404-title {
  font-family: var(--tp-font-serif);
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.tp-404-desc {
  font-size: 1.05rem;
  color: var(--tp-text-secondary);
  margin-bottom: 28px;
}

.tp-404-actions {
  margin-top: 24px;
}

/* Back to Top Button */
.tp-back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--tp-accent);
  color: #ffffff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--tp-shadow-md);
  cursor: pointer;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: var(--tp-transition);
}

.tp-back-to-top.tp-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tp-back-to-top:hover {
  background-color: var(--tp-accent-hover);
  transform: translateY(-2px);
}

/* ==========================================================================
   15. TextPress-Plus Optional Thumbnail Layout Styles
   (Applied when thumbnails are enabled in TextPress-Plus customizer)
   ========================================================================== */
.tp-story-has-thumb {
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  color: #ffffff;
}

.tp-story-has-thumb .tp-story-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.85) 100%);
  z-index: 1;
}

.tp-story-has-thumb .tp-story-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.tp-story-has-thumb h3 {
  color: #ffffff;
}

.tp-hero-lead-thumb-box {
  margin-bottom: 20px;
  border-radius: var(--tp-radius-md);
  overflow: hidden;
  max-height: 380px;
}

.tp-hero-lead-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tp-card-has-thumb .tp-card-thumb-box {
  margin: -24px -24px 18px -24px;
  border-radius: var(--tp-radius-md) var(--tp-radius-md) 0 0;
  overflow: hidden;
  max-height: 180px;
}

.tp-card-has-thumb .tp-card-thumb-box img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.tp-card-has-thumb:hover .tp-card-thumb-box img {
  transform: scale(1.04);
}

.tp-feed-has-thumb {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
}

.tp-feed-thumb-box {
  border-radius: var(--tp-radius-md);
  overflow: hidden;
  height: 140px;
}

.tp-feed-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tp-sidebar-thumb-box {
  width: 68px;
  height: 52px;
  border-radius: var(--tp-radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

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

.tp-related-thumb-box {
  margin: -18px -18px 12px -18px;
  border-radius: var(--tp-radius-md) var(--tp-radius-md) 0 0;
  overflow: hidden;
  height: 120px;
}

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

/* ==========================================================================
   16. Responsive Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
  .tp-primary-nav {
    display: none;
  }

  .tp-card-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .tp-trending-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tp-main-layout {
    grid-template-columns: 1fr;
  }

  .tp-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .tp-hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --tp-header-height: 56px;
  }

  .tp-hero-lead {
    padding: 22px 20px;
  }

  .tp-hero-lead-title {
    font-size: 1.65rem;
  }

  .tp-article-title {
    font-size: 1.85rem;
  }

  .tp-single-article {
    padding: 24px 20px;
  }

  .tp-card-grid-3 {
    grid-template-columns: 1fr;
  }

  .tp-trending-grid {
    grid-template-columns: 1fr;
  }

  .tp-related-grid {
    grid-template-columns: 1fr;
  }

  /* Newsletter Responsiveness - Stack vertically */
  .tp-newsletter-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .tp-newsletter-form {
    min-width: 100%;
    flex-direction: column;
  }

  .tp-newsletter-btn {
    width: 100%;
  }

  .tp-feed-has-thumb {
    grid-template-columns: 1fr;
  }

  .tp-feed-thumb-box {
    height: 180px;
  }

  .tp-footer-grid {
    grid-template-columns: 1fr;
  }

  .tp-footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

/* ==========================================================================
   17. PageSpeed & Accessibility Optimizations (Core Web Vitals Boost)
   ========================================================================== */
/* Touch targets minimum hit area */
.tp-main-menu li a,
.tp-nav-list li a,
.tp-drawer-menu li a,
.tp-drawer-nav-list li a {
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
  padding: 0 8px;
}

.tp-category-item a,
.tp-footer-links li a,
.tp-footer-list li a {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.tp-tag-pill,
.tp-pill-item {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin: 4px 2px;
}

/* Content visibility containment for offscreen sections */
.tp-trending-section,
.tp-main-layout,
.tp-site-footer,
.tp-footer {
  content-visibility: auto;
  contain-intrinsic-size: 0 450px;
}
