.h2-catalog { max-width: 1400px; margin: 0 auto; padding: 20px; font-family: system-ui, -apple-system, sans-serif; }
.h2-catalog * { box-sizing: border-box; }
.h2-catalog svg { max-width: 100%; max-height: 100%; }
.h2-catalog .h2-filter-toggle { overflow: hidden; }
.h2-catalog-content { display: flex; gap: 24px; align-items: flex-start; }
.h2-catalog-sidebar { width: 240px; flex-shrink: 0; position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; }
.h2-catalog-sidebar .h2-filters { background: #f8fafc; border-radius: 12px; padding: 16px; border: 1px solid #e2e8f0; }
.h2-catalog-main { flex: 1; min-width: 0; }
.h2-catalog-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0; }
.h2-catalog-header h1 { margin: 0; font-size: 1.75rem; color: #204755; font-weight: 400; font-family: 'Poppins', sans-serif; }
.h2-header-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.h2-view-switcher { display: inline-flex; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; background: #f8fafc; padding: 2px; }
.h2-view-btn { padding: 6px 10px; background: transparent; border: none; cursor: pointer; color: #64748b; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.h2-view-btn svg { width: 18px; height: 18px; }
.h2-view-btn:hover { color: #1e293b; background: #f1f5f9; }
.h2-view-btn.active { background: #3aa8d4; color: white; box-shadow: 0 2px 4px rgba(58,168,212,0.25); }
.h2-search-box { position: relative; width: 280px; }
.h2-search-box input { width: 100%; padding: 8px 14px 8px 38px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 0.9rem; background: #f8fafc; transition: all 0.2s; }
.h2-search-box input:focus { outline: none; border-color: #3aa8d4; background: white; box-shadow: 0 0 0 3px rgba(58,168,212,0.15); }
.h2-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9ca3af; display: flex; align-items: center; }

/* Dynamic Layout Grid Wrapper */
#h2-catalog ul.h2-grid-wrapper {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  position: relative !important;
  clear: both !important;
}
#h2-catalog ul.h2-grid-wrapper > li.grid-item,
#h2-catalog ul.h2-grid-wrapper > li.grid-sizer {
  list-style: none !important;
  margin: 0 !important;
  padding: 8px !important;
  cursor: default !important;
  width: 16.66667% !important;
  float: left !important;
  box-sizing: border-box !important;
}
#h2-catalog ul.h2-grid-wrapper > li.grid-sizer {
  padding: 0 !important;
  height: 0 !important;
}
#h2-catalog ul.h2-grid-wrapper > li.grid-item.has-modal { cursor: pointer !important; }
#h2-catalog .blog-post { background: white; border-radius: 12px; border: 1px solid #f1f5f9; box-shadow: 0 4px 12px rgba(0,0,0,0.03); transition: all 0.25s ease; display: flex; flex-direction: column; overflow: hidden; position: relative; height: 280px; }
#h2-catalog .blog-post:hover { box-shadow: 0 12px 24px rgba(0,0,0,0.08); transform: translateY(-3px); border-color: #e2e8f0; }
#h2-catalog .blog-post-image { position: relative; width: 100%; height: 125px; min-height: 125px; overflow: hidden; background: #f8fafc; display: flex; align-items: center; justify-content: center; }
#h2-catalog .blog-post-image img, #h2-catalog .blog-post-image .h2-list-item-picto { width: 100%; height: 100%; object-fit: contain; padding: 8px 12px; transition: transform 0.3s ease; border: none; background: transparent; }
#h2-catalog .blog-post-image .h2-list-item-picto-placeholder { width: 64px; height: 64px; border-radius: 50%; background: #e2e8f0; opacity: 0.6; }
#h2-catalog .blog-post:hover .blog-post-image img, #h2-catalog .blog-post:hover .blog-post-image .h2-list-item-picto { transform: scale(1.06); }
#h2-catalog .blog-rounded-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.8); width: 38px; height: 38px; border-radius: 50%; background: white; display: flex; align-items: center; justify-content: center; opacity: 0; transition: all 0.25s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.18); color: #3aa8d4; }
#h2-catalog .blog-post:hover .blog-rounded-icon { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#h2-catalog .h2-list-item:not(.has-modal) .blog-rounded-icon { display: none; }
.h2-arrow-icon { width: 18px; height: 18px; color: #3aa8d4; }
#h2-catalog .post-details { padding: 8px 10px 6px; display: flex; flex-direction: column; flex: 1; text-align: center; justify-content: flex-start; overflow: hidden; }
.post-details h3 { font-size: 0.95rem; font-weight: 600; color: #1e293b; margin: 0 0 6px; line-height: 1.35; }
.h2-grid-desc { font-size: 0.8rem; color: #64748b; margin: 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Filter Toggle on Grid Card */
.blog-post .h2-filter-toggle { position: absolute; top: 10px; left: 10px; z-index: 10; width: 22px; height: 22px; border-radius: 6px; background: white; border: 2px solid #cbd5e1; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: all 0.2s; padding: 0; }
.blog-post .h2-filter-toggle:hover { border-color: #3aa8d4; background: rgba(58,168,212,0.06); }
.blog-post .h2-filter-toggle.active { background: #3aa8d4; border-color: #3aa8d4; }

/* List View Override Mode */
#h2-catalog.h2-view-list ul.h2-grid-wrapper { display: flex !important; flex-direction: column !important; gap: 8px !important; }
#h2-catalog.h2-view-list ul.h2-grid-wrapper { height: auto !important; }
#h2-catalog.h2-view-list ul.h2-grid-wrapper > li.grid-sizer { display: none !important; }
#h2-catalog.h2-view-list ul.h2-grid-wrapper > li.grid-item { width: 100% !important; padding: 0 !important; position: static !important; inset: auto !important; transform: none !important; opacity: 1 !important; float: none !important; }
#h2-catalog.h2-view-list .blog-post { flex-direction: row !important; align-items: center !important; height: auto !important; padding: 8px 16px !important; border-radius: 10px; }
#h2-catalog.h2-view-list .blog-post-image { width: 60px !important; height: 60px !important; min-height: 60px !important; flex-shrink: 0; background: transparent !important; border-radius: 8px; overflow: hidden; }
#h2-catalog.h2-view-list .blog-post-image img, #h2-catalog.h2-view-list .blog-post-image .h2-list-item-picto { padding: 4px; }
#h2-catalog.h2-view-list .blog-rounded-icon { display: none !important; }
#h2-catalog.h2-view-list .blog-post .h2-filter-toggle { position: relative !important; top: auto !important; left: auto !important; margin-right: 12px; flex-shrink: 0; }
#h2-catalog.h2-view-list .post-details { text-align: left !important; padding: 0 0 0 16px !important; flex-direction: row !important; align-items: center !important; justify-content: flex-start !important; gap: 16px; }
#h2-catalog.h2-view-list .post-details h3 { margin: 0; font-size: 0.95rem; min-width: 150px; }
#h2-catalog.h2-view-list .h2-grid-desc { -webkit-line-clamp: 1; max-width: 500px; }

.h2-active-filter button:hover { opacity: 1; }
.h2-filter-toggle { flex-shrink: 0; width: 20px; height: 20px; border: 2px solid #d1d5db; border-radius: 4px; background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; padding: 0; margin-right: 6px; }
.h2-filter-toggle:hover { border-color: #4fc0ea; background: rgba(79,192,234,0.06); }
.h2-filter-toggle.active { background: #4fc0ea; border-color: #4fc0ea; }
.h2-filter-toggle svg { width: 14px; height: 14px; color: white; display: none; }
.h2-filter-toggle.active svg { display: block; }
.h2-list-item { cursor: default; }
.h2-list-item.has-modal { cursor: pointer; }
.h2-list-item.highlighted .blog-post { border-color: #3aa8d4 !important; box-shadow: 0 0 0 2px rgba(58,168,212,0.16), 0 8px 18px rgba(0,0,0,0.06); }
.h2-filter-toggle:focus-visible, .h2-filter-btn:focus-visible, .h2-view-btn:focus-visible, .h2-reset-btn:focus-visible { outline: 3px solid rgba(58,168,212,0.35); outline-offset: 2px; }

/* Sidebar Filter Sections */
.h2-filter-section { margin-bottom: 8px; }
.h2-filter-section-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: white; border-radius: 8px; cursor: pointer; transition: background 0.2s; border: 1px solid #e2e8f0; }
.h2-filter-section-header h3 { margin: 0; font-size: 0.85rem; font-weight: 600; color: #1e293b; flex: 1; }
.h2-filter-section-header:hover { background: #f1f5f9; }
.h2-sidebar-chevron { width: 16px; height: 16px; flex-shrink: 0; color: #94a3b8; transition: transform 0.2s; }
.h2-filter-section-header.collapsed .h2-sidebar-chevron { transform: rotate(-90deg); }
.h2-filter-section ul { list-style: none; padding: 4px 0 0; margin: 0; }
.h2-filter-section ul.collapsed { display: none; }
.h2-filter-btn { display: flex; align-items: center; width: 100%; padding: 5px 10px; border: none; background: transparent; cursor: pointer; font-size: 0.8rem; color: #475569; border-radius: 6px; transition: all 0.15s; text-align: left; gap: 6px; }
.h2-filter-btn:hover { background: #f1f5f9; color: #1e293b; }
.h2-filter-btn.active { background: #e0f7fa; color: #0e7490; font-weight: 600; }
.h2-filter-btn .count { margin-left: auto; font-size: 0.7rem; color: #94a3b8; background: #f1f5f9; padding: 1px 6px; border-radius: 10px; }
.h2-sidebar-show-more { display: block; width: 100%; padding: 6px 10px; margin-top: 4px; border: 1px dashed #cbd5e1; background: transparent; color: #64748b; font-size: 0.78rem; cursor: pointer; border-radius: 6px; transition: all 0.2s; }
.h2-sidebar-show-more:hover { background: #f8fafc; color: #3aa8d4; border-color: #3aa8d4; }
.h2-reset-btn { display: block; width: 100%; padding: 8px; margin-top: 12px; border: 1px solid #e2e8f0; background: white; color: #64748b; font-size: 0.8rem; cursor: pointer; border-radius: 8px; transition: all 0.2s; }
.h2-reset-btn:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* Active Filters Bar */
#h2-active-filter-container { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.h2-active-filter { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: #e0f7fa; color: #0e7490; border-radius: 20px; font-size: 0.78rem; font-weight: 500; }
.h2-active-filter button { border: none; background: transparent; cursor: pointer; color: #0e7490; font-size: 1rem; padding: 0 2px; line-height: 1; }
.h2-active-filter button:hover { color: #dc2626; }

/* Tags, metadata and pagination generated by the Gateway */
.h2-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 7px; }
.h2-tag, .h2-tags-more, .h2-paper-meta { display: inline-flex; align-items: center; border: 1px solid #e2e8f0; border-radius: 999px; padding: 2px 7px; font-size: 0.68rem; line-height: 1.35; color: #64748b; }
.h2-list-item-meta { margin-top: auto; padding-top: 6px; }
.h2-show-more-btn { display: block; margin: 4px auto 24px; padding: 9px 16px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #475569; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.h2-show-more-btn:hover { border-color: #3aa8d4; color: #0e7490; background: #f0f9ff; }
.h2-no-results { padding: 48px 20px; text-align: center; color: #64748b; }
.h2-no-results > div { display: none; }

/* Section Headers - Override Litho's section { padding: 130px 0 } */
#h2-catalog .h2-section { margin-bottom: 32px; padding: 0 !important; overflow: visible !important; clear: both !important; width: 100% !important; display: block !important; }
#h2-catalog .h2-section.h2-section-hidden { display: none !important; }
#h2-catalog ul.h2-grid-wrapper::after { content: ""; display: table; clear: both; }
.h2-section-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.h2-section-header h2 { margin: 0; font-size: 1.35rem; font-weight: 400; color: #204755; font-family: 'Poppins', sans-serif; }
.h2-section-count { font-size: 0.85rem; color: #94a3b8; font-weight: 400; }

/* Modal Tag Categories */
.h2-modal-body .h2-accordion-tags { margin-top: 16px; padding-top: 16px; border-top: 1px solid #f1f5f9; }
.h2-modal-body .h2-tag-category-group { margin-bottom: 12px; }
.h2-modal-body .h2-tag-category-group:last-child { margin-bottom: 0; }
.h2-modal-body .h2-tag-category-title { font-size: 0.75rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.h2-modal-body .h2-tag-category-items { display: flex; flex-wrap: wrap; gap: 6px; }
.h2-modal-body .h2-detail-desc { display: none !important; }
.h2-modal-body .h2-detail-desc p { margin: 0 0 10px; }
.h2-modal-body .h2-detail-desc p:last-child { margin-bottom: 0; }

/* Modal Container & Sticky Close Button */
/* La modale est rattachée au body : conserver les styles hérités du catalogue. */
div.h2-modal-overlay { font-family: system-ui, -apple-system, sans-serif; }
div.h2-modal-overlay, div.h2-modal-overlay * { box-sizing: border-box; }
div.h2-modal-overlay.open { display: flex !important; position: fixed !important; inset: 0 !important; z-index: 999999 !important; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); align-items: center !important; justify-content: center !important; overflow: hidden !important; }
div.h2-modal-overlay { display: none; }
div.h2-modal-overlay .h2-modal-box { background: white; border-radius: 16px; max-width: 720px; width: 90%; max-height: 85vh !important; display: flex !important; flex-direction: column !important; overflow: hidden !important; padding: 0; position: relative; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
div.h2-modal-overlay .h2-modal-content-scroll { overflow-y: auto !important; overflow-x: hidden !important; max-height: 85vh !important; min-height: 0 !important; flex: 1 1 auto; padding: 36px 40px; scrollbar-width: thin; scrollbar-color: #cbd5e1 #f8fafc; -webkit-overflow-scrolling: touch; }
.h2-modal-content-scroll::-webkit-scrollbar { width: 8px; display: block; }
.h2-modal-content-scroll::-webkit-scrollbar-track { background: #f8fafc; border-radius: 8px; }
.h2-modal-content-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.h2-modal-content-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.h2-modal-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; background: #f1f5f9; border: none; font-size: 1.3rem; font-weight: 500; cursor: pointer; color: #64748b; display: flex; align-items: center; justify-content: center; z-index: 10; transition: all 0.2s ease; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.h2-modal-close:hover { background: #e2e8f0; color: #0f172a; transform: scale(1.05); }
.h2-modal-box h2 { margin: 0 0 20px; font-size: 1.5rem; font-weight: 700; color: #3aa8d4; padding-right: 40px; line-height: 1.3; }
.h2-modal-box .h2-modal-img { width: 100%; border-radius: 12px; margin-bottom: 20px; }
.h2-modal-box .h2-modal-body { font-size: 0.95rem; color: #334155; line-height: 1.7; }
.h2-modal-box .h2-modal-body p { margin: 0 0 12px; }
.h2-modal-slideshow { margin-bottom: 20px; }
.h2-modal-slideshow .h2-modal-main-img { width: 100%; border-radius: 12px; display: block; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.h2-modal-slideshow .h2-modal-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.h2-modal-slideshow .h2-modal-thumb { width: 80px; height: 60px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; opacity: 0.6; transition: all 0.2s; flex-shrink: 0; }
.h2-modal-slideshow .h2-modal-thumb:hover { opacity: 0.9; }
.h2-modal-slideshow .h2-modal-thumb.active { border-color: #3aa8d4; opacity: 1; transform: scale(1.03); }
.h2-modal-badges { margin-top: 24px; padding-top: 16px; border-top: 1px solid #f1f5f9; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }

/* Rule Badges & Severities */
.h2-rule-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; justify-content: flex-end; }
.h2-rule-badge { position: relative; display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 9999px; font-size: 0.65rem; font-weight: 500; letter-spacing: 0.02em; line-height: 1.6; cursor: default; white-space: nowrap; }
.h2-rule-badge.h2-rule-info { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.h2-rule-badge.h2-rule-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.h2-rule-badge.h2-rule-danger, .h2-rule-badge.h2-rule-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.h2-rule-badge.h2-rule-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.h2-rule-badge .h2-rule-tooltip { display: none; position: absolute; bottom: calc(100% + 8px); right: 0; min-width: 250px; max-width: 350px; padding: 10px 14px; background: white; color: #1f2937; font-size: 0.8rem; font-weight: 400; line-height: 1.5; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); border: 1px solid #e5e7eb; z-index: 100; white-space: normal; }
.h2-rule-badge .h2-rule-tooltip::after { content: ''; position: absolute; top: 100%; right: 16px; border: 6px solid transparent; border-top-color: white; }
.h2-rule-badge:hover .h2-rule-tooltip { display: block; }

@media (max-width: 900px) {
  .h2-catalog-content { flex-direction: column; }
  .h2-catalog-sidebar { width: 100%; position: static; }
  .h2-filters { position: static; }
  .h2-list-item-content { flex-direction: column; align-items: flex-start; gap: 2px; }
  .h2-list-item-content p { white-space: normal; }
  .h2-modal-box { width: 95%; padding: 0; }
  .h2-modal-content-scroll { padding: 24px 20px; }
  .h2-rule-badge .h2-rule-tooltip { min-width: 200px; right: -10px; }
}

/* The theme's responsive grid classes are overridden above on purpose, so the
   same breakpoints must be declared here for both items and the Isotope sizer. */
@media (max-width: 1199px) {
  #h2-catalog ul.h2-grid-wrapper > li.grid-item,
  #h2-catalog ul.h2-grid-wrapper > li.grid-sizer { width: 25% !important; }
}
@media (max-width: 1050px) {
  #h2-catalog ul.h2-grid-wrapper > li.grid-item,
  #h2-catalog ul.h2-grid-wrapper > li.grid-sizer { width: 33.33333% !important; }
}
@media (max-width: 900px) {
  #h2-catalog ul.h2-grid-wrapper > li.grid-item,
  #h2-catalog ul.h2-grid-wrapper > li.grid-sizer { width: 33.33333% !important; }
  .h2-catalog-sidebar { max-height: none; overflow-y: visible; }
}
@media (max-width: 640px) {
  .h2-catalog { padding: 12px; }
  .h2-catalog-header, .h2-header-right { align-items: stretch; }
  .h2-header-right, .h2-search-box { width: 100%; }
  .h2-view-switcher { align-self: flex-start; }
  #h2-catalog ul.h2-grid-wrapper > li.grid-item,
  #h2-catalog ul.h2-grid-wrapper > li.grid-sizer { width: 50% !important; }
  #h2-catalog.h2-view-list .post-details { flex-direction: column !important; align-items: flex-start !important; gap: 3px; }
  #h2-catalog.h2-view-list .post-details h3 { min-width: 0; }
  div.h2-modal-overlay .h2-modal-content-scroll { padding: 28px 20px; }
}
@media (max-width: 420px) {
  #h2-catalog ul.h2-grid-wrapper > li.grid-item,
  #h2-catalog ul.h2-grid-wrapper > li.grid-sizer { width: 100% !important; }
  div.h2-modal-overlay .h2-modal-content-scroll { padding: 28px 18px; }
}
.h2-overflow-hidden { display: none !important; }

