/*
 * Tamiyouz Blog V43 — Full-width centered archive and category results
 * Scoped to public archives and search. No DOM changes, JS, fonts or new images.
 * The theme reserved 1/3 for a sidebar; place the intact sidebar after the grid.
 * Override legacy Codevz float/masonry dimensions for a stable flex card layout.
 */
body:is(.archive,.category,.search) #page_content {
  min-width:0;
}
body:is(.archive,.category,.search) #page_content > .row {
  display:flex!important;
  flex-direction:column!important;
  flex-wrap:nowrap!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  box-sizing:border-box!important;
  width:min(1380px,calc(100% - 48px))!important;
  max-width:100%!important;
  min-width:0!important;
  margin:0 auto!important;
  padding:0!important;
  gap:clamp(24px,3vw,42px)!important;
}
body:is(.archive,.category,.search) #page_content > .row > .col.s8 {
  order:1!important;
  float:none!important;
  clear:both!important;
  display:block!important;
  flex:0 0 auto!important;
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin:0 auto!important;
  padding:0!important;
}
body:is(.archive,.category,.search) #page_content > .row > .col.s8 > .content {
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin:0 auto!important;
  padding:0!important;
}
/* Keep the archive introduction legible and centered with the cards. */
body:is(.archive,.category,.search) #page_content > .row .xtra-archive-desc {
  max-width:1000px!important;
  margin:0 auto clamp(22px,2.7vw,36px)!important;
  padding:0 12px!important;
  text-align:center!important;
  box-sizing:border-box!important;
  color:#e1eaf1!important;
}
body:is(.archive,.category,.search) #page_content > .row .xtra-archive-desc p {
  color:#e1eaf1!important;
  text-align:center!important;
  font:500 clamp(14px,1.2vw,17px)/1.9 Almarai,system-ui,sans-serif!important;
}
body:is(.archive,.category,.search) #page_content > .row .elementor[data-elementor-type="section"],
body:is(.archive,.category,.search) #page_content > .row .elementor-widget-cz_posts,
body:is(.archive,.category,.search) #page_content > .row .elementor-widget-cz_posts > .elementor-widget-container,
body:is(.archive,.category,.search) #page_content > .row .elementor-widget-cz_posts .e-con,
body:is(.archive,.category,.search) #page_content > .row .elementor-widget-cz_posts .e-con-inner {
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}
body:is(.archive,.category,.search) #page_content > .row .elementor[data-elementor-type="section"] > .e-con,
body:is(.archive,.category,.search) #page_content > .row .elementor[data-elementor-type="section"] > .e-con > .e-con-inner {
  width:100%!important;
  max-width:100%!important;
}
body:is(.archive,.category,.search) #page_content > .row .tyz-v19-archive-wrap {
  width:100%!important;
  max-width:1320px!important;
  box-sizing:border-box!important;
  margin:clamp(25px,3.3vw,43px) auto clamp(29px,3.5vw,46px)!important;
  padding:0!important;
}
/* The Codevz widget uses an empty first grid placeholder; it must not
   consume a flex slot or leave a blank position in the layout. */
body:is(.archive,.category,.search) #page_content > .row .cz_grid_p {
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin:0 auto!important;
}
body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts {
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:wrap!important;
  align-items:stretch!important;
  justify-content:center!important;
  gap:clamp(16px,2.0vw,27px)!important;
  direction:rtl;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:auto!important;
  min-height:0!important;
  margin:0 auto!important;
  padding:0!important;
  position:relative!important;
  box-sizing:border-box!important;
}
body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts::before,
body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts::after {
  content:none!important;
  display:none!important;
}
body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts > .cz_grid_first {
  display:none!important;
}
body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts > .cz_grid_item:not(.cz_grid_first) {
  display:block!important;
  float:none!important;
  clear:none!important;
  position:relative!important;
  inset:auto!important;
  top:auto!important;
  left:auto!important;
  right:auto!important;
  bottom:auto!important;
  transform:none!important;
  flex:0 0 calc((100% - 2 * clamp(16px,2.0vw,27px))/3)!important;
  width:calc((100% - 2 * clamp(16px,2.0vw,27px))/3)!important;
  max-width:100%!important;
  min-width:0!important;
  height:auto!important;
  margin:0!important;
  padding:0!important;
  box-sizing:border-box!important;
  visibility:visible!important;
}
body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts > .cz_grid_item:not(.cz_grid_first) > .clr {
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  height:100%!important;
  margin:0!important;
  border-radius:clamp(14px,1.6vw,20px)!important;
  overflow:hidden!important;
  background:linear-gradient(155deg,#13344b,#0c263c)!important;
  border:1px solid rgba(222,183,116,.4)!important;
  box-shadow:0 12px 28px rgba(0,8,20,.19)!important;
}
body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts .cz_grid_item > .clr > .cz_grid_link {
  display:block!important;
  position:relative!important;
  width:100%!important;
  max-width:100%!important;
  height:auto!important;
  aspect-ratio:16/9!important;
  overflow:hidden!important;
  border-radius:0!important;
  flex:0 0 auto!important;
  background:#102a3c!important;
}
body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts .cz_grid_link > img {
  display:block!important;
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  object-position:center!important;
  max-width:100%!important;
  border-radius:0!important;
}
body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts .cz_grid_details_outside {
  box-sizing:border-box!important;
  display:flex!important;
  flex:1 1 auto!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:9px!important;
  min-height:155px!important;
  width:100%!important;
  padding:clamp(14px,1.6vw,22px)!important;
  margin:0!important;
  text-align:right!important;
  background:transparent!important;
}
body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts .cz_grid_post_title {
  margin:0!important;
  color:#f6f9fe!important;
  font:800 clamp(16px,1.2vw,19px)/1.7 Almarai,system-ui,sans-serif!important;
  text-align:right!important;
  text-wrap:pretty;
  overflow-wrap:break-word!important;
}
body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts .cz_post_excerpt {
  color:#d5e3ed!important;
  font:450 clamp(13px,1vw,15px)/1.9 Almarai,system-ui,sans-serif!important;
  margin-block:2px 0!important;
  max-width:100%!important;
  text-align:right!important;
}
body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts .cz_readmore {
  display:inline-flex!important;
  align-items:center!important;
  min-height:40px!important;
  margin-top:12px!important;
  padding:6px 0!important;
  color:#f1cf90!important;
  font-weight:800!important;
  text-decoration:none!important;
}
body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts .cz_readmore:hover,
body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts .cz_readmore:focus-visible {
  color:#ffe6b6!important;
}
body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts .cz_grid_item:is(:hover,:focus-within) > .clr {
  border-color:rgba(246,205,139,.68)!important;
  box-shadow:0 18px 35px rgba(0,7,18,.25)!important;
}
/* The existing category/search/recent widgets remain usable BELOW results,
   instead of reserving an empty-looking third of the screen beside cards. */
body:is(.archive,.category,.search) #page_content > .row > .col.s4.sidebar_primary {
  order:2!important;
  float:none!important;
  clear:both!important;
  display:block!important;
  flex:0 0 auto!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
  margin:clamp(24px,3vw,45px) auto 45px!important;
  padding:clamp(21px,2.3vw,30px) 0 0!important;
  border-top:1px solid rgba(231,194,127,.27)!important;
  position:relative!important;
  right:auto!important;left:auto!important;
}
body:is(.archive,.category,.search) #page_content > .row > .col.s4.sidebar_primary .sidebar_inner {
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:wrap!important;
  align-items:flex-start!important;
  justify-content:center!important;
  gap:clamp(13px,1.8vw,22px)!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
  position:static!important;
  transform:none!important;
  margin:0!important;
}
body:is(.archive,.category,.search) #page_content > .row > .col.s4.sidebar_primary .sidebar_inner > .widget {
  flex:1 1 265px!important;
  width:auto!important;
  max-width:calc(50% - 9px)!important;
  min-width:230px!important;
  box-sizing:border-box!important;
  margin:0!important;
  padding:clamp(15px,1.5vw,20px)!important;
  border-radius:15px!important;
  border:1px solid rgba(231,193,130,.27)!important;
  background:#102c43!important;
}
body:is(.archive,.category,.search) #page_content > .row > .col.s4.sidebar_primary .sidebar_inner > .widget h4 {
  color:#f3d69c!important;
  line-height:1.7!important;
}
body:is(.archive,.category,.search) #page_content > .row > .col.s4.sidebar_primary .sidebar_inner > .widget a {
  color:#e2ebf4!important;
}
body:is(.archive,.category,.search) #page_content > .row > .col.s4.sidebar_primary .sidebar_inner > .widget a:hover {
  color:#f4d39d!important;
}
/* 2 columns on tablets, each card still centered with stable image ratio. */
@media(max-width:1050px) {
  body:is(.archive,.category,.search) #page_content > .row {
    width:calc(100% - 30px)!important;
  }
  body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts > .cz_grid_item:not(.cz_grid_first) {
    flex-basis:calc((100% - clamp(16px,2.0vw,27px))/2)!important;
    width:calc((100% - clamp(16px,2.0vw,27px))/2)!important;
  }
  body:is(.archive,.category,.search) #page_content > .row .tyz-v19-archive-wrap{
    margin-block:25px 36px!important;
  }
}
@media(max-width:650px) {
  body:is(.archive,.category,.search) #page_content > .row {
    width:calc(100% - 22px)!important;
    gap:20px!important;
  }
  body:is(.archive,.category,.search) #page_content > .row .xtra-archive-desc {
    margin-bottom:18px!important;
    padding-inline:6px!important;
  }
  body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts {
    gap:15px!important;
  }
  body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts > .cz_grid_item:not(.cz_grid_first) {
    flex-basis:100%!important;
    width:100%!important;
    max-width:560px!important;
  }
  body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts .cz_grid_details_outside{
    min-height:0!important;
    padding:16px 17px 18px!important;
    gap:7px!important;
  }
  body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts .cz_grid_post_title{
    font-size:17px!important;
    line-height:1.75!important;
  }
  body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts .cz_post_excerpt{
    font-size:14px!important;
  }
  body:is(.archive,.category,.search) #page_content > .row .tyz-v19-archive-wrap{
    padding:0!important;
    margin:23px auto 29px!important;
  }
  body:is(.archive,.category,.search) #page_content > .row > .col.s4.sidebar_primary {
    margin-top:23px!important;
    padding-top:20px!important;
  }
  body:is(.archive,.category,.search) #page_content > .row > .col.s4.sidebar_primary .sidebar_inner > .widget {
    max-width:100%!important;
    min-width:0!important;
    flex-basis:100%!important;
  }
}
@media(max-width:360px) {
  body:is(.archive,.category,.search) #page_content > .row {
    width:calc(100% - 16px)!important;
  }
  body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts .cz_grid_details_outside {
    padding:13px!important;
  }
}
@media(prefers-reduced-motion:reduce) {
  body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts .cz_grid_item > .clr,
  body:is(.archive,.category,.search) #page_content > .row .cz_grid.cz_grid_posts .cz_grid_link img{
    transition:none!important;
  }
}
