/*
 * OriginalBibles / CoverNews Modern Visual Refresh
 * Version 1.0.0 — design layer only, loaded AFTER the original theme.
 * No templates, content, navigation behaviours, or WordPress data are changed.
 * To reverse the redesign, remove the 'covernews-modern' enqueue in functions.php.
 */

:root {
  --ob-navy: #14233b;
  --ob-deep: #0d192c;
  --ob-accent: #1b66bc;
  --ob-accent-hover: #114d96;
  --ob-gold: #c49b58;
  --ob-ink: #17253b;
  --ob-muted: #62718a;
  --ob-canvas: #f5f7fb;
  --ob-surface: #fff;
  --ob-border: #e1e7f0;
  --ob-shadow: 0 12px 32px rgba(18, 37, 63, .065);
  --ob-radius: 14px;
  --ob-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --ob-reading: Georgia, "Noto Serif", "Times New Roman", serif;
}

/* Foundations */
html { scroll-behavior: smooth; }
body, body.default {
  background: var(--ob-canvas);
  color: var(--ob-ink);
  font-family: var(--ob-font);
  font-size: 16px;
  line-height: 1.65;
}
body, button, input, select, optgroup, textarea {
  font-family: var(--ob-font);
}
h1, h2, h3, h4, h5, h6,
.main-navigation a, .font-family-1, .site-description,
.trending-posts-line, .exclusive-posts, .widget-title,
.em-widget-subtitle, .entry-meta .item-metadata,
.grid-item-metadata .item-metadata, .nav-links a {
  font-family: var(--ob-font);
  letter-spacing: -.025em;
}
h1, h2, h3, h4, h5, h6 { color: var(--ob-ink); }
body a, body a:visited { transition: color .18s ease, background-color .18s ease, box-shadow .18s ease; }
body a:hover, body a:active { color: var(--ob-accent); }
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--ob-gold) !important;
  outline-offset: 3px;
}
img { max-width: 100%; }
::selection { background: #d2e5fc; color: var(--ob-deep); }
/* 3.5.1.5: Use the screen on EVERY page, not just Bible-reading posts.
   CoverNews previously capped the modern layout at 1260px on desktop.
   Retain slim outer gutters; let the Bootstrap containers' own padding
   protect content from touching the edges. */
body .site .container,
body .site .site-content {
  width: calc(100% - 24px) !important;
  max-width: none !important;
}
@media (max-width: 767px) {
  body .site .container,
  body .site .site-content {
    width: calc(100% - 12px) !important;
  }
}

/* Masthead / identity: spacious, calm, scholarly */
.top-masthead { background: var(--ob-deep); border-bottom: 1px solid rgba(255,255,255,.1); }
.top-masthead, .top-masthead a { font-size: 12px; letter-spacing: .025em; }
.topbar-date { opacity: .88; }
.masthead-banner { background-color: var(--ob-surface); padding: 30px 0; }
.masthead-banner.data-bg { background-position: center; }
.masthead-banner:not(.data-bg) .site-branding .site-title a,
.masthead-banner:not(.data-bg) .site-branding .site-title a:visited { color: var(--ob-navy); }
.masthead-banner .site-branding .site-title {
  font-size: clamp(30px, 3.5vw, 44px);
  font-weight: 780;
  line-height: 1.13;
  letter-spacing: -.055em;
}
.masthead-banner .site-branding .site-description {
  margin-top: 9px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .095em;
  color: var(--ob-muted);
  text-transform: uppercase;
}
.masthead-banner .site-branding img { max-height: 105px; width: auto; object-fit: contain; }
/* 3.5.1.7: explicit WordPress custom-logo sizing so image is not collapsed
   or unintentionally hidden by legacy masthead/mobile styles. */
.site-header .site-branding .custom-logo-link,
.site-header .af-mobile-site-title-wrap .custom-logo-link {
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
}
.site-header .site-branding img.custom-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 105px;
  object-fit: contain;
}
.site-header .af-mobile-site-title-wrap img.custom-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(220px, 100%);
  max-height: 48px;
  object-fit: contain;
}

.masthead-banner .banner-advertisement-wrapper img,
.masthead-banner .advertisement-section img { max-width: 100%; height: auto; }

/* Navigation: simplified dark surface, clearer spacing and active states */
.main-navigation { background: var(--ob-navy); border: 0; box-shadow: 0 6px 20px rgba(15,30,55,.1); }
.main-navigation .navigation-container { border: 0; }
.main-navigation .menu ul li a {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .005em;
}
.main-navigation .menu > ul > li > a { padding-left: 17px; padding-right: 17px; }
.main-navigation .menu ul li a:hover,
.main-navigation .menu ul li.current-menu-item > a,
.main-navigation .menu ul li.current_page_item > a { color: #fff; background: rgba(255,255,255,.12); }
.main-navigation .menu ul ul { border: 1px solid var(--ob-border); box-shadow: var(--ob-shadow); border-radius: 0 0 12px 12px; overflow: hidden; }
.main-navigation .menu ul ul li a { letter-spacing: 0; }
.main-navigation.aft-sticky-navigation { box-shadow: 0 14px 28px rgba(13, 25, 44, .14); }
.main-navigation .search-icon { transition: background .18s ease; }
.main-navigation .search-icon:hover { background: rgba(255,255,255,.12); }
.af-search-form {
  border: 1px solid var(--ob-border);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(13, 25, 44, .16);
  padding: 17px;
}

/* Breathing room in homepage magazine sections */
#content.container { padding-top: 22px; padding-bottom: 45px; }
.home #content.container { padding-top: 20px; }
.section-block-upper { margin-top: 22px; }
.af-main-banner { margin-top: 18px; margin-bottom: 28px; }
.af-main-banner .tabbed-story:not([class*="elementor-col-"]),
.af-main-banner .main-story-wrapper:not([class*="elementor-col-"]),
.af-main-banner .af-main-banner-editors-picks:not([class*="elementor-col-"]),
.af-main-banner .trending-story:not([class*="elementor-col-"]) {
  padding-left: 10px;
  padding-right: 10px;
}

/* Headings: remove tabloid-red rule and give sections hierarchy */
.widget-title, #primary .widget-title, .header-after1,
.related-title, h2.section-title, .header-title-wrapper .page-title {
  color: var(--ob-navy);
  font-weight: 760;
  letter-spacing: -.035em;
}
.widget-title span, span.header-after, .covernews-heading-style {
  margin-bottom: 13px;
}
.widget-title span::before, .covernews-heading-style::before,
.em-reated-posts .related-title::before,
.widget_block .wp-block-search__label::before,
.widget_block .wp-block-group__inner-container h1::before,
.widget_block .wp-block-group__inner-container h2::before,
.widget_block .wp-block-group__inner-container h3::before,
.widget_block .wp-block-group__inner-container h4::before,
.widget_block .wp-block-group__inner-container h5::before,
.widget_block .wp-block-group__inner-container h6::before,
span.header-after:after, span.border-after, .main-story-wrapper span.border-after {
  background: var(--ob-gold);
  height: 3px;
  border-radius: 3px;
}

/* Article cards, tiles, and editorial widgets */
.featured-posts-grid .spotlight-post,
.af-main-banner-editors-picks .spotlight-post,
.trending-story .spotlight-post,
.latest-posts-grid .entry-header-image-wrap,
.latest-posts-full .entry-header-image-wrap,
.em-latest-post-carousel .spotlight-post {
  background: var(--ob-surface);
  border: 1px solid var(--ob-border);
  border-radius: var(--ob-radius);
  box-shadow: var(--ob-shadow);
  overflow: hidden;
}
.featured-posts-grid .spotlight-post figcaption,
.af-main-banner-editors-picks .spotlight-post figcaption,
.trending-story .spotlight-post figcaption { padding: 11px 13px 12px; }
.featured-posts-grid .spotlight-post .featured-article,
.af-main-banner-editors-picks .spotlight-post .featured-article { margin-bottom: 0; }
.featured-posts-grid .spotlight-post img,
.af-main-banner-editors-picks .spotlight-post img,
.trending-story .spotlight-post img,
.latest-posts-grid .post-thumbnail img {
  transition: transform .3s ease;
}
.featured-posts-grid .spotlight-post:hover img,
.af-main-banner-editors-picks .spotlight-post:hover img,
.trending-story .spotlight-post:hover img,
.latest-posts-grid article:hover .post-thumbnail img { transform: scale(1.035); }
.article-title, .article-title a, .article-title a:visited {
  font-family: var(--ob-font);
  font-weight: 720;
  letter-spacing: -.022em;
}
.article-title { line-height: 1.37; }
.article-title a:hover, .entry-title a:hover { color: var(--ob-accent); }
.grid-item-metadata, .post-item-metadata, .entry-meta { color: var(--ob-muted); font-size: 12px; }
.figure-categories .cat-links a.covernews-categories {
  border-radius: 5px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .02em;
  padding: 4px 8px;
}
/* The hero slider has text over imagery; keep that contrast and positioning intact. */
.main-slider .slider-figcaption .article-title a,
.main-slider .slider-figcaption .slide-title a { color: #fff; }
.slider-figcaption { text-shadow: 0 2px 10px rgba(0,0,0,.35); }

/* News ticker softened; can be disabled in Customizer for a quieter homepage */
.exclusive-posts {
  background: var(--ob-surface);
  border: 1px solid var(--ob-border);
  border-radius: 12px;
  box-shadow: 0 3px 14px rgba(18, 37, 63, .035);
  overflow: hidden;
}
.exclusive-posts .exclusive-now { background: var(--ob-navy); }
.exclusive-posts .exclusive-slides a { font-size: 13px; font-weight: 600; }

/* Archive / post list cards */
.latest-posts-grid, .latest-posts-full { margin-bottom: 24px; }
.latest-posts-grid .entry-header-image-wrap,
.latest-posts-full .entry-header-image-wrap { padding-bottom: 12px; }
.latest-posts-grid .header-details-wrapper,
.latest-posts-full .header-details-wrapper { padding: 18px 20px 10px; }
.latest-posts-grid .entry-title,
.latest-posts-full .entry-title { line-height: 1.24; }
.archive .header-title-wrapper, .search-results .header-title-wrapper { padding: 12px 0 20px; }
.archive .page-title, .search-results .page-title { font-size: clamp(27px, 3vw, 38px); }

/* Reading page: very important for longer reference and original-language texts */
.single .af-single-article .entry-content-wrap,
.page #primary .entry-content-wrap {
  background: var(--ob-surface);
  border: 1px solid var(--ob-border);
  border-radius: 16px;
  box-shadow: var(--ob-shadow);
  padding: clamp(20px, 3.5vw, 45px);
}
.single .entry-header .entry-title {
  font-size: clamp(30px, 3.6vw, 48px);
  line-height: 1.17;
  font-weight: 780;
  letter-spacing: -.045em;
  margin: 12px 0 16px;
}
.single .entry-header .post-excerpt { color: var(--ob-muted); font-size: 18px; line-height: 1.65; }
.single .entry-content, .page .entry-content {
  font-family: var(--ob-reading);
  font-size: clamp(17px, 1.3vw, 19px);
  line-height: 1.83;
  color: var(--ob-ink);
  overflow-wrap: break-word;
}
.single .entry-content p, .page .entry-content p { margin-bottom: 1.15em; }
.single .entry-content h2, .page .entry-content h2 { font-size: clamp(23px, 2.4vw, 31px); margin-top: 1.5em; }
.single .entry-content h3, .page .entry-content h3 { font-size: 22px; margin-top: 1.4em; }
.entry-content a:not(.button):not(.wp-block-button__link) { color: var(--ob-accent); text-decoration: underline; text-underline-offset: .13em; }
.entry-content a:not(.button):not(.wp-block-button__link):hover { color: var(--ob-accent-hover); }
.entry-content blockquote {
  background: #f2f6fc;
  border-left: 4px solid var(--ob-gold);
  border-radius: 0 12px 12px 0;
  padding: 20px 24px;
  margin: 25px 0;
  font-size: 1.1em;
  text-align: left;
}
.entry-content blockquote:before, .entry-content blockquote:after { display: none; }
.entry-content figure img, .single .aft-post-thumbnail-wrapper img { border-radius: 12px; height: auto; }
/* Special reading assets must never overflow a mobile viewport. */
.entry-content embed, .entry-content object, .entry-content iframe,
#theText embed, #embeddedPDF, #theText iframe {
  max-width: 100% !important;
}
#theText { max-width: 100%; min-width: 0; }
#theText #embeddedPDF { height: min(78vh, 1000px); }
.entry-content pre { overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Intentionally do not reformat interlinear tables or rows. */

/* Sidebar, related material and form controls */
#secondary .widget,
#secondary .covernews-widget {
  background: var(--ob-surface);
  border: 1px solid var(--ob-border);
  border-radius: 14px;
  box-shadow: 0 7px 24px rgba(18, 37, 63, .045);
  padding: 20px;
  margin-bottom: 20px;
}
#secondary .widget-title { font-size: 20px; }
#secondary .widget li { border-color: var(--ob-border); }
input[type="search"], input[type="text"], input[type="email"],
input[type="url"], input[type="password"], textarea, select {
  background-color: var(--ob-surface);
  border: 1px solid #cdd7e4;
  border-radius: 9px;
  min-height: 42px;
  color: var(--ob-ink);
  padding: 10px 13px;
}
input[type="search"]:focus, input[type="text"]:focus,
input[type="email"]:focus, textarea:focus { border-color: var(--ob-accent); }
button, input[type="submit"], input[type="button"],
.wp-block-button__link, .wp-block-search__button {
  background: var(--ob-accent);
  color: #fff;
  border: 0;
  border-radius: 9px;
  font-family: var(--ob-font);
  font-weight: 700;
  letter-spacing: .005em;
  transition: background-color .18s ease, transform .18s ease;
}
button:hover, input[type="submit"]:hover, input[type="button"]:hover,
.wp-block-button__link:hover, .wp-block-search__button:hover {
  background: var(--ob-accent-hover);
  color: #fff;
}
.covernews-pagination .nav-links .page-numbers {
  border-radius: 9px;
  overflow: hidden;
}
#scroll-up { background: var(--ob-accent); color: #fff; width: 44px; height: 44px; line-height: 44px; border-radius: 50%; box-shadow: 0 9px 28px rgba(18,37,63,.18); }

/* Footer: a contemporary editorial sign-off */
.site-footer { background: var(--ob-deep); border-top: 3px solid var(--ob-gold); }
.primary-footer { padding-top: 48px; }
.site-footer h2, .site-footer .widget-title { color: #fff; }
.site-footer a, .site-footer a:visited { color: #dbe6f6; }
.site-footer a:hover { color: #fff; }
.site-footer .widget ul li { border-color: rgba(255,255,255,.13); }
.site-footer .secondary-footer { border-top: 1px solid rgba(255,255,255,.1); }
.site-footer .site-info { background: #091222; padding: 18px 0; color: #bdcce0; font-size: 13px; letter-spacing: .01em; }

/* Respect CoverNews' optional dark-mode body class. */
body.dark {
  --ob-ink: #e8effa;
  --ob-muted: #a5b7cf;
  --ob-canvas: #0c1523;
  --ob-surface: #172539;
  --ob-border: #2c405a;
  --ob-shadow: 0 12px 32px rgba(0,0,0,.2);
  background: var(--ob-canvas);
}
body.dark .masthead-banner:not(.data-bg) { background: var(--ob-surface); }
body.dark .masthead-banner:not(.data-bg) .site-branding .site-title a { color: #edf3ff; }
body.dark .entry-content blockquote { background: #20314b; }
body.dark input[type="search"], body.dark input[type="text"],
body.dark input[type="email"], body.dark textarea,
body.dark .af-search-form { background: var(--ob-surface); color: var(--ob-ink); }
body.dark .widget-title, body.dark #primary .widget-title,
body.dark .header-after1, body.dark .related-title { color: var(--ob-ink); }

/* Responsive adjustments; does not replace the theme's existing menu script */
@media (max-width: 991px) {
  .main-navigation .menu > ul > li > a { padding-left: 13px; padding-right: 13px; }
  .main-navigation .toggle-menu { width: 64px; }
  .main-navigation .menu .menu-mobile { background: var(--ob-navy); border-radius: 0 0 12px 12px; }
  .main-navigation .menu .menu-mobile li { border-color: rgba(255,255,255,.12); }
  .main-navigation .menu .menu-mobile li a { font-size: 15px; letter-spacing: 0; }
  #secondary .widget, #secondary .covernews-widget { padding: 17px; }
}
@media (max-width: 767px) {
  #content.container { padding-top: 16px; padding-bottom: 25px; }
  .masthead-banner { padding: 22px 0; }
  .masthead-banner .site-branding { text-align: center; padding-right: 0; }
  .masthead-banner .site-branding .site-title { font-size: 34px; }
  .masthead-banner .site-branding .site-description { font-size: 11px; }
  .af-main-banner { margin-top: 12px; }
  .af-main-banner .tabbed-story:not([class*="elementor-col-"]),
  .af-main-banner .main-story-wrapper:not([class*="elementor-col-"]),
  .af-main-banner .af-main-banner-editors-picks:not([class*="elementor-col-"]),
  .af-main-banner .trending-story:not([class*="elementor-col-"]) { padding-left: 10px; padding-right: 10px; }
  .featured-posts-grid .spotlight-post figcaption { padding: 10px 12px; }
  .single .af-single-article .entry-content-wrap,
  .page #primary .entry-content-wrap { border-radius: 12px; padding: 21px 16px; }
  .single .entry-content, .page .entry-content { font-size: 17px; line-height: 1.8; }
  .exclusive-posts .exclusive-now strong { font-size: 11px; }
  .af-search-form { right: 0; max-width: calc(100vw - 30px); }
  .site-footer .primary-footer { padding-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body *, body *::before, body *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* CoverNews retains a few hard-coded red accents; harmonise them with the palette. */
.figure-categories .cat-links a.covernews-categories:not([class*="category-color-"]),
.full-plus-list .spotlight-post:first-of-type .figure-categories .cat-links a.covernews-categories:not([class*="category-color-"]) {
  background: var(--ob-accent);
  color: #fff;
}
.trending-story .figure-categories .cat-links a.covernews-categories:not([class*="category-color-"]),
.tabbed-story .figure-categories .cat-links a.covernews-categories:not([class*="category-color-"]) {
  background: transparent;
  color: var(--ob-accent);
}
.secondary-color,
.site-content .search-form .search-submit,
.site-footer .search-form .search-submit { background: var(--ob-accent); color: #fff; }
/* Do not interfere with colour-coded categories set in the theme Customizer. */
