/*
Theme Name: TotalTechDeals Affiliate Theme
Author: Elias Henriquez
Description: Lightweight, mobile-first WordPress theme built for deal blogging and affiliate conversions with 795px main column and 320px sidebar.
Version: 1.0.2
Text Domain: ttd-affiliate
*/

:root {
  --ttd-primary: #0066cc;
  --ttd-primary-hover: #0052a3;
  --ttd-dark: #111827;
  --ttd-text: #1f2937;
  --ttd-muted: #6b7280;
  --ttd-bg: #f8fafc;
  --ttd-card-bg: #ffffff;
  --ttd-border: #e5e7eb;
  --ttd-badge-bg: #dc2626;
  --ttd-container-max: 1135px;
  --ttd-main-width: 795px;
  --ttd-sidebar-width: 320px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ttd-text);
  background-color: var(--ttd-bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--ttd-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.ttd-container {
  width: 100%;
  max-width: var(--ttd-container-max);
  margin: 0 auto;
  padding: 0 16px;
}

/* Mobile-first single column */
main.ttd-container.ttd-layout-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 10px 0 90px;
}

.ttd-main-column,
.ttd-sidebar {
  width: 100%;
}

/* Desktop split: 795px content (+25%) + 320px sidebar */
@media (min-width: 1160px) {
  .ttd-container {
    padding: 0;
  }
  main.ttd-container.ttd-layout-grid {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-top: 10px;
    padding-bottom: 48px;
  }
  .ttd-main-column {
    width: var(--ttd-main-width);
    flex-shrink: 0;
  }
  .ttd-sidebar {
    width: var(--ttd-sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 74px;
  }
}

/* =========================================
   Compact 15 Posts Sidebar Widget (~300px Fit)
   ========================================= */
.ttd-custom-top-posts {
  width: 100%;
  max-width: 300px;
  margin-top: 20px;
  padding: 0;
  background: transparent;
}

.ttd-posts-compact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ttd-post-compact-item {
  margin: 0;
  padding: 0;
}

/* Full Clickable Box with Mouseover Effect */
.ttd-post-compact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background-color: var(--ttd-card-bg);
  border: 1px solid var(--ttd-border);
  border-radius: 10px;
  text-decoration: none;
  color: #0c2340;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.ttd-post-compact-link:hover {
  background-color: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
  text-decoration: none;
}

.ttd-post-compact-link:hover .ttd-post-compact-title {
  color: var(--ttd-primary);
}

/* Image Thumbnail */
.ttd-post-compact-thumb {
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  display: block;
}

.ttd-post-compact-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.ttd-post-compact-link:hover .ttd-post-compact-thumb img {
  transform: scale(1.04);
}

/* Text Content */
.ttd-post-compact-content {
  flex: 1;
  min-width: 0;
}

.ttd-post-compact-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.25;
  color: #0c2340;
  transition: color 0.18s ease;
}

/* Placeholder for posts without images */
.ttd-post-compact-placeholder {
  width: 100%;
  height: 100%;
  background: var(--ttd-border);
}