/* ==========================================================================
   Tech Weeklys - Core Design Tokens & Global Styles
   Inspired by Tech Weeklys Lovable & Dubai Weeklys Editorial Magazine
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,600;0,700;0,800;0,900;1,700;1,800&family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400&display=swap');

:root {
  /* Color Palette - Light Theme */
  --bg-body: #ffffff;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-muted: #f1f5f9;
  --bg-card: #ffffff;
  --bg-alt-section: #f8fafc;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --border-color: #e2e8f0;
  --border-strong: #0f172a;
  --border-subtle: #edf2f7;

  /* Brand Accents - Tech Weeklys Signature Amber/Gold */
  --color-primary: #FF9F31;
  --color-primary-hover: #FFCA8E;
  --color-primary-light: #fef3c7;
  --color-primary-glow: rgba(255, 159, 49, 0.25);
  --color-accent-badge: #0f172a;

  /* Status & Accents */
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-info: #0284c7;

  /* Footer Colors */
  --footer-bg: #090d16;
  --footer-surface: #111827;
  --footer-text: #94a3b8;
  --footer-text-light: #e2e8f0;
  --footer-border: rgba(255, 255, 255, 0.12);

  /* Typography */
  --font-display: 'Barlow Condensed', sans-serif, system-ui;
  --font-sans: 'DM Sans', sans-serif, system-ui;
  --font-serif: 'Merriweather', Georgia, serif;

  /* Layout */
  --container-max-width: 1240px;
  --site-header-height: 80px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-body: #0a0e17;
  --bg-surface: #111726;
  --bg-subtle: #161e31;
  --bg-muted: #1c263c;
  --bg-card: #111726;
  --bg-alt-section: #0e1422;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --border-color: #232e44;
  --border-strong: #f8fafc;
  --border-subtle: #1c2538;

  --color-primary: #FF9F31;
  --color-primary-hover: #FFCA8E;
  --color-primary-light: #2c210d;
  --color-primary-glow: rgba(255, 159, 49, 0.3);
  --color-accent-badge: #FF9F31;

  --footer-bg: #06080e;
  --footer-surface: #0a0e17;
  --footer-border: rgba(255, 255, 255, 0.08);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

/* Page Containers */
.page-wrap {
  width: min(100% - 20px, var(--container-max-width));
  margin-inline: auto;
}

@media (min-width: 768px) {
  .page-wrap {
    width: min(100% - 48px, var(--container-max-width));
  }
}

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

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

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
}

/* Utility Badges */
.story-category {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  margin-bottom: 6px;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.story-category:hover {
  color: var(--color-primary-hover);
  transform: translateX(2px);
}

.story-category.badge-pill {
  background-color: var(--color-primary);
  color: #000000;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.story-category.badge-pill:hover {
  background-color: var(--color-primary-hover);
  color: #ffffff;
}

.story-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.story-time svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
}

/* Author initials mark (HG, MS, SC, DZ) */
.author-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #000000;
  font-size: 0.65rem;
  font-weight: 900;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

/* Advertisement banner styling */
.advertisement,
.advertisement-banner {
  display: none !important;
}

/* Section Heading (Dubai Weeklys & Tech Weeklys style) */
.section-heading {
  border-top: 4px solid var(--border-strong);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 20px;
  margin-bottom: 24px;
}

.section-heading h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-heading h2::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
}

.section-heading a.view-more {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.section-heading a.view-more:hover {
  color: var(--color-primary);
  transform: translateX(3px);
}

/* Toast Notification */
.toast-message {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: var(--bg-body);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  z-index: 999999;
  opacity: 0;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-message.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Scroll to top button */
.scroll-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
  transition: opacity var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
  z-index: 1000;
}

.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.scroll-top-btn:hover {
  background: var(--color-primary);
  color: #000;
  border-color: var(--color-primary);
}
