/* =============================================================
   ATOZ THEME — BASE.CSS
   Design Tokens + Reset + Layout
   Flatsome: 152KB all-in-one. Atoz: ~8KB, only what you need.
   ============================================================= */

/* ---- 1. DESIGN TOKENS (CSS Custom Properties) ---- */
:root {
  /* Brand Colors */
  --atoz-primary:        #0066FF;
  --atoz-primary-dark:   #0047CC;
  --atoz-primary-light:  #E8F0FF;
  --atoz-secondary:      #FF6600;
  --atoz-accent:         #00CC88;

  /* Neutrals */
  --atoz-white:    #FFFFFF;
  --atoz-black:    #0A0A0A;
  --atoz-gray-100: #F8F9FA;
  --atoz-gray-200: #E9ECEF;
  --atoz-gray-300: #DEE2E6;
  --atoz-gray-400: #CED4DA;
  --atoz-gray-500: #ADB5BD;
  --atoz-gray-600: #6C757D;
  --atoz-gray-700: #495057;
  --atoz-gray-800: #343A40;
  --atoz-gray-900: #212529;

  /* Text */
  --atoz-text:         var(--atoz-gray-900);
  --atoz-text-light:   var(--atoz-gray-600);
  --atoz-text-inverse: var(--atoz-white);
  --atoz-link:         var(--atoz-primary);
  --atoz-link-hover:   var(--atoz-primary-dark);

  /* Typography */
  --atoz-font-sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --atoz-font-serif: Georgia, 'Times New Roman', serif;
  --atoz-font-mono:  'Courier New', Courier, monospace;
  --atoz-font-body:  var(--atoz-font-sans);
  --atoz-font-head:  var(--atoz-font-sans);

  --atoz-text-xs:   0.75rem;   /* 12px */
  --atoz-text-sm:   0.875rem;  /* 14px */
  --atoz-text-base: 1rem;      /* 16px */
  --atoz-text-lg:   1.125rem;  /* 18px */
  --atoz-text-xl:   1.25rem;   /* 20px */
  --atoz-text-2xl:  1.5rem;    /* 24px */
  --atoz-text-3xl:  1.875rem;  /* 30px */
  --atoz-text-4xl:  2.25rem;   /* 36px */
  --atoz-text-5xl:  3rem;      /* 48px */
  --atoz-text-6xl:  3.75rem;   /* 60px */

  --atoz-leading-tight:  1.25;
  --atoz-leading-normal: 1.6;
  --atoz-leading-loose:  1.8;

  /* Spacing */
  --atoz-space-1:  0.25rem;
  --atoz-space-2:  0.5rem;
  --atoz-space-3:  0.75rem;
  --atoz-space-4:  1rem;
  --atoz-space-5:  1.25rem;
  --atoz-space-6:  1.5rem;
  --atoz-space-8:  2rem;
  --atoz-space-10: 2.5rem;
  --atoz-space-12: 3rem;
  --atoz-space-16: 4rem;
  --atoz-space-20: 5rem;
  --atoz-space-24: 6rem;

  /* Layout */
  --atoz-container:      1200px;
  --atoz-container-wide: 1440px;
  --atoz-container-px:   1.5rem;
  --atoz-header-h:       72px;

  /* Border */
  --atoz-radius-sm:  4px;
  --atoz-radius:     8px;
  --atoz-radius-lg:  12px;
  --atoz-radius-xl:  20px;
  --atoz-radius-full: 9999px;
  --atoz-border:     1px solid var(--atoz-gray-200);

  /* Shadow */
  --atoz-shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --atoz-shadow:    0 4px 16px rgba(0,0,0,.10);
  --atoz-shadow-lg: 0 8px 32px rgba(0,0,0,.12);

  /* Transition */
  --atoz-ease:     cubic-bezier(.4,0,.2,1);
  --atoz-duration: 200ms;
  --atoz-transition: var(--atoz-duration) var(--atoz-ease);
}

/* ---- 2. RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--atoz-font-body);
  font-size: var(--atoz-text-base);
  line-height: var(--atoz-leading-normal);
  color: var(--atoz-text);
  background: var(--atoz-white);
  -webkit-font-smoothing: antialiased;
}

img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--atoz-link); text-decoration: none; transition: color var(--atoz-transition); }
a:hover { color: var(--atoz-link-hover); }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ---- 3. LAYOUT ---- */
.container {
  width: 100%;
  max-width: var(--atoz-container);
  margin-inline: auto;
  padding-inline: var(--atoz-container-px);
}
.container--wide { max-width: var(--atoz-container-wide); }
.container--full { max-width: 100%; }

.atoz-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.atoz-content-wrap { flex: 1; }

/* Grid */
.atoz-grid {
  display: grid;
  gap: var(--atoz-space-6);
}
.atoz-grid--2 { grid-template-columns: repeat(2, 1fr); }
.atoz-grid--3 { grid-template-columns: repeat(3, 1fr); }
.atoz-grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .atoz-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .atoz-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .atoz-grid--4, .atoz-grid--3, .atoz-grid--2 { grid-template-columns: 1fr; }
}

/* ---- 4. HEADER ---- */
.atoz-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--atoz-header-h);
  background: var(--atoz-white);
  border-bottom: var(--atoz-border);
  transition: box-shadow var(--atoz-transition);
}
.atoz-header.scrolled { box-shadow: var(--atoz-shadow); }
.atoz-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--atoz-space-6);
}
.atoz-header__logo { flex-shrink: 0; }
.atoz-site-name { font-size: var(--atoz-text-xl); font-weight: 700; color: var(--atoz-black); }
.atoz-header__actions { display: flex; align-items: center; gap: var(--atoz-space-4); }

/* Navigation */
.atoz-nav__list {
  display: flex;
  align-items: center;
  gap: var(--atoz-space-1);
}
.atoz-nav__list li a {
  display: block;
  padding: var(--atoz-space-2) var(--atoz-space-3);
  font-size: var(--atoz-text-sm);
  font-weight: 500;
  color: var(--atoz-text);
  border-radius: var(--atoz-radius-sm);
  transition: all var(--atoz-transition);
}
.atoz-nav__list li a:hover,
.atoz-nav__list li.current-menu-item > a {
  color: var(--atoz-primary);
  background: var(--atoz-primary-light);
}

/* Mobile toggle */
.atoz-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--atoz-space-2);
}
.atoz-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--atoz-text);
  border-radius: var(--atoz-radius-full);
  transition: all var(--atoz-transition);
}

/* ---- 5. BUTTONS ---- */
.atoz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--atoz-space-2);
  padding: var(--atoz-space-3) var(--atoz-space-6);
  font-size: var(--atoz-text-sm);
  font-weight: 600;
  border-radius: var(--atoz-radius);
  transition: all var(--atoz-transition);
  white-space: nowrap;
}
.atoz-btn--primary {
  background: var(--atoz-primary);
  color: var(--atoz-white);
}
.atoz-btn--primary:hover { background: var(--atoz-primary-dark); color: var(--atoz-white); }
.atoz-btn--secondary {
  background: var(--atoz-secondary);
  color: var(--atoz-white);
}
.atoz-btn--outline {
  border: 2px solid var(--atoz-primary);
  color: var(--atoz-primary);
}
.atoz-btn--outline:hover { background: var(--atoz-primary); color: var(--atoz-white); }
.atoz-btn--ghost { color: var(--atoz-primary); }
.atoz-btn--ghost:hover { background: var(--atoz-primary-light); }
.atoz-btn--sm { padding: var(--atoz-space-2) var(--atoz-space-4); font-size: var(--atoz-text-xs); }
.atoz-btn--lg { padding: var(--atoz-space-4) var(--atoz-space-8); font-size: var(--atoz-text-base); }

/* ---- 6. POSTS ---- */
.atoz-content { padding: var(--atoz-space-16) 0; }
.atoz-content.has-sidebar .container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--atoz-space-12);
  align-items: start;
}
.atoz-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--atoz-space-8);
}

@media (max-width: 1024px) { .atoz-posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .atoz-posts-grid { grid-template-columns: 1fr; } }

.atoz-post-card { border-radius: var(--atoz-radius-lg); overflow: hidden; background: var(--atoz-white); box-shadow: var(--atoz-shadow-sm); transition: box-shadow var(--atoz-transition); }
.atoz-post-card:hover { box-shadow: var(--atoz-shadow); }
.atoz-post-card__thumb img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.atoz-post-card__body { padding: var(--atoz-space-6); }
.atoz-post-card__meta { font-size: var(--atoz-text-xs); color: var(--atoz-text-light); margin-bottom: var(--atoz-space-2); }
.atoz-post-card__title { font-size: var(--atoz-text-xl); margin-bottom: var(--atoz-space-3); line-height: var(--atoz-leading-tight); }
.atoz-post-card__title a { color: var(--atoz-text); }
.atoz-post-card__title a:hover { color: var(--atoz-primary); }
.atoz-post-card__excerpt { color: var(--atoz-text-light); font-size: var(--atoz-text-sm); margin-bottom: var(--atoz-space-4); }

/* ---- 7. SIDEBAR ---- */
.atoz-sidebar { position: sticky; top: calc(var(--atoz-header-h) + 1rem); }
.widget { margin-bottom: var(--atoz-space-8); }
.widget-title { font-size: var(--atoz-text-lg); font-weight: 700; margin-bottom: var(--atoz-space-4); padding-bottom: var(--atoz-space-2); border-bottom: 2px solid var(--atoz-primary); }

/* ---- 8. FOOTER ---- */
.atoz-footer { background: var(--atoz-gray-900); color: var(--atoz-gray-300); }
.atoz-footer__widgets { padding: var(--atoz-space-16) 0; }
.atoz-footer__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--atoz-space-8); }
.atoz-footer__bottom { border-top: 1px solid var(--atoz-gray-700); padding: var(--atoz-space-6) 0; }
.atoz-footer__bottom .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--atoz-space-4); }
.atoz-footer__copy { font-size: var(--atoz-text-sm); }
.atoz-footer__copy a { color: var(--atoz-gray-300); }
.atoz-footer__copy a:hover { color: var(--atoz-white); }
.atoz-footer__nav { display: flex; gap: var(--atoz-space-4); }
.atoz-footer__nav a { font-size: var(--atoz-text-sm); color: var(--atoz-gray-400); }
.atoz-footer__nav a:hover { color: var(--atoz-white); }

/* ---- 9. PAGINATION ---- */
.atoz-pagination { margin-top: var(--atoz-space-12); }
.atoz-pagination .nav-links { display: flex; gap: var(--atoz-space-2); justify-content: center; }
.atoz-pagination .page-numbers {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--atoz-radius);
  font-size: var(--atoz-text-sm);
  color: var(--atoz-text);
  border: var(--atoz-border);
  transition: all var(--atoz-transition);
}
.atoz-pagination .page-numbers.current,
.atoz-pagination .page-numbers:hover { background: var(--atoz-primary); color: var(--atoz-white); border-color: var(--atoz-primary); }

/* ---- 10. UTILITIES ---- */
.atoz-text-center { text-align: center; }
.atoz-text-right  { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.atoz-404__inner { text-align: center; padding: var(--atoz-space-24) 0; }
.atoz-404__title { font-size: 8rem; font-weight: 900; color: var(--atoz-gray-200); line-height: 1; }
.atoz-404__message { font-size: var(--atoz-text-xl); color: var(--atoz-text-light); margin: var(--atoz-space-4) 0 var(--atoz-space-8); }

/* ---- 11. RESPONSIVE ---- */
@media (max-width: 768px) {
  :root { --atoz-header-h: 60px; }

  .atoz-nav { display: none; }
  .atoz-nav.is-open { display: block; }
  .atoz-nav-toggle { display: flex; }
  .atoz-nav__list { flex-direction: column; align-items: stretch; padding: var(--atoz-space-4); background: var(--atoz-white); border-top: var(--atoz-border); }

  .atoz-content.has-sidebar .container { grid-template-columns: 1fr; }
  .atoz-footer__cols { grid-template-columns: 1fr; }
  .atoz-footer__bottom .container { flex-direction: column; text-align: center; }
}
