/**
 * Techtip Article Styling
 * Theme-independent CSS for government services articles
 * Version: 1.0.0
 *
 * This CSS file provides complete styling for Techtip articles.
 * NO other styling should be added to article content.
 * Keep articles using ONLY semantic HTML tags.
 */

/* ============================================
   COLOR PALETTE
   ============================================ */

:root {
  --tt-primary: #2563eb;
  --tt-primary-dark: #1e40af;
  --tt-primary-light: #eff6ff;

  --tt-success: #10b981;
  --tt-success-light: #ecfdf5;

  --tt-warning: #f59e0b;
  --tt-warning-light: #fffbeb;

  --tt-danger: #ef4444;
  --tt-danger-light: #fef2f2;

  --tt-info: #0ea5e9;
  --tt-info-light: #f0f9ff;

  --tt-text: #1f2937;
  --tt-text-light: #6b7280;
  --tt-text-lighter: #9ca3af;

  --tt-border: #e5e7eb;
  --tt-bg: #ffffff;
  --tt-bg-light: #f9fafb;
}

/* ============================================
   ARTICLE CONTAINER (THEME OVERRIDE)
   ============================================ */

/* Main article content area - respects WordPress width constraints */
.entry-content,
article,
.post-content,
.content,
main,
.site-content,
.post {
  color: var(--tt-text) !important;
  line-height: 1.7 !important;
  font-size: 16px !important;
}

/* Override default theme article styling */
.entry-content * {
  background-color: transparent !important;
}

.entry-content a,
.content a,
.post a {
  background: none !important;
}

/* ============================================
   HEADING STYLES
   ============================================ */

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  color: var(--tt-text);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 28px;
  margin-bottom: 16px;
}

.entry-content h1 {
  font-size: 32px;
  color: var(--tt-primary-dark);
  border-bottom: 3px solid var(--tt-primary);
  padding-bottom: 12px;
  margin-top: 0;
  margin-bottom: 24px;
}

.entry-content h2 {
  font-size: 24px;
  color: var(--tt-primary-dark);
  border-bottom: 2px solid var(--tt-primary);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.entry-content h3 {
  font-size: 20px;
  color: var(--tt-primary);
  margin-bottom: 12px;
}

.entry-content h4 {
  font-size: 18px;
  color: var(--tt-text);
  font-weight: 600;
}

.entry-content h5,
.entry-content h6 {
  font-size: 16px;
  color: var(--tt-text);
  font-weight: 600;
}

/* ============================================
   PARAGRAPH & TEXT STYLES
   ============================================ */

.entry-content p {
  margin-bottom: 16px;
  color: var(--tt-text);
}

.entry-content strong,
.entry-content b {
  font-weight: 700;
  color: var(--tt-text);
}

.entry-content em,
.entry-content i {
  font-style: italic;
  color: var(--tt-text-light);
}

.entry-content small {
  font-size: 14px;
  color: var(--tt-text-light);
}

.entry-content a {
  color: var(--tt-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--tt-primary);
  transition: all 0.2s ease;
}

.entry-content a:hover {
  color: var(--tt-primary-dark);
  background-color: var(--tt-primary-light);
  padding: 0 4px;
}

/* ============================================
   LIST STYLES
   ============================================ */

.entry-content ul,
.entry-content ol {
  margin-left: 24px;
  margin-bottom: 16px;
}

.entry-content ul {
  list-style-type: disc;
}

.entry-content ul ul {
  list-style-type: circle;
  margin-top: 8px;
}

.entry-content ul ul ul {
  list-style-type: square;
}

.entry-content ol {
  list-style-type: decimal;
}

.entry-content ol ol {
  list-style-type: lower-alpha;
  margin-top: 8px;
}

.entry-content ol ol ol {
  list-style-type: lower-roman;
}

.entry-content li {
  margin-bottom: 8px;
  color: var(--tt-text);
  line-height: 1.6;
}

.entry-content li strong {
  color: var(--tt-primary-dark);
}

/* ============================================
   BLOCKQUOTE & CALLOUT STYLES
   ============================================ */

.entry-content blockquote {
  border-left: 4px solid var(--tt-primary);
  background-color: var(--tt-primary-light);
  padding: 16px 20px;
  margin: 20px 0;
  font-style: italic;
  color: var(--tt-text);
}

/* ============================================
   INFO BOX (Custom Class)
   ============================================ */

.tt-info-box,
.entry-content .tt-info-box {
  background-color: var(--tt-info-light);
  border-left: 4px solid var(--tt-info);
  border-radius: 4px;
  padding: 16px 20px;
  margin: 20px 0;
  color: var(--tt-text);
}

.tt-info-box p,
.entry-content .tt-info-box p {
  margin: 0;
}

.tt-info-box strong {
  color: var(--tt-info);
}

/* ============================================
   TOOLTIP / HIGHLIGHT BOXES
   ============================================ */

/* Success/Pro Tip Box */
.tt-tooltip,
.tt-tooltip-success,
.entry-content .tt-tooltip {
  background-color: var(--tt-success-light);
  border-left: 4px solid var(--tt-success);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 4px;
}

.tt-tooltip strong,
.entry-content .tt-tooltip strong {
  color: var(--tt-success);
}

/* Warning Box */
.tt-tooltip-warning,
.entry-content .tt-tooltip-warning {
  background-color: var(--tt-warning-light);
  border-left: 4px solid var(--tt-warning);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 4px;
}

.tt-tooltip-warning strong {
  color: var(--tt-warning);
}

/* Important/Danger Box */
.tt-tooltip-danger,
.entry-content .tt-tooltip-danger {
  background-color: var(--tt-danger-light);
  border-left: 4px solid var(--tt-danger);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 4px;
}

.tt-tooltip-danger strong {
  color: var(--tt-danger);
}

/* Info Box (Blue) */
.tt-tooltip-info,
.entry-content .tt-tooltip-info {
  background-color: var(--tt-info-light);
  border-left: 4px solid var(--tt-info);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 4px;
}

.tt-tooltip-info strong {
  color: var(--tt-info);
}

/* ============================================
   HIGHLIGHT / BADGE STYLES
   ============================================ */

.tt-highlight,
.entry-content .tt-highlight {
  background-color: rgba(37, 99, 235, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--tt-primary-dark);
  font-weight: 500;
}

.tt-badge {
  display: inline-block;
  background-color: var(--tt-primary);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin: 0 4px 4px 0;
}

.tt-badge-success {
  background-color: var(--tt-success);
}

.tt-badge-warning {
  background-color: var(--tt-warning);
}

.tt-badge-danger {
  background-color: var(--tt-danger);
}

/* ============================================
   TABLE STYLES
   ============================================ */

.entry-content table,
.tt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  border: 1px solid var(--tt-border);
  border-radius: 6px;
  overflow: hidden;
}

.entry-content table thead,
.tt-table thead {
  background-color: var(--tt-primary);
  color: white;
}

.entry-content table thead th,
.tt-table thead th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}

.entry-content table tbody tr,
.tt-table tbody tr {
  border-bottom: 1px solid var(--tt-border);
  transition: background-color 0.2s ease;
}

.entry-content table tbody tr:hover,
.tt-table tbody tr:hover {
  background-color: var(--tt-bg-light);
}

.entry-content table tbody td,
.tt-table tbody td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--tt-text);
}

.entry-content table tbody tr:last-child,
.tt-table tbody tr:last-child {
  border-bottom: none;
}

/* Comparison Table Specific */
.tt-comparison,
.entry-content .tt-comparison {
  width: 100%;
  margin: 24px 0;
}

.tt-comparison thead th {
  background-color: var(--tt-primary-dark);
  color: white;
  padding: 16px;
  font-weight: 600;
}

.tt-comparison tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--tt-border);
}

.tt-comparison tbody tr:nth-child(even) {
  background-color: var(--tt-bg-light);
}

/* ============================================
   BUTTON & CTA STYLES
   ============================================ */

.tt-cta,
.entry-content .tt-cta,
.tt-button,
.entry-content .tt-button {
  display: inline-block;
  background-color: var(--tt-primary);
  color: white;
  padding: 12px 28px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  margin: 12px 12px 12px 0;
}

.tt-cta:hover,
.entry-content .tt-cta:hover,
.tt-button:hover,
.entry-content .tt-button:hover {
  background-color: var(--tt-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
  border-bottom: none;
  color: white;
}

/* Secondary Button */
.tt-cta-secondary,
.entry-content .tt-cta-secondary {
  background-color: var(--tt-bg-light);
  color: var(--tt-primary);
  border: 2px solid var(--tt-primary);
}

.tt-cta-secondary:hover,
.entry-content .tt-cta-secondary:hover {
  background-color: var(--tt-primary-light);
  border-color: var(--tt-primary-dark);
}

/* Success Button */
.tt-cta-success {
  background-color: var(--tt-success);
}

.tt-cta-success:hover {
  background-color: #059669;
}

/* Danger Button */
.tt-cta-danger {
  background-color: var(--tt-danger);
}

.tt-cta-danger:hover {
  background-color: #dc2626;
}

/* Block Button (Full Width) */
.tt-cta-block,
.entry-content .tt-cta-block {
  display: block;
  width: 100%;
  text-align: center;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablets */
@media (max-width: 768px) {
  .entry-content h1 {
    font-size: 28px;
    margin-bottom: 20px;
  }

  .entry-content h2 {
    font-size: 22px;
  }

  .entry-content h3 {
    font-size: 18px;
  }

  .entry-content p {
    font-size: 16px;
  }

  .entry-content table,
  .tt-table {
    font-size: 14px;
    margin: 16px 0;
  }

  .entry-content table thead th,
  .tt-table thead th {
    padding: 12px;
  }

  .entry-content table tbody td,
  .tt-table tbody td {
    padding: 10px 12px;
  }

  .tt-cta,
  .tt-button {
    padding: 10px 20px;
    font-size: 14px;
  }

  .tt-info-box,
  .tt-tooltip,
  .tt-tooltip-success,
  .tt-tooltip-warning,
  .tt-tooltip-danger,
  .tt-tooltip-info {
    padding: 12px 16px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .entry-content {
    font-size: 15px;
  }

  .entry-content h1 {
    font-size: 24px;
    margin-bottom: 16px;
  }

  .entry-content h2 {
    font-size: 20px;
  }

  .entry-content h3 {
    font-size: 16px;
  }

  .entry-content ul,
  .entry-content ol {
    margin-left: 16px;
  }

  .entry-content table,
  .tt-table {
    font-size: 13px;
    margin: 12px 0;
    overflow-x: auto;
    display: block;
  }

  .entry-content table thead th,
  .tt-table thead th,
  .entry-content table tbody td,
  .tt-table tbody td {
    padding: 8px 10px;
  }

  .tt-cta,
  .tt-button,
  .tt-cta-block {
    padding: 10px 16px;
    font-size: 13px;
    margin: 8px 8px 8px 0;
  }

  .tt-badge {
    font-size: 11px;
    padding: 3px 8px;
  }

  .entry-content blockquote,
  .tt-info-box,
  .tt-tooltip,
  .tt-tooltip-success,
  .tt-tooltip-warning,
  .tt-tooltip-danger,
  .tt-tooltip-info {
    padding: 12px 14px;
    margin: 16px 0;
    border-left-width: 3px;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.entry-content a:focus,
.tt-cta:focus,
.tt-button:focus {
  outline: 2px solid var(--tt-primary);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .tt-cta,
  .tt-button {
    border: 1px solid var(--tt-text);
    color: var(--tt-text);
    background: none;
  }

  .entry-content a {
    color: var(--tt-text);
    text-decoration: underline;
    border: none;
  }
}

/* ============================================
   AGGRESSIVE THEME CONFLICT RESOLUTION
   ============================================ */

/* HIGHEST SPECIFICITY - Override all theme CSS */
.techtip-styled .entry-content,
.techtip-styled article,
.techtip-styled .post-content,
.techtip-styled .content,
.techtip-styled main {
  all: revert !important;
}

/* Remove theme borders, margins, and spacing issues */
.entry-content div:not([class]),
.entry-content span:not([class]),
.entry-content section:not([class]),
.entry-content div,
.entry-content span,
.entry-content section {
  border: none !important;
  margin: inherit !important;
  padding: inherit !important;
  background-color: transparent !important;
}

/* Fix theme-injected styles on tables */
.entry-content table,
.tt-table {
  background: white !important;
  color: var(--tt-text) !important;
  border: 1px solid var(--tt-border) !important;
}

.entry-content table th,
.tt-table th {
  background: var(--tt-primary) !important;
  color: white !important;
  border: none !important;
}

.entry-content table td,
.tt-table td {
  border-bottom: 1px solid var(--tt-border) !important;
  color: var(--tt-text) !important;
}

/* Fix button inheritance from theme */
.tt-cta,
.tt-button,
.tt-cta-block {
  font: inherit !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

/* Remove theme's list styling conflicts */
.entry-content ul,
.entry-content ol {
  background: transparent !important;
  padding-left: 24px !important;
}

.entry-content li {
  background: transparent !important;
  margin-bottom: 8px !important;
}

/* Fix heading conflicts from theme */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  text-transform: none !important;
  letter-spacing: normal !important;
  font-style: normal !important;
  font-weight: 600 !important;
  background: transparent !important;
}

/* Fix link styling conflicts */
.entry-content a {
  text-decoration: none !important;
  background-image: none !important;
  box-shadow: none !important;
}

.entry-content a:visited {
  color: var(--tt-primary) !important;
}

/* Override blockquote theme styling */
.entry-content blockquote {
  background: var(--tt-primary-light) !important;
  border-left: 4px solid var(--tt-primary) !important;
  color: var(--tt-text) !important;
  margin: 20px 0 !important;
  padding: 16px 20px !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
}

/* Ensure info boxes override theme */
.tt-info-box,
.tt-tooltip,
.tt-tooltip-success,
.tt-tooltip-warning,
.tt-tooltip-danger,
.tt-tooltip-info {
  background-color: var(--tt-primary-light) !important;
  border-left: 4px solid var(--tt-primary) !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

/* Fix paragraph spacing issues */
.entry-content p {
  margin-bottom: 16px !important;
  margin-top: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

/* ============================================
   TEMPLATE-SPECIFIC LAYOUT OVERRIDES
   ============================================ */

/* Full-Width Article (No Sidebar) */
body.techtip-article-full-width .single-layout-container {
  display: block !important;
  grid-template-columns: 1fr !important;
}

body.techtip-article-full-width .site-sidebar {
  display: none !important;
}

body.techtip-article-full-width main {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  padding: 40px 20px !important;
}

/* Article with Sidebar */
body.techtip-article-with-sidebar .single-layout-container {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 340px !important;
  gap: 40px !important;
  padding: 40px 20px !important;
}

body.techtip-article-with-sidebar .site-sidebar {
  display: flex !important;
}

/* Poster page - minimize all theme styles */
body.techtip-poster-page {
  background: white !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.techtip-poster-page .techtip-poster-container {
  width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  padding: 0 !important;
}

body.techtip-poster-page .techtip-poster-content {
  width: 100% !important;
  max-width: 100% !important;
}

/* Allow all inline styles in poster content */
body.techtip-poster-page .techtip-poster-content * {
  all: revert !important;
}
