/**
 * Breezway Design Manual - Styling
 * Simple, elegant, professional
 * Version: 3.4.2 - Feature box styling added
 */

/* ========================================
   PAGE BACKGROUND
   ======================================== */

/* Set light grey page background for entire Design Manual */
body.single-design_manual,
body.single-design_manual #page-container,
body.single-design_manual #et-main-area,
body.single-design_manual #main-content {
  background-color: #f5f7fa !important;
}

/* ========================================
   LAYOUT FOUNDATION
   ======================================== */

/* Reset Divi container constraints */
body.single-design_manual #main-content .container { 
  max-width: none !important; 
  width: 100% !important; 
  padding-left: 0 !important; 
  padding-right: 0 !important; 
}

body.single-design_manual #content-area, 
body.single-design_manual #left-area { 
  width: 100% !important; 
  float: none !important; 
  padding: 0 !important; 
}

/* Layout variables - all fluid */
body.single-design_manual {
  --dm-gutter: clamp(20px, 3vw, 48px);
  --dm-blue: #0078a8;
  --dm-bg-subtle: #fafbfc;
  --dm-border: #e7edf2;
  --dm-text: #2c3e50;
  --dm-text-light: #6c7a89;
}

/* ========================================
   BREADCRUMBS & HEADER ALIGNMENT
   ======================================== */

/* Breadcrumbs - align with content and add spacing from blue bar */
body.single-design_manual #breadcrumbs {
  max-width: 1800px;
  width: 90%;
  margin-left: var(--dm-gutter);
  margin-right: auto;
  padding-top: 1.5rem;
  padding-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--dm-text-light);
}

body.single-design_manual #breadcrumbs a {
  color: var(--dm-text-light);
  text-decoration: none;
}

body.single-design_manual #breadcrumbs a:hover {
  color: var(--dm-blue);
}

/* Entry header - align with content */
body.single-design_manual .entry-header {
  max-width: 1800px;
  width: 90%;
  margin-left: var(--dm-gutter);
  margin-right: auto;
  margin-bottom: 1rem;
  padding-top: 0.5rem;
}

/* ========================================
   PAGE STRUCTURE
   ======================================== */

/* Fluid wrapper - adapts to viewport */
body.single-design_manual .dm-wrap { 
  max-width: 1800px; /* Cap for ultra-wide monitors */
  width: 90%;
  margin-left: var(--dm-gutter);
  margin-right: auto;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

/* Grid: TOC left (13% of wrapper), content right (remaining space) */
body.single-design_manual .dm-layout {
  display: grid !important;
  grid-template-columns: minmax(180px, 13%) 1fr;
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
  margin: 2.5rem 0 0;
}

/* Override WordPress block column styles */
body.single-design_manual .dm-layout .dm-toc,
body.single-design_manual .dm-layout .dm-content {
  width: 100% !important;
  flex-basis: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ========================================
   HEADER
   ======================================== */

body.single-design_manual .entry-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin: 0;
  line-height: 1.2;
  color: var(--dm-text);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ========================================
   PDF/PRINT BUTTONS - Text-only, compact
   ======================================== */

/* Desktop - Fixed top-right, text-only for maximum space */
body.single-design_manual .dm-export-buttons {
  position: fixed;
  top: 140px;
  right: clamp(15px, 2vw, 30px); /* Fluid right positioning */
  z-index: 999;
  display: flex;
  gap: 0.5rem;
}

body.single-design_manual .dm-export-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  background: white;
  border: 1px solid var(--dm-border);
  border-radius: 6px;
  color: var(--dm-text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

body.single-design_manual .dm-export-btn:hover {
  background: var(--dm-blue);
  color: white;
  border-color: var(--dm-blue);
  box-shadow: 0 4px 8px rgba(74, 144, 164, 0.2);
  transform: translateY(-1px);
}

body.single-design_manual .dm-export-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Remove icons - text-only buttons */
body.single-design_manual .dm-export-btn::before {
  display: none;
}

/* ========================================
   TABLE OF CONTENTS (Sidebar)
   ======================================== */

body.single-design_manual .dm-toc {
  position: sticky;
  top: 120px;
  background: white;
  border-radius: 8px;
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--dm-border);
}

body.single-design_manual .dm-toc h2 { 
  font-size: 0.75rem; 
  margin: 0 0 1rem; 
  font-weight: 600; 
  color: var(--dm-text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.single-design_manual .dm-toc ul { 
  list-style: none; 
  padding: 0; 
  margin: 0; 
}

body.single-design_manual .dm-toc li { 
  margin: 0.25rem 0;
  font-size: clamp(0.875rem, 1.5vw, 0.9375rem);
  line-height: 1.5;
}

body.single-design_manual .dm-toc a { 
  text-decoration: none; 
  color: var(--dm-text);
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

body.single-design_manual .dm-toc a:hover { 
  color: var(--dm-blue);
  background: var(--dm-bg-subtle);
  transform: translateX(2px);
}

/* Active state for current section */
body.single-design_manual .dm-toc a.active {
  color: var(--dm-blue);
  background: var(--dm-bg-subtle);
  border-left: 3px solid var(--dm-blue);
  padding-left: calc(0.75rem - 3px);
}

/* ========================================
   CONTENT AREA
   ======================================== */

body.single-design_manual .dm-content { 
  min-width: 0;
  color: var(--dm-text);
  font-size: clamp(1rem, 1.8vw, 1.0625rem);
  line-height: 1.7;
}

body.single-design_manual .dm-content > *:first-child { 
  margin-top: 0; 
}

/* Typography hierarchy */
body.single-design_manual .dm-content h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  line-height: 1.3;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: var(--dm-text);
  letter-spacing: -0.01em;
  scroll-margin-top: 120px;
}

body.single-design_manual .dm-content h2:first-child {
  margin-top: 0;
}

body.single-design_manual .dm-content h3 {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 600;
  line-height: 1.4;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--dm-text);
  scroll-margin-top: 120px;
}

body.single-design_manual .dm-content p {
  margin: 0 0 1.25rem;
}

/* Lists */
body.single-design_manual .dm-content ul,
body.single-design_manual .dm-content ol {
  margin: 0 0 1.5rem;
  padding-left: 1.5rem;
}

body.single-design_manual .dm-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* Strong text */
body.single-design_manual .dm-content strong {
  font-weight: 600;
  color: var(--dm-text);
}

/* Links in content */
body.single-design_manual .dm-content a {
  color: var(--dm-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

body.single-design_manual .dm-content a:hover {
  border-bottom-color: var(--dm-blue);
}

/* ========================================
   FEATURE BOXES & CALLOUTS
   ======================================== */

/* White box with blue left border - for key features, highlights, etc. */
body.single-design_manual .dm-feature-box,
body.single-design_manual .wp-block-group.dm-feature-box {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--dm-blue);
  margin: 2rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.single-design_manual .dm-feature-box h2:first-child,
body.single-design_manual .dm-feature-box h3:first-child {
  margin-top: 0;
}

body.single-design_manual .dm-feature-box h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--dm-text);
}

body.single-design_manual .dm-feature-box ul {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

body.single-design_manual .dm-feature-box li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

body.single-design_manual .dm-feature-box li strong {
  color: var(--dm-text);
  font-weight: 600;
}

body.single-design_manual .dm-feature-box > *:last-child {
  margin-bottom: 0;
}

/* ========================================
   GUTENBERG BLOCKS
   ======================================== */

/* Tables */
body.single-design_manual .wp-block-table { 
  width: 100%;
  margin: 2rem 0;
}

body.single-design_manual .wp-block-table table {
  border-collapse: collapse;
  width: 100%;
}

body.single-design_manual .wp-block-table th {
  background: var(--dm-bg-subtle);
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--dm-text);
  border-bottom: 2px solid var(--dm-border);
}

body.single-design_manual .wp-block-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--dm-border);
}

/* Images */
body.single-design_manual .wp-block-image { 
  margin: 2rem 0;
}

body.single-design_manual .wp-block-image img { 
  height: auto; 
  max-width: 100%;
  border-radius: 4px;
}

body.single-design_manual .wp-block-image figcaption {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  color: var(--dm-text-light);
  text-align: center;
  font-style: italic;
}

/* Quote blocks */
body.single-design_manual .wp-block-quote {
  border-left: 4px solid var(--dm-blue);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--dm-text-light);
}

/* Wide/full width blocks */
body.single-design_manual .alignwide { 
  margin-left: calc(-0.5 * var(--dm-gutter)); 
  margin-right: calc(-0.5 * var(--dm-gutter)); 
}

body.single-design_manual .alignfull { 
  margin-left: calc(-1 * var(--dm-gutter)); 
  margin-right: calc(-1 * var(--dm-gutter)); 
}

/* Hide print logo on screen */
.dm-print-logo {
  display: none;
}

/* ========================================
   PRINT STYLES - CLEAN & SIMPLE
   ======================================== */

@media print {
  /* Hide site header */
  header.et-l--header {
    display: none !important;
  }
  
  /* Hide site footer */
  footer,
  footer.et-l--footer,
  .et-l--footer {
    display: none !important;
  }
  
  /* Hide navigation and non-content elements */
  .dm-toc,
  .dm-export-buttons,
  #breadcrumbs {
    display: none !important;
  }
  
  /* Show and style the page title (H1) */
  .entry-header {
    display: block !important;
    margin-bottom: 2rem !important;
    padding-top: 2rem !important;
  }
  
  .entry-title {
    display: block !important;
    font-size: 2.25rem !important;
    font-weight: 600 !important;
    margin: 0 0 1.5rem !important;
    color: #000 !important;
  }
  
  /* Layout for print */
  .dm-wrap {
    margin: 0 !important;
    padding: 1rem !important;
    max-width: 100% !important;
    padding-bottom: 80px !important; /* Space for logo */
  }
  
  .dm-layout {
    display: block !important;
  }
  
  .dm-content {
    display: block !important;
    max-width: 100% !important;
  }
  
  /* Show and position the print logo */
  .dm-print-logo {
    display: block !important;
    position: fixed;
    bottom: 20px;
    right: 30px;
    width: 180px;
    height: auto;
    z-index: 9999;
  }
  
  /* Page break controls - allow natural breaks */
  h2 {
    page-break-after: avoid !important;
    page-break-before: auto !important;
  }
  
  h3 {
    page-break-after: avoid !important;
  }
  
  figure, img:not(.dm-print-logo) {
    page-break-inside: avoid !important;
  }
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */

@media (max-width: 1024px) {
  body.single-design_manual .dm-wrap {
    width: 96%;
    padding-inline: var(--dm-gutter);
    padding-top: 1.5rem;
  }
  
  body.single-design_manual .dm-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
  }
  
  body.single-design_manual .dm-toc {
    position: static;
    border-radius: 6px;
    padding: 1.25rem;
  }
  
  body.single-design_manual .entry-title {
    font-size: 1.75rem;
  }
  
  body.single-design_manual .dm-content {
    font-size: 1rem;
  }
  
  body.single-design_manual .dm-content h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
  }
  
  body.single-design_manual .dm-content h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
  }
  
  /* Buttons - Move to bottom-right, icon-only, stacked */
  body.single-design_manual .dm-export-buttons {
    top: auto;
    bottom: 20px;
    right: 20px;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  body.single-design_manual .dm-export-btn {
    padding: 0.75rem;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    font-size: 1.25rem;
    opacity: 0.9;
  }
  
  /* Hide text labels on mobile, show only icons */
  body.single-design_manual .dm-export-btn span {
    display: none;
  }
  
  body.single-design_manual .dm-export-btn::before {
    font-size: 1.375rem;
  }
  
  body.single-design_manual .dm-export-btn:hover {
    opacity: 1;
  }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 640px) {
  body.single-design_manual .entry-title {
    font-size: 1.5rem;
  }
  
  body.single-design_manual .dm-content h2 {
    font-size: 1.375rem;
  }
  
  body.single-design_manual .dm-content h3 {
    font-size: 1.125rem;
  }
  
  body.single-design_manual .wp-block-table {
    font-size: 0.875rem;
  }
  
  body.single-design_manual .wp-block-table th,
  body.single-design_manual .wp-block-table td {
    padding: 0.625rem 0.75rem;
  }
  
  /* Buttons - Slightly smaller on very small screens */
  body.single-design_manual .dm-export-buttons {
    bottom: 15px;
    right: 15px;
  }
  
  body.single-design_manual .dm-export-btn {
    padding: 0.625rem;
    min-width: 40px;
    min-height: 40px;
  }
  
  body.single-design_manual .dm-export-btn::before {
    font-size: 1.25rem;
  }
}