/**
 * Visual Fixes v3 — STI Newsroom Flow
 * - Mobile responsive header (logo left, hamburger right)
 * - 3-line hamburger icon visibility
 * - Dark mode: ALL widget/sidebar/archive/recent-post links → white
 * - Breaking ticker label vertical centering
 *
 * @since 1.0.4
 */

/* ============================================================
   HAMBURGER ICON — guarantee 3 visible lines (override .social-icon)
   ============================================================ */
.hamburger-menu-toggle.social-icon {
  /* The toggle is built on .social-icon (round, 34x34). Make sure the
     inner hamburger-icon stack is visible and centred, not collapsed
     by display:inline-flex on the parent. */
  width: 38px;
  height: 38px;
  padding: 0;
}

.hamburger-menu-toggle.social-icon .hamburger-icon {
  display: inline-flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: stretch !important;
  gap: 4px !important;
  width: 18px !important;
  height: 14px !important;
  padding: 0 !important;
  margin: 0 !important;
}

.hamburger-menu-toggle.social-icon .hamburger-icon > span {
  display: block !important;
  width: 100% !important;
  height: 2px !important;
  background-color: #ffffff !important;
  border-radius: 1px !important;
  transition: transform 0.25s ease, opacity 0.25s ease;
  flex: 0 0 2px !important;
}

/* Active (open) state — animated X */
.hamburger-menu-toggle.active .hamburger-icon > span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.hamburger-menu-toggle.active .hamburger-icon > span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu-toggle.active .hamburger-icon > span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ============================================================
   MOBILE HEADER LAYOUT
   On phones we collapse to: [LOGO]              [hamburger]
   Nav (.main-navigation) and social icons hide; the hamburger
   popup carries everything.
   ============================================================ */
@media (max-width: 1024px) {
  .header-content {
    flex-wrap: wrap;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 12px !important;
    gap: 8px !important;
  }
  .site-branding { flex: 0 0 auto !important; order: 1 !important; }
  .main-navigation { display: none !important; }
  .header-social   { flex: 0 0 auto !important; order: 2 !important; margin-left: auto !important; }
  .site-logo img,
  .custom-logo-link img { max-height: 46px !important; }

  /* Hide all social icons on small screens — keep only dark-mode + hamburger */
  .social-icons-header .social-icon:not(.dark-mode-toggle):not(.hamburger-menu-toggle) {
    display: none !important;
  }

  .header-main {
    padding: 6px 0 !important;
    background-color: var(--color-primary-black) !important;
  }
}

/* On very small phones tighten further */
@media (max-width: 480px) {
  .site-logo img,
  .custom-logo-link img { max-height: 38px !important; }
  .header-content { padding: 4px 8px !important; }
  .breaking-news-ticker .ticker-label {
    font-size: 11px !important;
    padding: 4px 8px !important;
  }
}

/* ============================================================
   DARK MODE — FORCE ALL SIDEBAR/WIDGET LINKS WHITE
   Fixes the red "Recent Posts", "Archives", "Read More" link
   colours seen in the user's screenshots.
   ============================================================ */
body.dark-mode .widget a,
body.dark-mode .widget li a,
body.dark-mode .widget_recent_entries a,
body.dark-mode .widget_archive a,
body.dark-mode .widget_categories a,
body.dark-mode .widget_pages a,
body.dark-mode .widget_meta a,
body.dark-mode .widget_nav_menu a,
body.dark-mode .widget_recent_comments a,
body.dark-mode aside.sidebar a,
body.dark-mode aside.sidebar .widget-title,
body.dark-mode aside.sidebar h1,
body.dark-mode aside.sidebar h2,
body.dark-mode aside.sidebar h3,
body.dark-mode .news-card-title a,
body.dark-mode .news-card-row .news-card-title a,
body.dark-mode .sti-tl-row-title,
body.dark-mode .sti-tl-hero-title,
body.dark-mode .related-posts .news-card-title a,
body.dark-mode .post-card-title,
body.dark-mode .post-card-title a,
body.dark-mode .related-news .news-card-title a {
  color: #ffffff !important;
}

body.dark-mode .widget a:hover,
body.dark-mode aside.sidebar a:hover,
body.dark-mode .news-card a:hover,
body.dark-mode .news-card-title a:hover {
  color: #FFFFFF !important;
}

/* Make "Read More" links inside widgets visible (often shown red by default) */
body.dark-mode .read-more,
body.dark-mode a.read-more,
body.dark-mode .more-link,
body.dark-mode a.more-link {
  color: #ffffff !important;
  background-color: var(--color-primary-red, #D60000);
  padding: 4px 10px;
  border-radius: 3px;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
}

/* Archive month items often print month/year in red — fix that */
body.dark-mode .widget_archive li,
body.dark-mode .widget_archive li a,
body.dark-mode .widget_recent_entries li,
body.dark-mode .widget_recent_entries li a,
body.dark-mode .widget_recent_comments li,
body.dark-mode .widget_categories li,
body.dark-mode .widget_categories li a {
  color: #ffffff !important;
}

/* ============================================================
   BREAKING TICKER LABEL — VERTICAL CENTER + READABILITY
   ============================================================ */
.breaking-news-ticker .ticker-label {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  color: var(--color-primary-red, #D60000);
  font-weight: 700;
  letter-spacing: 1.5px;
}

/* ============================================================
   SINGLE POST TEMPLATES (single-classic / single-magazine)
   Container styles for the two new template variants.
   ============================================================ */
.sti-single-layout {
  padding: 24px 0 60px;
}

.sti-single-grid {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 28px;
  align-items: start;
}

.sti-single-grid .sti-single-aside,
.sti-single-grid .sti-single-aside-right {
  position: sticky;
  top: 80px;
}

.sti-single-main {
  min-width: 0;
}

.sti-breadcrumbs {
  font-size: 0.85rem;
  margin-bottom: 14px;
  color: #888;
}
.sti-breadcrumbs a { color: #888; text-decoration: none; }
.sti-breadcrumbs a:hover { color: var(--color-primary-red, #D60000); }
.sti-breadcrumbs .sep { margin: 0 6px; opacity: 0.6; }

.sti-single-main .entry-title {
  font-size: 2rem;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 14px;
}

.sti-single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.85rem;
  color: #666;
  border-bottom: 1px solid var(--color-border, #E5E5E5);
  padding-bottom: 14px;
  margin-bottom: 22px;
}
.sti-single-meta .by-label { color: #999; letter-spacing: 0.6px; }
.sti-single-meta .author-name {
  color: var(--color-primary-red, #D60000);
  font-weight: 600;
  text-transform: uppercase;
}
.sti-single-meta .category-link {
  color: var(--color-primary-red, #D60000);
  font-weight: 600;
}

.sti-single-featured img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.sti-single-content {
  font-size: 1.02rem;
  line-height: 1.85;
  margin-top: 22px;
}
.sti-single-content p { margin-bottom: 1.1rem; }

.sti-single-share {
  display: flex;
  gap: 8px;
  margin: 22px 0;
  padding: 12px;
  background: #f7f7f7;
  border-radius: 4px;
}
body.dark-mode .sti-single-share { background: #1f1f1f !important; }

.sti-single-share .share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff !important;
  text-decoration: none;
  border-radius: 3px;
}
.sti-single-share .share-facebook { background: #1877F2; }
.sti-single-share .share-twitter  { background: #000; }
.sti-single-share .share-whatsapp { background: #25D366; }
.sti-single-share .share-telegram { background: #0088CC; }
.sti-single-share .share-copy     { background: #555; cursor: pointer; border: 0; }

@media (max-width: 1024px) {
  .sti-single-grid {
    grid-template-columns: 1fr 280px;
  }
  .sti-single-grid .sti-single-aside { display: none; }
}
@media (max-width: 768px) {
  .sti-single-grid {
    grid-template-columns: 1fr;
  }
  .sti-single-grid .sti-single-aside,
  .sti-single-grid .sti-single-aside-right {
    position: static;
  }
  .sti-single-main .entry-title { font-size: 1.5rem; }
}

/* ============================================================
   RELATED NEWS BLOCK (bottom of single)
   ============================================================ */
.sti-related-block {
  margin-top: 40px;
  border-top: 3px solid var(--color-primary-red, #D60000);
  padding-top: 24px;
}
.sti-related-block .section-title {
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 18px;
}

/* ============================================================
   SITEORIGIN BUILDER ZONE INSIDE SINGLE POST
   Posts that use SiteOrigin Page Builder are rendered cleanly.
   ============================================================ */
.sti-single-content .panel-grid { margin-bottom: 0 !important; }
