/**
 * Updated Custom CSS for STI Newsroom Flow Theme
 * Fixes for full-width layout, header, dark mode, and breaking news ticker
 * @package STI_Newsroom_Flow
 * @since 1.0.1
 */

/* ========================================
   FULL WIDTH LAYOUT
======================================== */
.site-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.container-full {
  width: 100%;
  max-width: 100%;
  padding: 0 2rem;
}

/* ========================================
   HEADER - NON-STICKY (SCROLLS AWAY)
======================================== */
.site-header {
  background-color: var(--color-primary-black);
  color: var(--color-white);
  box-shadow: var(--shadow-md);
  position: relative; /* Changed from sticky to relative */
  z-index: 1000;
}

/* Remove top bar completely */
.top-bar {
  display: none !important;
}

.header-main {
  padding: 0.75rem 0 !important;
  background-color: var(--color-primary-black);
  min-height: auto;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}

.site-branding {
  flex-shrink: 0;
}

.site-logo img,
.custom-logo-link img {
  max-height: 50px !important;
  width: auto;
  display: block;
}

.site-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
}

.site-title a {
  color: var(--color-white);
}

/* Hide old search and widgets */
.header-widgets,
.header-search,
.search-form-wrapper,
.weather-widget-header {
  display: none !important;
}

/* ========================================
   HEADER SOCIAL ICONS
======================================== */
.header-social {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.social-icons-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.social-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--color-white) !important;
  border-radius: 50%;
  font-size: 1.25rem;
  transition: all 0.3s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

.social-icon:hover {
  background-color: var(--color-primary-red);
  color: var(--color-white) !important;
  transform: scale(1.1);
}

.social-icon span {
  display: block;
  line-height: 1;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  position: relative;
  background-color: rgba(255, 255, 255, 0.1);
}

.dark-mode-toggle .icon-moon {
  display: none;
}

body.dark-mode .dark-mode-toggle .icon-sun {
  display: none;
}

body.dark-mode .dark-mode-toggle .icon-moon {
  display: block;
}

/* ========================================
   BREAKING NEWS TICKER - POSITION CONTROL
======================================== */
.breaking-news-ticker {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Default: Ticker after header */
.site-header {
  display: flex;
  flex-direction: column;
}

/* Ticker position: top (before header content) */
body.ticker-top .breaking-news-ticker {
  order: -1;
}

body.ticker-top .site-header {
  flex-direction: column;
}

body.ticker-top .header-main {
  order: 0;
}

body.ticker-top .main-navigation {
  order: 1;
}

/* Ticker position: bottom (after navigation) */
body.ticker-bottom .breaking-news-ticker {
  order: 999;
}

body.ticker-bottom .header-main {
  order: 0;
}

body.ticker-bottom .main-navigation {
  order: 1;
}

.ticker-wrapper {
  display: flex;
  align-items: center;
  padding: 0 2rem;
}

.ticker-label {
  background-color: var(--color-white);
  color: var(--color-primary-red);
  padding: 0.5rem 1rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: 1rem;
  flex-shrink: 0;
}

.ticker-content {
  flex: 1;
  overflow: hidden;
}

.ticker-list {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  animation: ticker-scroll 30s linear infinite;
}

.ticker-list li {
  white-space: nowrap;
  padding-right: 3rem;
}

.ticker-list li a {
  color: var(--color-white);
  text-decoration: none;
  font-weight: 500;
}

.ticker-list li a:hover {
  text-decoration: underline;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ========================================
   DARK MODE COLOR FIXES
======================================== */
body.dark-mode {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

body.dark-mode .site-content {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: #ffffff;
}

body.dark-mode p,
body.dark-mode .entry-content,
body.dark-mode .entry-meta {
  color: #e0e0e0;
}

body.dark-mode a {
  color: #ffffff;
}

body.dark-mode a:hover {
  color: #ff8888;
}

body.dark-mode .news-card {
  background-color: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #333;
}

body.dark-mode .news-card-title a {
  color: #ffffff;
}

body.dark-mode .news-card-meta {
  color: #999;
}

body.dark-mode .widget {
  background-color: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #333;
}

body.dark-mode .widget-title {
  color: #ffffff;
}

body.dark-mode .sidebar {
  background-color: #1a1a1a;
}

body.dark-mode .entry-title {
  color: #ffffff;
}

body.dark-mode .category-badge {
  color: #ffffff;
}

body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="search"],
body.dark-mode textarea {
  background-color: #2a2a2a;
  color: #e0e0e0;
  border-color: #444;
}

body.dark-mode .btn {
  background-color: #d60000;
  color: #ffffff;
}

body.dark-mode .page-header {
  background-color: #2a2a2a;
  color: #ffffff;
}

/* ========================================
   ODIA FONT STYLING
======================================== */
body.use-odia-font,
body.use-odia-font * {
  font-family: var(--font-odia) !important;
}

.odia-text {
  font-family: var(--font-odia);
  line-height: 1.8;
  letter-spacing: 0.02em;
}

/* ========================================
   NAVIGATION FULL WIDTH
======================================== */
.main-navigation {
  width: 100%;
}

.main-navigation .container {
  max-width: 100%;
  padding: 0 2rem;
}

/* ========================================
   CONTENT FULL WIDTH
======================================== */
.site-content .container {
  max-width: 1400px;
  margin: 0 auto;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
======================================== */
@media (max-width: 768px) {
  .container-full {
    padding: 0 1rem;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
  }
  
  .social-icons-header {
    justify-content: center;
  }
  
  .ticker-wrapper {
    padding: 0 1rem;
  }
  
  .ticker-label {
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
  }
  
  .main-navigation .container {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .social-icon {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
  
  .social-icons-header {
    gap: 0.5rem;
  }
  
  .site-logo img,
  .custom-logo-link img {
    max-height: 40px !important;
  }
}

/* ========================================
   UTILITY CLASSES
======================================== */
.d-flex {
  display: flex !important;
}

.justify-between {
  justify-content: space-between !important;
}

.align-center {
  align-items: center !important;
}

.text-white {
  color: var(--color-white) !important;
}
