/*
Theme Name: Mediatext
Theme URI: https://mediatext.ro
Author: Galan Mihai
Author URI: https://mediatext.ro
Description: Temă WordPress modernă, editorială și culturală dedicată proiectului literar Mediatext (mediatext.ro). Include suport nativ pentru Poezie centrată, Povești S.F. imersive, Asistent AI (Gemini), sistem nativ AJAX Like, bară de progres a lecturii și conformitate strictă GDPR / UE.
Version: 1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mediatext
Tags: blog, cultural, literature, dark-mode, poetry, science-fiction, clean, accessible, editor-style, translation-ready
*/

/* ==========================================================================
   1. CSS VARIABLES & THEMES (Light & Dark Mode)
   ========================================================================== */
:root {
  --bg-primary: #faf8f5;
  --bg-secondary: #f4ede4;
  --bg-card: #ffffff;
  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #78716c;
  --accent: #b45309;
  --accent-hover: #92400e;
  --accent-light: #fef3c7;
  --border-color: #e7e5e4;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-body: 'Merriweather', 'Lora', serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --container-width: 1200px;
  --reading-width: 780px;
}

[data-theme="dark"], body.dark-mode {
  --bg-primary: #0c0d10;
  --bg-secondary: #141720;
  --bg-card: #161a24;
  --text-primary: #f5f5f4;
  --text-secondary: #d6d3d1;
  --text-muted: #a8a29e;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-light: #292524;
  --border-color: #262626;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.85;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.site-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Reading Progress Bar */
#reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #b45309, #f59e0b);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s ease-out;
}

/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  background-color: rgba(250, 248, 245, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: background-color 0.3s ease;
}

[data-theme="dark"] .site-header,
body.dark-mode .site-header {
  background-color: rgba(12, 13, 16, 0.95);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
}

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

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

.site-tagline {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.main-navigation ul {
  display: flex;
  list-style: none;
  gap: 1.75rem;
  align-items: center;
}

.main-navigation a {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ==========================================================================
   4. EDITORIAL HERO & MAGAZINE GRID
   ========================================================================== */
.hero-section {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border-color);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-badge {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background-color: var(--accent-light);
  color: var(--accent);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 3.25rem;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero-meta {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.categories-bar {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 3rem;
}

.category-pill {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  white-space: nowrap;
}

.category-pill:hover,
.category-pill.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2.5rem;
  margin-bottom: 4rem;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-content {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.625rem;
  margin: 0.5rem 0 0.85rem;
}

.card-excerpt {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* ==========================================================================
   5. TEMPLATES PENTRU ARTICOLE (POEZIE, SF, UNIVERSAL)
   ========================================================================== */
.single-article {
  max-width: var(--reading-width);
  margin: 3rem auto 5rem;
  padding: 0 1rem;
}

.single-header {
  text-align: center;
  margin-bottom: 3rem;
}

.single-title {
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.single-meta {
  font-family: var(--font-sans);
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Layout dedicat Poezie */
.layout-poetry {
  text-align: center;
}

.poetry-body {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 2.2;
  font-style: italic;
  max-width: 600px;
  margin: 0 auto;
}

.poetry-stanza {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  position: relative;
}

.poetry-stanza::after {
  content: "✦";
  display: block;
  font-size: 0.75rem;
  color: var(--accent);
  opacity: 0.5;
  margin-top: 1.5rem;
}

.poetry-stanza:last-child::after {
  display: none;
}

/* Layout dedicat Science-Fiction */
.layout-sf {
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.05), transparent 70%);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.layout-sf .sf-badge {
  color: #38bdf8;
  background-color: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.article-content p {
  margin-bottom: 1.75rem;
  text-align: justify;
}

.drop-cap::first-letter {
  font-family: var(--font-serif);
  float: left;
  font-size: 3.75rem;
  line-height: 0.8;
  margin: 0.15em 0.2em 0 0;
  font-weight: 700;
  color: var(--accent);
}

/* Bară Acțiuni (Like nativ & Social Share) */
.post-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin: 3.5rem 0;
  font-family: var(--font-sans);
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem 1.25rem;
  border-radius: 9999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
}

.like-btn:hover,
.like-btn.liked {
  border-color: #ef4444;
  color: #ef4444;
  background-color: #fef2f2;
}

[data-theme="dark"] .like-btn.liked,
body.dark-mode .like-btn.liked {
  background-color: #450a0a;
}

.share-buttons {
  display: flex;
  gap: 0.5rem;
}

.share-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

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

/* Caseta Autor (Galan Mihai) */
.author-box {
  display: flex;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin: 3.5rem 0;
}

.author-title {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.author-role {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.author-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   6. COMENTARII & CHECKBOX OBLIGATORIU GDPR
   ========================================================================== */
.comments-area {
  margin-top: 4rem;
}

.comment-list {
  list-style: none;
  margin: 2rem 0;
}

.comment-body {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.comment-author-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.comment-reactions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.reaction-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8125rem;
  cursor: pointer;
}

.comment-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  margin-bottom: 1rem;
}

.comment-form-gdpr {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 1.25rem 0;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.comment-form-gdpr input[type="checkbox"] {
  margin-top: 0.25rem;
  accent-color: var(--accent);
}

.submit-btn {
  background: var(--accent);
  color: #ffffff;
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.submit-btn:hover {
  background: var(--accent-hover);
}

/* ==========================================================================
   7. ASISTENTUL MEDIATEXT AI (CHATBOT WIDGET)
   ========================================================================== */
.ai-chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  font-family: var(--font-sans);
}

.ai-chatbot-trigger {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b45309, #d97706);
  color: #ffffff;
  border: none;
  box-shadow: 0 8px 24px rgba(180, 83, 9, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.ai-chatbot-trigger:hover {
  transform: scale(1.08);
}

.ai-chat-window {
  display: none;
  position: fixed;
  bottom: 95px;
  right: 24px;
  width: 380px;
  height: 540px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 120px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
}

.ai-chat-window.open {
  display: flex;
}

.ai-chat-header {
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-chat-messages {
  flex-grow: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-bubble {
  max-width: 82%;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.chat-bubble.bot {
  background: var(--bg-secondary);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  background: var(--accent);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ai-chat-input-area {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.ai-chat-form {
  display: flex;
  gap: 0.5rem;
}

.ai-chat-form input {
  flex-grow: 1;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.ai-chat-disclaimer {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
  line-height: 1.3;
}

/* ==========================================================================
   8. GDPR COOKIE NOTICE
   ========================================================================== */
.cookie-consent-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 9995;
  font-family: var(--font-sans);
  display: none;
}

.cookie-consent-banner.visible {
  display: block;
}

.cookie-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.cookie-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.cookie-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.cookie-btn-accept {
  background: var(--accent);
  color: #ffffff;
  border: none;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
}

.cookie-btn-reject {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  cursor: pointer;
}

/* ==========================================================================
   9. FOOTER & RESPONSIVE
   ========================================================================== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  font-family: var(--font-sans);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h5 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.65rem;
}

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

.footer-col a:hover {
  color: var(--accent);
}

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

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .main-navigation { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 2.25rem; }
  .single-title { font-size: 2.25rem; }
  .post-actions-bar { flex-direction: column; gap: 1rem; align-items: flex-start; }
}
