:root{
  --bg: #f7f7f9;
  --panel: #ffffff;
  --panel2: #f1f2f6;
  --stroke: #e5e6ea;
  --text: #1a1a1a;
  --muted: #6b7280;
  --accent: #ff6a3d;
  --accent2: #ffa07a;
  --shadow: 0 15px 40px rgba(0,0,0,0.08);
  --radius: 18px;
}

body.dark{
  --bg: #0b0d12;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.09);
  --stroke: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.68);
  --shadow: 0 22px 55px rgba(0,0,0,0.35);
}

/* ===== Cross Browser Stability ===== */
/* ===== Cross Browser Stability ===== */
/* ===== Cross Browser Stability ===== */
img{
  display:block;
  max-width:100%;
  height:auto;
}

/* Prevent layout shift on iOS */
.hero-image,
.article-cover{
  min-height: 50px;
}

/* Fix iOS flex overflow issues */
.container,
.section,
.hero-inner,
.content-layout{
  min-width: 0;
}

/* Better font rendering on Safari */
body{
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fix sticky header issues on iOS */
.site-header{
  /*position: sticky;
  position: -webkit-sticky;*/
  position: static;
}
/* ===== END Cross Browser Stability ===== */
/* ===== END Cross Browser Stability ===== */
/* ===== END Cross Browser Stability ===== */


*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:"Tajawal", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(
      1200px 800px at top center,
      rgba(255,106,61,0.20),
      rgba(255,106,61,0.08) 50%,
      transparent 80%
    ),
    var(--bg);
  background-repeat: no-repeat;
  line-height: 1.7;
}
html, body {
  overflow-x: clip;
}
.rtl{ direction: rtl; }

.d-none{
  display: none !important;
}

a{color:var(--text);text-decoration:none}
img{max-width:100%;display:block}

.container{width:min(1200px, 92vw); margin:0 auto}

.site-header{
  position: static; top:0; z-index:20;
  background: rgba(11,13,18,0.65);
  /*background: rgba(11,13,18);*/
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke);
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 0;
  gap: 16px;
}
.brand{display:flex; align-items:center; gap:12px}
.brand-mark{
  width:42px; height:42px; border-radius: 14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(255,106,61,0.95), rgba(255,160,122,0.75));
  box-shadow: 0 10px 25px rgba(255,106,61,0.18);
  font-weight: 800;
}
.brand-mark.small{width:34px;height:34px;border-radius:12px}
.brand-text{display:flex;flex-direction:column;line-height:1.2}
.brand-title{font-weight:800;letter-spacing:0.2px}
.brand-subtitle{font-size: 12px; color: rgba(255, 255, 255, 0.68);; margin-top:3px}

.header-actions{display:flex; align-items:center; gap:12px; flex-wrap:wrap}
.link.subtle{color: rgba(255, 255, 255, 0.68);}
.link.subtle:hover{color: rgba(255, 255, 255, 0.9);}

.btn{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  display:inline-flex; align-items:center; justify-content:center;
  gap: 10px;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover{transform: translateY(-1px); background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.16)}
.btn.primary{
  border-color: rgba(255,106,61,0.35);
  background: linear-gradient(135deg, rgba(255,106,61,0.95), rgba(255,160,122,0.75));
  color:#120a07;
  font-weight:800;
}
.btn.ghost{background: transparent}

.hero{padding: 28px 0 18px}
.hero-inner{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 980px){
  .hero-inner{grid-template-columns:1fr; }
}

.hero-copy{
  border:1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.hero-copy h1{margin:0 0 10px; font-size: clamp(28px, 3.5vw, 42px); line-height: 1.2}
.hero-copy p{margin:0 0 18px; color: var(--muted)}

.hero-controls{
  display:grid;
  grid-template-columns: 1fr 220px 140px;
  gap: 12px;
}
@media (max-width: 720px){
  .hero-controls{grid-template-columns:1fr}
}
.control label{display:block; font-size:12px; color: var(--muted); margin: 0 0 6px}
.control-input{
  display:flex; align-items:center; gap:10px;
  border:3px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 10px 12px;
}
.control-input i{color: rgba(255,255,255,0.55)}
.control-input input,
.control-input select{
  width:100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem; /* = 16px base */
}
.control-input select option{color:#111}

.hero-card{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.hero-card-top{
  display:flex; align-items:center; justify-content:space-between; gap: 10px;
  margin-bottom: 12px;
}
.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding: 6px 10px;
  background: rgba(255,106,61,0.15);
  border:1px solid rgba(255,106,61,0.25);
  border-radius: 999px;
  font-size: 12px;
  color: var(--accent2);
  font-weight: 700;
}
.muted{color: var(--muted)}

.featured-grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 980px){
  .featured-grid{grid-template-columns: repeat(2, 1fr);}
}
@media (max-width: 420px){
  .featured-grid{grid-template-columns:1fr;}
}

.section{padding: 18px 0 36px}
.section-head{
  display:flex; align-items:flex-end; justify-content:space-between; gap:14px;
  margin-bottom: 14px;
}
.section-head h2{margin:0; font-size: 1.25rem;}
.section-head p{margin:0}

.category-bar{
  display:flex; gap:10px; flex-wrap:wrap;
}
.cat-chip{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  padding: 10px 12px;
  display:flex; align-items:center; gap:10px;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.cat-chip:hover{transform: translateY(-1px); background: rgba(255,255,255,0.08)}
.cat-chip.active{
  background: var(--accent);
  color: white;
}
.cat-chip i{color: rgba(255,255,255,0.75)}
.cat-chip span{font-weight:700; font-size: 14px}

.recipes-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1100px){
  .recipes-grid{grid-template-columns: repeat(3,1fr);}
}
@media (max-width: 820px){
  .recipes-grid{grid-template-columns: repeat(2,1fr);}
}
@media (max-width: 480px){
  .recipes-grid{grid-template-columns: 1fr;}
}

.card{
  border:1px solid var(--stroke);
  background: var(--panel);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.card:hover{
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
}
.card-img{
  position: relative;
  width:100%;
  aspect-ratio: 4 / 3;   /* modern + stable */
  background: rgba(255,255,255,0.04);
  overflow:hidden;
}

.card-img img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.card-body{padding: 14px}
.card-title{margin:0 0 6px; font-weight:800; font-size: 1rem;}
.card-title{
  color: var(--text);
}
.card-meta{
  display:flex; align-items:center; justify-content:space-between;
  color: var(--muted);
  font-size: 12px;
  gap: 10px;
}

.card,
.card-body {
  transform: translateZ(0);
  will-change: transform;
}

a { -webkit-tap-highlight-color: transparent; }


.pill{
  border:1px solid var(--stroke);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--muted);
  background: var(--panel2);
}
.pill.accent{
  border-color: rgba(255,106,61,0.35);
  background: rgba(255,106,61,0.10);
  color: var(--accent2);
}

.pagination{
  margin-top: 18px;
  display:flex; gap:10px; align-items:center; justify-content:center;
  flex-wrap:wrap;
}
.page-btn{
  min-width: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid var(--stroke);
  cursor:pointer;
}
.page-btn.active{
  border-color: rgba(255,106,61,0.35);
  background: rgba(255,106,61,0.14);
  color: var(--accent2);
  font-weight:800;
}
.page-btn{
  color: var(--text);
  background: var(--panel);
}

.articles-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 980px){ .articles-grid{grid-template-columns:repeat(2,1fr);} }
@media (max-width: 520px){ .articles-grid{grid-template-columns:1fr;} }

.about-inner{
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}
@media (max-width: 980px){ .about-inner{grid-template-columns:1fr;} }

.about-card, .quote, .note, .side-card{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 35px rgba(0,0,0,0.18);
  color: var(--text);
}
.quote{
  opacity: .8;
}
.about-stats{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.about h2{
  color: var(--text);
  font-weight: 600;
  opacity: .85;
}
.stat{
  border:1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
}
.stat-num{font-weight:900; font-size: 20px}
.stat-label{display:block; color: var(--muted); font-size: 12px}

.site-footer{
  border-top:1px solid var(--stroke);
  padding: 16px 0;
  background: rgba(11,13,18,0.35);
}
.footer-inner{display:flex; align-items:center; justify-content:space-between; gap: 14px; flex-wrap:wrap}
.footer-links{display:flex; gap: 12px; flex-wrap:wrap}

.content-layout{
  display:grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 14px;
}
@media (max-width: 980px){ .content-layout{grid-template-columns:1fr;} }

.content-main{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.recipe-hero{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap: 12px; flex-wrap:wrap;
}
.recipe-hero h1{margin:0; font-size: 1.75rem; line-height:1.25}
.recipe-actions{display:flex; gap: 10px; flex-wrap:wrap}

.hero-image{
  margin-top: 12px;
  
  overflow:hidden;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
}
.hero-image{
  display:flex;
  align-items:center;
  justify-content:center;
}

.hero-image img{
  max-height:400px;
  width:auto;
  max-width:100%;
  height:auto;
  object-fit:contain;
  border-radius: var(--radius);
}
@media (max-width: 520px){ .hero-image img{height: 240px;} }

.recipe-sections{
  margin-top: 14px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 820px){ .recipe-sections{grid-template-columns:1fr;} }

.block{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius);
  padding: 14px;
}
.block h2{margin:0 0 10px; font-size: 16px}
.pre{
  white-space: pre-wrap;
  color: var(--text);
  margin:0;
}

.content-side{display:flex; flex-direction:column; gap: 14px}
.side-head h3{margin:0}
.side-head p{margin:6px 0 0}
.side-list{display:flex; flex-direction:column; gap: 10px; margin-top: 12px}
.side-item{
  display:flex; gap: 10px; align-items:center;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  border-radius: 16px;
  padding: 10px;
}
.side-thumb{
  width:64px; height:64px; border-radius: 14px;
  overflow:hidden; flex:0 0 auto;
  border:1px solid rgba(255,255,255,0.10);
}
.side-thumb img{width:100%; height:100%; object-fit:cover}
.side-title{margin:0; font-weight:800; font-size: 14px; line-height: 1.3}
.side-meta{font-size: 12px; color: var(--muted); margin-top: 4px}

.banner{
  border-color: rgba(255,106,61,0.25);
  background: linear-gradient(180deg, rgba(255,106,61,0.14), rgba(255,255,255,0.03));
}

.article-page{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.article-page h1{margin:0; font-size: 28px}
.article-cover{
  margin-top: 12px;
  
  overflow:hidden;
  border:1px solid var(--stroke);
}
.article-cover{
  display:flex;
  align-items:center;
  
}

.article-cover img{
  max-height:400px;
  width:auto;
  max-width:100%;
  height:auto;
  object-fit:contain;
  border-radius: var(--radius);
}
.article-body{margin-top: 14px}
.article-body .pre{font-size: 16px}

.skeleton .sk-line{
  height: 12px;
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
  margin: 10px 0;
  overflow:hidden;
  position:relative;
}
.skeleton .sk-line::after,
.skeleton .sk-img::after{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.2s infinite;
}
.skeleton .sk-img{
  height: 240px;
  background: rgba(255,255,255,0.07);
  border-radius: var(--radius);
  position:relative;
  margin: 14px 0;
}
.w-40{width:40%} .w-60{width:60%} .w-70{width:70%} .w-85{width:85%} .w-90{width:90%}
@keyframes shimmer { to { transform: translateX(100%); } }


.btn.small{
  padding:6px 10px;
  font-size:13px;
}

.hidden{ display:none !important; }


.cat-chip{
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cat-chip i{
  color: inherit !important;
}

/* Brand Title */
.brand-title{
  color: #fff;
  font-weight: 700;
  letter-spacing: .5px;
}

/* Slightly softer in light mode */
body:not(.dark) .brand-title{
  color: #fff;
}

body{
  color: var(--text);
}

h1,h2,h3,h4,h5,h6{
  color: var(--text);
}

/* ===== App Loader ===== */
.app-loader{
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity .3s ease;
}

.app-loader.hidden{
  opacity: 0;
  pointer-events: none;
}

.spinner{
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid var(--stroke);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}

@keyframes spin{
  to{ transform: rotate(360deg); }
}

/* ===== Navbar Icons Responsive ===== */

.nav-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
}

/* Mobile: icons only */
@media (max-width: 640px){

  .nav-text{
    display:none;
  }

  .nav-btn{
    width:42px;
    height:42px;
    padding:0;
    justify-content:center;
  }

  .nav-btn i{
    font-size:18px;
  }

}

.a11y-bar{
  display:flex;
  justify-content:flex-start;
  margin: 10px 0 0;
}

.font-slider{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 14px;
  border-radius:999px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  backdrop-filter: blur(10px);
}

body.dark .font-slider{
  background: rgba(20,20,20,.55);
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
}

.font-slider i{
  color: rgba(0,0,0,.65);
  font-size: 16px;
}

body.dark .font-slider i{
  color: rgba(255,255,255,.80);
}

#fontSizeSlider{
  width: 180px;
  accent-color: var(--accent);
}

@media (max-width: 520px){
  #fontSizeSlider{ width: 150px; }
}

.toast{
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 9999;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,.80);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  max-width: calc(100vw - 32px);
}

.toast.show{
  opacity: 1;
  transform: translateY(0);
}