/*
Theme Name: ReviewNews Child
Theme URI: http://localhost/elbiladinfo/
Description: Child theme refinements for البلاد أنفو on ReviewNews.
Author: البلاد أنفو
Template: reviewnews
Version: 1.0.0
Text Domain: reviewnews-child
*/

/* Legacy shared editorial and archive rules retained pending component ownership. */

/* Editorial typography */
.read-title h3,
.entry-title,
.page-title,
.widget-title,
.header-after1,
.reviewnews-widget .wp-block-heading {
  color: var(--elbi-charcoal);
  letter-spacing: 0;
}

.read-title h3 {
  line-height: 1.45;
  font-weight: 700;
}

.read-title h3 a {
  overflow-wrap: anywhere;
}

.read-details .entry-meta,
.read-single .entry-meta,
.item-metadata,
.min-read {
  color: var(--elbi-muted);
  font-size: 12px;
  line-height: 1.7;
}

/* Cards and news grids */
.read-single {
  transition: color 0.15s ease, background-color 0.15s ease;
}

.read-img img {
  display: block;
  border-radius: var(--elbi-radius);
  object-fit: cover;
}

.read-img,
body:not(.single) .grid-design-default .read-single,
body:not(.single) .archive-layout-grid article,
.af-main-banner-latest-posts .read-single {
  border-radius: var(--elbi-radius);
}

body:not(.single) .grid-design-default .read-img.read-bg-img,
body:not(.single) .archive-layout-grid .read-img.read-bg-img,
body:not(.single) .af-main-banner-latest-posts .read-img.read-bg-img {
  height: auto;
  aspect-ratio: 16 / 9;
  min-height: 0;
}

.grid-design-default .pad.read-details {
  padding-top: 12px;
}

.archive-layout-grid article,
.af-main-banner-latest-posts .read-single {
  margin-bottom: 22px;
}

body:not(.single) .archive-layout-grid article,
.af-main-banner-latest-posts .read-single {
  overflow: hidden;
  border: 1px solid var(--elbi-border);
  background: var(--elbi-white);
  box-shadow: var(--elbi-shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

body:not(.single) .archive-layout-grid article:hover,
.af-main-banner-latest-posts .read-single:hover {
  border-color: #cdd4df;
  box-shadow: 0 5px 14px rgba(16, 24, 40, 0.09);
  transform: translateY(-2px);
}

body:not(.single) .archive-layout-grid .pad.read-details,
.af-main-banner-latest-posts .pad.read-details {
  padding: 14px;
}

.cat-links {
  margin-top: 4px;
}

.cat-links li a,
.categories-inside-image a.reviewnews-categories {
  border-radius: var(--elbi-radius-sm);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

a.reviewnews-categories.category-color-1,
a.reviewnews-categories.category-color-2,
a.reviewnews-categories.category-color-3,
a.reviewnews-categories.category-color-4,
a.reviewnews-categories.category-color-5,
a.reviewnews-categories.category-color-6,
a.reviewnews-categories.category-color-7 {
  color: var(--elbi-red);
}

.categories-inside-image a.reviewnews-categories.category-color-1,
.categories-inside-image a.reviewnews-categories.category-color-2,
.categories-inside-image a.reviewnews-categories.category-color-3,
.categories-inside-image a.reviewnews-categories.category-color-4,
.categories-inside-image a.reviewnews-categories.category-color-5,
.categories-inside-image a.reviewnews-categories.category-color-6,
.categories-inside-image a.reviewnews-categories.category-color-7 {
  background-color: var(--elbi-red);
  color: var(--elbi-white);
}

/* Keep legacy ReviewNews accent surfaces aligned with the child-theme brand color. */
.main-navigation .menu-description,
.reviewnews-header .top-header,
.reviewnews-header div.custom-menu-link > a,
#reading-progress-bar,
.site-info,
footer.site-footer .read-img.read-bg-img,
.read-img .trending-no,
.trending-posts-vertical .trending-no,
.exclusive-posts .exclusive-now,
#scroll-up.secondary-color,
:is(.aft-small-social-menu, .social-widget-menu.af-widget-body)
  ul
  li
  a[href*="youtube.com"] {
  background-color: var(--elbi-red);
}

.main-navigation .menu-description::after {
  border-top-color: var(--elbi-red);
}

.widget-title-border-bottom .reviewnews-widget .wp-block-search__label::before,
.widget-title-border-bottom .reviewnews-widget .wp-block-group .wp-block-heading::before,
.widget-title-fill-and-border .reviewnews-widget .wp-block-search__label::before,
.widget-title-fill-and-border .reviewnews-widget .wp-block-group .wp-block-heading::after {
  background-color: var(--elbi-red);
}

.reviewnews-widget .wp-block-search__label,
input.search-submit {
  border-color: var(--elbi-red);
}

[class*="widget-title-fill-"] .reviewnews-widget .wp-block-search__label {
  background-color: var(--elbi-red);
}

@supports (-webkit-line-clamp: 2) {
  body:not(.single) .grid-design-default .read-title h3 a,
  body:not(.single) .archive-layout-grid .read-title h3 a,
  body:not(.single) .af-main-banner-latest-posts .read-title h3 a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .grid-design-texts-over-image .read-title h3 a,
  .af-banner-carousel .read-title h3 a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }
}

/* Cross-page metadata and archive visibility rules. */

/* Keep card dates visible while suppressing secondary card-only clutter. */
body:not(.single) .read-details .entry-meta .posts-author.byline,
body:not(.single) .read-details .entry-meta .min-read,
body:not(.single) .read-details .entry-meta .aft-comment-view-share,
body:not(.single) .read-img .min-read,
body:not(.single) .read-img .aft-comment-view-share,
body:not(.single) .aft-comment-count {
  display: none;
}

.reviewnews-author-bio,
.af-author-info,
.wp_post_author_widget {
  display: none;
}

body.rtl:not(.single) .grid-design-default.has-post-image > .pad.read-details,
body.rtl:not(.single) .archive-layout-grid .has-post-image > .pad.read-details {
  padding-right: 5px;
  padding-left: 5px;
}

/* Sidebar */
#secondary .widget-area {
  padding-top: 0;
}

#secondary .reviewnews-widget {
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--elbi-border);
  border-radius: var(--elbi-radius);
  background: var(--elbi-white);
  box-shadow: none;
}

#secondary .wp-block-latest-posts__list li {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  line-height: 1.55;
}

#secondary .wp-block-latest-posts__list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

/* Legacy responsive rules for articles, archives, and sidebars. */

@media screen and (max-width: 990px) {
  .container-wrapper #primary,
  .container-wrapper #secondary {
    width: 100%;
    padding-right: 0;
    padding-left: 0;
  }

}

@media screen and (max-width: 768px) {
  .read-title h3 {
    line-height: 1.5;
  }

  #secondary .reviewnews-widget {
    padding: 16px;
  }
}

@media screen and (max-width: 480px) {
  .entry-summary,
  .entry-content,
  .entry-header .post-excerpt {
    font-size: 16px;
  }
}
