/* style.css - Core Stylesheet for Sipbite.fun */

@import url('./variables.css');

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

html {
  scroll-behavior: smooth;
  font-size: calc(16px * var(--font-scale));
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-theme), color var(--transition-theme);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 0.5em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; margin-top: 1.5em; }
h3 { font-size: 1.4rem; margin-top: 1.2em; }
h4 { font-size: 1.2rem; }

p {
  margin-bottom: 1.2rem;
  color: var(--text-secondary);
}

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

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1.2rem;
  color: var(--text-secondary);
}

li {
  margin-bottom: 0.4rem;
}

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

iframe {
  border: none;
  border-radius: var(--radius-md);
}

/* Skip to Content Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-accent);
  color: var(--color-white);
  padding: 10px 20px;
  z-index: 10000;
  transition: top var(--transition-speed);
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--text-primary);
}

/* ==========================================================================
   2. Layout Containers
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-right: auto;
  margin-left: auto;
  padding-right: 20px;
  padding-left: 20px;
}

.grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Main Post Layout with Sidebar */
.main-layout {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 40px;
  margin-bottom: 60px;
}

@media (min-width: 1024px) {
  .main-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .content-area {
    flex: 1;
    min-width: 0;
  }

  .sidebar-area {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 5px;
  }
}

/* Custom Scrollbar for sidebars */
.sidebar-area::-webkit-scrollbar {
  width: 4px;
}
.sidebar-area::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   3. Header, Navigation & Mega Menu
   ========================================================================== */
.header-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-theme), border-color var(--transition-theme);
}

/* Disclaimer Bar */
.disclaimer-bar {
  background-color: #0f172a;
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 6px 0;
  text-align: center;
  border-bottom: 1px solid #1e293b;
  font-weight: 500;
}

.disclaimer-bar strong {
  color: var(--color-white);
}

/* Main Nav Header */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

/* Logo */
.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--color-primary);
}

.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-accent);
}

/* Desktop Menu */
.desktop-nav {
  display: none;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 70px;
  padding: 0 16px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
}

.nav-link:hover, .nav-item:hover .nav-link {
  color: var(--color-primary);
  text-decoration: none;
}

.nav-link svg {
  transition: transform 0.2s ease;
}

.nav-item:hover .nav-link svg {
  transform: rotate(180deg);
}

/* Mega Menu Dropdown */
.mega-menu {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.nav-item:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mega-menu-column h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.mega-menu-list {
  list-style: none;
  margin: 0;
}

.mega-menu-list li a {
  display: block;
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.mega-menu-list li a:hover {
  color: var(--color-accent);
  padding-left: 4px;
}

/* Header Utilities */
.header-utils {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

.btn-icon:focus {
  outline: 2px solid var(--color-primary);
}

/* Mobile Hamburger Menu */
.hamburger-btn {
  display: flex;
}

@media (min-width: 1024px) {
  .desktop-nav { display: block; }
  .hamburger-btn { display: none; }
}

/* Mobile Sidebar Menu */
.mobile-nav-panel {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100%;
  background-color: var(--bg-surface);
  box-shadow: var(--shadow-xl);
  z-index: 2000;
  padding: 24px;
  overflow-y: auto;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-nav-panel.open {
  left: 0;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.mobile-menu-list {
  list-style: none;
  margin: 0;
}

.mobile-menu-item {
  border-bottom: 1px solid var(--bg-secondary);
}

.mobile-menu-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 0;
  font-weight: 600;
  background: none;
  border: none;
  text-align: left;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
}

.mobile-submenu {
  list-style: none;
  margin-left: 12px;
  display: none;
  padding-bottom: 12px;
}

.mobile-submenu.open {
  display: block;
}

.mobile-submenu a {
  display: block;
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Backdrop */
.nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.nav-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* Reading Progress Bar */
.progress-container {
  width: 100%;
  height: 4px;
  background-color: var(--bg-secondary);
  position: absolute;
  bottom: -4px;
  left: 0;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--color-accent);
  transition: width 0.1s ease-out;
}

/* ==========================================================================
   4. Advanced Accessibility Toolbar
   ========================================================================== */
.a11y-toolbar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 0;
  font-size: 0.8rem;
  transition: var(--transition-theme);
}

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

.a11y-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.a11y-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.a11y-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.a11y-btn.active {
  background: var(--color-primary);
  color: var(--text-on-primary);
  border-color: var(--color-primary);
}

/* Reading Mode Style overrides */
body.reading-mode .sidebar-area,
body.reading-mode .header-wrapper,
body.reading-mode .disclaimer-bar,
body.reading-mode .a11y-toolbar,
body.reading-mode .breadcrumbs,
body.reading-mode .share-buttons,
body.reading-mode .related-section,
body.reading-mode .author-review-box,
body.reading-mode .comment-section,
body.reading-mode footer {
  display: none !important;
}

body.reading-mode .content-area {
  max-width: 700px;
  margin: 40px auto !important;
  font-size: 1.2rem;
  line-height: 1.8;
}

body.reading-mode .reading-mode-exit {
  display: block !important;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  background-color: var(--color-black);
  color: var(--color-white);
  padding: 12px 24px;
  border-radius: var(--radius-round);
  font-weight: bold;
  box-shadow: var(--shadow-lg);
  border: none;
  cursor: pointer;
}

/* ==========================================================================
   5. Search Overlay Component
   ========================================================================== */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.95);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

body.dark-mode .search-overlay {
  background-color: rgba(11, 15, 25, 0.97);
}

.search-overlay.open {
  opacity: 1;
  visibility: visible;
}

.search-container {
  width: 100%;
  max-width: 650px;
  padding: 20px;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  padding: 16px 50px 16px 20px;
  border-radius: var(--radius-md);
  font-size: 1.15rem;
  color: var(--text-primary);
  font-family: inherit;
  box-shadow: var(--shadow-md);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.search-icon-right {
  position: absolute;
  right: 16px;
  display: flex;
  gap: 8px;
}

.mic-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 4px;
}
.mic-btn.listening {
  color: var(--color-danger);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.close-search-btn {
  position: absolute;
  top: -50px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--color-white);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Autocomplete Results Box */
.search-results-panel {
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  margin-top: 12px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  display: none;
}

.search-results-panel.has-results {
  display: block;
}

.search-result-item {
  display: block;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.search-result-item:hover, .search-result-item:focus {
  background-color: var(--bg-surface-hover);
  text-decoration: none;
  outline: none;
}

.search-result-title {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.search-result-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.search-result-cat {
  display: inline-block;
  font-size: 0.7rem;
  background-color: var(--primary-light);
  color: var(--color-primary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  font-weight: 600;
}

.search-popular-tags {
  margin-top: 16px;
}

.search-popular-tags span {
  display: block;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  font-weight: 600;
}

.search-tags-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-tag {
  background-color: rgba(255,255,255,0.1);
  color: var(--color-white);
  padding: 6px 12px;
  border-radius: var(--radius-round);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background-color 0.2s;
}

.search-tag:hover {
  background-color: var(--color-primary);
}

/* ==========================================================================
   6. Breadcrumbs & Reading indicators
   ========================================================================== */
.breadcrumbs {
  padding: 16px 0;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.breadcrumbs-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
}

.breadcrumbs-item {
  display: flex;
  align-items: center;
}

.breadcrumbs-item::after {
  content: "/";
  margin: 0 8px;
  color: var(--text-tertiary);
}

.breadcrumbs-item:last-child::after {
  content: "";
}

.breadcrumbs-item a {
  color: var(--text-secondary);
}

.breadcrumbs-item a:hover {
  color: var(--color-primary);
}

.breadcrumbs-item.active {
  color: var(--text-primary);
  font-weight: 600;
  pointer-events: none;
}

/* ==========================================================================
   7. Typography & Article Elements
   ========================================================================== */
.article-header {
  margin-bottom: 24px;
}

.article-category {
  display: inline-block;
  background-color: var(--accent-light);
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.meta-author-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

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

/* Styled Alerts: Tips & Warnings */
.styled-notice {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.styled-notice svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.styled-notice-title {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 1rem;
}

.styled-notice-content {
  font-size: 0.95rem;
}

.styled-notice-content p:last-child {
  margin-bottom: 0;
}

.notice-tip {
  background-color: var(--accent-light);
  border-left: 4px solid var(--color-accent);
  color: hsl(var(--accent-h), var(--accent-s), 18%);
}
body.dark-mode .notice-tip {
  color: hsl(var(--accent-h), var(--accent-s), 85%);
}

.notice-tip .styled-notice-title {
  color: var(--color-accent);
}

.notice-warning {
  background-color: rgba(239, 68, 68, 0.08);
  border-left: 4px solid var(--color-danger);
  color: #7f1d1d;
}
body.dark-mode .notice-warning {
  color: #fca5a5;
}

.notice-warning .styled-notice-title {
  color: var(--color-danger);
}

/* Key Takeaways Card */
.key-takeaways {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}

.key-takeaways h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-primary);
  margin-top: 0;
  font-size: 1.2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.takeaway-list {
  list-style: none;
  margin: 0;
}

.takeaway-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.takeaway-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: bold;
}

/* Responsive Table Styles */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  background-color: var(--bg-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

th {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 700;
  padding: 14px 16px;
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: none;
}

tr:nth-child(even) {
  background-color: rgba(0,0,0,0.015);
}
body.dark-mode tr:nth-child(even) {
  background-color: rgba(255,255,255,0.015);
}

/* ==========================================================================
   8. Accordion FAQ Component
   ========================================================================== */
.faq-section {
  margin-top: 40px;
  margin-bottom: 40px;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item:hover {
  border-color: var(--border-hover);
}

.faq-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
  cursor: pointer;
}

.faq-icon {
  font-size: 1.25rem;
  transition: transform 0.25s ease;
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out, padding 0.25s ease;
  padding: 0 24px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  border-top: 1px solid transparent;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-item.active .faq-content {
  max-height: 500px;
  padding-bottom: 18px;
  border-top-color: var(--border-color);
}

/* ==========================================================================
   9. Floating Table of Contents & Sidebars
   ========================================================================== */
.toc-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.toc-card h3 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.toc-list {
  list-style: none;
  margin: 0;
}

.toc-list li {
  margin-bottom: 8px;
}

.toc-list li.depth-h3 {
  margin-left: 12px;
}

.toc-link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.toc-link.active {
  color: var(--color-primary);
  font-weight: 700;
  border-left: 2px solid var(--color-primary);
  padding-left: 8px;
}

/* Sidebar Widgets */
.sidebar-widget {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.sidebar-widget h3 {
  font-size: 1.05rem;
  margin-top: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.widget-links {
  list-style: none;
  margin: 0;
}

.widget-links li {
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.widget-links li a {
  color: var(--text-secondary);
  font-weight: 500;
}

.widget-links li a:hover {
  color: var(--color-primary);
}

/* Bookmark Icon Link */
.bookmark-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
}
.bookmark-btn.saved {
  color: var(--color-accent);
}

/* ==========================================================================
   10. Authors, EEAT Blocks & Comments
   ========================================================================== */
.author-review-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 40px;
  box-shadow: var(--shadow-sm);
}

.eeat-badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.eeat-badge {
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-round);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.eeat-badge.verified {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background-color: var(--accent-light);
}

.eeat-profiles {
  display: grid;
  gap: 20px;
}

@media (min-width: 640px) {
  .eeat-profiles {
    grid-template-columns: 1fr 1fr;
  }
}

.profile-card {
  display: flex;
  gap: 16px;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.profile-info h4 {
  font-size: 1rem;
  margin-bottom: 2px;
}

.profile-title {
  font-size: 0.75rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 6px;
}

.profile-bio {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Citations & Sources section */
.sources-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 30px;
}

.sources-card h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.sources-list {
  list-style: decimal;
  margin-left: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.sources-list li {
  margin-bottom: 6px;
}

/* Version History drop panel */
.version-history {
  margin-top: 16px;
  font-size: 0.8rem;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.version-toggle {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 4px;
}

.version-list {
  display: none;
  list-style: none;
  margin-top: 8px;
  padding-left: 8px;
}

.version-list.open {
  display: block;
}

.version-list li {
  border-left: 2px solid var(--border-color);
  padding-left: 10px;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

/* Simulated Moderated Discussion */
.comment-section {
  margin-top: 40px;
  border-top: 1px solid var(--border-color);
  padding-top: 30px;
}

.comment-list {
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.comment-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comment-author {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.comment-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.comment-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

.comment-form h4 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--text-on-primary);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  font-family: inherit;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

/* ==========================================================================
   11. Homepage Specific Components
   ========================================================================== */
.hero-section {
  background: linear-gradient(135deg, hsl(var(--primary-h), var(--primary-s), 15%) 0%, hsl(var(--primary-h), var(--primary-s), 30%) 100%);
  color: var(--color-white);
  padding: 60px 0 80px;
  text-align: center;
  position: relative;
}

.hero-section p {
  color: #cbd5e1;
}

.hero-title {
  color: var(--color-white);
  font-size: 2.75rem;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.15rem;
  max-width: 800px;
  margin: 0 auto 30px;
}

.hero-search-wrapper {
  max-width: 600px;
  margin: 0 auto 24px;
}

.hero-search-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  width: 100%;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  text-align: left;
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-popular {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.hero-popular a {
  color: var(--color-white);
  background-color: rgba(255,255,255,0.1);
  padding: 4px 10px;
  border-radius: var(--radius-round);
}

.hero-popular a:hover {
  background-color: var(--color-accent);
  text-decoration: none;
}

.section-title {
  font-size: 1.75rem;
  margin-top: 60px;
  margin-bottom: 24px;
  text-align: center;
}

/* Category grid cards */
.category-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.category-card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--color-primary);
}

.category-card h3 {
  font-size: 1.15rem;
  margin-top: 0;
  margin-bottom: 8px;
}

.category-card p {
  font-size: 0.85rem;
  margin-bottom: 0;
}

/* Emergency Banner */
.emergency-banner {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 768px) {
  .emergency-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.emergency-info h3 {
  color: var(--color-danger);
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 1.2rem;
}

.emergency-info p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.emergency-btn {
  background-color: var(--color-danger);
  color: var(--color-white);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: bold;
  font-size: 0.9rem;
  white-space: nowrap;
}

.emergency-btn:hover {
  text-decoration: none;
  background-color: #dc2626;
}

/* ==========================================================================
   12. Footer Component
   ========================================================================== */
footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 60px 0 30px;
  border-top: 1px solid #1e293b;
  font-size: 0.9rem;
}

footer h3 {
  color: var(--color-white);
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.footer-grid {
  display: grid;
  gap: 30px;
  margin-bottom: 40px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
  }
}

.footer-col p {
  color: #94a3b8;
  font-size: 0.85rem;
}

.footer-links {
  list-style: none;
  margin: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links li a {
  color: #94a3b8;
}

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

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
  }
}

.footer-copyright {
  font-size: 0.8rem;
  color: #64748b;
}

.footer-socials {
  display: flex;
  gap: 16px;
}

.footer-socials a {
  color: #94a3b8;
}

.footer-socials a:hover {
  color: var(--color-white);
}

/* ==========================================================================
   13. Utility Styles
   ========================================================================== */
.text-center { text-align: center; }
.margin-top { margin-top: 40px; }
.margin-bottom { margin-bottom: 40px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Floating Share Buttons */
.share-buttons {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}

@media (min-width: 1024px) {
  .share-buttons {
    flex-direction: column;
    position: fixed;
    left: 20px;
    top: 200px;
    z-index: 100;
  }
}

.share-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-size: 1.1rem;
  box-shadow: var(--shadow-md);
  border: none;
  cursor: pointer;
}

.share-fb { background-color: #1877f2; }
.share-tw { background-color: #1da1f2; }
.share-wa { background-color: #25d366; }
.share-cop { background-color: var(--text-secondary); }

/* Newsletter Form styling */
.newsletter-card {
  background: linear-gradient(135deg, hsl(var(--accent-h), var(--accent-s), 15%) 0%, hsl(var(--accent-h), var(--accent-s), 25%) 100%);
  color: var(--color-white);
  padding: 40px;
  border-radius: var(--radius-lg);
  margin-top: 60px;
  text-align: center;
}

.newsletter-card h3 {
  color: var(--color-white);
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.newsletter-card p {
  color: #cbd5e1;
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 auto 20px;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .newsletter-form {
    flex-direction: row;
  }
}

.newsletter-input {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.2);
  background-color: rgba(255,255,255,0.1);
  color: var(--color-white);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
}

.newsletter-input::placeholder {
  color: #94a3b8;
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--color-accent);
  background-color: rgba(255,255,255,0.15);
}

.newsletter-btn {
  background-color: var(--color-accent);
  color: var(--color-white);
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
  font-family: inherit;
}

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