/*
  Yemen Now News responsive layer
  - Keeps the old Laravel views working.
  - Overrides old table/fixed-width styles without adding heavy libraries.
*/
:root {
  --ynn-primary: #d23f3f;
  --ynn-primary-dark: #9f2424;
  --ynn-text: #1f2933;
  --ynn-muted: #6b7280;
  --ynn-border: #e5e7eb;
  --ynn-bg: #f7f7f7;
  --ynn-card: #ffffff;
  --ynn-dark-card: #363f45;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 !important;
  background: var(--ynn-bg) !important;
  color: var(--ynn-text);
  direction: rtl;
  font-family: Arial, Tahoma, sans-serif !important;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none !important;
}

a:hover {
  color: var(--ynn-primary) !important;
}

img {
  max-width: 100%;
  height: auto;
}

table {
  max-width: 100%;
}

.ynn-page {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
}

.ynn-topbar {
  background: var(--ynn-card);
  border-bottom: 1px solid var(--ynn-border);
  margin-bottom: 12px;
}

.ynn-header {
  width: min(1180px, calc(100% - 24px));
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
}

.ynn-logo img {
  display: block;
  width: auto;
  max-width: 160px;
  max-height: 82px;
}

.ynn-header-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: var(--ynn-muted);
}

.ynn-header-links a {
  background: #f2f3f5;
  border: 1px solid var(--ynn-border);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--ynn-text);
}

.scrollmenu,
.ynn-scrollmenu {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  overflow-x: auto;
  white-space: nowrap;
  padding: 8px 0 12px;
  scrollbar-width: thin;
}

.scrollmenu a,
.ynn-scrollmenu a {
  display: inline-block;
  margin-left: 6px;
  background: #fff;
  border: 1px solid var(--ynn-border);
  border-radius: 999px;
  padding: 7px 12px;
  color: #111827;
  font-size: 14px;
}

.scrollmenu a:hover,
.ynn-scrollmenu a:hover {
  background: var(--ynn-primary);
  color: #fff !important;
}

.ynn-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}

.ynn-main,
.ynn-sidebar,
.ynn-card,
.main_news,
.more_news,
.items-box,
.latest_news .container {
  background: var(--ynn-card) !important;
  border: 1px solid var(--ynn-border) !important;
  border-radius: 10px;
  overflow: hidden;
}

.ynn-section-title,
.dept,
.more_news_header {
  background: #f1f2f4 !important;
  border-bottom: 1px solid var(--ynn-border);
  color: var(--ynn-primary) !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  min-height: auto !important;
  height: auto !important;
  padding: 9px 12px !important;
  margin: 0 !important;
  line-height: 1.5;
}

.ynn-hero {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
}

.ynn-hero img {
  width: 190px;
  height: 125px;
  object-fit: cover;
  border-radius: 8px;
  background: #f2f2f2;
}

.ynn-hero h1,
.ynn-hero h2,
.ynn-hero h3 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.5;
}

.ynn-meta,
.source_name,
.source_name2 {
  color: var(--ynn-muted) !important;
  font-size: 12px !important;
  line-height: 1.7;
}

.ynn-meta a,
.source_name a,
.source_name2 a {
  color: var(--ynn-primary) !important;
}

.ynn-summary {
  margin: 8px 0 0;
  color: #4b5563;
  font-size: 14px;
}

.tab,
.ynn-tabs {
  display: flex;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--ynn-border);
  border-radius: 10px;
  padding: 6px;
  margin: 12px 0;
  overflow-x: auto;
}

.tab button,
.ynn-tabs button {
  border: 0;
  border-radius: 8px;
  background: #f3f4f6;
  color: #111827;
  cursor: pointer;
  font-weight: 700;
  padding: 9px 14px;
  white-space: nowrap;
}

.tab button.active,
.ynn-tabs button.active {
  background: var(--ynn-primary);
  color: #fff;
}

.tabcontent,
.ynn-tabcontent {
  display: none;
}

.tabcontent.active,
.ynn-tabcontent.active {
  display: block;
}

.ynn-news-list {
  display: grid;
  gap: 10px;
}

.ynn-news-item,
.more_news_item,
.latest_news .container,
.items-box .container {
  display: block;
  background: var(--ynn-card) !important;
  border: 1px solid var(--ynn-border) !important;
  border-radius: 10px;
  padding: 10px 12px !important;
  margin: 0 0 10px !important;
  color: var(--ynn-text) !important;
  overflow: hidden;
}

.ynn-news-item h3,
.more_news_item h3,
.latest_news .title,
.items-box .title {
  margin: 0 0 6px !important;
  font-size: 19px !important;
  line-height: 1.55 !important;
  font-weight: 700 !important;
}

.ynn-news-item h3 a,
.more_news_item a,
.latest_news .title a,
.items-box .title a {
  color: var(--ynn-text) !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

.ynn-news-item h3 a:hover,
.more_news_item a:hover,
.latest_news .title a:hover,
.items-box .title a:hover {
  color: var(--ynn-primary) !important;
}

.ynn-share {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
}

.ynn-share a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f3f4f6;
}

.ynn-share img {
  width: 17px !important;
  height: 17px !important;
}

.ynn-latest-list .ynn-news-item:nth-child(odd),
.more_news ul li.even_block:nth-of-type(odd) {
  background: var(--ynn-dark-card) !important;
  color: #fff !important;
}

.ynn-latest-list .ynn-news-item:nth-child(odd) a,
.more_news ul li.even_block:nth-of-type(odd) a {
  color: #fff !important;
}

.ynn-latest-list .ynn-news-item:nth-child(odd) .ynn-meta,
.more_news ul li.even_block:nth-of-type(odd) .source_name {
  color: #fff3a6 !important;
}

.ynn-sidebar-title,
.index_header td {
  background: var(--ynn-primary) !important;
  color: #fff !important;
  font-weight: 700;
  padding: 8px 10px;
}

.ynn-source-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ynn-source-list li,
.newColor {
  border-bottom: 1px solid var(--ynn-border);
}

.ynn-source-list a,
.index_name a {
  display: block;
  padding: 8px 10px;
  color: #111827 !important;
  font-size: 14px !important;
}

.ynn-pagination,
.pages,
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 20px !important;
  height: auto !important;
  font-family: Arial, Tahoma, sans-serif !important;
}

.ynn-pagination a,
.pages a,
.pagination a {
  display: inline-block;
}

.selected_page,
.page {
  float: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: auto !important;
  min-width: 100px !important;
  padding: 9px 12px !important;
  margin: 0 !important;
  border: 1px solid var(--ynn-border) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--ynn-text) !important;
}

.footer {
  height: auto !important;
  padding: 18px 10px !important;
  margin-top: 18px;
  background: #fff !important;
  border-top: 1px solid var(--ynn-border);
  line-height: 1.9;
}

.width_728,
.width-container {
  max-width: 100% !important;
}

.adsRight,
.adsLeft,
.adsHeader {
  max-width: 100%;
}

@media (max-width: 900px) {
  .ynn-page {
    width: calc(100% - 16px);
  }

  .ynn-grid {
    display: block;
  }

  .ynn-sidebar {
    margin-top: 12px;
  }

  .ynn-header {
    width: calc(100% - 16px);
    min-height: 66px;
  }

  .ynn-logo img {
    max-width: 115px;
    max-height: 62px;
  }

  .ynn-header-links {
    font-size: 12px;
    gap: 5px;
    justify-content: flex-end;
  }

  .ynn-header-links a {
    padding: 5px 8px;
  }

  .ynn-scrollmenu,
  .scrollmenu {
    width: calc(100% - 16px);
  }

      .ynn-hero{
        display:flex;
        flex-direction:column;
    }

    .ynn-hero > div{
        order:1;
    }

    .ynn-hero > a{
        order:2;
    }

    .ynn-hero img{
        width:100%;
        height:auto;
        aspect-ratio:16 / 9;
        margin:10px 0 0;
    }

    .ynn-hero h2{
        margin-bottom:8px;
    }


 

  .ynn-hero h1,
  .ynn-hero h2,
  .ynn-hero h3 {
    font-size: 21px;
  }

  .ynn-news-item h3,
  .more_news_item h3,
  .latest_news .title,
  .items-box .title {
    font-size: 20px !important;
  }

  .hidden_mob,
  .adsRight,
  .adsLeft,
  .adsHeader {
    display: none !important;
  }

  body > table,
  body table[align="center"],
  body table[align="center"] tbody,
  body table[align="center"] tr,
  body table[align="center"] td {
    display: block;
    width: 100% !important;
  }
}

@media (max-width: 520px) {
  .ynn-header {
    align-items: flex-start;
  }

  .ynn-header-links {
    max-width: 60%;
  }

  .ynn-section-title,
  .dept,
  .more_news_header {
    font-size: 16px !important;
  }

  .ynn-news-item,
  .more_news_item,
  .latest_news .container,
  .items-box .container {
    border-radius: 8px;
    padding: 9px 10px !important;
  }

  .ynn-news-item h3,
  .more_news_item h3,
  .latest_news .title,
  .items-box .title {
    font-size: 19px !important;
  }
}

/* ===== Patch 2: unified responsive header + list pages fixes ===== */
.ynn-topbar {
  position: relative;
  z-index: 50;
}

.ynn-header {
  min-height: 74px;
}

.ynn-header-links {
  direction: rtl;
}

.ynn-header-links a {
  line-height: 1.4;
  text-align: center;
}

.ynn-list-page {
  width: min(982px, calc(100% - 24px));
  margin: 0 auto;
}

.ynn-list-main {
  background: var(--ynn-card);
  border: 1px solid var(--ynn-border);
  border-radius: 10px;
  overflow: hidden;
}

.ynn-list-main .more_news_header {
  display: block !important;
}

.ynn-list-main .more_news_header h1,
.ynn-list-main .more_news_header h2,
.ynn-list-main .more_news_header a {
  display: inline !important;
  font-size: 18px !important;
  line-height: 1.7 !important;
}

.ynn-list-main .more_news_item,
.ynn-list-card {
  position: relative;
  min-height: 104px;
  background: #fff !important;
  color: var(--ynn-text) !important;
  border-bottom: 1px solid var(--ynn-border) !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  overflow: hidden;
}

.ynn-list-main .more_news_item:nth-of-type(even),
.ynn-list-card:nth-of-type(even) {
  background: #f8fafc !important;
  color: var(--ynn-text) !important;
}

.ynn-list-main .more_news_item img,
.ynn-list-thumb {
  float: left !important;
  width: 136px !important;
  height: 86px !important;
  object-fit: cover;
  margin: 0 0 8px 12px !important;
  top: 0 !important;
  position: relative !important;
  border-radius: 8px;
  background: #f2f2f2;
}

.ynn-list-main .more_news_item h3,
.ynn-list-card h3 {
  margin: 0 0 6px !important;
  color: var(--ynn-primary) !important;
  font-size: 20px !important;
  line-height: 1.55 !important;
}

.ynn-list-main .more_news_item h3 a,
.ynn-list-card h3 a {
  color: var(--ynn-primary) !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

.ynn-list-main .source_name,
.ynn-list-main .source_name2,
.ynn-list-main .source_name a,
.ynn-list-main .source_name2 a,
.ynn-list-card .source_name,
.ynn-list-card .source_name2,
.ynn-list-card .source_name a,
.ynn-list-card .source_name2 a {
  color: #374151 !important;
  font-size: 12px !important;
  line-height: 1.7 !important;
  font-weight: 400 !important;
}

.ynn-list-main .more_news_item p,
.ynn-list-card p {
  color: #4b5563 !important;
  margin: 5px 0 0 !important;
  font-size: 14px !important;
  line-height: 1.8 !important;
}

.ynn-clean-footer {
  width: min(982px, calc(100% - 24px));
  margin: 0 auto;
}

@media (max-width: 900px) {
  .ynn-topbar {
    margin-bottom: 8px;
  }

  .ynn-header {
    display: block;
    width: calc(100% - 14px);
    min-height: auto;
    padding: 8px 0 6px;
    text-align: center;
  }

  .ynn-logo {
    display: block;
    margin: 0 auto 7px;
  }

  .ynn-logo img {
    margin: 0 auto;
    max-width: 104px;
    max-height: 58px;
  }

  .ynn-header-links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
    max-width: 100%;
    justify-content: stretch;
    font-size: 11px;
  }

  .ynn-header-links a {
    padding: 6px 4px;
    border-radius: 8px;
    white-space: nowrap;
  }

  .ynn-scrollmenu,
  .scrollmenu {
    width: 100%;
    padding: 6px 8px 10px;
    border-top: 1px solid var(--ynn-border);
  }

  .ynn-scrollmenu a,
  .scrollmenu a {
    padding: 6px 9px;
    font-size: 13px;
  }

  .ynn-list-page {
    width: calc(100% - 12px);
  }

  .ynn-list-main {
    border-radius: 9px;
  }

  .ynn-list-main .more_news_header {
    padding: 8px 10px !important;
  }

  .ynn-list-main .more_news_header h1,
  .ynn-list-main .more_news_header h2,
  .ynn-list-main .more_news_header a {
    font-size: 16px !important;
  }

  .ynn-list-main .more_news_item,
  .ynn-list-card {
    min-height: auto;
    padding: 10px !important;
  }

  .ynn-list-main .more_news_item img,
  .ynn-list-thumb {
    width: 96px !important;
    height: 68px !important;
    margin: 0 0 6px 9px !important;
  }

  .ynn-list-main .more_news_item h3,
  .ynn-list-card h3 {
    font-size: 18px !important;
    line-height: 1.55 !important;
  }

  .ynn-list-main .more_news_item p,
  .ynn-list-card p {
    font-size: 13px !important;
    line-height: 1.75 !important;
  }
}

@media (max-width: 430px) {
  .ynn-header-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    font-size: 12px;
  }

  .ynn-list-main .more_news_item img,
  .ynn-list-thumb {
    float: none !important;
    display: block;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    margin: 0 0 8px 0 !important;
  }

  .ynn-list-main .more_news_item h3,
  .ynn-list-card h3 {
    font-size: 17px !important;
  }
}
