/* =================================================================
   Affilix — Premium WordPress Theme
   Design system inspired by modern Medium-style magazine layouts.
   ================================================================= */

:root {
  --ax-bg:           #ffffff;
  --ax-surface:      #ffffff;
  --ax-surface-2:    #f6f6f4;
  --ax-text:         #0f0f10;
  --ax-text-muted:   #6b6b73;
  --ax-text-soft:    #8a8a92;
  --ax-border:       #ececec;
  --ax-border-soft:  #f0f0ee;
  --ax-accent:       #22c55e;
  --ax-accent-2:     #16a34a;
  --ax-chip-bg:      #eef2f6;
  --ax-chip-text:    #1f2937;
  --ax-news-bg:      #4cc1ff;
  --ax-news-text:    #ffffff;
  --ax-card-radius:  16px;
  --ax-pill-radius:  999px;
  --ax-shadow:       0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(15,15,16,.04);
  --ax-font-sans:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ax-font-display: 'Playfair Display', Georgia, serif;
  --ax-sidenav-w:    240px;
  --ax-rsidebar-w:   340px;
  --ax-topbar-h:     72px;
}

html[data-theme="dark"], .dark-mode {
  --ax-bg:           #0e0f12;
  --ax-surface:      #15171c;
  --ax-surface-2:    #1c1f26;
  --ax-text:         #f4f5f7;
  --ax-text-muted:   #a8acb6;
  --ax-text-soft:    #7e828c;
  --ax-border:       #232730;
  --ax-border-soft:  #1c1f26;
  --ax-chip-bg:      #232730;
  --ax-chip-text:    #e6e8ee;
  --ax-shadow:       0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --ax-bg:#0e0f12; --ax-surface:#15171c; --ax-surface-2:#1c1f26;
    --ax-text:#f4f5f7; --ax-text-muted:#a8acb6; --ax-text-soft:#7e828c;
    --ax-border:#232730; --ax-border-soft:#1c1f26;
    --ax-chip-bg:#232730; --ax-chip-text:#e6e8ee;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ax-font-sans);
  background: var(--ax-bg);
  color: var(--ax-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ax-accent-2); }
img { max-width: 100%; height: auto; display: block; }

/* ===== Topbar ===== */
.ax-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  height: var(--ax-topbar-h);
  padding: 0 22px;
  background: var(--ax-surface);
  border-bottom: 1px solid var(--ax-border-soft);
}
.ax-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: transparent; border: 1px solid transparent;
  color: var(--ax-text); cursor: pointer; transition: all .15s ease;
}
.ax-iconbtn:hover { background: var(--ax-surface-2); }
.ax-logo { display: inline-flex; align-items: center; color: var(--ax-text); }
.ax-logo svg { display: block; }
.ax-search {
  flex: 1; max-width: 520px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--ax-surface-2);
  border-radius: var(--ax-pill-radius);
  color: var(--ax-text-muted);
}
.ax-search input {
  flex: 1; border: 0; background: transparent; outline: none;
  color: var(--ax-text); font: inherit;
}
.ax-search input::placeholder { color: var(--ax-text-soft); }
.ax-topbar__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.ax-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--ax-pill-radius);
  font-weight: 600; font-size: 14px; line-height: 1;
  border: 1px solid var(--ax-border); background: var(--ax-surface); color: var(--ax-text);
  cursor: pointer; transition: all .15s ease;
}
.ax-btn:hover { transform: translateY(-1px); box-shadow: var(--ax-shadow); }
.ax-btn--write { border-color: var(--ax-text); }
.ax-btn--primary {
  background: var(--ax-accent); border-color: var(--ax-accent); color: #fff;
}
.ax-btn--primary:hover { background: var(--ax-accent-2); border-color: var(--ax-accent-2); color:#fff; }

/* ===== Shell ===== */
.ax-shell {
  display: grid;
  grid-template-columns: var(--ax-sidenav-w) minmax(0,1fr) var(--ax-rsidebar-w);
  gap: 0;
  max-width: 1480px;
  margin: 0 auto;
}

/* ===== Side nav ===== */
.ax-sidenav {
  position: sticky; top: var(--ax-topbar-h);
  align-self: start;
  height: calc(100vh - var(--ax-topbar-h));
  padding: 28px 18px;
  border-right: 1px solid var(--ax-border-soft);
  overflow-y: auto;
}
.ax-sidenav__menu {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.ax-sidenav__menu a {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px; border-radius: 12px;
  color: var(--ax-text); font-weight: 500; font-size: 15px;
  position: relative;
}
.ax-sidenav__menu a:hover { background: var(--ax-surface-2); }
.ax-sidenav__menu a.is-active { color: var(--ax-text); }
.ax-sidenav__menu a.is-active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 2px; background: var(--ax-text); border-radius: 2px;
}
.ax-sidenav__icon { display: inline-flex; width: 22px; justify-content: center; color: var(--ax-text-muted); }
.ax-sidenav__menu a:hover .ax-sidenav__icon { color: var(--ax-text); }
.ax-sidenav__menu li:nth-child(4) { margin-top: 14px; }
.ax-sidenav__menu li:nth-child(7) { margin-top: 14px; }

/* ===== Main feed ===== */
.ax-main { padding: 28px 36px; min-width: 0; }
.ax-feed__head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ax-border);
  margin-bottom: 26px;
  position: relative;
}
.ax-feed__title {
  margin: 0; font-size: 20px; font-weight: 700; color: var(--ax-text);
  position: relative; padding-bottom: 14px;
}
.ax-feed__title::after {
  content: ""; position: absolute; left: 0; bottom: -16px; width: 100%;
  height: 2px; background: var(--ax-text);
}
.ax-filters {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 0; cursor: pointer;
  color: var(--ax-text); font-weight: 600; font-size: 14px;
}

/* ===== Cards ===== */
.ax-cards { display: flex; flex-direction: column; gap: 36px; }
.ax-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) 280px;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--ax-border-soft);
  align-items: start;
}
.ax-card__main { min-width: 0; }
.ax-card__title {
  margin: 12px 0 10px;
  font-size: 26px; line-height: 1.25; font-weight: 800;
  letter-spacing: -.01em;
  font-family: var(--ax-font-sans);
}
.ax-card__title a { color: var(--ax-text); }
.ax-card__excerpt { color: var(--ax-text-muted); font-size: 15px; line-height: 1.6; }
.ax-card__foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px;
}
.ax-card__actions { display: flex; gap: 6px; }
.ax-card__media {
  position: relative; display: block;
  border-radius: var(--ax-card-radius); overflow: hidden;
  aspect-ratio: 4/3; background: var(--ax-surface-2);
}
.ax-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.ax-card__media:hover img { transform: scale(1.04); }
.ax-card__label {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--ax-pill-radius);
  background: var(--ax-news-bg); color: var(--ax-news-text);
  font-size: 12px; font-weight: 600; line-height: 1;
}

/* ===== Meta ===== */
.ax-meta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ax-text-muted);
}
.ax-meta__author {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ax-surface-2); padding: 4px 12px 4px 4px;
  border-radius: var(--ax-pill-radius);
  color: var(--ax-text);
}
.ax-meta__avatar { width: 28px !important; height: 28px !important; border-radius: 50%; }
.ax-meta__by { color: var(--ax-text-muted); font-size: 13px; }
.ax-meta__name { font-weight: 600; font-size: 13px; }
.ax-meta__in { color: var(--ax-text-muted); font-size: 13px; }
.ax-meta__catwrap {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ax-surface-2); padding: 4px 12px;
  border-radius: var(--ax-pill-radius); font-size: 13px; font-weight: 600;
}
.ax-meta__icon { color: var(--ax-text-muted); }

/* ===== Stats ===== */
.ax-stats { display: inline-flex; align-items: center; gap: 16px; color: var(--ax-text-muted); font-size: 13px; }
.ax-stat { display: inline-flex; align-items: center; gap: 6px; }

/* ===== Right sidebar ===== */
.ax-rsidebar {
  position: sticky; top: var(--ax-topbar-h);
  align-self: start;
  height: calc(100vh - var(--ax-topbar-h));
  padding: 28px 28px 28px 16px;
  overflow-y: auto;
  border-left: 1px solid var(--ax-border-soft);
}
.ax-widget { margin-bottom: 36px; }
.ax-widget__title {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 0 22px;
  font-size: 13px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ax-text);
  text-align: center;
}
.ax-widget__title--plain { justify-content: flex-start; }
.ax-widget__title--plain .ax-leaf { display: none; }
.ax-leaf { color: var(--ax-accent); font-size: 15px; }

/* Editor's choice list */
.ax-editors { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 22px; }
.ax-editors__item {
  display: grid;
  grid-template-columns: 28px 78px 1fr;
  gap: 14px; align-items: start;
}
.ax-editors__num {
  font-family: var(--ax-font-display);
  font-size: 28px; font-weight: 800;
  color: var(--ax-text-soft);
  line-height: 1;
}
.ax-editors__thumb {
  display: block; width: 78px; height: 78px;
  border-radius: 12px; overflow: hidden;
  background: var(--ax-surface-2);
}
.ax-editors__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ax-editors__title {
  display: block; color: var(--ax-text);
  font-weight: 700; font-size: 15px; line-height: 1.35;
  margin-bottom: 8px;
}
.ax-editors__stats { display: flex; gap: 12px; color: var(--ax-text-muted); font-size: 12px; }
.ax-editors__stats span { display: inline-flex; align-items: center; gap: 4px; }

/* Trending */
.ax-trending { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.ax-trending__item { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: center; }
.ax-trending__thumb { width: 70px; height: 70px; border-radius: 12px; overflow: hidden; background: var(--ax-surface-2); }
.ax-trending__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ax-trending__title { color: var(--ax-text); font-weight: 600; font-size: 14px; line-height: 1.4; }

/* ===== Single ===== */
.ax-single { max-width: 760px; margin: 0 auto; padding: 20px 0 60px; }
.ax-single__head { margin-bottom: 28px; }
.ax-single__title {
  font-family: var(--ax-font-display);
  font-size: 44px; line-height: 1.15; letter-spacing: -.01em;
  margin: 14px 0 10px; font-weight: 800;
}
.ax-single__lede { font-size: 18px; color: var(--ax-text-muted); margin: 0 0 16px; }
.ax-single__hero { margin: 24px 0 28px; border-radius: var(--ax-card-radius); overflow: hidden; }
.ax-single__content { font-size: 17px; line-height: 1.8; }
.ax-single__content h2 { font-family: var(--ax-font-display); font-size: 28px; margin: 36px 0 14px; }
.ax-single__content h3 { font-size: 22px; margin: 28px 0 10px; }
.ax-single__content blockquote {
  border-left: 4px solid var(--ax-accent);
  margin: 24px 0; padding: 8px 0 8px 22px;
  color: var(--ax-text-muted); font-style: italic;
}
.ax-single__content a { color: var(--ax-accent-2); text-decoration: underline; }
.ax-single__content img { border-radius: 12px; margin: 18px 0; }

/* ===== Footer ===== */
.ax-footer { border-top: 1px solid var(--ax-border-soft); margin-top: 40px; padding: 36px 22px; background: var(--ax-surface); }
.ax-footer__inner { max-width: 1480px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.ax-footer__brand strong { font-size: 18px; }
.ax-footer__brand p { margin: 4px 0 0; color: var(--ax-text-muted); font-size: 14px; }
.ax-footer__copy { color: var(--ax-text-muted); font-size: 13px; }

/* ===== Pagination ===== */
.ax-pagination { margin-top: 36px; text-align: center; }
.ax-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px;
  border-radius: 12px; background: var(--ax-surface-2);
  margin: 0 3px; color: var(--ax-text); font-weight: 600;
}
.ax-pagination .page-numbers.current { background: var(--ax-text); color: var(--ax-bg); }

/* ===== Shortcodes ===== */
.ax-rbox {
  display: grid; grid-template-columns: 160px 1fr; gap: 18px;
  padding: 18px; border: 1px solid var(--ax-border);
  border-radius: var(--ax-card-radius); background: var(--ax-surface); margin: 24px 0;
}
.ax-rbox__img img { border-radius: 12px; }
.ax-rbox__title { margin: 0 0 8px; font-size: 18px; }
.ax-rbox__rating { color: var(--ax-text-muted); margin-bottom: 6px; }
.ax-rbox__rating strong { color: var(--ax-accent-2); font-size: 22px; }
.ax-rbox__price { font-weight: 700; margin-bottom: 12px; }
.ax-pc { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.ax-pc__col { padding: 16px; border-radius: 12px; border: 1px solid var(--ax-border); }
.ax-pc__col--pros { background: rgba(34,197,94,.06); }
.ax-pc__col--cons { background: rgba(239,68,68,.06); }
.ax-pc__col h4 { margin: 0 0 10px; }
.ax-pc__col ul { margin: 0; padding-left: 20px; }

/* ===== Empty ===== */
.ax-empty { padding: 60px 20px; text-align: center; color: var(--ax-text-muted); }

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  :root { --ax-rsidebar-w: 300px; }
  .ax-card { grid-template-columns: minmax(0,1fr) 220px; gap: 24px; }
}
@media (max-width: 1024px) {
  .ax-shell { grid-template-columns: var(--ax-sidenav-w) minmax(0,1fr); }
  .ax-rsidebar { display: none; }
}
@media (max-width: 820px) {
  .ax-shell { grid-template-columns: 1fr; }
  .ax-sidenav { display: none; position: fixed; top: var(--ax-topbar-h); left: 0; width: 280px; background: var(--ax-surface); z-index: 40; }
  .ax-sidenav.is-open { display: block; }
  .ax-main { padding: 20px 18px; }
  .ax-card { grid-template-columns: 1fr; gap: 16px; }
  .ax-card__media { aspect-ratio: 16/9; order: -1; }
  .ax-card__title { font-size: 22px; }
  .ax-single__title { font-size: 32px; }
  .ax-search { max-width: none; }
  .ax-btn--write span, .ax-btn--write { padding: 10px 14px; }
}
@media (max-width: 480px) {
  .ax-topbar { padding: 0 14px; gap: 8px; }
  .ax-search { padding: 8px 14px; }
  .ax-btn--write { display: none; }
}

/* === Categories widget === */
.ax-cats { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:4px; }
.ax-cats__item { margin:0; }
.ax-cats__link {
  display:flex; align-items:center; gap:14px;
  padding:10px 8px; border-radius:10px;
  color:var(--ax-text); text-decoration:none;
  font-weight:600; font-size:15px;
  transition:background .18s ease, transform .18s ease;
}
.ax-cats__link:hover { background:color-mix(in oklab, var(--ax-text) 6%, transparent); transform:translateX(2px); }
.ax-cats__icon {
  width:34px; height:34px; flex:0 0 34px;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:10px;
}
.ax-cats__icon svg { width:20px; height:20px; }
.ax-cats__name { letter-spacing:.1px; }
[dir="rtl"] .ax-cats__link:hover { transform:translateX(-2px); }

/* === Tags widget === */
.ax-tags { display:flex; flex-wrap:wrap; gap:8px; }
.ax-tags__chip {
  display:inline-flex; align-items:center;
  padding:6px 12px; border-radius:999px;
  background:color-mix(in oklab, var(--ax-accent) 10%, transparent);
  color:var(--ax-accent);
  text-decoration:none; font-size:13px; font-weight:600;
  border:1px solid color-mix(in oklab, var(--ax-accent) 25%, transparent);
  transition:all .18s ease;
}
.ax-tags__chip:hover { background:var(--ax-accent); color:#fff; transform:translateY(-1px); }
