/*
Theme Name: Astra Child - MyWorldPulse
Theme URI: https://myworldpulse.com
Template: astra
Version: 1.0.0
Description: MyWorldPulse custom news layout based on Astra
*/

:root {
  --mwp-red: #E63946;
  --mwp-ink: #111111;
  --mwp-bg: #F8F8F6;
  --mwp-border: #e7e5e4;
}

body {
  background: #F8F8F6 !important;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
}

/* ===== GLOBAL OVERFLOW / CENTERING ===== */
html, body { overflow-x: hidden !important; }
#page, .site { max-width: 100%; overflow-x: clip; }

/* Full-width containers for ticker / header */
.main-header-bar-wrap,
.mwp-ticker { max-width: 100% !important; }

/* The actual content containers - constrain to 1200 and center */
.site-content,
#primary,
#secondary,
.site-content .ast-container,
.entry-content .ast-container,
.ast-page-builder-template .site-content > .ast-container,
#content .ast-container {
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  box-sizing: border-box !important;
}

/* Generic ast-container (parent theme) */
.ast-container {
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
}

/* ===== HEADER ===== */
#masthead {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #fff !important;
  border-bottom: 1px solid #e7e5e4 !important;
}
.ast-site-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.custom-logo {
  max-height: 44px !important;
  width: auto !important;
}
.site-title {
  display: block !important;
  margin: 0 !important;
  line-height: 1;
}
.site-title a {
  font-weight: 900 !important;
  font-size: 22px !important;
  color: #1c1917 !important;
  text-decoration: none !important;
  letter-spacing: -.01em;
}
.site-title a:hover { color: #E63946 !important; }

/* Category nav injected into masthead */
.mwp-header-nav {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
}
.mwp-header-nav ul {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.mwp-header-nav a {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #1c1917;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.mwp-header-nav a:hover { color: #E63946; border-bottom-color: #E63946; }
@media (max-width: 920px) {
  .mwp-header-nav { display: none; }
}
@media (min-width: 921px) {
  .ast-mobile-menu-trigger-minimal,
  .ast-mobile-menu-trigger-fill,
  .ast-mobile-menu-trigger-outline,
  button.menu-toggle {
    display: none !important;
  }
}

/* ===== TRENDING TICKER (full-width with red box on left) ===== */
.mwp-ticker {
  background: #fff;
  border-bottom: 1px solid #e7e5e4;
  border-top: 1px solid #e7e5e4;
  overflow: hidden;
  height: 42px;
  display: flex;
  align-items: stretch;
  width: 100%;
  position: relative;
}
.mwp-ticker-label {
  flex-shrink: 0;
  background: #E63946;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 0 18px;
  height: 100%;
  display: flex;
  align-items: center;
  min-width: 110px;
  justify-content: center;
}
.mwp-ticker-viewport {
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}
.mwp-ticker-track {
  display: inline-flex;
  gap: 0;
  white-space: nowrap;
  animation: mwp-marquee 40s linear infinite;
}
.mwp-ticker-track:hover { animation-play-state: paused; }
.mwp-ticker-item {
  font-size: 14px;
  font-weight: 600;
  color: #1c1917;
  padding: 0 10px;
}
.mwp-ticker-item a { color: inherit; text-decoration: none; }
.mwp-ticker-item a:hover { color: #E63946; }
.mwp-ticker-dot { color: #E63946; font-weight: 900; }
@keyframes mwp-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===== HERO SLIDER ===== */
.mwp-slider { position: relative; overflow: hidden; border-radius: 16px; }
.mwp-slide { display: none; }
.mwp-slide.active {
  display: block;
  animation: mwpFade .45s ease;
}
@keyframes mwpFade { from { opacity: 0; } to { opacity: 1; } }
.mwp-slide a { text-decoration: none; display: block; }
.mwp-hero-thumb {
  border-radius: 16px;
  overflow: hidden;
  background: #f0efec;
  width: 100%;
  position: relative;
  aspect-ratio: 16 / 9;
}
.mwp-hero-thumb img {
  width: 100% !important; height: 100% !important; object-fit: cover !important; display: block;
  object-position: center 15% !important;
  transition: opacity .3s;
  max-width: none;
}
.mwp-slide h2.mwp-hero-title {
  font-size: 22px; font-weight: 900; letter-spacing: -.01em; line-height: 1.25;
  color: #1c1917; margin: 14px 0 0;
}
@media (min-width: 640px) { .mwp-slide h2.mwp-hero-title { font-size: 30px; } }
.mwp-slide a:hover h2.mwp-hero-title { color: #57534e; }
.mwp-hero-excerpt {
  color: #78716c; font-size: 15px; line-height: 1.6; margin: 8px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mwp-badge {
  display: inline-block;
  font-size: 11px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: #E63946;
  margin-top: 14px;
}
.mwp-date { font-size: 12px; color: #a8a29e; margin-top: 8px; }
.mwp-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(20, 20, 20, .32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  color: #fff;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .25s ease, border-color .25s ease;
}
.mwp-arrow svg { display: block; }
.mwp-arrow:hover { background: #E63946; border-color: #E63946; color: #fff; }
.mwp-prev { left: 16px; }
.mwp-next { right: 16px; }
@media (max-width: 639px) {
  .mwp-arrow { width: 34px; height: 34px; }
  .mwp-arrow svg { width: 14px; height: 14px; }
  .mwp-prev { left: 10px; }
  .mwp-next { right: 10px; }
}

/* ===== LAYOUT WRAP ===== */
.mwp-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.mwp-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: 36px;
}
@media (min-width: 1024px) {
  .mwp-hero-grid { grid-template-columns: 300px minmax(0, 1fr); }
}

/* ===== SECTION TITLES ===== */
.mwp-section-title {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #1c1917;
  border-left: 4px solid #E63946;
  padding-left: 10px;
  margin: 40px 0 20px;
  line-height: 1.2;
}

/* ===== TRENDING SIDEBAR ===== */
.mwp-trending-box {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e7e5e4;
  padding: 20px;
}
.mwp-trend-head {
  font-size: 13px; font-weight: 900; letter-spacing: .14em;
  text-transform: uppercase; color: #1c1917; margin: 0 0 6px;
}
.mwp-trend-item {
  display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid #f0efec;
}
.mwp-trend-item:last-child { border-bottom: none; padding-bottom: 4px; }
.mwp-trend-num { font-weight: 900; font-size: 22px; color: #d6d3d1; line-height: 1; min-width: 30px; }
.mwp-trend-item a {
  font-size: 14px; font-weight: 600; color: #1c1917; line-height: 1.4; text-decoration: none;
}
.mwp-trend-item a:hover { color: #E63946; }

/* ===== CARDS GRID ===== */
.mwp-cards {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .mwp-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .mwp-cards { grid-template-columns: repeat(3, 1fr); } }

.mwp-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e7e5e4;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  transition: box-shadow .3s;
}
.mwp-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.10); }
.mwp-card > a { display: block; text-decoration: none; }
.mwp-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #f0efec;
}
.mwp-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  object-position: center 15%;
  transition: opacity .3s;
}
.mwp-card:hover .mwp-thumb img { opacity: .95; }
.mwp-body { padding: 16px; }
.mwp-card h3 {
  font-size: 16px; font-weight: 800; color: #1c1917; line-height: 1.35;
  margin: 4px 0 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mwp-card a:hover h3 { color: #57534e; }
.mwp-excerpt {
  color: #78716c; font-size: 14px; line-height: 1.55; margin: 8px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

@media (max-width: 639px) {
  .mwp-card > a { display: flex; gap: 12px; padding: 12px; align-items: flex-start; }
  .mwp-card .mwp-thumb {
    width: 110px; height: 80px; aspect-ratio: auto;
    border-radius: 8px; flex-shrink: 0;
  }
  .mwp-card .mwp-body { padding: 0; }
  .mwp-card h3 { font-size: 15px; -webkit-line-clamp: 3; }
  .mwp-excerpt { display: none; }
  .mwp-date { margin-top: 4px; }
}

/* ===== NEWSLETTER ===== */
.mwp-newsletter {
  background: #111111;
  color: #fff;
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  margin: 48px 0;
}
.mwp-newsletter h2 { font-size: 26px; font-weight: 900; margin: 0 0 10px; color: #fff; }
.mwp-newsletter p { color: #a8a29e; font-size: 15px; margin: 0 0 22px; }
.mwp-newsletter .mwp-btn {
  display: inline-block;
  background: #E63946;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 26px;
  border-radius: 999px;
  text-decoration: none;
  transition: opacity .2s;
}
.mwp-newsletter .mwp-btn:hover { opacity: .88; color: #fff; }

/* ===== ASTRA NATIVE HEADER MENU (news style) ===== */
#primary-site-navigation-desktop .main-header-menu {
  gap: 26px;
}
#primary-site-navigation-desktop .main-header-menu > .menu-item > .menu-link {
  font-size: 13px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: .1em !important;
  color: #1c1917 !important;
  padding: 8px 0 !important;
  background: transparent !important;
}
#primary-site-navigation-desktop .main-header-menu > .menu-item > .menu-link:hover,
#primary-site-navigation-desktop .main-header-menu > .menu-item.current-menu-item > .menu-link {
  color: #E63946 !important;
}

/* ===== SINGLE POST FEATURED IMAGE ===== */
.post-thumb-img-content { margin: 0 0 8px !important; }
.post-thumb-img-content img {
  width: 100% !important; height: auto !important; border-radius: 12px !important;
  object-fit: cover !important; object-position: center 15% !important;
}
/* Prevent distorted inline images inside article body */
.entry-content img { max-width: 100%; height: auto !important; }

/* ===== DARK FOOTER ===== */
#colophon {
  background: #111111 !important;
  color: #a8a29e !important;
  margin-top: 48px;
}
#colophon, #colophon * { color: #a8a29e !important; border-color: #2a2a2a !important; }
#colophon a { color: #d6d3d1 !important; text-decoration: none; }
#colophon a:hover { color: #fff !important; }
#colophon .ast-footer-widget-area .widget-title { color: #fff !important; font-weight: 800; }

/* ===== CUSTOM 3-COLUMN FOOTER ===== */
.mwp-footer {
  background: #111111;
  color: #a8a29e;
  padding: 48px 0 0;
  margin-top: 48px;
}
.mwp-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.mwp-footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #2a2a2a;
}
.mwp-footer-col h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 16px;
}
.mwp-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mwp-footer-col li {
  margin-bottom: 10px;
}
.mwp-footer-col a {
  color: #d6d3d1;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.mwp-footer-col a:hover {
  color: #E63946;
}
.mwp-footer-bottom {
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  color: #78716c;
}
.mwp-footer-bottom p {
  margin: 0;
}
@media (max-width: 768px) {
  .mwp-footer-cols {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ===== LEGACY ANDROID / OLD BROWSER COMPATIBILITY ===== */

/* 1. Literal color fallbacks (browsers without CSS custom properties, Chrome < 49) */
#masthead { border-bottom: 1px solid #e7e5e4 !important; }
.site-title a:hover { color: #E63946 !important; }
.mwp-header-nav a:hover { color: #E63946; border-bottom-color: #E63946; }
.mwp-ticker-label { background: #E63946; }
.mwp-ticker-dot { color: #E63946; }
.mwp-badge { color: #E63946; }
.mwp-section-title { border-left: 4px solid #E63946; }
.mwp-trend-item a:hover { color: #E63946; }
.mwp-arrow:hover { background: #E63946; border-color: #E63946; color: #fff; }
.mwp-newsletter { background: #111111; }
#primary-site-navigation-desktop .main-header-menu > .menu-item > .menu-link:hover,
#primary-site-navigation-desktop .main-header-menu > .menu-item.current-menu-item > .menu-link { color: #E63946 !important; }
#colophon { background: #111111 !important; }
.mwp-footer { background: #111111 !important; }
.mwp-footer-col a:hover { color: #E63946 !important; }

/* 2. No CSS Grid (Chrome < 57): stack sections with spacing */
@supports not (display: grid) {
  .mwp-hero-grid { display: block; }
  .mwp-trending-box { margin-top: 32px; }
  .mwp-cards .mwp-card { margin-bottom: 20px; }
  .mwp-footer-cols { display: block !important; }
  .mwp-footer-col { margin-bottom: 32px !important; }
}

/* 3. Grid without row-gap (Chrome 57-83): margins instead of row gap */
@supports (display: grid) and (not (inset: auto)) {
  .mwp-cards .mwp-card { margin-bottom: 20px; }
  .mwp-hero-grid { grid-row-gap: 32px; }
  .mwp-footer-cols { grid-row-gap: 40px; }
}

/* 4. No flex gap (Chrome < 84): use margins instead */
@supports not (inset: auto) {
  .ast-site-identity .custom-logo { margin-right: 12px; }
  .mwp-trend-num { margin-right: 14px; }
  .mwp-logo-icon { margin-right: 12px; }
  .mwp-nav-link { margin-right: 24px; }
  .mwp-search-btn { margin-right: 16px; }
}
@media (max-width: 900px) {
  @supports not (inset: auto) {
    .mwp-nav-link { margin-right: 12px; }
  }
}
@media (max-width: 639px) {
  @supports not (inset: auto) {
    .mwp-card > a .mwp-thumb { margin-right: 12px; }
  }
}

/* 5. No aspect-ratio (Chrome < 88): fixed heights for image crops */
@supports not (aspect-ratio: 16 / 9) {
  .mwp-hero-thumb { height: 210px !important; }
  .mwp-thumb { height: 170px !important; }
  @media (min-width: 640px) {
    .mwp-hero-thumb { height: 330px !important; }
  }
}
@media (max-width: 639px) {
  @supports not (aspect-ratio: 16 / 9) {
    .mwp-card .mwp-thumb { height: 80px !important; }
  }
}

/* 6. No object-fit (very old, Chrome < 32): show images at natural ratio */
@supports not (object-fit: cover) {
  .mwp-hero-thumb, .mwp-thumb { height: auto !important; }
  .mwp-hero-thumb img, .mwp-thumb img { height: auto !important; }
}
