/* Responsive article layer. The iframe remains the main reading method. */
:root {
  --ynn-primary: #d23f3f;
  --ynn-primary-dark: #9f2424;
  --ynn-text: #1f2933;
  --ynn-muted: #6b7280;
  --ynn-border: #e5e7eb;
  --ynn-bg: #f7f7f7;
  --ynn-card: #ffffff;
}

* {
  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.8;
}

a {
  text-decoration: none !important;
}

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

.head {
  position: sticky;
  top: 0;
  z-index: 1000;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 8px 18px !important;
  background: rgba(255,255,255,.96) !important;
  border-bottom: 1px solid var(--ynn-border);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
}

.header_logo {
  margin-right: 0 !important;
  flex: 0 0 auto;
}

.header_logo img,
.logo {
  max-width: 136px;
  max-height: 76px;
  width: auto !important;
  height: auto !important;
  display: block;
}

.titlepost {
  flex: 1;
  width: auto !important;
  margin-top: 0 !important;
  text-align: center;
}

.titlepost h1,
.titlepost h1 a {
  display: block !important;
  color: var(--ynn-primary) !important;
  font-size: 21px !important;
  line-height: 1.55 !important;
  margin: 0 0 4px !important;
  right: 0 !important;
}

.titlepost span,
.titlepost time,
.titlepost .article_date,
.titlepost .article_time {
  font-size: 13px !important;
  color: var(--ynn-muted) !important;
}

.titlepost span a,
.titlepost .next a {
  color: var(--ynn-primary) !important;
}

.titlepost .next {
  font-size: 13px !important;
  margin: 4px 0 0 !important;
}

#frm {
  display: block;
  width: 100% !important;
  min-height: calc(100vh - 92px);
  border: 0;
  background: #fff;
}

#details {
  width: min(840px, calc(100% - 20px));
  margin: 18px auto;
  background: var(--ynn-card);
  border: 1px solid var(--ynn-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.imagthumb {
  border-radius: 0 !important;
  max-width: 100% !important;
}

.textcontent {
  min-height: 300px !important;
  padding: 18px 20px;
  color: var(--ynn-text);
  font-size: 19px;
  line-height: 2;
}

.textcontent p,
#response p {
  margin: 0 0 14px;
}

.share-buttons a {
  transition: transform .15s ease, opacity .15s ease;
}

.share-buttons a:hover {
  transform: translateY(-1px);
  opacity: .92;
}

.btn-source,
.btn-sourcety,
.btn-sourcet,
.btn-sourcete,
.btn-sourcef {
  display: inline-block !important;
  border-radius: 9px;
  padding: 9px 14px !important;
  line-height: 1.5 !important;
}

.sourcelink,
.social,
.related-news {
  text-align: center;
  padding: 0 14px;
}

.follow-google {
  width: min(780px, calc(100% - 20px));
  margin: 18px auto !important;
  background: #fff;
}

.more_news_item {
  width: min(840px, calc(100% - 20px));
  margin: 0 auto 10px !important;
  background: #fff !important;
  border: 1px solid var(--ynn-border) !important;
  border-radius: 10px;
  padding: 11px 13px !important;
}

.more_news_item h3,
.more_news_item h3 a {
  color: var(--ynn-text) !important;
  font-size: 20px !important;
  line-height: 1.6 !important;
}

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

.source_name2,
.source_name2 a {
  color: var(--ynn-muted) !important;
  font-size: 12px !important;
}

@media (max-width: 768px) {
  .head {
    position: relative;
    display: block !important;
    min-height: auto;
    padding: 8px 10px !important;
  }

  .header_logo {
    text-align: center;
    margin: 0 0 6px !important;
  }

  .header_logo img,
  .logo {
    margin: 0 auto;
    max-width: 96px;
    max-height: 58px;
  }

  .titlepost {
    text-align: center;
  }

  .titlepost h1,
  .titlepost h1 a {
    font-size: 19px !important;
  }

  .titlepost > div {
    display: block;
  }

  .titlepost span,
  .titlepost time,
  .titlepost .article_date,
  .titlepost .article_time {
    display: inline-block;
    margin: 2px 3px;
    font-size: 12px !important;
  }

  #frm {
    min-height: 68vh;
  }

  #details {
    width: calc(100% - 12px);
    margin-top: 10px;
    border-radius: 10px;
  }

  .textcontent {
    padding: 14px 13px;
    font-size: 18px;
    line-height: 2;
  }

  .follow-google {
    display: block !important;
    text-align: center;
  }

  .follow-google img {
    width: 70px !important;
    height: 70px !important;
    display: block;
    margin: 0 auto 8px;
  }

  .btn-source,
  .btn-sourcety,
  .btn-sourcet,
  .btn-sourcete,
  .btn-sourcef {
    width: calc(100% - 20px);
    max-width: 420px;
    font-size: 18px !important;
    margin: 4px auto;
  }
}

/* ===== Patch 2: compact article header ===== */
.article-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--ynn-border);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
}

.article-topbar-inner {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 7px 0;
}

.article-logo img {
  display: block;
  width: auto !important;
  max-width: 104px;
  max-height: 56px;
  height: auto !important;
  border: 0;
}

.article-title-wrap {
  min-width: 0;
}

.article-title-wrap h1 {
  margin: 0 0 4px !important;
  color: var(--ynn-primary) !important;
  font-size: 18px !important;
  line-height: 1.45 !important;
  font-weight: 700 !important;
}

.article-title-wrap h1 a {
  color: var(--ynn-primary) !important;
}

.article-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 10px;
  color: var(--ynn-muted);
  font-size: 12px;
  line-height: 1.45;
}

.article-meta-row a,
.article-source-link {
  color: var(--ynn-primary) !important;
  font-weight: 700;
}

.article-action-link {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff1f1;
  color: var(--ynn-primary) !important;
  border: 1px solid #ffd6d6;
  font-weight: 700;
}

.article-next-row {
  display: block;
  margin-top: 3px;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-next-row a {
  color: #374151 !important;
  font-weight: 700;
}

@media (max-width: 768px) {
  .article-topbar {
    position: relative;
  }

  .article-topbar-inner {
    grid-template-columns: 72px minmax(0, 1fr);
    width: calc(100% - 12px);
    gap: 8px;
    padding: 6px 0;
  }

  .article-logo img {
    max-width: 68px;
    max-height: 42px;
  }

  .article-title-wrap h1 {
    font-size: 15px !important;
    line-height: 1.35 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .article-meta-row {
    gap: 4px 7px;
    font-size: 11px;
  }

  .article-action-link {
    padding: 2px 7px;
  }

  .article-next-row {
    font-size: 11px;
  }

  #frm {
    min-height: 72vh;
  }
}
