/*
Theme Name: Break The News
Theme URI: https://breakthenews.com
Author: Break The News Team
Author URI: https://breakthenews.com
Description: A premium, professional WordPress news theme for digital news portals, online newspapers, and media organizations. Packed with breaking news tickers, hero sliders, category blocks, mega menus, dark mode, RTL support, and monetization features.
Version: 1.1.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: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: break-the-news
Tags: news, blog, custom-menu, featured-images, custom-logo, full-width-template, sticky-post, translation-ready, rtl-language-support, dark, grid-layout, left-sidebar, right-sidebar, two-columns, three-columns, custom-colors, custom-header, custom-background, post-formats, editor-style, accessibility-ready
*/

/* ============================================================
   TABLE OF CONTENTS
   01. CSS Custom Properties (Design Tokens)
   02. CSS Reset & Base
   03. Typography
   04. Layout Grid
   05. Utility Classes
   06. Animations & Keyframes
   ============================================================ */

/* -----------------------------------------------------------
   01. CSS Custom Properties
   ----------------------------------------------------------- */
:root {
  /* Brand Colors */
  --btn-red:           #C0392B;
  --btn-red-dark:      #96281b;
  --btn-red-light:     #e74c3c;
  --btn-slate:         #2C3E50;
  --btn-slate-dark:    #1a252f;
  --btn-slate-light:   #34495e;

  /* Category Colors */
  --cat-politics:      #8e44ad;
  --cat-international: #2980b9;
  --cat-national:      #27ae60;
  --cat-kerala:        #d35400;
  --cat-business:      #16a085;
  --cat-technology:    #2c3e50;
  --cat-sports:        #e74c3c;
  --cat-entertainment: #8e44ad;
  --cat-health:        #27ae60;
  --cat-education:     #2980b9;
  --cat-lifestyle:     #f39c12;
  --cat-opinion:       #7f8c8d;
  --cat-editorial:     #c0392b;
  --cat-crime:         #e74c3c;
  --cat-local:         #16a085;

  /* UI Colors - Light Mode */
  --bg-primary:        #FFFFFF;
  --bg-secondary:      #F4F5F7;
  --bg-tertiary:       #EAECEF;
  --bg-card:           #FFFFFF;
  --bg-header:         #FFFFFF;
  --bg-top-bar:        #1a1a2e;
  --bg-nav:            #C0392B;
  --bg-footer:         #1a1a2e;

  /* Text Colors */
  --text-primary:      #1A1A2E;
  --text-secondary:    #4A5568;
  --text-muted:        #718096;
  --text-inverse:      #FFFFFF;
  --text-link:         #C0392B;
  --text-link-hover:   #96281b;

  /* Borders */
  --border-light:      #E2E8F0;
  --border-medium:     #CBD5E0;
  --border-dark:       #A0AEC0;

  /* Shadows */
  --shadow-sm:         0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:         0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg:         0 10px 30px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-card:       0 2px 12px rgba(0,0,0,0.07);

  /* Typography */
  --font-heading:      'Playfair Display', Georgia, serif;
  --font-body:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:         'JetBrains Mono', 'Courier New', monospace;
  --font-news:         'Merriweather', Georgia, serif;

  /* Font Sizes */
  --text-xs:           0.75rem;
  --text-sm:           0.875rem;
  --text-base:         1rem;
  --text-lg:           1.125rem;
  --text-xl:           1.25rem;
  --text-2xl:          1.5rem;
  --text-3xl:          1.875rem;
  --text-4xl:          2.25rem;
  --text-5xl:          3rem;

  /* Font Weights */
  --fw-light:          300;
  --fw-regular:        400;
  --fw-medium:         500;
  --fw-semibold:       600;
  --fw-bold:           700;
  --fw-extrabold:      800;
  --fw-black:          900;

  /* Spacing */
  --space-1:           0.25rem;
  --space-2:           0.5rem;
  --space-3:           0.75rem;
  --space-4:           1rem;
  --space-5:           1.25rem;
  --space-6:           1.5rem;
  --space-8:           2rem;
  --space-10:          2.5rem;
  --space-12:          3rem;
  --space-16:          4rem;
  --space-20:          5rem;

  /* Radius */
  --radius-sm:         4px;
  --radius-md:         6px;
  --radius-lg:         10px;
  --radius-xl:         16px;
  --radius-full:       9999px;

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-base:   0.25s ease;
  --transition-slow:   0.4s ease;

  /* Z-Index */
  --z-base:            1;
  --z-dropdown:        100;
  --z-sticky:          200;
  --z-overlay:         300;
  --z-modal:           400;
  --z-toast:           500;

  /* Layout */
  --container-max:     1320px;
  --sidebar-width:     300px;
  --header-height:     64px;
  --top-bar-height:    40px;
}

/* Dark Mode Tokens */
[data-theme="dark"],
.dark-mode {
  --bg-primary:        #0F1117;
  --bg-secondary:      #1A1D27;
  --bg-tertiary:       #232639;
  --bg-card:           #1A1D27;
  --bg-header:         #0F1117;
  --bg-top-bar:        #060810;
  --bg-nav:            #96281b;
  --bg-footer:         #060810;

  --text-primary:      #F0F4F8;
  --text-secondary:    #A8B2C1;
  --text-muted:        #6B7590;
  --text-link:         #e74c3c;
  --text-link-hover:   #ff6b6b;

  --border-light:      #252840;
  --border-medium:     #323555;
  --border-dark:       #4A4E6B;

  --shadow-sm:         0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:         0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:         0 10px 30px rgba(0,0,0,0.5);
  --shadow-card:       0 2px 12px rgba(0,0,0,0.35);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-base), color var(--transition-base);
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

ul, ol {
  list-style: none;
}

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

a:hover {
  color: var(--text-link-hover);
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* -----------------------------------------------------------
   03. Typography
   ----------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: 1.25;
  color: var(--text-primary);
}

h1 { font-size: clamp(1.75rem, 4vw, var(--text-5xl)); }
h2 { font-size: clamp(1.375rem, 3vw, var(--text-4xl)); }
h3 { font-size: clamp(1.125rem, 2.5vw, var(--text-3xl)); }
h4 { font-size: clamp(1rem, 2vw, var(--text-2xl)); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }

blockquote {
  border-left: 4px solid var(--btn-red);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-6) 0;
  background: var(--bg-tertiary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-tertiary);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
}

pre {
  background: var(--bg-tertiary);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

/* -----------------------------------------------------------
   04. Layout Grid
   ----------------------------------------------------------- */
.btn-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 640px)  { .btn-container { padding: 0 var(--space-6); } }
@media (min-width: 1024px) { .btn-container { padding: 0 var(--space-8); } }

.btn-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 1024px) {
  .btn-layout-sidebar-left {
    grid-template-columns: var(--sidebar-width) 1fr;
  }
  .btn-layout-sidebar-right {
    grid-template-columns: 1fr var(--sidebar-width);
  }
  .btn-layout-both-sidebars {
    grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
  }
}

.btn-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.btn-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.btn-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }

@media (max-width: 1023px) {
  .btn-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .btn-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 639px) {
  .btn-grid-4, .btn-grid-3, .btn-grid-2 { grid-template-columns: 1fr; }
}

/* -----------------------------------------------------------
   05. Utility Classes
   ----------------------------------------------------------- */
.btn-section { padding: var(--space-10) 0; }
.btn-section-sm { padding: var(--space-6) 0; }

.btn-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.btn-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.btn-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--btn-red);
}

.btn-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--border-light);
}

.btn-section-title .title-text {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--fw-extrabold);
  color: var(--text-primary);
}

.btn-section-title .title-bar {
  display: inline-block;
  width: 4px;
  height: 28px;
  background: var(--btn-red);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.btn-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.btn-meta span { display: flex; align-items: center; gap: var(--space-1); }

.btn-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  transition: all var(--transition-fast);
}
.btn-btn-primary {
  background: var(--btn-red);
  color: #fff;
}
.btn-btn-primary:hover {
  background: var(--btn-red-dark);
  color: #fff;
  transform: translateY(-1px);
}
.btn-btn-outline {
  border: 2px solid var(--btn-red);
  color: var(--btn-red);
}
.btn-btn-outline:hover {
  background: var(--btn-red);
  color: #fff;
}

.btn-img-wrap {
  position: relative;
  overflow: hidden;
}
.btn-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.btn-img-wrap:hover img { transform: scale(1.05); }

.btn-label-overlay {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 2;
}

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

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

/* -----------------------------------------------------------
   06. Animations & Keyframes
   ----------------------------------------------------------- */
@keyframes btn-ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes btn-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes btn-slide-in-right {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes btn-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes btn-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes btn-shimmer {
  0%   { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.btn-animate-in { animation: btn-fade-in 0.4s ease both; }

/* Skeleton Loader */
.btn-skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-secondary) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 1000px 100%;
  animation: btn-shimmer 2s infinite linear;
  border-radius: var(--radius-md);
}

/* Focus styles - WCAG */
:focus-visible {
  outline: 3px solid var(--btn-red);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Print */
@media print {
  .btn-top-bar,
  .btn-nav-wrap,
  .btn-sidebar,
  .btn-ads-area,
  .btn-breaking-ticker { display: none !important; }
}
