/* ==========================================================================
   Design Tokens - Premium News Portal
   ========================================================================== */

:root {
  /* Color Palette - Premium News Theme */
  --color-primary: #1a1a2e;
  --color-primary-light: #16213e;
  --color-primary-dark: #0f0f1a;
  --color-accent: #e94560;
  --color-accent-hover: #d63652;
  --color-accent-light: #f28b9a;
  --color-gold: #d4a843;
  --color-gold-light: #e8c56d;
  --color-gold-dark: #b8922e;

  /* Neutral Scale */
  --color-bg: #fafafa;
  --color-bg-elevated: #ffffff;
  --color-bg-muted: #f5f5f5;
  --color-bg-subtle: #f8f8f8;
  --color-border: #e8e8e8;
  --color-border-strong: #d0d0d0;
  --color-border-muted: #f0f0f0;
  --color-text: #1a1a1a;
  --color-text-secondary: #555555;
  --color-text-muted: #888888;
  --color-text-light: #aaaaaa;
  --color-text-inverse: #ffffff;

  /* Typography Scale */
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Fluid Typography Scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
  --text-3xl: clamp(1.875rem, 1.6rem + 1.25vw, 2.25rem);
  --text-4xl: clamp(2.25rem, 1.9rem + 1.75vw, 3rem);
  --text-5xl: clamp(3rem, 2.5rem + 2.5vw, 4rem);

  /* Spacing Scale */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Shadow System */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
  --shadow-2xl: 0 24px 64px rgba(0, 0, 0, 0.2);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(233, 69, 96, 0.15);

  /* Border Radius */
  --radius-none: 0;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index Scale */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-toast: 700;
  --z-tooltip: 800;

  /* Layout */
  --container-max: 1280px;
  --container-padding: 1rem;
  --header-height: 72px;
  --header-height-mobile: 64px;
  --sidebar-width: 320px;

  /* Reading */
  --reading-line-height: 1.7;
  --reading-max-width: 720px;
  --reading-paragraph-spacing: 1.5em;
}

/* Dark Mode Tokens */
[data-theme="dark"],
.sg-dark {
  --color-bg: #0f0f1a;
  --color-bg-elevated: #1a1a2e;
  --color-bg-muted: #16213e;
  --color-bg-subtle: #12121e;
  --color-border: #2a2a3e;
  --color-border-strong: #3a3a4e;
  --color-border-muted: #222232;
  --color-text: #e8e8e8;
  --color-text-secondary: #b0b0b0;
  --color-text-muted: #808080;
  --color-text-light: #606060;
  --color-text-inverse: #1a1a1a;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(233, 69, 96, 0.25);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
    --transition-slow: 0ms;
    --transition-spring: 0ms;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --color-text: #000000;
    --color-border: #000000;
    --color-border-strong: #000000;
  }
}

/* Hero section spacing */
.sg-home-section .row {
  margin-left: -6px;
  margin-right: -6px;
}

.sg-home-section .row > [class*='col-'] {
  padding: 6px !important;
}

.sg-home-section .sg-post {
  margin-bottom: 0;
  height: 100%;
}
  :root {
    --color-bg: #ffffff;
    --color-text: #000000;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
  }
}

/* Latest posts spacing and modern look */
.latest-post-area .sg-post {
  margin-bottom: 4px !important;
  padding: var(--space-4) !important;
  border-radius: var(--radius-lg) !important;
  background: var(--color-bg-elevated) !important;
  box-shadow: var(--shadow-sm) !important;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.latest-post-area .sg-post:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.latest-post-area .sg-post:last-child {
  margin-bottom: 0;
}

/* Force spacing for latest post items */
.latest-post-area .sg-post.medium-post-style-1 {
  margin-bottom: 20px !important;
  padding: 16px !important;
}

/* Force flex gap for latest post area */
.latest-post-area {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

/* Lighten latest post boxes */
.latest-post-area .sg-post {
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
  border: 1px solid var(--color-border-muted) !important;
}

.latest-post-area .sg-post:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06) !important;
  transform: translateY(-1px) !important;
}

.latest-post-area .sg-post .entry-thumbnail img,
.latest-post-area .sg-post img {
  border-radius: var(--radius-md) !important;
}

/* Gentle hover - no jump, background color change */
.latest-post-area .sg-post:hover {
  transform: none !important;
  background: #d0d0d0 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}

/* Ensure rounded corners on hover for latest post images */
.latest-post-area .sg-post:hover .entry-thumbnail img,
.latest-post-area .sg-post:hover img {
  border-radius: var(--radius-md) !important;
}

/* Maintain rounded corners on hover for all images */
img:hover {
  border-radius: var(--radius-md) !important;
}

/* Prevent sharp corners on hover zoom - overflow hidden on container */
.latest-post-area .sg-post,
.latest-post-area .sg-post .entry-thumbnail {
  overflow: hidden !important;
  border-radius: var(--radius-lg) !important;
}

.latest-post-area .sg-post:hover .entry-thumbnail img {
  border-radius: var(--radius-md) !important;
}

.latest-post-area .sg-post .entry-thumbnail img {
  border-radius: var(--radius-md) !important;
  transition: transform var(--transition-slow);
}

/* Bolder and darker titles globally */
.entry-title,
.entry-title a,
.sg-post .entry-title,
.sg-post .entry-title a,
.article-card__title,
.article-card__title a,
.breaking-item__title,
.breaking-item__title a,
.mega-item__title {
  font-weight: 700 !important;
  color: #1a1a1a !important;
}

.entry-title a:hover,
.sg-post .entry-title a:hover,
.article-card__title a:hover,
.breaking-item__title a:hover {
  color: var(--color-accent) !important;
}

/* Override global img:hover border-radius for search result thumbnails */
.search-result-item img:hover,
.search-result-item .search-result-item__image:hover {
  border-radius: 12px !important;
}

/* Rounded corners for search result thumbnails */
.search-result-item .entry-thumbnail img,
.search-result-item img {
  border-radius: var(--radius-md) !important;
}

/* Maintain rounded corners on hover for search result thumbnails */
.search-result-item:hover .entry-thumbnail img,
.search-result-item:hover img,
.search-result-item .entry-thumbnail img:hover {
  border-radius: var(--radius-md) !important;
}

/* Fix rounded corners on hover for search result thumbnails */
.search-result-item .entry-thumbnail {
  overflow: hidden !important;
  border-radius: var(--radius-md) !important;
}

.search-result-item .entry-thumbnail img {
  border-radius: var(--radius-md) !important;
  transition: transform 0.3s ease;
}

.search-result-item:hover .entry-thumbnail img {
  transform: scale(1.05);
  border-radius: var(--radius-md) !important;
}

/* Modernize sidebar widgets */
.sg-sidebar .sg-widget {
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  margin-bottom: var(--space-6) !important;
  background: var(--color-bg-elevated);
}

.sg-sidebar .sg-widget .widget-title {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.sg-sidebar .sg-widget .sg-post {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sg-sidebar .sg-widget .sg-post .entry-thumbnail img {
  border-radius: var(--radius-md) !important;
  transition: transform 0.3s ease;
}

.sg-sidebar .sg-widget .sg-post:hover .entry-thumbnail img {
  transform: scale(1.05);
  border-radius: var(--radius-md) !important;
}

.sg-sidebar .sg-widget .sg-post .entry-thumbnail {
  overflow: hidden;
  border-radius: var(--radius-md);
}

/* Gap between sidebar widgets */
.sg-sidebar .sg-widget + .sg-widget {
  margin-top: var(--space-4);
}

/* Force larger gap between sidebar widgets */
.sg-sidebar .sg-widget {
  margin-bottom: 24px !important;
  padding: 0 !important;
}

.sg-sidebar .sg-widget + .sg-widget {
  margin-top: 24px !important;
}

/* Override global-list and sg-list margin for sidebar widgets */
.sg-sidebar .global-list {
  margin: 0 !important;
  padding: 0 !important;
}

/* Ensure sidebar widgets have visible gap */
.sg-sidebar .sg-widget {
  margin-bottom: 32px !important;
}



/* Rounded corners for post thumbnails (normal + hover) */
.sg-home-section .entry-thumbnail img,
.sg-home-section .entry-thumbnail {
  border-radius: var(--radius-md);
}
.sg-home-section .entry-thumbnail img:hover {
  border-radius: var(--radius-md);
}


/* Ensure thumbnail and content side by side in small-post items */
.sg-home-section .sg-post.small-post.post-style-1 {
  display: flex;
  flex-direction: row;
  align-items: center;
}
.sg-home-section .sg-post.small-post.post-style-1 .entry-content {
  flex: 1 1 auto;
  min-width: 0;
}

/* Constrain height of small-post items */
.sg-home-section .sg-post.small-post.post-style-1 {
  max-height: 80px;
  overflow: hidden;
}

/* Reduce main large item (carousel) height slightly */
.sg-home-section #home-carousel .entry-thumbnail img,
.sg-home-section .home-slider .sg-post.featured-post .entry-thumbnail img {
  max-height: 380px;
  object-fit: cover;
}
