
.vyq-template-categories {
  --vyq-primary: #E23744 !important;
  --vyq-primary-soft: #FFF0F1 !important;
  --vyq-heading: #222222 !important;
  --vyq-body: #666666 !important;
  --vyq-border: #E8E8E8 !important;
  --vyq-rule: #F0F0F0 !important;
  --vyq-white: #FFFFFF !important;
  --vyq-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* --- Base ----------------------------------------------------------------- */
.vyq-template-categories,
.vyq-template-categories * {
  box-sizing: border-box !important;
  /* Reset only has to beat the theme defaults. Equal specificity to the
     rules below, so it must stay first in the file — they re-apply the
     spacing this block actually wants. */
  margin: 0 !important;
  padding: 0 !important;
}

/* --- Classic-theme group wrapper ------------------------------------------
   On a classic theme (Sydney), WordPress wraps every group block's children in
   an extra .wp-block-group__inner-container div at render time — it is not in
   the pasted markup. That wrapper would be the only child of the grid below,
   collapsing it to one column. display: contents takes it out of the layout. */
.vyq-template-categories .wp-block-group__inner-container {
  display: contents !important;
}

.vyq-template-categories {
  font-family: var(--vyq-font) !important;
  line-height: 1.6 !important;
  color: var(--vyq-heading) !important;
}

/* --- Grid -----------------------------------------------------------------
   auto-fit rather than a fixed 1fr 1fr: two cards still sit side by side, and
   adding a third or fourth card reflows instead of needing a CSS change. */
.vyq-template-categories-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
  gap: 16px !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
}

/* --- Card ----------------------------------------------------------------- */
.vyq-template-categories-card {
  /* position: relative anchors the stretched link below */
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 24px !important;
  background: var(--vyq-white) !important;
  border: 1px solid var(--vyq-border) !important;
  border-radius: 10px !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.vyq-template-categories-card:hover {
  border-color: var(--vyq-primary) !important;
  box-shadow: 0 2px 10px rgba(226, 55, 68, 0.06) !important;
}

/* --- Icon tile -----------------------------------------------------------
   The icon is a ::before on the card, keyed off the card's modifier class, so
   there is no icon element to maintain in the editor. A card with no modifier
   falls back to the plain document icon below. */
.vyq-template-categories-card::before {
  content: '' !important;
  width: 42px !important;
  height: 42px !important;
  flex-shrink: 0 !important;
  margin-bottom: 16px !important;
  border-radius: 8px !important;
  background-color: var(--vyq-primary-soft) !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: 20px 20px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E23744' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E") !important;
}

.vyq-template-categories-card--invoice::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E23744' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M8 13h8'/%3E%3Cpath d='M8 17h8'/%3E%3Cpath d='M8 9h2'/%3E%3C/svg%3E") !important;
}

.vyq-template-categories-card--quotation::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E23744' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M12 18v-6'/%3E%3Cpath d='m9 15 3-3 3 3'/%3E%3C/svg%3E") !important;
}

/* Spare icons for cards you add later — see the README */
.vyq-template-categories-card--receipt::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E23744' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1Z'/%3E%3Cpath d='M8 7h8'/%3E%3Cpath d='M8 11h8'/%3E%3Cpath d='M8 15h5'/%3E%3C/svg%3E") !important;
}

.vyq-template-categories-card--checklist::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E23744' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E") !important;
}

.vyq-template-categories-card--report::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E23744' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M8 17v-3'/%3E%3Cpath d='M12 17v-6'/%3E%3Cpath d='M16 17v-2'/%3E%3C/svg%3E") !important;
}

/* --- Card text ------------------------------------------------------------ */
.vyq-template-categories-card-title {
  font-family: var(--vyq-font) !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  color: var(--vyq-heading) !important;
  line-height: 1.4 !important;
  margin-bottom: 6px !important;
  transition: color 0.15s ease !important;
}

.vyq-template-categories-card:hover .vyq-template-categories-card-title {
  color: var(--vyq-primary) !important;
}

.vyq-template-categories-card-desc {
  font-size: 13px !important;
  color: var(--vyq-body) !important;
  line-height: 1.55 !important;
  margin-bottom: 16px !important;
  /* flex: 1 keeps every footer aligned no matter how long the description is */
  flex: 1 !important;
}

/* --- Footer --------------------------------------------------------------- */
.vyq-template-categories-card-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding-top: 14px !important;
  border-top: 1px solid var(--vyq-rule) !important;
}

.vyq-template-categories-card-formats {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}

.vyq-template-categories-fmt {
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  padding: 3px 8px !important;
  border-radius: 4px !important;
  /* Neutral default so a pill for a new format is still legible */
  background: #F3F4F6 !important;
  color: #4B5563 !important;
}

.vyq-template-categories-fmt--word {
  background: #EBF4FF !important;
  color: #2563EB !important;
}

.vyq-template-categories-fmt--excel {
  background: #ECFDF5 !important;
  color: #16A34A !important;
}

.vyq-template-categories-fmt--pdf {
  background: #FFF0F1 !important;
  color: #E23744 !important;
}

/* --- Count link ----------------------------------------------------------- */
.vyq-template-categories-count {
  font-size: 12px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
}

.vyq-template-categories-count a,
.vyq-template-categories-count a:hover,
.vyq-template-categories-count a:focus,
.vyq-template-categories-count a:visited {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  color: var(--vyq-primary) !important;
  text-decoration: none !important;
}

/* Stretched link: the ::before covers the whole card, so clicking anywhere on
   the card follows this link. No core block can wrap a card in an <a>, and this
   avoids needing JS for it. */
.vyq-template-categories-count a::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 1 !important;
}

.vyq-template-categories-count a::after {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23E23744' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") !important;
  display: inline-block !important;
  width: 14px !important;
  height: 14px !important;
  line-height: 0 !important;
  flex-shrink: 0 !important;
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 600px) {
  .vyq-template-categories-grid {
    grid-template-columns: 1fr !important;
    padding: 0 16px !important;
  }
  .vyq-template-categories-card {
    padding: 20px !important;
  }
}
