/*
Theme Name: Farhan Paal Portfolio
Theme URI: https://farhanpaal.com
Author: Farhan Paal
Author URI: https://farhanpaal.com
Description: Personal portfolio theme with Articles, Journal, Projects, Courses and Books - color-coded content types, secure AJAX likes/cart, and a scrollable date-grouped journal.
Version: 2.3
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: farhan-theme
*/

/* ==========================================================================
   TABLE OF CONTENTS
   1.  Design tokens
   2.  Reset & base
   3.  Buttons & icons
   4.  Header / Nav / Cart
   5.  Hero
   6.  Badges & type colors
   7.  Home bento grid
   8.  Cards (shared archive card)
   9.  Archive headers & listings
   10. Journal timeline
   11. Like button
   12. Share buttons
   13. Article single/archive
   14. Project single/archive
   15. Course & Book single (purchase card)
   16. About page
   17. Single post / page (generic)
   18. Footer
   19. Accessibility
   20. Responsive
   ========================================================================== */

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  --bg: #F7F8FB;
  --surface: #FFFFFF;
  --ink: #12162B;
  --muted: #5B6178;
  --border: #E4E6EF;
  --border-soft: #ECEDF5;

  --accent: #6C5CE7;
  --accent-ink: #4B3FC4;

  /* Per content-type palette */
  --violet: #6C5CE7;   --violet-tint: #F1EEFD;
  --coral:  #E8607A;   --coral-tint:  #FDEEF1;
  --teal:   #14B8A6;   --teal-tint:   #E7FAF7;
  --amber:  #D9932B;   --amber-tint:  #FBF1E1;
  --indigo: #3E5CC9;   --indigo-tint: #EBEFFB;

  --success: #16A34A;  --success-tint: #E7F8EE;
  --danger:  #DC2626;  --danger-tint:  #FDECEC;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --max-width: 1100px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-card: 0 14px 28px -16px rgba(18,22,43,0.16);
  --header-h: 66px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   2. Reset & base
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--ink);
}
p { margin: 0 0 1em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section-wrap { max-width: var(--max-width); margin: 16px auto 64px; padding: 0 24px; }

/* ==========================================================================
   3. Buttons & icons
   ========================================================================== */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-fill { fill: currentColor; stroke: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  border: none;
  cursor: pointer;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); color: #fff; transform: translateY(-1px); }

.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--ink); transform: translateY(-1px); color: var(--ink); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #128a3e; color: #fff; transform: translateY(-1px); }

/* Amber "buy" CTA — visually distinct from the generic dark primary button */
.btn-buy { background: var(--amber); color: #fff; border: 2px solid var(--amber); }
.btn-buy:hover { background: #c07f1c; border-color: #c07f1c; color: #fff; transform: translateY(-1px); }

.btn-code { background: var(--ink); color: #fff; }
.btn-code:hover { background: var(--accent-ink); color: #fff; }
.btn-demo { background: var(--teal); color: #fff; }
.btn-demo:hover { background: #0d9488; color: #fff; }

.btn-block { display: flex; width: 100%; }

/* ==========================================================================
   4. Header / Nav / Cart
   ========================================================================== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
}

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

.header-left { flex-shrink: 0; display: flex; align-items: center; }

.custom-logo-link { display: flex; align-items: center; line-height: 0; }
.custom-logo-link img,
.site-logo,
.header-left img {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}
.site-title { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; margin: 0; }
.site-title a { color: var(--ink); text-decoration: none; }

.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav ul li a {
  display: inline-block;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 999px;
  transition: all 0.2s;
  text-decoration: none;
}
.main-nav ul li a:hover { background: var(--violet-tint); color: var(--violet); }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a { background: var(--ink); color: #fff; }

.main-nav ul li.nav-cta > a,
.main-nav ul li:has(a.nav-contact) > a {
  background: var(--ink);
  color: #fff;
  padding: 9px 20px;
  margin-left: 6px;
}
.main-nav ul li.nav-cta > a:hover,
.main-nav ul li:has(a.nav-contact) > a:hover { background: var(--accent-ink); }

/* ---- Cart ---- */
.header-cart-wrapper { position: relative; display: inline-flex; align-items: center; }
.header-cart {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 12px;
  color: var(--ink); text-decoration: none; position: relative;
  transition: background 0.2s;
}
.header-cart:hover { background: var(--violet-tint); color: var(--violet); }
.cart-icon { width: 21px; height: 21px; }
.cart-count {
  position: absolute; top: 0; right: 0;
  background: var(--amber); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  font-family: var(--font-mono);
}
.cart-count:empty { display: none; }

.mini-cart-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: -10px;
  width: 340px;
  max-width: 90vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(18,22,43,0.18);
  padding: 16px;
  z-index: 1001;
}
.header-cart-wrapper:hover .mini-cart-dropdown,
.header-cart-wrapper:focus-within .mini-cart-dropdown { display: block; }

.mini-cart-inner { max-height: 340px; overflow-y: auto; }
.mini-cart-items { margin-bottom: 12px; }
.mini-cart-empty { text-align: center; color: var(--muted); padding: 20px 0; margin: 0; font-size: 0.92rem; }

.mini-cart-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); align-items: center; }
.mini-cart-item:last-child { border-bottom: none; }
.mini-cart-item-image { width: 48px; height: 48px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: var(--border-soft); }
.mini-cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.mini-cart-item-details { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mini-cart-item-title { font-weight: 600; font-size: 0.88rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-cart-item-quantity { font-size: 0.76rem; color: var(--muted); }
.mini-cart-item-price { font-weight: 700; color: var(--amber); font-size: 0.88rem; font-family: var(--font-mono); }
.mini-cart-remove { font-size: 1.3rem; color: var(--muted); text-decoration: none; padding: 0 4px; line-height: 1; transition: color 0.2s; background: none; border: none; cursor: pointer; }
.mini-cart-remove:hover { color: var(--danger); }

.mini-cart-footer { border-top: 2px solid var(--border-soft); padding-top: 12px; }
.mini-cart-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1rem; margin-bottom: 12px; }
.mini-cart-actions { display: flex; gap: 8px; }
.mini-cart-actions .btn { flex: 1; padding: 10px 12px; border-radius: 8px; font-size: 0.85rem; }

.mobile-cart-link { display: none; }

/* ---- Mobile nav toggle ---- */
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: all 0.25s ease; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 4px; }
  .main-nav ul li a { padding: 12px 16px; border-radius: 10px; }
  .main-nav ul li.nav-cta > a,
  .main-nav ul li:has(a.nav-contact) > a { margin-left: 0; margin-top: 8px; text-align: center; }
  .nav-toggle { display: flex; }
  .header-cart-wrapper { display: none; }
  .mobile-cart-link { display: block; margin-top: 16px; }
}

/* ==========================================================================
   5. Hero — full-bleed, dark, restrained.
   ========================================================================== */
.hero {
  position: relative;
  background-color: #12162B; /* explicit hex fallback in case var() ever fails to load */
  background-color: var(--ink);
  color: rgba(255,255,255,0.92);
  overflow: hidden;
  padding: 148px 24px 120px;
}

.hero::before {
  content: "";
  position: absolute;
  width: 640px; height: 640px;
  border-radius: 50%;
  background: var(--violet);
  filter: blur(160px);
  opacity: 0.28;
  top: -280px; right: -120px;
  pointer-events: none;
}

.hero-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 75%);
  opacity: 0.5;
  pointer-events: none;
}

.hero-inner { position: relative; max-width: var(--max-width); margin: 0 auto; }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 28px;
  display: inline-flex; align-items: center; gap: 8px;
}
.hero-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 0 3px rgba(108,92,231,0.25); }

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 7vw, 6.4rem);
  font-weight: 700; letter-spacing: -0.035em; line-height: 0.98;
  margin-bottom: 32px; color: #fff; max-width: 16ch;
}
.hero-name .name-accent { color: var(--violet); }

.hero-sub { max-width: 46ch; font-size: 1.22rem; line-height: 1.6; color: rgba(255,255,255,0.68); margin-bottom: 48px; font-weight: 400; }

.hero-ctas { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-bottom: 56px; }
.hero-ctas .btn-primary { background: #fff; color: var(--ink); }
.hero-ctas .btn-primary:hover { background: rgba(255,255,255,0.85); color: var(--ink); transform: translateY(-1px); }
.hero-ctas .btn-text {
  font-weight: 600; font-size: 0.95rem; color: rgba(255,255,255,0.8);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 13px 4px; border-bottom: 1px solid transparent;
}
.hero-ctas .btn-text:hover { color: #fff; border-bottom-color: rgba(255,255,255,0.5); }

.hero-stats { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid rgba(255,255,255,0.14); padding-top: 28px; }
.hero-stat { flex: 1; min-width: 140px; padding-right: 28px; color: rgba(255,255,255,0.9); transition: transform 0.15s ease; }
.hero-stat:hover { transform: translateY(-2px); }
.hero-stat-count { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; display: block; margin-bottom: 4px; color: #fff; display:flex; align-items:center; justify-content:center; }
.hero-stat-label { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.04em; color: rgba(255,255,255,0.48); display: flex;  align-items: center;   justify-content: center;}

/* Fades the very bottom of the hero toward --bg so the bento cards below
   (which overlap upward) sit on a soft edge instead of a hard color cut. */
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 140px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

/* ==========================================================================
   6. Badges & type colors
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; letter-spacing: 0.01em;
}
.badge-violet { background: var(--violet-tint); color: var(--violet); }
.badge-coral  { background: var(--coral-tint);  color: var(--coral); }
.badge-teal   { background: var(--teal-tint);   color: var(--teal); }
.badge-amber  { background: var(--amber-tint);  color: var(--amber); }
.badge-indigo { background: var(--indigo-tint); color: var(--indigo); }

.eyebrow-violet { color: var(--violet); }
.eyebrow-coral  { color: var(--coral); }
.eyebrow-teal   { color: var(--teal); }
.eyebrow-amber  { color: var(--amber); }
.eyebrow-indigo { color: var(--indigo); }

.thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.thumb-placeholder span { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; color: rgba(255,255,255,0.92); }
.thumb-violet { background: linear-gradient(135deg, #7C6EF0, #5A47D6); }
.thumb-coral  { background: linear-gradient(135deg, #F0788F, #D64A66); }
.thumb-teal   { background: linear-gradient(135deg, #22D3BF, #0E9C8C); }
.thumb-amber  { background: linear-gradient(135deg, #E7AC4F, #C77E17); }
.thumb-indigo { background: linear-gradient(135deg, #5C77E0, #2E47AD); }

/* ==========================================================================
   7. Home bento grid
   ========================================================================== */
.section-eyebrow { font-family: var(--font-mono); font-size: 0.8rem; margin-bottom: 6px; letter-spacing: 0.05em; }
.section-title { font-size: 1.6rem; margin-bottom: 0; position: relative; display: inline-block; padding-bottom: 10px; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 42px; height: 3px; border-radius: 2px; background: currentColor; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.home-bento {
  max-width: var(--max-width);
  margin: -72px auto 100px;
  padding: 0 24px;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-areas:
    "proj proj proj proj proj proj proj art  art  art  art  art"
    "proj proj proj proj proj proj proj jour jour jour jour jour"
    "crs  crs  crs  crs  crs  crs  bk   bk   bk   bk   bk   bk";
  gap: 20px;
}

.bento-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 32px 32px 30px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.bento-tile:hover { transform: translateY(-3px); }
.bento-tile--projects { grid-area: proj; }
.bento-tile--articles { grid-area: art; }
.bento-tile--journal  { grid-area: jour; }
.bento-tile--courses  { grid-area: crs; }
.bento-tile--books    { grid-area: bk; }

.bento-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.bento-head .section-eyebrow { margin-bottom: 8px; display: inline-flex; align-items: center; gap: 7px; }
.bento-head .section-eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bento-head .section-title { font-size: 1.5rem; padding-bottom: 0; font-weight: 600; }
.bento-head .section-title::after { display: none; }
.bento-viewall { font-size: 0.82rem; font-weight: 600; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; padding-top: 6px; }
.bento-viewall:hover { color: var(--accent); }

.bento-empty { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* flex, not a rigid 2-col grid, so a single project fills the tile
   instead of leaving an empty column of dead white space next to it */
.bento-projects-grid { display: flex; flex-wrap: wrap; gap: 18px; flex: 1; }
.bento-project { flex: 1 1 260px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.bento-project:only-child { flex-basis: 100%; }
.bento-project:only-child .bento-project-thumb { aspect-ratio: auto; flex: 1; min-height: 200px; }
.bento-project:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.bento-project-thumb { aspect-ratio: 16/10; background: var(--border-soft); overflow: hidden; }
.bento-project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bento-project-body { padding: 14px 16px 16px; }
.bento-project-title { font-size: 1rem; margin-bottom: 4px; }
.bento-project-title a { color: var(--ink); }
.bento-project-title a:hover { color: var(--teal); }
.bento-project-excerpt { color: var(--muted); font-size: 0.86rem; margin: 0; }

.bento-list { display: flex; flex-direction: column; flex: 1; }
.bento-list-item { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.bento-list-item:last-child { border-bottom: none; padding-bottom: 0; }
.bento-list-item:first-child { padding-top: 0; }
.bento-list-title { font-size: 0.96rem; margin: 0; line-height: 1.35; }
.bento-list-title a { color: var(--ink); }
.bento-tile--articles .bento-list-title a:hover { color: var(--violet); }
.bento-tile--journal .bento-list-title a:hover { color: var(--coral); }
.bento-list-meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }

.bento-journal-item { display: flex; gap: 10px; }
.bento-journal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--coral); flex-shrink: 0; margin-top: 8px; }
.bento-journal-body { flex: 1; min-width: 0; }

.bento-mini-grid { display: flex; flex-wrap: wrap; gap: 16px; flex: 1; }
.bento-mini-card { flex: 1 1 45%; min-width: 130px; display: flex; flex-direction: column; gap: 8px; }
.bento-mini-thumb { aspect-ratio: 16/10; border-radius: var(--radius-sm); overflow: hidden; background: var(--border-soft); }
.bento-mini-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bento-mini-thumb .thumb-placeholder { width: 100%; height: 100%; }
.bento-mini-thumb .thumb-placeholder span { font-size: 1.5rem; }

/* A lone item gets a horizontal "featured" layout — thumbnail beside the
   text — so it fills the full tile width instead of floating in a small
   fixed-width box with dead space beside it. */
.bento-mini-card:only-child {
  flex-basis: 100%;
  flex-direction: row;
  align-items: center;
  gap: 18px;
}
.bento-mini-card:only-child .bento-mini-thumb {
  width: 120px;
  flex-shrink: 0;
  aspect-ratio: 1;
}
.bento-mini-card:only-child .bento-mini-title { font-size: 1.05rem; }
.bento-mini-card:only-child .bento-mini-price { font-size: 0.9rem; }
.bento-mini-title { font-size: 0.92rem; margin: 0; line-height: 1.3; }
.bento-mini-title a { color: var(--ink); }
.bento-tile--courses .bento-mini-title a:hover { color: var(--amber); }
.bento-tile--books .bento-mini-title a:hover { color: var(--indigo); }
.bento-mini-price { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600; }
.bento-tile--courses .bento-mini-price { color: var(--amber); }
.bento-tile--books .bento-mini-price { color: var(--indigo); }

/* ==========================================================================
   8. Cards (shared archive card)
   ========================================================================== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 24px; margin-top: 26px; }

.card {
  border: 1px solid var(--border);
  border-top: 4px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  display: flex; flex-direction: column; height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card); }
.card[data-accent="violet"]:hover { border-top-color: var(--violet); }
.card[data-accent="coral"]:hover  { border-top-color: var(--coral); }
.card[data-accent="teal"]:hover   { border-top-color: var(--teal); }
.card[data-accent="amber"]:hover  { border-top-color: var(--amber); }
.card[data-accent="indigo"]:hover { border-top-color: var(--indigo); }

.card-thumb-link { display: block; }
.card-thumb { aspect-ratio: 16/9; overflow: hidden; background: var(--border-soft); position: relative; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 1.06rem; margin-bottom: 6px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); }
.card-desc { color: var(--muted); font-size: 0.92rem; flex: 1; margin-bottom: 16px; }
.card-meta { font-size: 0.8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.card-meta .article-cats { color: var(--violet); font-weight: 500; }

.card-price { margin: 8px 0 4px; }
.card-price .price-tag {
  font-size: 0.9rem; font-weight: 600; padding: 3px 12px; border-radius: 999px;
  background: var(--amber-tint); color: var(--amber); display: inline-block;
}

.card-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.card-actions .btn { flex: 1; font-size: 0.85rem; padding: 10px 16px; min-width: 120px; }

/* ==========================================================================
   9. Archive headers & listings
   ========================================================================== */
.archive-header { max-width: var(--max-width); margin: 0 auto; padding: 60px 24px 8px; }
.archive-header h1 { font-size: 2.3rem; }
.archive-header p { color: var(--muted); font-size: 1.05rem; }

.post-list { max-width: var(--max-width); margin: 0 auto; padding: 16px 24px 64px; }
.post-list-item { padding: 28px 0; border-bottom: 1px solid var(--border-soft); }
.post-list-item h2 { font-size: 1.4rem; margin-bottom: 8px; }
.post-list-item h2 a { color: var(--ink); }
.post-list-item h2 a:hover { color: var(--accent); }

/* ==========================================================================
   10. Journal timeline
   ========================================================================== */
.journal-timeline { max-width: 760px; }
.journal-day-group { margin-bottom: 36px; }
.journal-day-heading {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
  position: sticky; top: var(--header-h); background: var(--bg); padding: 10px 0; z-index: 5;
}
.journal-day-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); flex-shrink: 0; }
.journal-day-label { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 500; color: var(--ink); text-transform: uppercase; letter-spacing: 0.03em; }

.journal-entry { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--coral); border-radius: var(--radius-sm); padding: 22px 24px; margin-bottom: 16px; }
.journal-entry-time { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); margin-bottom: 6px; }
.journal-entry-title { font-size: 1.2rem; margin-bottom: 8px; }
.journal-entry-title a { color: var(--ink); }
.journal-entry-title a:hover { color: var(--coral); }
.journal-entry-desc { color: var(--muted); font-size: 0.98rem; margin-bottom: 14px; }
.journal-entry-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--border-soft); }

/* ==========================================================================
   11. Like button
   ========================================================================== */
.like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: all 0.15s ease;
}
.like-btn .icon { width: 16px; height: 16px; }
.like-btn:hover { border-color: var(--coral); color: var(--coral); }
.like-btn.is-liked { background: var(--coral-tint); border-color: var(--coral); color: var(--coral); }
.like-btn.is-liked .icon { fill: currentColor; }

/* ==========================================================================
   12. Share buttons
   ========================================================================== */
.share-buttons { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.share-label { font-size: 0.8rem; color: var(--muted); margin-right: 2px; font-weight: 600; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: all 0.15s ease;
}
.share-btn .icon { width: 16px; height: 16px; }
.share-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.share-btn.copy-link-btn { width: auto; padding: 0 14px; gap: 6px; font-size: 0.78rem; font-weight: 600; }
.share-btn.copy-link-btn.is-copied { border-color: var(--success); color: var(--success); background: var(--success-tint); }

/* ==========================================================================
   13. Article single/archive
   ========================================================================== */
.article-hero { padding: 60px 0 30px; background: var(--surface); border-bottom: 1px solid var(--border-soft); }
.article-hero-content { max-width: 780px; margin: 0 auto; }
.article-categories { margin-bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.article-cat { display: inline-block; background: var(--violet-tint); color: var(--violet); font-size: 0.75rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.article-hero h1 { font-size: 2.8rem; line-height: 1.2; margin-bottom: 16px; }
.article-meta { display: flex; align-items: center; gap: 16px; font-size: 0.9rem; color: var(--muted); flex-wrap: wrap; }
.article-author { display: flex; align-items: center; gap: 8px; }
.article-author .author-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }

.article-featured-image { margin: 40px 0 30px; }
.article-featured-image img { width: 100%; max-height: 500px; object-fit: cover; border-radius: var(--radius); }

.article-body { max-width: 780px; margin: 0 auto; padding: 0 24px 60px; }
.article-content { font-size: 1.1rem; line-height: 1.8; }
.article-content h2 { margin-top: 2em; }
.article-content h3 { margin-top: 1.5em; }
.article-content img { border-radius: var(--radius); margin: 30px 0; }

.article-source { margin: 40px 0 30px; }

.article-share { display: flex; align-items: center; gap: 10px; padding: 20px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); margin: 30px 0; flex-wrap: wrap; }

.author-bio { display: flex; align-items: center; gap: 20px; background: var(--bg); padding: 24px; border-radius: var(--radius); margin: 30px 0; }
.author-bio .author-avatar-large { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-bio .author-info h3 { margin-bottom: 4px; font-size: 1.1rem; }
.author-bio .author-info p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.related-articles { background: var(--bg); padding: 40px 0 60px; }
.related-articles .related-title { font-size: 1.6rem; margin-bottom: 20px; }

/* ==========================================================================
   14. Project single/archive
   ========================================================================== */
.projects-list { max-width: var(--max-width); margin: 0 auto; }
.project-row {
  display: grid; grid-template-columns: 1fr 2fr; gap: 30px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 30px; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.project-row:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.project-row-image { height: 100%; min-height: 220px; background: var(--border-soft); }
.project-row-image img { width: 100%; height: 100%; object-fit: cover; }
.project-row-content { padding: 30px 30px 30px 0; }
.project-row-title { font-size: 1.6rem; margin: 8px 0 12px; }
.project-row-title a { color: var(--ink); }
.project-row-title a:hover { color: var(--teal); }
.project-row-excerpt { color: var(--muted); font-size: 1rem; margin-bottom: 20px; }
.project-row-actions .btn { padding: 12px 28px; }

.single-project .project-hero-image { margin: 0 0 30px; }
.single-project .project-hero-image img { width: 100%; max-height: 500px; object-fit: cover; border-radius: var(--radius); }
.single-project .project-content { max-width: 780px; margin: 0 auto; padding: 0 24px 60px; }
.single-project .project-header { margin-bottom: 20px; }
.single-project .project-header h1 { font-size: 2.4rem; margin-top: 8px; }
.single-project .project-description { font-size: 1.1rem; line-height: 1.8; }
.single-project .project-description h2,
.single-project .project-description h3 { margin-top: 1.8em; }
.single-project .project-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--border-soft); }
.single-project .project-actions .btn { padding: 14px 32px; font-size: 1rem; font-weight: 600; }

/* ==========================================================================
   15. Course & Book single (shared purchase card)
   ========================================================================== */
.single-course .course-content,
.single-book .book-content {
  display: grid; grid-template-columns: 2fr 1fr; gap: 40px; margin-top: 30px;
}
.single-course .course-header,
.single-book .book-header { margin-bottom: 20px; }
.single-course .course-header h1,
.single-book .book-header h1 { font-size: 2.4rem; margin-top: 8px; }

.single-course .course-featured-image,
.single-book .book-featured-image { border-radius: var(--radius); overflow: hidden; margin-bottom: 30px; }
.single-course .course-featured-image img,
.single-book .book-featured-image img { width: 100%; height: auto; display: block; }

.single-course .course-description,
.single-book .book-description { font-size: 1.1rem; line-height: 1.8; }
.single-course .course-description h2, .single-course .course-description h3,
.single-book .book-description h2, .single-book .book-description h3 { margin-top: 1.8em; }

.single-course .course-sidebar,
.single-book .book-sidebar { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }

.purchase-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-card); }
.purchase-card h3 { font-size: 1.2rem; margin-bottom: 16px; font-weight: 600; }

.price-display { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); margin-bottom: 18px; }
.price-label { color: var(--muted); font-size: 0.9rem; }
.price-amount { font-size: 1.8rem; font-weight: 700; color: var(--indigo); font-family: var(--font-display); }

.purchase-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.purchase-actions .btn { padding: 14px 20px; font-size: 1rem; width: 100%; }

.already-purchased { margin-top: 12px; color: var(--success); font-weight: 600; text-align: center; background: var(--success-tint); padding: 10px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; gap: 6px; }
.out-of-stock, .no-action { color: var(--muted); text-align: center; font-size: 0.95rem; background: var(--border-soft); padding: 14px; border-radius: var(--radius-sm); }
.course-meta { margin-top: 18px; }
.course-meta h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 8px; }

/* ==========================================================================
   16. About page
   ========================================================================== */
.about-page { padding: 40px 0 60px; }
.about-hero { display: grid; grid-template-columns: 2fr 1fr; gap: 50px; align-items: center; margin-bottom: 50px; padding-bottom: 40px; border-bottom: 1px solid var(--border-soft); }
.about-hero-content h1 { font-size: 3rem; margin: 8px 0 12px; }
.about-tagline { font-size: 1.2rem; color: var(--muted); margin-bottom: 24px; max-width: 90%; }
.about-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.about-actions .btn { padding: 12px 28px; }

.about-hero-image { width: 100%; max-width: 260px; border-radius: 50%; overflow: hidden; aspect-ratio: 1; background: var(--border-soft); border: 4px solid var(--surface); box-shadow: 0 8px 30px rgba(0,0,0,0.1); justify-self: end; }
.about-hero-image img { width: 100%; height: 100%; object-fit: cover; }

.about-bio { max-width: 780px; margin: 0 auto 50px; font-size: 1.1rem; line-height: 1.8; }
.about-bio h2, .about-bio h3 { margin-top: 1.8em; }

.about-status { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--violet); border-radius: var(--radius); padding: 30px 36px; margin: 40px 0; }
.about-status h2 { font-size: 1.3rem; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.about-status .status-content { color: var(--muted); font-size: 1rem; }
.about-status .status-content p:last-child { margin-bottom: 0; }

.about-skills { margin: 40px 0; }
.about-skills h2 { font-size: 1.3rem; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.skills-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-tag { background: var(--violet-tint); color: var(--violet); padding: 7px 16px; border-radius: 999px; font-size: 0.9rem; font-weight: 500; }

.about-availability { margin: 30px 0; }
.availability-badge { display: inline-flex; align-items: center; gap: 10px; padding: 10px 24px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; }
.availability-badge.available { background: var(--success-tint); color: var(--success); }
.availability-badge.unavailable { background: var(--danger-tint); color: var(--danger); }
.availability-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: currentColor; }

.about-social { margin: 40px 0 0; padding-top: 30px; border-top: 1px solid var(--border-soft); text-align: center; }
.about-social h3 { font-size: 1.1rem; margin-bottom: 16px; color: var(--muted); }
.social-links { display: flex; justify-content: center; gap: 16px; }
.social-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  text-decoration: none; transition: all 0.2s; color: var(--ink);
}
.social-link .icon { width: 20px; height: 20px; }
.social-link:hover { border-color: var(--violet); color: var(--violet); transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* ==========================================================================
   17. Single post / page (generic)
   ========================================================================== */
.single-content { max-width: 720px; margin: 0 auto; padding: 56px 24px 80px; }
.single-content .post-meta { font-family: var(--font-mono); color: var(--muted); font-size: 0.8rem; margin-bottom: 20px; text-transform: uppercase; }
.single-content h1 { font-size: 2.15rem; margin-bottom: 16px; }
.single-thumb { border-radius: var(--radius); overflow: hidden; margin: 20px 0 28px; aspect-ratio: 16/9; }
.single-thumb img { width: 100%; height: 100%; object-fit: cover; }
.single-body { font-size: 1.06rem; }
.single-body img { border-radius: var(--radius); margin: 24px 0; }
.single-body h2 { margin-top: 1.6em; }

/* ==========================================================================
   18. Footer
   ========================================================================== */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--muted); font-size: 0.88rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-nav { display: flex; gap: 18px; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--accent); }

/* ==========================================================================
   19. Accessibility helpers
   ========================================================================== */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  z-index: 3000;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  font-size: 0.9rem;
}
.skip-link:focus {
  left: 0;
  top: 0;
}

@keyframes farhan-bounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.cart-count.bounce { animation: farhan-bounce 0.4s ease; }
.add-to-cart-btn.processing, .buy-now-btn.processing { opacity: 0.7; cursor: not-allowed; }
.add-to-cart-btn.in-cart { background: var(--success-tint); border-color: var(--success); color: var(--success); }

/* ==========================================================================
   20. Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero { padding: 96px 20px 72px; }
  .hero-name { max-width: 100%; }

  .home-bento {
    grid-template-columns: 1fr;
    grid-template-areas: "proj" "art" "jour" "crs" "bk";
    margin-top: -40px;
  }
  .bento-tile { padding: 28px 22px 24px; }

  .featured-article, .project-row, .single-course .course-content, .single-book .book-content, .about-hero {
    grid-template-columns: 1fr !important;
  }
  .single-course .course-sidebar, .single-book .book-sidebar { position: static; }
  .about-hero-image { max-width: 220px; justify-self: center; }
  .about-hero { text-align: center; gap: 30px; }
}

@media (max-width: 720px) {
  .archive-header { padding: 40px 24px 8px; }
  .journal-day-heading { top: var(--header-h); }
  .journal-entry { padding: 18px; }
  .article-hero h1 { font-size: 2.2rem; }
  .single-course .course-header h1, .single-book .book-header h1, .single-project .project-header h1 { font-size: 2rem; }
}

@media (max-width: 640px) {
	
  .hero { padding: 72px 20px 56px; }
  .hero-stats { flex-wrap: wrap; row-gap: 20px; }
  .hero-stat { min-width: 0; padding-right: 12px; }
  .hero-ctas { flex-direction: column; align-items: flex-start; gap: 18px; }
  .hero-stat-count{font-size:20px;}
}

@media (max-width: 560px) {
  .bento-projects-grid, .bento-mini-grid { grid-template-columns: 1fr; }
  .bento-tile { padding: 22px 20px 20px; }
  .card-actions { flex-direction: column; }
  .card-actions .btn { min-width: 100%; }
  .about-actions .btn { width: 100%; }
}