/*
Theme Name: Daami Linear
Theme URI: https://adilfahim.com/myblog
Description: A fast, warm-white Linear-style technical blog theme for SAP consultants. Child of Daami.
Author: OWL
Template: daami
Version: 2.0.0
Text Domain: daami-linear
*/

/* ============================================
   CSS CUSTOM PROPERTIES (Warm White Design System)
   ============================================ */
:root {
  /* Background Surfaces */
  --bg-primary: #fafaf9;
  --bg-secondary: #ffffff;
  --bg-panel: #ffffff;
  --bg-elevated: #f5f5f4;
  --bg-hover: #e7e5e4;
  --bg-card: #ffffff;

  /* Text */
  --text-primary: #1a1a1a;
  --text-secondary: #44403c;
  --text-tertiary: #78716c;
  --text-muted: #a8a29e;

  /* Brand / Accent */
  --accent: #5e6ad2;
  --accent-hover: #7170ff;
  --accent-bg: rgba(94,106,210,0.08);

  /* Borders */
  --border-subtle: rgba(0,0,0,0.06);
  --border-default: rgba(0,0,0,0.10);
  --border-strong: rgba(0,0,0,0.16);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Layout */
  --max-width: 800px;
  --max-width-wide: 1200px;
  --sidebar-width: 320px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 16px;
}

/* ============================================
   FONTS
   ============================================ */
@font-face {
  font-family: 'Inter';
  src: url('https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZ9hjp-Ek-_EeA.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('https://fonts.gstatic.com/s/jetbrainsmono/v20/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxjPVmUsaaDhw.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

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

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

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.15s ease;
}
a:hover {
  color: var(--accent);
}

/* ============================================
   LAYOUT — Two column: content + sidebar
   ============================================ */
.site-container {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.content-area {
  display: flex;
  gap: var(--space-2xl);
  align-items: flex-start;
}

.primary-content {
  flex: 1;
  min-width: 0;
  max-width: var(--max-width);
}

.sidebar-content {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 80px;
}

@media (max-width: 1024px) {
  .content-area {
    flex-direction: column;
  }
  .sidebar-content {
    width: 100%;
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }
}

@media (max-width: 768px) {
  .sidebar-content {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.site-header {
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  background: rgba(250,250,249,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

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

.site-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.site-title a { color: var(--text-primary); }
.site-title a:hover { color: var(--accent); }
.site-title .accent { color: var(--accent); }

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.main-nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: -0.13px;
  transition: color 0.15s ease;
}
.main-nav a:hover {
  color: var(--accent);
}

/* ============================================
   HERO SECTION (Homepage)
   ============================================ */
.hero-section {
  padding: var(--space-4xl) 0 var(--space-3xl);
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -1.2px;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.hero-subtitle {
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-tertiary);
  max-width: 560px;
  margin: 0 auto;
}

/* ============================================
   SEARCH
   ============================================ */
.search-form {
  position: relative;
  margin-bottom: var(--space-lg);
}

.search-form .search-field {
  width: 100%;
  padding: 10px 40px 10px var(--space-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
}

.search-form .search-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.search-form .search-field::placeholder {
  color: var(--text-muted);
}

.search-form .search-submit {
  position: absolute;
  right: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: var(--space-xs);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.search-form .search-submit:hover {
  color: var(--accent);
}

.search-form .search-submit svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   SECTION LABELS
   ============================================ */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-top: var(--space-2xl);
  margin-bottom: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

/* ============================================
   BLOG POST CARDS
   ============================================ */
.posts-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.post-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
  transform: translateY(-1px);
}

.post-card .post-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
  flex-wrap: wrap;
}

.post-card .post-category {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-card .post-date {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.post-card .post-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.3px;
  margin-bottom: var(--space-sm);
}
.post-card .post-title a {
  color: var(--text-primary);
}
.post-card .post-title a:hover {
  color: var(--accent);
}

.post-card .post-excerpt {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  line-height: 1.6;
}

.post-card .post-tags {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}

.post-card .post-tag {
  display: inline-block;
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
}
.post-card .post-tag:hover {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ============================================
   FEATURED IMAGE
   ============================================ */
.post-featured-image {
  margin: 0 0 var(--space-xl) 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
}
.post-featured-image img,
.post-featured-image .featured-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 420px;
}

/* ============================================
   SINGLE POST
   ============================================ */
.single-post {
  padding: var(--space-3xl) 0;
}

.single-post .post-header {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.single-post .post-header .post-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.single-post .post-title {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.8px;
  color: var(--text-primary);
}

.single-post .entry-content {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.single-post .entry-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.single-post .entry-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.single-post .entry-content p {
  margin-bottom: var(--space-md);
}

.single-post .entry-content ul,
.single-post .entry-content ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}
.single-post .entry-content li {
  margin-bottom: var(--space-xs);
}

.single-post .entry-content code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  color: var(--accent);
}

.single-post .entry-content pre {
  background: #2d2d2d;
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  overflow-x: auto;
  margin-bottom: var(--space-lg);
  color: #e8e8e8;
}
.single-post .entry-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8125rem;
  color: inherit;
}

.single-post .entry-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--text-tertiary);
  font-style: italic;
  background: var(--accent-bg);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.single-post .entry-content img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  margin: var(--space-lg) 0;
  box-shadow: var(--shadow-sm);
}

.single-post .entry-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.single-post .entry-content a:hover {
  color: var(--accent-hover);
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */
.ez-toc, #ez-toc-container {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-lg) !important;
  padding: var(--space-lg) !important;
  margin-bottom: var(--space-2xl) !important;
  box-shadow: var(--shadow-sm) !important;
}
.ez-toc-title {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
}
.ez-toc-list a {
  color: var(--text-tertiary) !important;
  font-size: 0.8125rem !important;
  line-height: 1.6 !important;
}
.ez-toc-list a:hover {
  color: var(--accent) !important;
}

/* ============================================
   SIDEBAR / WIDGETS
   ============================================ */
.widget-area .widget {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--accent);
}

.widget ul {
  list-style: none;
}
.widget ul li {
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.widget ul li:last-child {
  border-bottom: none;
}
.widget ul li a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: block;
  padding: 2px 0;
  transition: all 0.1s ease;
}
.widget ul li a:hover {
  color: var(--accent);
  padding-left: var(--space-xs);
}

/* ============================================
   ADS
   ============================================ */
.ad-slot {
  margin: var(--space-2xl) 0;
  text-align: center;
  padding: var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-default);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-2xl) 0;
}
.pagination a, .pagination span {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.pagination a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-bg);
}
.pagination .current {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-bg);
  font-weight: 600;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-2xl) 0;
  margin-top: var(--space-3xl);
  background: var(--bg-secondary);
}

.footer-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-inner p, .footer-inner a {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.footer-inner a:hover {
  color: var(--accent);
}

/* ============================================
   SEARCH RESULTS
   ============================================ */
.search-results-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
}

.search-results-title span {
  color: var(--accent);
}

.no-results {
  text-align: center;
  padding: var(--space-3xl) 0;
  color: var(--text-tertiary);
}

.no-results h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

/* ============================================
   COMMENTS
   ============================================ */
#comments {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.comment-reply-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  width: 100%;
  transition: border-color 0.15s ease;
}

.comment-form textarea:focus,
.comment-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.comment-form .submit {
  background: var(--text-primary);
  color: #fff;
  border: none;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.comment-form .submit:hover {
  background: var(--accent);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  html { font-size: 15px; }

  .hero-title { font-size: 1.75rem; }
  .hero-section { padding: var(--space-2xl) 0; }

  .header-inner {
    flex-direction: column;
    gap: var(--space-sm);
  }
  .main-nav {
    gap: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
  }

  .single-post .post-title { font-size: 1.5rem; }
  .single-post .entry-content { font-size: 1rem; }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .posts-grid { gap: var(--space-sm); }
  .post-card { padding: var(--space-md); }

  .content-area {
    gap: var(--space-xl);
  }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  .site-header, .site-footer, .sidebar-content, .ad-slot, .comment-respond, .main-nav { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

a:focus, button:focus, input:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-bg);
  color: var(--text-primary);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
