/*
Theme Name: Alshareaf Noor
Theme URI: https://www.alshareaf.com/
Author: Alshareaf
Description: قالب عربي خفيف وآمن لموقع الشيخ عيسى بن يحيى بن معافا الشريف، بلا تعليقات أو مكتبات خارجية.
Version: 1.1.1
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: alshareaf-noor
*/

:root {
  --brand: #075f5b;
  --brand-dark: #064843;
  --brand-soft: #e9f4f2;
  --gold: #b79245;
  --ink: #172321;
  --muted: #64716f;
  --line: #dce6e4;
  --paper: #ffffff;
  --canvas: #f5f8f7;
  --radius: 18px;
  --shadow: 0 16px 40px rgba(12, 57, 53, 0.08);
  --content: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Tahoma, "Traditional Arabic", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.85;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--brand-dark);
}

button,
input,
select,
textarea {
  font: inherit;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  z-index: 100000;
  top: 12px;
  right: 12px;
  width: auto;
  height: auto;
  padding: 10px 16px;
  color: #fff;
  background: var(--brand-dark);
  clip: auto;
}

.site-shell {
  width: min(calc(100% - 32px), var(--content));
  margin-inline: auto;
}

.top-strip {
  color: #dcecea;
  background: #043d3a;
  font-size: 14px;
}

.top-strip__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  gap: 20px;
}

.top-strip p {
  margin: 0;
}

.top-strip a {
  color: #fff;
}

.site-header {
  position: relative;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.branding {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  min-height: 138px;
  padding-block: 22px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  max-width: 760px;
  padding: 12px 28px;
  background: linear-gradient(135deg, #e1ece9, #f9fbfa);
  border: 1px solid #ceddd9;
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(7, 95, 91, 0.07);
}

.brand-logo {
  display: block;
  width: auto;
  max-width: min(100%, 590px);
  max-height: 104px;
  object-fit: contain;
  filter: contrast(1.45) brightness(0.78);
}

.brand-text strong {
  display: block;
  color: var(--brand-dark);
  font-size: clamp(25px, 3vw, 39px);
  line-height: 1.35;
}

.brand-text span {
  color: var(--muted);
  font-size: 15px;
}

.header-search {
  width: min(100%, 310px);
}

.search-form {
  position: relative;
  display: flex;
}

.search-field {
  width: 100%;
  min-height: 48px;
  padding: 10px 18px 10px 52px;
  color: var(--ink);
  background: #f7f9f8;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
}

.search-field:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(7, 95, 91, 0.12);
}

.search-submit {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: 40px;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.nav-wrap {
  background: var(--brand);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
}

.primary-nav {
  flex: 1;
}

.primary-nav ul {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.primary-nav a {
  display: block;
  padding: 13px 16px;
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
}

.primary-nav a:hover,
.primary-nav a:focus,
.primary-nav .current-menu-item > a,
.primary-nav .current-cat > a {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  cursor: pointer;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.news-ticker {
  position: relative;
  z-index: 10;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(12, 57, 53, 0.04);
}

.news-ticker__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  min-height: 48px;
  padding-inline: 0;
}

.news-ticker__label {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  color: #fff;
  background: var(--gold);
  font-size: 14px;
  white-space: nowrap;
}

.news-ticker__label svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.news-ticker__viewport {
  position: relative;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(to left, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(to left, transparent, #000 4%, #000 96%, transparent);
}

.news-ticker__track {
  display: flex;
  width: max-content;
  min-width: 100%;
  animation: alshareaf-ticker 72s linear infinite;
  will-change: transform;
}

.news-ticker__group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.news-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 30px;
  white-space: nowrap;
}

.news-ticker__item::before {
  content: "◆";
  color: var(--gold);
  font-size: 8px;
}

.news-ticker__item:hover,
.news-ticker__item:focus {
  color: var(--brand);
}

.news-ticker:hover .news-ticker__track,
.news-ticker:focus-within .news-ticker__track {
  animation-play-state: paused;
}

@keyframes alshareaf-ticker {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(50%);
  }
}

.main-content {
  min-height: 60vh;
  padding-block: 38px 64px;
}

.breadcrumbs {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs a {
  font-weight: 700;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.8fr);
  gap: 24px;
  margin-bottom: 46px;
}

.hero-card,
.welcome-card,
.post-card,
.article,
.archive-head,
.empty-state {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  min-height: 440px;
  overflow: hidden;
}

.hero-card__media {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, var(--brand-dark), var(--brand));
}

.hero-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 31, 29, 0.94), rgba(2, 31, 29, 0.08) 70%);
}

.hero-card__body {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  padding: clamp(24px, 5vw, 46px);
  color: #fff;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
}

.eyebrow::before {
  width: 28px;
  height: 2px;
  content: "";
  background: currentColor;
}

.hero-card h1,
.hero-card h2 {
  margin: 0 0 12px;
  color: #fff;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.45;
}

.hero-card h1 a,
.hero-card h2 a {
  color: inherit;
}

.hero-card__excerpt {
  max-width: 700px;
  margin: 0;
  color: #e4efed;
}

.welcome-card {
  padding: 32px;
  background: linear-gradient(155deg, #fff, var(--brand-soft));
}

.welcome-card__mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 22px;
  color: #fff;
  background: var(--brand);
  border-radius: 18px;
}

.welcome-card__mark svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.welcome-card h2 {
  margin: 0 0 12px;
  color: var(--brand-dark);
  font-size: 25px;
  line-height: 1.5;
}

.welcome-card p {
  margin: 0 0 22px;
  color: var(--muted);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  padding: 8px 20px;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  font-weight: 700;
}

.button-link:hover,
.button-link:focus {
  color: #fff;
  background: var(--brand-dark);
}

.section-block {
  margin-top: 46px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-heading h2 {
  position: relative;
  padding-right: 18px;
  margin: 0;
  color: var(--brand-dark);
  font-size: 29px;
  line-height: 1.4;
}

.section-heading h2::before {
  position: absolute;
  top: 10%;
  right: 0;
  width: 5px;
  height: 80%;
  content: "";
  background: var(--gold);
  border-radius: 5px;
}

.section-heading > a {
  font-size: 14px;
  font-weight: 700;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.post-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 46px rgba(12, 57, 53, 0.13);
}

.post-card__thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-dark), #14877f);
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.post-card:hover .post-card__thumb img {
  transform: scale(1.035);
}

.post-card__fallback {
  display: grid;
  place-items: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.88);
}

.post-card__fallback svg {
  width: 58px;
  height: 58px;
  fill: currentColor;
}

.post-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
}

.post-meta a {
  color: var(--brand);
  font-weight: 700;
}

.post-card h3 {
  margin: 0 0 10px;
  font-size: 21px;
  line-height: 1.65;
}

.post-card h3 a {
  color: var(--ink);
}

.post-card h3 a:hover {
  color: var(--brand);
}

.post-card__excerpt {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
}

.read-more {
  margin-top: auto;
  font-size: 14px;
  font-weight: 700;
}

.archive-head {
  padding: 28px 32px;
  margin-bottom: 25px;
}

.archive-head h1 {
  margin: 0 0 6px;
  color: var(--brand-dark);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.45;
}

.archive-head p {
  margin: 0;
  color: var(--muted);
}

.article {
  max-width: 900px;
  padding: clamp(25px, 6vw, 58px);
  margin-inline: auto;
}

.article-header {
  padding-bottom: 24px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.article-title {
  margin: 0 0 14px;
  color: var(--brand-dark);
  font-size: clamp(31px, 5vw, 50px);
  line-height: 1.55;
}

.article-featured {
  margin: 0 0 34px;
  overflow: hidden;
  border-radius: 14px;
}

.article-featured img {
  display: block;
  width: 100%;
}

.entry-content {
  font-size: 19px;
  line-height: 2.05;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 1.8em;
  color: var(--brand-dark);
  line-height: 1.55;
}

.entry-content a {
  text-decoration: underline;
  text-decoration-color: rgba(7, 95, 91, 0.35);
  text-underline-offset: 4px;
}

.entry-content blockquote {
  padding: 18px 24px;
  margin-inline: 0;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-right: 4px solid var(--gold);
  border-radius: 12px;
}

.entry-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.entry-content th,
.entry-content td {
  padding: 10px 12px;
  border: 1px solid var(--line);
}

.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 900px;
  margin: 22px auto 0;
}

.post-navigation a {
  display: block;
  height: 100%;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.pagination {
  margin-top: 32px;
}

.pagination .nav-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination .page-numbers {
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  padding: 5px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.pagination .current {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.empty-state {
  padding: 46px;
  text-align: center;
}

.site-footer {
  color: #cfdfdd;
  background: #063f3c;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-block: 46px;
}

.footer-grid h2,
.footer-grid h3 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 20px;
}

.footer-grid p {
  margin: 0;
}

.footer-grid ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.footer-grid a {
  color: #e8f3f1;
}

.footer-grid a:hover {
  color: #fff;
}

.site-info {
  padding-block: 17px;
  font-size: 13px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 900px) {
  .branding {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .header-search {
    width: 100%;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    min-height: 400px;
  }

  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 16px;
  }

  .site-shell {
    width: min(calc(100% - 22px), var(--content));
  }

  .top-strip__inner {
    justify-content: center;
    text-align: center;
  }

  .top-strip__inner p:last-child {
    display: none;
  }

  .branding {
    min-height: 108px;
    padding-block: 15px;
  }

  .brand-logo {
    max-height: 82px;
  }

  .brand-link {
    width: 100%;
    justify-content: center;
    padding: 10px 18px;
  }

  .nav-row {
    min-height: 56px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .primary-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    padding: 12px;
    background: var(--brand-dark);
    box-shadow: var(--shadow);
  }

  .primary-nav.is-open {
    display: block;
  }

  .primary-nav ul {
    display: block;
  }

  .primary-nav a {
    padding: 12px 14px;
  }

  .news-ticker .site-shell {
    width: 100%;
  }

  .news-ticker__label {
    padding-inline: 12px;
  }

  .news-ticker__label span {
    font-size: 13px;
  }

  .news-ticker__item {
    padding-inline: 16px;
    font-size: 13px;
  }

  .main-content {
    padding-block: 24px 44px;
  }

  .hero-card {
    min-height: 390px;
  }

  .hero-card__body {
    padding: 24px;
  }

  .welcome-card {
    padding: 25px;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .section-heading h2 {
    font-size: 25px;
  }

  .article,
  .archive-head,
  .empty-state {
    border-radius: 14px;
  }

  .article {
    padding: 24px 20px;
  }

  .entry-content {
    font-size: 18px;
  }

  .post-navigation,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .top-strip,
  .header-search,
  .nav-wrap,
  .news-ticker,
  .site-footer,
  .post-navigation {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  .article {
    max-width: none;
    padding: 0;
    border: 0;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-ticker__track {
    animation: none;
  }

  .news-ticker__group[aria-hidden="true"] {
    display: none;
  }
}
