/* ============================================================
   SHAMURAI — design tokens
   ============================================================ */
:root{
  --bg:#FAF8F3;
  --surface:#F1EDE4;
  --surface-2:#EAE4D8;
  --text:#2B2A27;
  --text-soft:#6B675E;
  --accent:#4A6B4D;
  --accent-soft:#DDE6DC;
  --gold:#C9A24B;
  --line:#E2DCCE;
  --radius:18px;
  --radius-sm:10px;
  --shadow:0 8px 30px -12px rgba(43,42,39,0.15);
  --serif:'Fraunces', 'Vazirmatn', serif;
  --sans:'Inter', 'Vazirmatn', sans-serif;
  --fa:'Vazirmatn', 'Inter', sans-serif;
  --ease:cubic-bezier(.22,.61,.36,1);
}
html[data-theme="dark"]{
  --bg:#14161A;
  --surface:#1D2024;
  --surface-2:#25292E;
  --text:#ECEAE2;
  --text-soft:#9B9890;
  --accent:#7FA87F;
  --accent-soft:#243128;
  --gold:#D8B968;
  --line:#2E3237;
  --shadow:0 8px 30px -12px rgba(0,0,0,0.5);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--fa);
  overflow-x:hidden;
  transition:background .4s var(--ease), color .4s var(--ease);
  -webkit-font-smoothing:antialiased;
}
html[dir="ltr"] body{ font-family:var(--sans); }
h1,h2,h3{ font-family:var(--serif); font-weight:600; margin:0; letter-spacing:-0.01em; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3{ font-family:var(--fa); font-weight:700; }
p{ line-height:1.85; color:var(--text-soft); }
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
button{ font-family:inherit; cursor:pointer; }
::selection{ background:var(--accent-soft); color:var(--accent); }

.trail-bg{ position:absolute; top:0; left:50%; transform:translateX(-50%); width:100%; height:100%; z-index:0; pointer-events:none; opacity:.5; }
.trail-path{ fill:none; stroke:var(--line); stroke-width:.4; vector-effect:non-scaling-stroke; }

/* ---------- nav ---------- */
.nav{ position:sticky; top:0; z-index:50; background:color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter:blur(14px); border-bottom:1px solid var(--line); }
.nav-inner{ max-width:1100px; margin:0 auto; padding:14px 20px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.brand{ display:flex; align-items:center; gap:8px; }
.brand-mark{ display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:50%; background:var(--accent); color:var(--bg); font-size:15px; line-height:1; }
.brand-logo{ width:30px; height:30px; border-radius:50%; object-fit:cover; }
.brand-name{ font-family:var(--serif); font-weight:600; font-size:1.05rem; letter-spacing:.02em; }
.nav-links{ display:none; gap:26px; font-size:.92rem; color:var(--text-soft); }
.nav-links a:hover{ color:var(--accent); }
@media(min-width:760px){ .nav-links{ display:flex; } }

.nav-controls{ display:flex; align-items:center; gap:10px; }
.icon-btn{ width:36px; height:36px; border-radius:50%; border:1px solid var(--line); background:var(--surface); display:flex; align-items:center; justify-content:center; color:var(--text); transition:transform .3s var(--ease), background .3s; }
.icon-btn:hover{ transform:rotate(20deg); }
.icon-btn svg{ width:17px; height:17px; }
html[data-theme="dark"] .icon-sun{ display:none; }
html[data-theme="dark"] .icon-moon{ display:block !important; }
.lang-btn{ border:1px solid var(--line); background:var(--surface); color:var(--text); padding:7px 13px; border-radius:20px; font-size:.82rem; font-weight:600; letter-spacing:.03em; transition:background .3s, color .3s; }
.lang-btn:hover{ background:var(--accent); color:var(--bg); border-color:var(--accent); }

/* hamburger menu button — glowing neon accent, sits top-right (or top-left in LTR) */
.menu-btn{
  width:38px; height:38px; border-radius:50%; border:1px solid var(--line);
  background:var(--surface); display:flex; align-items:center; justify-content:center;
  color:var(--accent); position:relative; transition:transform .3s var(--ease);
}
.menu-btn .menu-icon{ width:18px; height:18px; filter:drop-shadow(0 0 3px color-mix(in srgb, var(--accent) 70%, transparent)); }
.menu-btn::after{
  content:""; position:absolute; inset:-3px; border-radius:50%;
  box-shadow:0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent),
             0 0 12px 2px color-mix(in srgb, var(--accent) 55%, transparent);
  animation:menuGlow 2.6s ease-in-out infinite;
  pointer-events:none;
}
@keyframes menuGlow{
  0%,100%{ opacity:.55; }
  50%{ opacity:1; }
}
.menu-btn:hover{ transform:scale(1.06); }

/* ---------- drawer menu ---------- */
.drawer-backdrop{
  position:fixed; inset:0; background:rgba(20,20,18,.5); backdrop-filter:blur(3px);
  z-index:110; display:none;
}
.drawer-backdrop:not([hidden]){ display:block; animation:fadeIn .3s var(--ease) both; }
@keyframes fadeIn{ from{opacity:0} to{opacity:1} }

.drawer{
  position:fixed; top:0; bottom:0; inset-inline-start:0; width:min(320px, 84vw);
  background:var(--bg); z-index:120; padding:22px 20px; border-inline-end:1px solid var(--line);
  box-shadow:0 0 40px rgba(0,0,0,.18);
  display:none; flex-direction:column;
  transform:translateX(-100%);
}
html[dir="rtl"] .drawer{ transform:translateX(100%); }
.drawer:not([hidden]){ display:flex; }
.drawer.drawer-open{ animation:drawerIn .38s var(--ease) forwards; }
.drawer.drawer-closing{ animation:drawerOut .28s var(--ease) forwards; }
@keyframes drawerIn{ from{ transform:translateX(-100%); opacity:.6 } to{ transform:translateX(0); opacity:1 } }
@keyframes drawerOut{ from{ transform:translateX(0); opacity:1 } to{ transform:translateX(-100%); opacity:.4 } }
html[dir="rtl"] .drawer.drawer-open{ animation-name:drawerInRtl; }
html[dir="rtl"] .drawer.drawer-closing{ animation-name:drawerOutRtl; }
@keyframes drawerInRtl{ from{ transform:translateX(100%); opacity:.6 } to{ transform:translateX(0); opacity:1 } }
@keyframes drawerOutRtl{ from{ transform:translateX(0); opacity:1 } to{ transform:translateX(100%); opacity:.4 } }

.drawer-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; }
.drawer-title{ font-family:var(--serif); font-weight:600; font-size:1.15rem; }
.drawer-close{ width:32px; height:32px; border-radius:50%; border:1px solid var(--line); background:var(--surface); color:var(--text); }
.drawer-links{ display:flex; flex-direction:column; gap:4px; overflow-y:auto; }
.drawer-links a{
  display:flex; align-items:center; gap:12px; padding:13px 14px; border-radius:12px;
  font-size:.96rem; color:var(--text); transition:background .2s, transform .2s var(--ease), color .2s;
}
.drawer-links a:hover{ background:var(--accent-soft); color:var(--accent); transform:translateX(3px); }
html[dir="rtl"] .drawer-links a:hover{ transform:translateX(-3px); }
.drawer-links .drawer-icon{ font-size:1.05rem; width:22px; text-align:center; flex-shrink:0; }

/* ---------- hero ---------- */
.hero{ position:relative; min-height:88vh; display:flex; align-items:flex-end; overflow:hidden; }
.hero-media{ position:absolute; inset:0; }
.hero-img{ width:100%; height:100%; object-fit:cover; }
.hero-scrim{ position:absolute; inset:0; background:linear-gradient(180deg, rgba(20,22,26,.05) 0%, rgba(20,22,26,.55) 78%, rgba(20,22,26,.78) 100%); }
.hero-content{ position:relative; z-index:2; color:#F5F3EC; padding:0 24px 64px; max-width:720px; margin:0 auto; width:100%; animation:rise 1s var(--ease) both; }
@keyframes rise{ from{ opacity:0; transform:translateY(18px);} to{opacity:1; transform:none;} }
.eyebrow{ font-size:.78rem; letter-spacing:.14em; text-transform:uppercase; color:var(--gold); margin:0 0 10px; font-weight:600; }
.hero .eyebrow{ color:#E9DDB8; }
.hero-title{ font-size:clamp(2.6rem,9vw,4.2rem); margin:0 0 10px; }
.hero-tagline{ font-size:clamp(1.05rem,3vw,1.3rem); color:#E7E4D8; margin:0 0 26px; max-width:38ch; }
.hero-day{ display:inline-flex; align-items:center; gap:10px; margin-bottom:26px; background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.25); padding:7px 14px 7px 8px; border-radius:30px; font-size:.85rem; backdrop-filter:blur(6px); }
html[dir="rtl"] .hero-day{ padding:7px 8px 7px 14px; }
.day-ring{ width:26px; height:26px; transform:rotate(-90deg); }
.ring-track{ fill:none; stroke:rgba(255,255,255,.25); stroke-width:3; }
.ring-fill{ fill:none; stroke:var(--gold); stroke-width:3; stroke-linecap:round; stroke-dasharray:119; stroke-dashoffset:119; transition:stroke-dashoffset 1s var(--ease); }
.btn-primary{ display:inline-block; background:var(--accent); color:#fff; padding:13px 28px; border-radius:30px; font-weight:600; font-size:.95rem; transition:transform .25s var(--ease), box-shadow .25s; box-shadow:0 10px 24px -8px rgba(74,107,77,.55); }
.btn-primary:hover{ transform:translateY(-2px); }

/* ---------- sections ---------- */
.section{ position:relative; z-index:1; max-width:1100px; margin:0 auto; padding:88px 22px; }
.section.alt{ background:var(--surface); border-radius:32px; max-width:1140px; }
.section-head{ margin-bottom:40px; max-width:640px; }
.section-head h2{ font-size:clamp(1.7rem,4vw,2.3rem); margin-bottom:10px; }
.section-sub{ margin:0; }
.section.contact{ text-align:center; }
.section.contact .section-head{ margin-left:auto; margin-right:auto; }

.journey-groups{ display:flex; flex-direction:column; gap:36px; }
.journey-group-label{ font-size:.8rem; color:var(--text-soft); letter-spacing:.08em; text-transform:uppercase; margin-bottom:14px; font-weight:600; }
.day-rail{ display:flex; gap:14px; overflow-x:auto; padding-bottom:10px; scroll-snap-type:x proximity; }
.day-rail::-webkit-scrollbar{ height:5px; }
.day-rail::-webkit-scrollbar-thumb{ background:var(--line); border-radius:10px; }
.day-card{ scroll-snap-align:start; flex:0 0 auto; width:230px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:18px; transition:transform .3s var(--ease), box-shadow .3s var(--ease); cursor:pointer; }
.section.alt .day-card{ background:var(--bg); }
.day-card:hover{ transform:translateY(-4px); box-shadow:var(--shadow); }
.day-card .day-num{ font-family:var(--serif); font-size:1.5rem; color:var(--accent); margin-bottom:4px; }
.day-card .day-title{ font-weight:600; margin-bottom:8px; font-size:.95rem; }
.day-card .day-meta{ font-size:.78rem; color:var(--text-soft); }
.day-card .post-count{ display:inline-block; margin-top:10px; font-size:.74rem; padding:3px 9px; border-radius:20px; background:var(--accent-soft); color:var(--accent); font-weight:600; }

.cards-grid{ display:grid; grid-template-columns:1fr; gap:18px; }
@media(min-width:640px){ .cards-grid{ grid-template-columns:repeat(2,1fr); } }
@media(min-width:960px){ .cards-grid{ grid-template-columns:repeat(3,1fr); } }
.card{ background:var(--bg); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; transition:transform .35s var(--ease), box-shadow .35s var(--ease); display:flex; flex-direction:column; cursor:pointer; }
.section.alt .card{ background:var(--surface); }
.card:hover{ transform:translateY(-5px); box-shadow:var(--shadow); }
.card-media{ aspect-ratio:16/10; background:var(--surface-2); overflow:hidden; }
.card-media img{ width:100%; height:100%; object-fit:cover; }
.card-body{ padding:18px 20px 20px; flex:1; display:flex; flex-direction:column; gap:8px; }
.card-title{ font-weight:600; font-size:1.02rem; }
.card-desc{ font-size:.88rem; margin:0; }
.card-foot{ margin-top:auto; display:flex; align-items:center; justify-content:space-between; font-size:.78rem; color:var(--text-soft); }
.star{ color:var(--gold); }
.badge{ font-size:.72rem; padding:3px 10px; border-radius:20px; font-weight:600; }
.badge.active{ background:var(--accent-soft); color:var(--accent); }
.badge.completed{ background:#EFE3C4; color:#8A6B1F; }
.badge.paused{ background:var(--surface-2); color:var(--text-soft); }
.progress-track{ height:5px; background:var(--surface-2); border-radius:10px; overflow:hidden; margin-top:6px; }
.progress-fill{ height:100%; background:var(--accent); border-radius:10px; transition:width .6s var(--ease); }

.about-text{ font-size:1.05rem; max-width:620px; }
.section.contact .about-text{ margin-left:auto; margin-right:auto; }

.footer{ text-align:center; padding:50px 20px 70px; color:var(--text-soft); font-size:.85rem; }
.footer .brand-mark.small{ margin:0 auto 10px; }

.newsletter{ text-align:center; }
.newsletter-form{ display:flex; gap:10px; max-width:380px; margin:20px auto 0; }
.newsletter-form input{ flex:1; padding:12px 16px; border-radius:30px; border:1px solid var(--line); background:var(--surface); color:var(--text); }
.newsletter-form button{ background:var(--accent); color:#fff; border:none; padding:12px 20px; border-radius:30px; font-weight:600; }

/* ---------- post modal ----------
   FIX (was C-1-related bug): the old rule set display:flex unconditionally,
   which beat the browser's default [hidden]{display:none} rule by source
   order — so the modal showed up empty all the time, even before any post
   was opened. Now it's display:none by default and only display:flex when
   NOT hidden. */
.modal-backdrop{
  position:fixed; inset:0; background:rgba(20,20,18,.55); backdrop-filter:blur(4px);
  z-index:100; display:none; align-items:flex-end; justify-content:center;
}
.modal-backdrop:not([hidden]){ display:flex; }
@media(min-width:760px){ .modal-backdrop{ align-items:center; } }
.modal{ background:var(--bg); width:100%; max-width:640px; max-height:88vh; overflow-y:auto; border-radius:24px 24px 0 0; padding:30px 26px 40px; position:relative; animation:slideup .4s var(--ease) both; }
@media(min-width:760px){ .modal{ border-radius:24px; } }
@keyframes slideup{ from{ transform:translateY(30px); opacity:0;} to{transform:none; opacity:1;} }
.modal-close{ position:absolute; top:16px; inset-inline-end:16px; width:34px; height:34px; border-radius:50%; border:1px solid var(--line); background:var(--surface); color:var(--text); }
.modal-post-title{ font-size:1.4rem; margin:6px 0 6px; padding-inline-end:40px; }
.modal-meta{ font-size:.8rem; color:var(--text-soft); margin-bottom:18px; display:flex; gap:14px; flex-wrap:wrap; }
.modal-body-text{ white-space:pre-wrap; color:var(--text); line-height:2; }
.modal-body-text mark{ background:var(--accent-soft); color:var(--accent); padding:0 4px; border-radius:4px; }
.modal-media{ display:grid; gap:10px; margin:16px 0; grid-template-columns:1fr; }
.modal-media img, .modal-media video{ width:100%; border-radius:14px; }
.modal-actions{ display:flex; gap:10px; margin:22px 0 8px; }
.like-btn{ display:flex; align-items:center; gap:6px; border:1px solid var(--line); background:var(--surface); padding:8px 16px; border-radius:30px; font-size:.85rem; font-weight:600; color:var(--text); transition:background .25s; }
.like-btn:hover{ background:var(--accent-soft); color:var(--accent); }
.like-btn[disabled]{ opacity:.55; cursor:default; }

/* day-posts list modal (when a day has more than one post) */
.day-posts-list{ display:flex; flex-direction:column; gap:10px; margin-top:18px; }
.day-post-row{
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  padding:13px 16px; border:1px solid var(--line); border-radius:14px; background:var(--surface);
  cursor:pointer; transition:transform .2s var(--ease), background .2s;
}
.day-post-row:hover{ transform:translateX(3px); background:var(--accent-soft); }
html[dir="rtl"] .day-post-row:hover{ transform:translateX(-3px); }
.day-post-row .dp-title{ font-weight:600; font-size:.92rem; }
.day-post-row .dp-meta{ font-size:.76rem; color:var(--text-soft); }

.comments{ margin-top:26px; border-top:1px solid var(--line); padding-top:22px; }
.comments h4{ font-family:var(--sans); font-size:.95rem; margin-bottom:14px; }
.comment{ padding:12px 0; border-bottom:1px solid var(--line); }
.comment.reply{ margin-inline-start:24px; opacity:.92; }
.comment-head{ display:flex; justify-content:space-between; font-size:.82rem; margin-bottom:4px; }
.comment-name{ font-weight:600; }
.comment-name.admin{ color:var(--accent); }
.comment-date{ color:var(--text-soft); }
.comment-content{ font-size:.9rem; color:var(--text); margin:0 0 8px; }
.comment-reacts{ display:flex; gap:14px; font-size:.78rem; color:var(--text-soft); }
.comment-reacts button{ background:none; border:none; color:inherit; display:flex; align-items:center; gap:4px; }
.comment-reacts button:hover{ color:var(--accent); }
.comment-reacts button[disabled]{ opacity:.5; cursor:default; }
.comment-form{ display:flex; flex-direction:column; gap:8px; margin-top:16px; }
.comment-form input, .comment-form textarea{ width:100%; padding:11px 14px; border-radius:12px; border:1px solid var(--line); background:var(--surface); color:var(--text); font-family:inherit; font-size:.9rem; }
.comment-form textarea{ min-height:70px; resize:vertical; }
.comment-form button{ align-self:flex-start; background:var(--accent); color:#fff; border:none; padding:10px 20px; border-radius:24px; font-weight:600; font-size:.85rem; }

.empty-note{ color:var(--text-soft); font-size:.9rem; padding:20px 0; }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.001ms !important; transition-duration:.001ms !important; }
}
