/* v3.4 horizontal recipe browsing */
#recipe-grid.browse-mode{display:block}
.browse-section{margin:1.4rem 0 2.25rem;min-width:0}
.browse-section-head{display:flex;justify-content:space-between;align-items:baseline;gap:1rem;margin:0 0 .8rem}
.browse-section-head h3{font-size:1.4rem;margin:0}
.browse-text-link{border:0;background:transparent;color:inherit;text-decoration:underline;text-underline-offset:3px;cursor:pointer;padding:.4rem .1rem;font:inherit;white-space:nowrap}
.browse-text-link:hover{opacity:.7}
.browse-track{display:flex;gap:1rem;overflow-x:auto;overscroll-behavior-inline:contain;scroll-snap-type:x proximity;padding:.25rem .15rem 1rem;scrollbar-width:thin}
.browse-track>.recipe-card{flex:0 0 clamp(200px,25vw,285px);min-width:0;scroll-snap-align:start}
.browse-category-tile{flex:0 0 clamp(160px,24vw,250px);min-height:110px;border:1px solid currentColor;border-radius:12px;padding:1rem;text-align:left;white-space:normal;background:transparent;font-size:1.1rem;font-weight:600;scroll-snap-align:start;cursor:pointer}
.browse-back{margin:1rem 0}
.browse-page-title{margin:.75rem 0 1.5rem}
#recipe-grid.browse-mode>.recipe-grid{display:grid}
@media(max-width:650px){.browse-track>.recipe-card{flex-basis:74vw;max-width:300px}.browse-category-tile{flex-basis:70vw}.browse-section-head h3{font-size:1.2rem}}
/* Category drill-downs: explicitly restore the card grid after browse-mode switches the outer container to block. */
#recipe-grid.browse-mode > .recipe-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:17px;align-items:stretch;width:100%}
#recipe-grid.browse-mode > .recipe-grid > .recipe-card{min-width:0;width:100%}
@media(max-width:850px){#recipe-grid.browse-mode > .recipe-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){#recipe-grid.browse-mode > .recipe-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}
/* Keep two columns even on narrow phones; the former 390px rule forced one column. */
@media(max-width:560px){#recipe-grid.browse-mode > .recipe-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}

/* Filtering exits browse mode; restore the outer recipe grid instead of inheriting display:block. */
#recipe-grid:not(.browse-mode){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:17px;align-items:stretch}
#recipe-grid:not(.browse-mode) > .recipe-card{min-width:0;width:100%}
@media(max-width:850px){#recipe-grid:not(.browse-mode){grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){#recipe-grid:not(.browse-mode){grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}
