/*
  ISRAFIL GRAPHICS — PHASE 21
  Premium compact mobile spacing and responsive homepage polish.
  Desktop layout is intentionally preserved; no content or business logic is changed here.
*/

/* Pagination count text is not useful on the homepage; keep the controls only. */
#designPagination .home-design-count{display:none!important}
#designPagination button{white-space:nowrap}

@media (max-width:900px){
  /* Consistent, tighter section rhythm across the homepage. */
  .section{padding:20px 0!important}
  .section-heading,.store-heading{
    margin-bottom:12px!important;
    gap:8px!important;
  }
  .section h2,.store-heading h2{margin:5px 0 4px!important}
  .section p,.store-heading p{margin:0!important;line-height:1.5!important}

  #designs.store-section{padding-top:20px!important;padding-bottom:14px!important}
  #videos.store-section{padding-top:20px!important;padding-bottom:14px!important}
  #audio-gallery.ig-home-audio-section{padding-top:16px!important;padding-bottom:18px!important}
  #services.service-section{padding-top:18px!important;padding-bottom:18px!important}
  #online-printing-order{padding-top:18px!important;padding-bottom:12px!important}
  #software.software-section{padding-top:18px!important;padding-bottom:18px!important}
  #printing.printing-section{padding-top:18px!important;padding-bottom:18px!important}
  .latest-section{padding-top:18px!important;padding-bottom:16px!important}
  .reviews-section{padding-top:18px!important;padding-bottom:20px!important}

  /* Homepage video copy stays to one line; the two video cards remain side by side. */
  #videos .store-heading>div:first-child{min-width:0!important;width:100%!important}
  #videos .store-heading>div:first-child p{
    display:block!important;width:100%!important;max-width:100%!important;
    white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
    font-size:11px!important;line-height:1.45!important;
  }
  #videoProductGrid.product-grid{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:9px!important;align-items:stretch!important;margin-bottom:0!important;
  }

  /* Keep homepage design pagination on a single row on phones. */
  #designPagination{width:100%!important;margin:10px auto 0!important;padding:0!important}
  #designPagination .home-design-pages{
    display:flex!important;flex-wrap:nowrap!important;justify-content:center!important;
    align-items:center!important;gap:5px!important;width:100%!important;max-width:100%!important;
  }
  #designPagination button{
    flex:0 0 auto!important;min-width:34px!important;min-height:36px!important;
    height:36px!important;padding:0 8px!important;font-size:10px!important;
    line-height:1!important;white-space:nowrap!important;border-radius:10px!important;
  }
  #designPagination .home-page-ellipsis{display:none!important}

  /* Audio gallery: no secondary CTA, compact heading and premium player card. */
  #audio-gallery .ig-audio-store-heading{margin-bottom:10px!important;gap:6px!important}
  #audio-gallery .ig-audio-store-heading .store-links{display:none!important}
  #audio-gallery .ig-audio-store-heading p{
    display:-webkit-box!important;-webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;overflow:hidden!important;
    font-size:11px!important;line-height:1.45!important;
  }
  #audio-gallery .ig-audio-gallery-grid{grid-template-columns:1fr!important;gap:9px!important}
  #audio-gallery .ig-home-audio-card{
    grid-template-columns:88px minmax(0,1fr)!important;
    min-height:0!important;border-radius:14px!important;
    box-shadow:0 8px 20px rgba(6,43,80,.07)!important;
  }
  #audio-gallery .ig-home-audio-art{min-height:128px!important}
  #audio-gallery .ig-home-audio-body{padding:9px 10px!important}
  #audio-gallery .ig-home-audio-meta{gap:5px!important;margin-bottom:5px!important}
  #audio-gallery .ig-home-audio-category{min-height:19px!important;padding:3px 7px!important;font-size:9px!important}
  #audio-gallery .ig-home-audio-plays{font-size:9px!important}
  #audio-gallery .ig-home-audio-body h3{font-size:13px!important;line-height:1.3!important;margin:0 0 4px!important}
  #audio-gallery .ig-home-audio-description{font-size:10px!important;line-height:1.4!important;margin:0 0 6px!important;-webkit-line-clamp:2!important}
  #audio-gallery .ig-home-audio-player{height:34px!important}

  /* Service showcase: retain the media-first layout, remove the empty band around it. */
  #services .service-grid{gap:11px!important}
  #services .service-panel{
    min-height:0!important;padding:13px!important;border-radius:18px!important;
    gap:0!important;box-shadow:0 10px 24px rgba(5,35,65,.09)!important;
  }
  #services .service-panel .ig-service-media{margin:0 0 9px!important;padding:0!important}
  #services .service-panel .ig-showcase-shell{
    min-height:0!important;height:auto!important;max-height:none!important;
    aspect-ratio:16/9!important;border-radius:13px!important;
  }
  #services .service-panel .section-kicker{margin:0 0 5px!important}
  #services .service-panel h2{margin:4px 0 6px!important;font-size:clamp(18px,5vw,22px)!important;line-height:1.22!important}
  #services .service-panel p{margin:0 0 6px!important;font-size:11px!important;line-height:1.48!important}
  #services .service-panel ul{margin:7px 0 9px!important;gap:5px 8px!important}
  #services .service-panel li{font-size:9.5px!important;line-height:1.35!important}
  #services .service-panel .btn{min-height:38px!important;padding:0 12px!important;font-size:10.5px!important}

  /* Online printing order: compact heading and action; no oversized gap before Software. */
  #online-printing-order .section-heading{
    display:flex!important;flex-direction:column!important;align-items:flex-start!important;
    gap:8px!important;margin-bottom:0!important;
  }
  #online-printing-order .section-heading>div{width:100%!important;min-width:0!important}
  #online-printing-order .section-heading .btn{
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    width:auto!important;min-height:42px!important;height:42px!important;
    padding:0 16px!important;margin:0!important;border-radius:12px!important;
    font-size:11px!important;white-space:nowrap!important;
  }

  /* Empty Software state becomes a small notice instead of a tall white panel. */
  #softwareProductGrid:has(>.software-loading-message:only-child){
    display:block!important;min-height:0!important;height:auto!important;margin:0!important;
  }
  #softwareProductGrid .software-loading-message{
    display:block!important;width:100%!important;min-height:0!important;height:auto!important;
    margin:0!important;padding:13px 12px!important;border-radius:13px!important;
    font-size:11px!important;line-height:1.5!important;text-align:center!important;
  }

  /* Printing cards: keep two columns, reduce image/body height and remove the blank gap before price. */
  #igPrintingGrid.printing-grid{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    align-items:stretch!important;gap:9px!important;
  }
  #igPrintingGrid .printing-card{
    min-width:0!important;min-height:0!important;height:auto!important;
    display:flex!important;flex-direction:column!important;border-radius:15px!important;
  }
  #igPrintingGrid .printing-thumb{
    height:clamp(118px,34vw,152px)!important;min-height:0!important;flex:0 0 auto!important;
  }
  #igPrintingGrid .printing-thumb-title{font-size:clamp(14px,4vw,17px)!important;line-height:1.18!important}
  #igPrintingGrid .printing-thumb-inner{padding:8px!important}
  #igPrintingGrid .printing-thumb-inner small{font-size:7.5px!important;margin-top:5px!important}
  #igPrintingGrid .printing-body{
    flex:1 1 auto!important;min-height:0!important;padding:10px!important;gap:5px!important;
  }
  #igPrintingGrid .printing-meta{font-size:8px!important;padding:4px 7px!important}
  #igPrintingGrid .printing-body h3{
    min-height:0!important;max-height:2.5em!important;margin:0!important;
    font-size:clamp(12px,3.5vw,15px)!important;line-height:1.25!important;
  }
  #igPrintingGrid .printing-body p{
    min-height:0!important;max-height:2.85em!important;margin:0!important;
    font-size:9px!important;line-height:1.42!important;
    display:-webkit-box!important;-webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;overflow:hidden!important;
  }
  #igPrintingGrid .printing-bottom{
    margin-top:8px!important;padding-top:8px!important;gap:7px!important;
  }
  #igPrintingGrid .printing-bottom .price{font-size:14px!important}
  #igPrintingGrid .printing-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important}
  #igPrintingGrid .printing-actions .preview-btn,
  #igPrintingGrid .printing-actions .buy-btn{
    width:100%!important;min-width:0!important;height:34px!important;min-height:34px!important;
    padding:0 4px!important;font-size:8.5px!important;border-radius:9px!important;
  }
  #igPrintingGrid:has(>.ig-print-notice:only-child){display:block!important;min-height:0!important}
  #igPrintingGrid>.ig-print-notice:only-child{
    margin:0!important;padding:13px!important;border:1px dashed #d5e3eb!important;
    border-radius:13px!important;font-size:11px!important;line-height:1.5!important;
  }

  /* Latest Work: a single empty message should not occupy a multi-column grid row. */
  #igLatestWorkGrid:has(>p:only-child){display:block!important;min-height:0!important;height:auto!important}
  #igLatestWorkGrid>p:only-child,
  #igLatestWorkGrid>.ig-portfolio-empty:only-child,
  #igLatestWorkGrid>.portfolio-empty:only-child,
  #igLatestWorkGrid>.empty-state:only-child{
    display:block!important;grid-column:1/-1!important;min-height:0!important;height:auto!important;
    margin:0!important;padding:13px 12px!important;border:1px dashed #d5e3eb!important;
    border-radius:13px!important;background:rgba(255,255,255,.86)!important;
    color:#718496!important;font-size:11px!important;line-height:1.5!important;text-align:center!important;
  }
  #igLatestWorkGrid .portfolio-live img{height:clamp(105px,31vw,145px)!important}

  /* Reviews: compact empty notice and bring the review form closer to the heading. */
  #reviewsGrid:has(>.review-empty:only-child){display:block!important;min-height:0!important;height:auto!important}
  #reviewsGrid>.review-empty:only-child{
    margin:0!important;padding:13px 12px!important;border:1px dashed #d5e3eb!important;
    border-radius:13px!important;background:rgba(255,255,255,.86)!important;
    font-size:11px!important;line-height:1.5!important;
  }
  #reviews .customer-review-box{margin:12px auto 0!important}
  #reviews .customer-review-prompt,
  #reviews .customer-review-form{padding:14px!important;border-radius:14px!important}

  /* Prevent empty software/review/portfolio blocks from adding artificial minimum height. */
  #igLatestWorkGrid,#reviewsGrid,#softwareProductGrid{min-height:0!important;height:auto!important}
}

@media(max-width:380px){
  #designPagination .home-design-pages{gap:4px!important}
  #designPagination button{padding:0 6px!important;font-size:9.5px!important}
  #igPrintingGrid .printing-body{padding:8px!important}
  #igPrintingGrid .printing-actions .preview-btn,
  #igPrintingGrid .printing-actions .buy-btn{font-size:7.8px!important}
}


/* SEO: keep recent design thumbnails as crawlable image elements, without changing card geometry. */
#recentDesignMarquee .recent-preview-card .cat-thumb.has-image{position:relative;overflow:hidden;background-image:none!important;background-color:#eef4f6!important;}
#recentDesignMarquee .recent-preview-card .cat-thumb .recent-design-img{position:absolute;inset:0;width:100%;height:100%;display:block;object-fit:cover;object-position:center;}
#recentDesignMarquee .recent-preview-card .cat-thumb .cat-thumb-badge{z-index:2;}
