/*
Theme Name: WOOR.AI
Theme URI: https://woor.ai
Author: WOOR.AI
Author URI: https://woor.ai
Description: A curated AI news hub with dark theme, category filters, search, bookmarks, and responsive design. Built for woor.ai — your daily source for AI news, model releases, research breakthroughs, and expert analysis.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: woor-ai
Tags: dark, one-column, two-columns, custom-menu, featured-images, threaded-comments, translation-ready, blog, news
*/

/* ═══════════════ CSS Variables (Dark Theme) ═══════════════ */

:root {
  --background: #1a1a1e;
  --background-rgb: 26, 26, 30;
  --foreground: #e4e4e7;
  --card: #232328;
  --card-rgb: 35, 35, 40;
  --card-alpha: rgba(var(--card-rgb), 0.3);
  --border: rgba(255, 255, 255, 0.08);
  --border-40: rgba(255, 255, 255, 0.04);
  --border-60: rgba(255, 255, 255, 0.06);
  --muted: #71717a;
  --muted-fg: #a1a1aa;
  --violet: #8b5cf6;
  --fuchsia: #d946ef;
  --cyan: #06b6d4;
  --amber: #f59e0b;
  --emerald: #10b981;
  --rose: #f43f5e;
  --radius: 0.625rem;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ═══════════════ Reset & Base ═══════════════ */

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

body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }

/* Focus visible */
*:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

html { scroll-behavior: smooth; }

/* Hide WordPress default */
.wp-embed-responsive .wp-block-embed__wrapper { margin-bottom: 0; }
.entry-content { margin: 0; }

/* ═══════════════ Grid Background ═══════════════ */

.woor-grid {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

/* ═══════════════ Scrollbar ═══════════════ */

.custom-scrollbar::-webkit-scrollbar { width: 5px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ═══════════════ Cards ═══════════════ */

.article-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.article-card:hover {
  border-color: rgba(255,255,255,0.14%);
  box-shadow: 0 0 40px -12px rgba(139,92,246,0.12), 0 4px 20px -8px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

.featured-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.featured-card:hover {
  border-color: rgba(255,255,255,0.16%);
  box-shadow: 0 0 60px -16px rgba(139,92,246,0.15), 0 8px 32px -8px rgba(0,0,0,0.25);
  transform: translateY(-3px);
}

/* ═══════════════ Category Pill ═══════════════ */

.category-active {
  box-shadow: 0 0 20px -4px rgba(139,92,246,0.3);
}

/* ═══════════════ Shimmer ═══════════════ */

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.stat-shimmer {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04%) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 4s ease-in-out infinite;
}

/* ═══════════════ Ping Dot ═══════════════ */

@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }

/* ═══════════════ Gradient Text ═══════════════ */

.gradient-text {
  background: linear-gradient(to right, #a78bfa, #e879f9, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══════════════ Utility Classes ═══════════════ */

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ═══════════════ Layout ═══════════════ */

.woor-container {
  max-width: 80rem;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .woor-container { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .woor-container { padding-left: 2rem; padding-right: 2rem; }
}

/* ═══════════════ Header ═══════════════ */

.woor-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: rgba(var(--background-rgb), 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.woor-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  gap: 0.75rem;
}

/* ═══════════════ Logo ═══════════════ */

.woor-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.woor-logo-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, var(--violet), var(--fuchsia));
  color: #fff;
  box-shadow: 0 10px 15px -3px rgba(139,92,246,0.25);
  transition: transform 0.2s;
}
.woor-logo:hover .woor-logo-icon {
  transform: scale(1.05) rotate(3deg);
}
.woor-logo-icon svg { width: 1.25rem; height: 1.25rem; }
.woor-logo-title { font-size: 0.875rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.woor-logo-sub { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

/* ═══════════════ Desktop Nav ═══════════════ */

.woor-nav { display: none; align-items: center; gap: 0.25rem; }
@media (min-width: 1024px) { .woor-nav { display: flex; } }
.woor-nav button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s;
  color: var(--muted);
}
.woor-nav button:hover, .woor-nav button.active {
  color: var(--foreground);
  background: rgba(var(--card-rgb), 0.6);
}
.woor-nav button.active { color: #c4b5fd; background: rgba(139,92,246,0.15); }

/* ═══════════════ Mobile Sheet ═══════════════ */

.woor-sheet-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.woor-sheet-overlay.open { opacity: 1; pointer-events: auto; }
.woor-sheet {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 18rem; z-index: 51;
  background: var(--background);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
}
.woor-sheet.open { transform: translateX(0); }
.woor-sheet-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.woor-sheet-nav { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.woor-sheet-nav a, .woor-sheet-nav button {
  display: flex; align-items: center; gap: 0.75rem;
  border-radius: 0.5rem; padding: 0.625rem 0.75rem;
  font-size: 0.875rem; color: var(--muted);
  transition: all 0.2s;
}
.woor-sheet-nav a:hover, .woor-sheet-nav button:hover {
  background: var(--card); color: var(--foreground);
}
.woor-sheet-nav .section-label {
  padding: 0 0.75rem 0.5rem;
  font-size: 0.625rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: rgba(113,113,122,0.6);
  margin-top: 0.5rem;
}
.woor-sheet-divider { height: 1px; background: var(--border); margin: 0.5rem 0; }

/* ═══════════════ Buttons ═══════════════ */

.woor-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500;
  padding: 0.625rem 1.25rem; transition: all 0.2s; border: none; cursor: pointer;
}
.woor-btn-primary {
  background: linear-gradient(to right, var(--violet), var(--fuchsia));
  color: #fff; box-shadow: 0 10px 15px -3px rgba(139,92,246,0.25);
}
.woor-btn-primary:hover { opacity: 0.9; }
.woor-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.woor-btn-ghost {
  background: transparent; color: var(--muted); padding: 0.375rem;
}
.woor-btn-ghost:hover { color: var(--foreground); }

/* ═══════════════ Badge ═══════════════ */

.woor-badge {
  display: inline-flex; align-items: center;
  padding: 0.125rem 0.5rem; border-radius: 0.375rem;
  font-size: 0.625rem; font-weight: 600; color: #fff;
  border: none; line-height: 1.5;
}

/* ═══════════════ Search ═══════════════ */

.woor-search-trigger {
  display: none; align-items: center; gap: 0.5rem;
  border-radius: 0.5rem; border: 1px solid var(--border);
  background: rgba(var(--card-rgb), 0.6); padding: 0.375rem 0.75rem;
  font-size: 0.75rem; color: var(--muted);
  backdrop-filter: blur(8px); transition: all 0.2s; cursor: pointer;
}
.woor-search-trigger:hover { border-color: var(--border-60); color: var(--foreground); }
@media (min-width: 768px) { .woor-search-trigger { display: inline-flex; } }
.woor-search-trigger kbd {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); background: rgba(var(--card-rgb),0.6);
  padding: 0.0625rem 0.25rem; border-radius: 0.25rem;
  font-family: monospace; font-size: 0.625rem; font-weight: 500;
  color: var(--muted); margin-left: 0.5rem;
}

/* Search Dialog */
.woor-search-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 15vh; opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.woor-search-overlay.open { opacity: 1; pointer-events: auto; }
.woor-search-dialog {
  width: 100%; max-width: 36rem; max-height: 28rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0.75rem; overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  transform: scale(0.95); transition: transform 0.2s;
}
.woor-search-overlay.open .woor-search-dialog { transform: scale(1); }
.woor-search-input {
  width: 100%; padding: 0.875rem 1rem 0.875rem 2.75rem;
  background: transparent; border: none; border-bottom: 1px solid var(--border);
  color: var(--foreground); font-size: 0.875rem; outline: none;
}
.woor-search-input::placeholder { color: var(--muted); }
.woor-search-icon {
  position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.woor-search-results {
  flex: 1; overflow-y: auto; padding: 0.5rem;
}
.woor-search-item {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 0.75rem; border-radius: 0.5rem; cursor: pointer;
  transition: background 0.15s;
}
.woor-search-item:hover { background: rgba(var(--card-rgb), 0.8); }
.woor-search-item-title { font-size: 0.75rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.woor-search-item-desc { font-size: 0.6875rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.woor-search-empty { padding: 2rem; text-align: center; font-size: 0.8125rem; color: var(--muted); }

/* ═══════════════ Stat Cards ═══════════════ */

.woor-stat-card {
  position: relative; overflow: hidden;
  border-radius: 0.75rem; border: 1px solid var(--border);
  background: rgba(var(--card-rgb), 0.3); padding: 1rem;
  backdrop-filter: blur(8px);
}
.woor-stat-value { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.woor-stat-label { font-size: 0.75rem; color: var(--muted); margin-top: 0.125rem; }
.woor-stat-icon {
  border-radius: 0.5rem; padding: 0.5rem;
  display: flex; align-items: center; justify-content: center;
}
.woor-stat-icon svg { width: 1rem; height: 1rem; }

/* ═══════════════ Trending Ticker ═══════════════ */

.woor-ticker {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0; overflow-x: auto;
}
.woor-ticker button {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.375rem;
  border-radius: 9999px; border: 1px solid var(--border);
  background: rgba(var(--background-rgb), 0.4);
  padding: 0.25rem 0.75rem; font-size: 0.75rem;
  color: var(--muted); transition: all 0.2s;
}
.woor-ticker button:hover { color: var(--foreground); border-color: var(--border-60); }
.woor-ticker-num { font-size: 0.625rem; font-family: monospace; color: rgba(113,113,122,0.5); }

/* ═══════════════ Article Grid ═══════════════ */

.woor-articles-grid {
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .woor-articles-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .woor-articles-grid { grid-template-columns: repeat(3, 1fr); } }

.woor-featured-grid {
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .woor-featured-grid { grid-template-columns: repeat(2, 1fr); } }

/* ═══════════════ Footer ═══════════════ */

.woor-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: rgba(var(--background-rgb), 0.6);
  backdrop-filter: blur(8px);
}
.woor-footer-grid {
  display: grid; gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .woor-footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .woor-footer-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .woor-footer-grid > :first-child { grid-column: span 1; } }

.woor-footer a { font-size: 0.75rem; color: var(--muted); transition: color 0.2s; display: inline-block; }
.woor-footer a:hover { color: var(--foreground); }

/* ═══════════════ Scroll to Top ═══════════════ */

.woor-scroll-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 40;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border-radius: 9999px;
  border: 1px solid var(--border);
  background: rgba(var(--card-rgb), 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2);
  transition: all 0.3s;
  opacity: 0; transform: translateY(1rem); pointer-events: none;
}
.woor-scroll-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.woor-scroll-top:hover { box-shadow: 0 20px 25px -5px rgba(139,92,246,0.2); transform: translateY(-0.125rem); }

/* ═══════════════ Subpage Layout ═══════════════ */

.woor-subpage-content {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 4rem;
}
@media (min-width: 640px) { .woor-subpage-content { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .woor-subpage-content { padding-left: 2rem; padding-right: 2rem; } }

.woor-info-card {
  border-radius: 0.75rem; border: 1px solid var(--border);
  background: rgba(var(--card-rgb), 0.3); padding: 1.25rem;
  backdrop-filter: blur(8px);
}
.woor-info-card-hover:hover {
  border-color: var(--border-60);
}

/* ═══════════════ Responsive ═══════════════ */

@media (max-width: 767px) {
  .woor-search-mobile { display: inline-flex !important; }
}

/* ═══════════════ WordPress Specific ═══════════════ */

.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;
}

/* Hide admin bar for clean frontend */
#wpadminbar { display: none; }

/* Bookmark active */
.bookmark-active { color: var(--fuchsia) !important; }
.bookmark-inactive { color: rgba(113,113,122,0.3); }
.bookmark-inactive:hover { color: var(--muted); }

/* Separator */
.woor-separator { height: 1px; background: var(--border); }

/* Back link on subpages */
.woor-back-link {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-size: 0.875rem; color: var(--muted);
  padding: 0.375rem 0.5rem; border-radius: 0.5rem;
  transition: all 0.2s;
}
.woor-back-link:hover { color: var(--foreground); background: rgba(var(--card-rgb),0.6); }

/* Newsletter input */
.woor-input {
  width: 100%; padding: 0.75rem 1rem;
  border-radius: 0.5rem; border: 1px solid var(--border);
  background: rgba(var(--background-rgb), 0.6);
  color: var(--foreground); font-size: 0.875rem; outline: none;
  transition: border-color 0.2s;
}
.woor-input:focus { border-color: var(--violet); }
.woor-input::placeholder { color: rgba(113,113,122,0.5); }