/*
Theme Name: Aljaser
Theme URI: https://example.com/
Author: AbuFahd + ChatGPT
Author URI: https://example.com/
Description: قالب مدونة نصية خفيف وسريع بتصميم لوحة أنيق (مثل واجهات التطبيقات) يركز على التدوينات بدون صور. RTL جاهز.
Version: 1.2.4
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aljaser
Tags: blog, rtl-language-support, custom-logo, custom-menu, accessibility-ready
*/

:root{
  /* Palette (from user image) */
  --mint: #A4D4A0;
  --tealD: #288279;
  --teal: #63B6A2;
  --sand: #E7E2BA;
  --orange: #F26C0B;

  --bg: #ffffff;
  --canvas: #f6f7f7;      /* app-like outer */
  --surface: #ffffff;
  --text: #111413;
  --muted: #5b6a66;
  --border: rgba(17,20,19,.10);

  /* Sharper corners (user request) */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px rgba(17,20,19,.08);
  --shadow2: 0 10px 26px rgba(17,20,19,.08);

  --sans: 'Readex Pro', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans Arabic, Noto Sans, Helvetica, Arial;
}

/* Dark mode (optional) */
:root[data-theme="dark"]{
  --bg: #0d1110;
  --canvas: #0a0d0c;
  --surface: #111615;
  --text: #f2f5f4;
  --muted: rgba(242,245,244,.70);
  --border: rgba(242,245,244,.12);
  --shadow: 0 18px 40px rgba(0,0,0,.40);
  --shadow2: 0 10px 26px rgba(0,0,0,.36);
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  font-family: var(--sans);
  background: var(--canvas);
  color: var(--text);
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a{color: var(--tealD); text-decoration:none;}
a:hover{color: #1f6a62; text-decoration:underline;}
img{max-width:100%; height:auto;}

.skip-link{
  position:absolute;
  top:-60px;
  inset-inline-start: 16px;
  background: var(--text);
  color:#fff;
  padding:10px 12px;
  border-radius: 12px;
  z-index:999;
}
.skip-link:focus{top:12px;}

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

/* Shell layout */
.tp-shell{
  max-width: 1180px;
  margin: 28px auto;
  padding: 0 18px;
  display:grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}

.tp-sidebar{
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  position: sticky;
  top: 18px;
  height: fit-content;
}

.tp-profile{margin-bottom: 14px;}
.tp-profile-link{
  display:flex;
  align-items:center;
  gap: 12px;
  text-decoration:none;
  color: var(--text);
}
.tp-profile-link:hover{text-decoration:none;}
.tp-avatar{
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(164,212,160,.35);
  border: 0;
  overflow:hidden;
  flex: 0 0 auto;
  font-weight: 900;
  color: var(--tealD);
}
.tp-avatar img{width:100%; height:100%; object-fit:cover;}
.tp-avatar .custom-logo-link{display:block; width:100%; height:100%;}
.tp-avatar .custom-logo{width:100%; height:100%; object-fit:cover;}
.tp-profile-name{font-weight: 900; font-size: 14px;}
.tp-profile-desc{color: var(--muted); font-size: 12px; margin-top:2px;}

/* Side menu */
.tp-side-menu{
  list-style:none;
  margin: 10px 0 0;
  padding: 0;
  display:flex;
  flex-direction:column;
  gap: 6px;
}
.tp-side-menu a{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 8px 0;
  border-radius: 14px;
  color: var(--text);
  text-decoration:none;
}
.tp-side-menu a:hover{
  background: rgba(231,226,186,.35);
  text-decoration:none;
}
.tp-side-menu .current-menu-item > a,
.tp-side-menu .current_page_item > a{
  background: rgba(242,108,11,.14);
  border: 1px solid rgba(242,108,11,.20);
}

/* Sidebar widgets block */
.tp-side-widgets{margin-top: 14px;}
.tp-side-widgets .widget{margin: 0 0 10px;}

.tp-side-actions{margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);}
.tp-theme-toggle{
  width:100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 8px 0;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  cursor:pointer;
}
.tp-theme-toggle:hover{background: rgba(99,182,162,.12);}
.tp-theme-dot{width:10px; height:10px; border-radius:999px; background: var(--tealD); box-shadow: 0 0 0 4px rgba(164,212,160,.25);}
.tp-theme-label{font-size: 13px; color: var(--muted);}

/* Main */
.tp-main{
  background: transparent;
}

.tp-topbar{
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 14px;
  display:grid;
  /* burger + tabs + profile */
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items:center;
  gap: 12px;
}

.tp-topbar-profile{display:flex; align-items:center; justify-content:flex-end;}
.tp-topbar .tp-profile-link{padding: 6px 10px; border-radius: 12px; border: 1px solid transparent;}
.tp-topbar .tp-profile-link:hover{background: rgba(231,226,186,.35); border-color: rgba(231,226,186,.55);} 
.tp-topbar .tp-avatar{width:34px; height:34px; border-radius: 10px;}
.tp-topbar .tp-profile-name{font-size: 13px;}
.tp-topbar .tp-profile-desc{font-size: 11px;}

.tp-burger{
  display:none;
  border:1px solid var(--border);
  background: transparent;
  border-radius: 14px;
  width: 44px;
  height: 44px;
  cursor:pointer;
}
.tp-burger-line{display:block; width:18px; height:2px; background: var(--text); margin: 4px auto; opacity:.9; border-radius:2px;}

/* Top title removed (no category/post titles in topbar) */

.tp-tabs{
  display:flex;
  gap: 8px;
  align-items:center;
  justify-content:center;
  flex-wrap:nowrap;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling: touch;
}

/* When the topbar menu is a WP menu, style the inner <ul> like tabs */
.tp-tabs-list,
.tp-tabs-fallback{
  display:flex;
  gap: 8px;
  align-items:center;
  justify-content:center;
  flex-wrap:nowrap;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling: touch;
}
.tp-tabs-list{
  list-style:none;
  margin:0;
  padding:0;
}
.tp-tabs-list a{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 13px;
  text-decoration:none;
  display:inline-block;
}
.tp-tabs-list a:hover{background: rgba(231,226,186,.35); color: var(--text); text-decoration:none;}
.tp-tabs-list .current-menu-item > a,
.tp-tabs-list .current-menu-ancestor > a,
.tp-tabs-list .current_page_item > a,
.tp-tabs-list .current_page_ancestor > a{
  background: rgba(242,108,11,.14);
  border-color: rgba(242,108,11,.22);
  color: var(--text);
  font-weight: 600;
}

/* Hide scrollbar for tabs (still scrollable) */
.tp-tabs::-webkit-scrollbar{display:none;}
.tp-tabs{scrollbar-width:none;}
.tp-tab{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 13px;
  text-decoration:none;
}
.tp-tab:hover{background: rgba(231,226,186,.35); color: var(--text); text-decoration:none;}
.tp-tab.is-active{
  background: rgba(242,108,11,.14);
  border-color: rgba(242,108,11,.22);
  color: var(--text);
}

/* Topbar profile (moved from sidebar) */
.tp-topbar-profile{justify-self:end;}
.tp-topbar-profile .tp-profile-link{
  padding: 6px 8px;
  border-radius: 12px;
}
.tp-topbar-profile .tp-profile-link:hover{background: rgba(231,226,186,.35);} 
.tp-topbar-profile .tp-avatar{width: 38px; height: 38px; border-radius: 10px;}
.tp-topbar-profile .tp-profile-name{font-size: 13px;}
.tp-topbar-profile .tp-profile-desc{display:none;}

.tp-top-actions{display:flex; align-items:center; justify-content:flex-end;}

.tp-search{position:relative; width: min(340px, 46vw);}
.tp-search input[type="search"]{
  width:100%;
  padding: 12px 44px 12px 12px;
  border-radius: 16px;
  border: 0;
  background: rgba(246,247,247,.55);
  color: var(--text);
  outline:none;
}
:root[data-theme="dark"] .tp-search input[type="search"]{background: rgba(255,255,255,.06);}
.tp-search input[type="search"]:focus{
  border-color: rgba(40,130,121,.55);
  box-shadow: 0 0 0 4px rgba(164,212,160,.25);
}
.tp-search-btn{
  position:absolute;
  top: 50%;
  transform: translateY(-50%);
  inset-inline-end: 10px;
  width: 34px;
  height: 34px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(99,182,162,.16);
  color: var(--text);
  cursor:pointer;
}
.tp-search-btn:hover{background: rgba(242,108,11,.16);}

.tp-content{
  margin-top: 14px;
}

/* Page head */
.tp-pagehead{
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding: 18px;
  margin-bottom: 14px;
}
.tp-pagehead-title{margin:0 0 6px; font-size: 18px; font-weight: 900;}
.tp-pagehead-desc{color: var(--muted); font-size: 14px;}

/* Cards grid (like the screenshot) */
.tp-cards{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.tp-card{
  border-radius: var(--radius);
  border: 0;
  background: var(--surface);
  box-shadow: var(--shadow2);
  overflow:hidden;
  min-height: 170px;
}

.tp-card-link{
  display:flex;
  flex-direction:column;
  height:100%;
  padding: 16px;
  color: inherit;
  text-decoration:none;
}
.tp-card-link:hover{text-decoration:none;}

.tp-card-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.tp-badge{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(231,226,186,.55);
  color: var(--text);
  border: 1px solid rgba(17,20,19,.06);
}
.tp-badge--muted{background: rgba(246,247,247,.8);}
.tp-meta{font-size: 12px; color: var(--muted);}

.tp-card-title{
  margin:0 0 10px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 900;
}

.tp-card-excerpt{color: var(--muted); font-size: 13px; line-height:1.75;}
.tp-card-excerpt p{margin:0;}

.tp-card-bottom{
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.tp-card-cta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.35);
  border: 1px solid rgba(255,255,255,.40);
  font-size: 12px;
  font-weight: 800;
}
.tp-card-date{font-size: 12px; color: var(--muted);}

/* Variants (accents only - cards stay white) */
.tp-card--featured{
  grid-column: span 2;
  background: var(--surface);
  color: var(--text);
  border-top: 4px solid var(--orange);
}
.tp-card--featured .tp-badge{background: rgba(242,108,11,.10); border-color: rgba(242,108,11,.18); color: var(--text);}
.tp-card--featured .tp-meta,
.tp-card--featured .tp-card-excerpt{color: var(--muted);}
.tp-card--featured .tp-card-cta{background: rgba(242,108,11,.10); border-color: rgba(242,108,11,.18); color: var(--text);}

.tp-card--tall{
  grid-row: span 2;
  background: var(--surface);
  color: var(--text);
  border-top: 4px solid var(--tealD);
}
.tp-card--tall .tp-badge{background: rgba(40,130,121,.10); border-color: rgba(40,130,121,.18); color: var(--text);}
.tp-card--tall .tp-meta,
.tp-card--tall .tp-card-excerpt{color: var(--muted);}
.tp-card--tall .tp-card-cta{background: rgba(40,130,121,.10); border-color: rgba(40,130,121,.18); color: var(--text);}

.tp-card--sand{background: var(--surface); border-top: 4px solid var(--sand);}
.tp-card--mint{background: var(--surface); border-top: 4px solid var(--mint);}
.tp-card--teal{background: var(--surface); border-top: 4px solid var(--teal);}
.tp-card--plain{background: var(--surface);}

/* Article */
.tp-article-shell{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.tp-article,
.tp-aside{
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
}

.tp-article{padding: 22px;}
.tp-article-head{margin-bottom: 14px;}
.tp-crumbs{display:flex; flex-wrap:wrap; gap: 6px; color: var(--muted); font-size: 12px;}
.tp-crumbs a{color: var(--muted);} 
.tp-crumb-current{color: var(--text); font-weight: 700;}
.tp-article-title{margin: 8px 0 6px; font-weight: 950; font-size: 26px; line-height:1.25;}
.tp-article-meta{display:flex; gap: 8px; flex-wrap:wrap;}
.tp-meta-pill{font-size: 12px; color: var(--muted); background: rgba(246,247,247,.70); border: 0; padding: 6px 10px; border-radius: 999px;}
:root[data-theme="dark"] .tp-meta-pill{background: rgba(255,255,255,.06);} 

.entry-content p{margin: 0 0 14px;}
.entry-content h2,
.entry-content h3,
.entry-content h4{margin: 22px 0 10px; line-height:1.35;}
.entry-content blockquote{margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: rgba(231,226,186,.35); border: 0;}
.entry-content code{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.95em;}
.entry-content pre{overflow:auto; padding: 12px 14px; border-radius: 12px; background: rgba(17,20,19,.06);}
:root[data-theme="dark"] .entry-content pre{background: rgba(255,255,255,.06);} 

.tp-article-foot{margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);}
.tp-tag{display:inline-flex; padding: 6px 10px; border-radius: 999px; border: 0; background: rgba(246,247,247,.7); margin-inline-end: 8px; margin-bottom: 8px; color: var(--muted); font-size: 12px;}
:root[data-theme="dark"] .tp-tag{background: rgba(255,255,255,.06);} 

.tp-post-nav a{display:block; padding: 12px 14px; border-radius: 12px; border: 0; background: rgba(246,247,247,.70); text-decoration:none; color: var(--text);} 
.tp-post-nav a:hover{background: rgba(231,226,186,.35);} 
:root[data-theme="dark"] .tp-post-nav a{background: rgba(255,255,255,.06);} 
.tp-nav-label{display:block; color: var(--muted); font-size: 12px;}
.tp-nav-title{display:block; font-weight: 900;}

/* Aside / widgets */
.tp-aside{padding: 16px;}
.widget{margin: 0 0 12px; padding: 12px; border-radius: 12px; border: 0; background: transparent;} 
:root[data-theme="dark"] .widget{background: transparent;} 
.widget-title{margin:0 0 8px; font-size: 14px; font-weight: 900;}
.widget a{text-decoration:none;}
.widget a:hover{text-decoration:underline;}

/* Theme widgets (categories + posts)
   Keep items tight (minimal spacing) */
.tp-widget-list{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap: 3px;}
.tp-widget-item{display:flex; align-items:flex-start; justify-content:space-between; gap: 10px;}
.tp-widget-link{
  display:block;
  flex: 1 1 auto;
  padding: 4px 0;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
}
.tp-widget-link:hover{background: transparent; text-decoration:underline;}
.tp-badge{
  flex: 0 0 auto;
  align-self:center;
  font-size: 12px;
  font-weight: 900;
  color: var(--tealD);
  border: 1px solid rgba(99,182,162,.35);
  background: rgba(99,182,162,.14);
  padding: 6px 10px;
  border-radius: 999px;
}
.tp-widget-sub{margin-top: 6px; color: var(--muted); font-size: 12px; line-height:1.55;}
.tp-widget-empty{margin:0; color: var(--muted); font-size: 13px;}

.tp-mini{padding: 12px; border-radius: 12px; border:1px solid var(--border); background: rgba(231,226,186,.22);} 
.tp-mini-title{margin:0 0 8px; font-weight: 900; font-size: 14px;}
.tp-mini-text{margin:0; color: var(--muted); font-size: 13px;}
.tp-mini-list{margin:0; padding:0 18px 0 0; color: var(--muted);} 

/* Empty / 404 */
.tp-empty{
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding: 22px;
}
.tp-empty-title{margin:0 0 8px; font-weight: 950;}
.tp-empty-text{margin:0 0 14px; color: var(--muted);} 
.tp-empty-actions{display:flex; flex-wrap:wrap; gap: 10px; align-items:center;}
.tp-btn{display:inline-flex; align-items:center; justify-content:center; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(242,108,11,.30); background: rgba(242,108,11,.14); color: var(--text); font-weight: 900; text-decoration:none;}
.tp-btn:hover{background: rgba(242,108,11,.20); text-decoration:none;}

/* Pagination */
.tp-pagination .nav-links{display:flex; gap: 8px; justify-content:center; margin: 14px 0 0; flex-wrap:wrap;}
.tp-pagination .page-numbers{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 0;
  background: var(--surface);
  color: var(--text);
  text-decoration:none;
}
.tp-pagination .page-numbers.current{background: rgba(99,182,162,.18); border-color: rgba(99,182,162,.30);}
.tp-pagination .page-numbers:hover{text-decoration:none; background: rgba(231,226,186,.35);} 

/* Footer */
.tp-footer{
  margin-top: 14px;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  padding: 14px 16px;
}
.tp-footer-inner{display:flex; align-items:center; justify-content:space-between; gap: 10px; flex-wrap:wrap;}
.tp-footer-copy{display:flex; align-items:center; gap: 10px; color: var(--muted); font-size: 13px;}
.tp-footer-links ul{list-style:none; margin:0; padding:0; display:flex; gap: 10px; flex-wrap:wrap;}
.tp-footer-links a{color: var(--muted); text-decoration:none;}
.tp-footer-links a:hover{color: var(--text); text-decoration:underline;}

/* Responsive */
@media (max-width: 980px){
  .tp-shell{grid-template-columns: 1fr; display:flex; flex-direction:column; gap:18px;}

  .tp-main{order:1;}
  .tp-sidebar{order:2;}
  /* On small screens, keep the sidebar as a normal block (no off-canvas).
     The burger toggles the topbar menu instead. */
  .tp-sidebar{
    position: relative;
    inset: auto;
    width: 100%;
    z-index: auto;
    transform: none;
    transition: none;
  }
  .tp-sidebar.is-open{transform:none;}
  .tp-burger{display:inline-flex; align-items:center; justify-content:center;}
  .tp-topbar{grid-template-columns: auto 1fr auto; grid-auto-rows: auto; position: relative;}
  /* Hide tabs by default, show them as a dropdown panel when opened */
  .tp-tabs{display:none; flex-direction: column; align-items: stretch;}
  .tp-tabs.is-open{
    display:flex;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 50;
    padding: 10px;
    border: 0;
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .tp-tabs-list,
  .tp-tabs-fallback{
    flex-direction: column;
    align-items: stretch;
    justify-content:flex-start;
    overflow: visible;
    white-space: normal;
  }
  .tp-tabs-list a{width:100%;}
  .tp-tab{justify-content:flex-start;}
  .tp-article-shell{grid-template-columns: 1fr;}
}

@media (max-width: 520px){
  .tp-topbar .tp-profile-desc{display:none;}
}

@media (max-width: 720px){
  .tp-cards{grid-template-columns: 1fr;}
  .tp-card--featured{grid-column: auto;}
  .tp-card--tall{grid-row: auto;}
}
