/*
Theme Name: Great Joy Projects
Theme URI: https://greatjoyprojects.com
Author: Ofer Biran
Author URI: https://greatjoyprojects.com
Description: Professional hub for Ofer Biran — Director of PM & Agile. Clean editorial design with teal accent, full RTL/Hebrew support.
Version: 1.0.0
License: Private
Text Domain: gjp
Tags: blog, two-columns, right-sidebar, responsive-layout, custom-colors
*/

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #F7F8FA;
  color: #1C2128;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body.rtl {
  direction: rtl;
  text-align: right;
  font-family: 'Segoe UI', 'Arial Hebrew', Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --teal:        #1D9E75;
  --teal-light:  #E1F5EE;
  --teal-dark:   #0F6E56;
  --teal-deeper: #04342C;
  --navy:        #1C2128;
  --navy-mid:    #243040;
  --text-dark:   #0F1C2E;
  --text-mid:    #334155;
  --text-muted:  #64748B;
  --text-faint:  #8B949E;
  --border:      #E2E8F0;
  --border-light:#F1F5F9;
  --bg-page:     #F7F8FA;
  --bg-white:    #ffffff;
  --bg-subtle:   #F1EFE8;
  --coming-bg:   #F7F8FA;
  --coming-text: #B4B2A9;
  --coming-border:#CBD5E0;
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.06);
  --max-width:   1080px;
  --sidebar-w:   260px;
  --gap:         24px;
}

/* ============================================================
   TOPBAR
   ============================================================ */
#topbar {
  background: var(--navy);
  padding: 8px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#topbar .topbar-date { font-size: 11px; color: var(--text-faint); }
#topbar .lang-toggle {
  font-size: 11px;
  color: var(--teal);
  font-weight: 500;
  border: 0.5px solid var(--teal);
  padding: 3px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  transition: background 0.2s;
}
#topbar .lang-toggle:hover { background: rgba(29,158,117,0.12); }

/* ============================================================
   NAVIGATION
   ============================================================ */
#site-header {
  background: var(--bg-white);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.site-logo span { color: var(--teal); }

.primary-nav { display: flex; align-items: center; gap: 4px; }
.primary-nav a {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
  white-space: nowrap;
}
.primary-nav a:hover,
.primary-nav a.current-menu-item { color: var(--teal); }
.primary-nav a.current-menu-item { border-bottom-color: var(--teal); }

/* Hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-mid);
  border-radius: 2px;
  transition: all 0.2s;
}

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  background: var(--bg-white);
  border-top: 0.5px solid var(--border);
  padding: 12px 24px 16px;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  font-size: 14px;
  color: var(--text-mid);
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border-light);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav .lang-toggle-mobile {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--teal);
  border: 0.5px solid var(--teal);
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
}

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
#page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--gap);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  gap: var(--gap);
  align-items: start;
}

/* ============================================================
   FEATURED POST
   ============================================================ */
.featured-post {
  background: var(--bg-white);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.featured-post .post-thumbnail {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: var(--navy-mid);
}
.featured-post .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}
.featured-post .post-thumbnail .no-image {
  width: 100%;
  height: 100%;
  background: var(--navy-mid);
  display: flex;
  align-items: center;
  justify-content: center;
}
.featured-post .post-thumbnail .no-image-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(29,158,117,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.featured-post .post-thumbnail .no-image-icon::after {
  content: '';
  width: 22px;
  height: 22px;
  border-radius: 3px;
  background: var(--teal);
}

.featured-post .category-badge {
  position: absolute;
  top: 16px;
  left: 16px;
}
body.rtl .featured-post .category-badge { left: auto; right: 16px; }

.category-badge a,
.category-badge span {
  display: inline-block;
  background: var(--teal);
  color: var(--teal-deeper);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.featured-post .post-body { padding: 20px 22px 18px; }
.featured-post .post-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 10px;
}
.featured-post .post-excerpt {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 14px;
}
.featured-post .post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.post-meta .meta-info { font-size: 12px; color: var(--text-faint); }
.post-meta .read-more {
  font-size: 13px;
  color: var(--teal);
  font-weight: 500;
}
.post-meta .read-more:hover { color: var(--teal-dark); }

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section-heading {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid var(--border);
}

/* ============================================================
   POST CARD GRID
   ============================================================ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.post-card {
  background: var(--bg-white);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.post-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* Coming soon — not clickable */
.post-card.coming-soon {
  background: var(--coming-bg);
  border: 0.5px dashed var(--coming-border);
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}
.post-card.coming-soon * { pointer-events: none; }

.post-card .card-thumb {
  height: 100px;
  overflow: hidden;
  background: var(--navy-mid);
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-card.coming-soon .card-thumb {
  background: var(--bg-subtle);
}
.post-card .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-thumb-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--teal);
  opacity: 0.35;
}
.coming-soon .card-thumb-dot { background: var(--coming-text); opacity: 0.4; }

.post-card .card-body { padding: 12px 14px 14px; }

.card-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  color: var(--teal-dark);
  background: var(--teal-light);
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 7px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.coming-soon .card-tag {
  background: var(--bg-subtle);
  color: var(--coming-text);
}

.card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  line-height: 1.4;
  margin-bottom: 6px;
}
.coming-soon .card-title { color: var(--coming-text); }

.card-author { font-size: 11px; color: var(--text-faint); }

.coming-soon-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 10px;
  font-style: italic;
  color: var(--coming-text);
  background: #EFEFED;
  padding: 2px 8px;
  border-radius: 3px;
}

/* ============================================================
   PROJECTS SECTION
   ============================================================ */
.projects-section {
  background: var(--bg-white);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px 18px;
  margin-bottom: 28px;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.project-card {
  background: var(--bg-page);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.project-label {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  color: var(--teal-dark);
  background: var(--teal-light);
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.project-label.paused {
  background: #FEF3C7;
  color: #92400E;
}

.project-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 4px;
}
.project-desc { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar { display: flex; flex-direction: column; gap: 18px; }

.sidebar-block {
  background: var(--bg-white);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.sidebar-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 0.5px solid var(--border);
}

/* About block */
.about-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 12px;
}
.about-name { font-size: 14px; font-weight: 500; color: var(--text-dark); margin-bottom: 6px; }
.about-bio { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-bottom: 12px; }
.about-links { display: flex; gap: 8px; flex-wrap: wrap; }
.about-link {
  font-size: 11px;
  color: var(--teal);
  border: 0.5px solid var(--teal);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.about-link:hover { background: var(--teal-light); }

/* Categories block */
.cat-list { display: flex; flex-direction: column; gap: 0; }
.cat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 0.5px solid var(--border-light);
}
.cat-item:last-child { border-bottom: none; padding-bottom: 0; }
.cat-name { font-size: 13px; color: var(--text-mid); }
.cat-count {
  font-size: 11px;
  background: var(--teal-light);
  color: var(--teal-dark);
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 500;
}

/* Popular block */
.pop-list { display: flex; flex-direction: column; gap: 0; }
.pop-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--border-light);
}
.pop-item:last-child { border-bottom: none; padding-bottom: 0; }
.pop-num { font-size: 14px; font-weight: 500; color: var(--border); min-width: 18px; }
.pop-title { font-size: 12px; color: var(--text-mid); line-height: 1.4; }

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-post-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--gap);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  gap: var(--gap);
  align-items: start;
}

.post-hero-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
}

.single-post-header { margin-bottom: 28px; }
.single-post-header .category-badge { margin-bottom: 12px; }
.single-post-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.25;
  margin-bottom: 14px;
}
.single-post-meta {
  font-size: 13px;
  color: var(--text-faint);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.post-content {
  font-size: 16px;
  color: var(--text-mid);
  line-height: 1.8;
}
.post-content h2 { font-size: 22px; font-weight: 600; color: var(--text-dark); margin: 32px 0 12px; }
.post-content h3 { font-size: 18px; font-weight: 600; color: var(--text-dark); margin: 24px 0 10px; }
.post-content p { margin-bottom: 18px; }
.post-content ul, .post-content ol { margin: 0 0 18px 24px; }
.post-content li { margin-bottom: 8px; }
.post-content blockquote {
  border-left: 3px solid var(--teal);
  padding: 12px 20px;
  background: var(--teal-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 24px 0;
  font-style: italic;
  color: var(--teal-dark);
}
body.rtl .post-content blockquote {
  border-left: none;
  border-right: 3px solid var(--teal);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.post-content a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
.post-content img { border-radius: var(--radius-md); margin: 24px 0; }

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  background: var(--navy);
  padding: 18px 24px;
  margin-top: 24px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-copy { font-size: 12px; color: #4A5568; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: 12px; color: var(--teal); }
.footer-links a:hover { color: #5DCAA5; }

/* ============================================================
   RTL ADJUSTMENTS
   ============================================================ */
body.rtl .primary-nav { flex-direction: row-reverse; }
body.rtl .post-meta { flex-direction: row-reverse; }
body.rtl .cat-item { flex-direction: row-reverse; }
body.rtl .pop-item { flex-direction: row-reverse; }
body.rtl .about-links { flex-direction: row-reverse; }
body.rtl .footer-inner { flex-direction: row-reverse; }
body.rtl .post-content ul,
body.rtl .post-content ol { margin: 0 24px 18px 0; }

/* ============================================================
   RESPONSIVE — TABLET (max 860px)
   ============================================================ */
@media (max-width: 860px) {
  :root { --sidebar-w: 220px; --gap: 18px; }
  .primary-nav { gap: 2px; }
  .primary-nav a { font-size: 12px; padding: 6px 7px; }
  .post-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   RESPONSIVE — MOBILE (max 640px)
   ============================================================ */
@media (max-width: 640px) {
  :root { --gap: 16px; }

  #topbar { padding: 7px 16px; }

  .header-inner { padding: 0 16px; height: 52px; }
  .primary-nav { display: none; }
  .menu-toggle { display: flex; }

  #page-wrap {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 20px;
  }

  .sidebar { order: 2; }

  .featured-post .post-thumbnail { height: 180px; }
  .featured-post .post-title { font-size: 18px; }
  .featured-post .post-body { padding: 16px; }

  .post-grid { grid-template-columns: 1fr; gap: 12px; }

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

  .single-post-wrap {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .single-post-title { font-size: 22px; }
  .post-hero-image { height: 200px; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE (max 380px)
   ============================================================ */
@media (max-width: 380px) {
  .site-logo { font-size: 15px; }
  .featured-post .post-title { font-size: 16px; }
  .single-post-title { font-size: 20px; }
}
