/*
Theme Name: shStudios
Description: Block theme for shStudios: quilting, artwork and app development.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: shstudios
*/

/* Small refinements that theme.json can't express */
.sh-mono { font-family: var(--wp--preset--font-family--mono); letter-spacing: .08em; text-transform: uppercase; }
.sh-card { transition: transform .2s ease, box-shadow .2s ease; }

.sh-stitch { border: 2px dashed var(--wp--preset--color--madder); border-radius: 4px; }
.wp-block-navigation a { text-decoration: none; }
.wp-block-navigation a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--wp--preset--color--madder); }
.sh-patch svg { display:block; width:100%; height:auto; }



/* ---- Minimal layout: content left, menu right ---- */
body { -webkit-font-smoothing: antialiased; }
.sh-shell { display: grid; grid-template-columns: minmax(0, 1fr) 200px; column-gap: clamp(2rem, 6vw, 6rem); max-width: 1100px; margin: 0 auto !important; padding: 2.5rem clamp(1rem, 4vw, 2.5rem) 3rem; align-items: start; }
.sh-shell > header { grid-column: 2; grid-row: 1; position: sticky; top: 2.5rem; }
.sh-shell > main { grid-column: 1; grid-row: 1; min-width: 0; }
.sh-shell > * { margin-block: 0 !important; }
.sh-side { display: flex; flex-direction: column; gap: 1.75rem; }
.sh-side .wp-block-site-logo img { display: block; }
.sh-side .wp-block-navigation { --wp--style--block-gap: .35rem; }
.sh-side .wp-block-navigation a { color: #8a929b; text-decoration: none; }
.sh-side .wp-block-navigation a:hover, .sh-side .current-menu-item > a { color: var(--wp--preset--color--ink); }
.sh-side .wp-block-navigation__container { gap: .4rem; }
.sh-shell main > * + * { margin-top: 1.25rem; }
.sh-shell main h1, .sh-shell main .wp-block-post-title { margin: 0 0 1.5rem; }
.sh-shell main .has-large-font-size { font-size: 1rem; }
.sh-shell main .wp-block-post-content > * { max-width: 36rem; margin-left: 0 !important; margin-right: 0 !important; }
.sh-hero { display: block; width: 100%; height: auto; }
.sh-foot { max-width: 1100px; margin: 0 auto !important; padding: 0 clamp(1rem, 4vw, 2.5rem) 2.5rem; color: #8a929b; }
footer.wp-block-template-part { margin-block-start: 0; }

/* gallery: plain images, small caption */
.sh-card { background: none; }
.sh-card .wp-block-post-title, .sh-card .wp-block-post-title a { font-size: .9rem; font-style: italic; color: #8a929b; margin: .5rem 0 0; }
.sh-card .wp-block-post-title a:hover { color: var(--wp--preset--color--ink); }
.sh-card .wp-block-post-featured-image { margin: 0; }
.sh-panel ul.wp-block-post-template.is-layout-grid, ul.wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 1.5rem; }
.sh-stitch { border: 1px dashed #c5cbd2; border-radius: 0; padding: 1rem; color: #8a929b; }

/* Quilts / Stoles tabs: plain text, CSS only */
.sh-tabs .sh-tab-input { position: absolute; opacity: 0; pointer-events: none; }
.sh-tablist { display: flex; gap: 1.5rem; margin: .5rem 0 2rem; }
.sh-tab { font-style: italic; font-size: .9rem; cursor: pointer; color: #8a929b; padding-bottom: .15rem; border-bottom: 1px solid transparent; }
.sh-tab:hover { color: var(--wp--preset--color--ink); }
.sh-panel { display: none; }
.sh-tabs:has(#tab-quilts:checked) .sh-panel-quilts,
.sh-tabs:has(#tab-stoles:checked) .sh-panel-stoles { display: block; }
.sh-tabs:has(#tab-quilts:checked) label[for="tab-quilts"],
.sh-tabs:has(#tab-stoles:checked) label[for="tab-stoles"] { color: var(--wp--preset--color--ink); border-bottom-color: var(--wp--preset--color--ink); }
.sh-tabs:has(#tab-quilts:focus-visible) label[for="tab-quilts"],
.sh-tabs:has(#tab-stoles:focus-visible) label[for="tab-stoles"] { outline: 2px solid var(--wp--preset--color--cyan); outline-offset: 3px; }

/* phone: menu moves to the top, still simple */
@media (max-width: 700px) {
  .sh-shell { grid-template-columns: minmax(0, 1fr); row-gap: 2rem; padding-top: 1.5rem; }
  .sh-shell > header { grid-column: 1; grid-row: 1; position: static; }
  .sh-shell > main { grid-column: 1; grid-row: 2; }
  .sh-side { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
  .sh-side .wp-block-site-logo img { width: 90px; height: auto; }
  .sh-side .wp-block-navigation__container { flex-direction: row !important; flex-wrap: wrap; gap: .4rem 1rem; }
  ul.wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem .75rem; }
}

/* natural image proportions in the gallery */
.sh-card .wp-block-post-featured-image { aspect-ratio: auto !important; }
.sh-card .wp-block-post-featured-image img { aspect-ratio: auto !important; height: auto !important; width: 100%; object-fit: contain; }
ul.wp-block-post-template.is-layout-grid { align-items: end; }

/* menu colors + phone menu as a wrapping row */
.sh-side .wp-block-navigation .wp-block-navigation-item a { color: #8a929b !important; }
.sh-side .wp-block-navigation .wp-block-navigation-item a:hover,
.sh-side .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--ink) !important; }
@media (max-width: 700px) {
  .sh-side { display: block; }
  .sh-side .wp-block-site-logo { margin-bottom: 1rem; }
  .sh-side .wp-block-navigation, .sh-side .wp-block-navigation .wp-block-page-list, .sh-side .wp-block-navigation__container { flex-direction: row !important; flex-wrap: wrap; gap: .3rem 1.1rem; align-items: flex-start; }
}

/* ---- round 3: mono menu, copyright in the side column, full-bleed home ---- */
.sh-side .wp-block-navigation { font-family: var(--wp--preset--font-family--mono) !important; font-style: normal !important; font-size: .78rem !important; text-transform: uppercase !important; letter-spacing: .08em !important; }
.sh-side .wp-block-navigation a { font-style: normal !important; }
.sh-side { min-height: calc(100vh - 5rem); }
.sh-side .sh-copy { margin: auto 0 0 !important; font-family: var(--wp--preset--font-family--mono); font-size: .7rem !important; letter-spacing: .08em; text-transform: uppercase; color: #8a929b; }
.sh-foot { display: none; }
.sh-tab { font-family: var(--wp--preset--font-family--mono); font-style: normal; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }

/* home: image bleeds to top, left and bottom */
body.home .sh-shell.sh-home { max-width: none; padding: 0; column-gap: 0; grid-template-columns: minmax(0, 1fr) 240px; min-height: 100vh; align-items: stretch; }
body.home .sh-home > main { height: 100%; }
body.home .sh-home .sh-hero { position: sticky; top: 0; width: 100%; height: 100vh; object-fit: cover; }
body.home .sh-home > header { position: sticky; top: 0; height: 100vh; padding: 2.5rem 1.5rem 2rem; box-sizing: border-box; align-self: start; }
body.home .sh-home .sh-side { min-height: 100%; height: 100%; }
body.admin-bar.home .sh-home .sh-hero, body.admin-bar.home .sh-home > header { top: 32px; height: calc(100vh - 32px); }

@media (max-width: 700px) {
  .sh-side { min-height: 0; }
  .sh-side .sh-copy { display: none; }
  .sh-foot { display: block; }
  .sh-foot p { font-family: var(--wp--preset--font-family--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
  body.home .sh-shell.sh-home { grid-template-columns: minmax(0, 1fr); }
  body.home .sh-home > header { position: static; height: auto; padding: 1.5rem 1rem 1rem; grid-row: 1; }
  body.home .sh-home > main { grid-row: 2; }
  body.home .sh-home .sh-hero { position: static; height: auto; }
}

/* gallery images: capped height, natural proportions */
.sh-card .wp-block-post-featured-image { display: flex; align-items: flex-end; height: 420px; }
.sh-card .wp-block-post-featured-image a { display: contents; }
.sh-card .wp-block-post-featured-image img { width: auto !important; max-width: 100%; height: auto !important; max-height: 420px; object-fit: contain; }
@media (max-width: 700px) { .sh-card .wp-block-post-featured-image { height: 260px; } .sh-card .wp-block-post-featured-image img { max-height: 260px; } }

/* single piece page */
body.single .wp-block-post-featured-image { margin: 0 0 1.25rem; }
body.single .wp-block-post-featured-image img { width: auto !important; max-width: 100%; height: auto !important; max-height: 78vh; aspect-ratio: auto !important; object-fit: contain; display: block; }
body.single main .wp-block-post-title { font-size: 1.3rem; margin: 0 0 .75rem; }

/* uniform square thumbnails; focus point set per piece in the editor */
.sh-card .wp-block-post-featured-image { height: auto !important; aspect-ratio: 7 / 8 !important; display: block; }
.sh-card .wp-block-post-featured-image a { display: block; height: 100%; }
.sh-card .wp-block-post-featured-image img { width: 100% !important; height: 100% !important; max-height: none; object-fit: cover; }
body.page-id-58 .sh-card .wp-block-post-featured-image img { object-fit: contain; }
ul.wp-block-post-template.is-layout-grid { align-items: start; }

/* wide screens: more columns */
@media (min-width: 701px) {
  .sh-shell:not(.sh-home) { max-width: 2000px; }
  .sh-shell:not(.sh-home) ul.wp-block-post-template.is-layout-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
.sh-shell main .wp-block-post-content > .wp-block-query { max-width: none; }

/* journal list */
.sh-journal { max-width: 36rem; }
.sh-entry { padding: 0 0 2rem; margin: 0 0 2rem; border-bottom: 1px solid #e6e9ed; }
.sh-entry .wp-block-post-date { font-size: .7rem; color: #8a929b; margin: 0 0 .4rem; }
.sh-entry .wp-block-post-title { font-size: 1.3rem; margin: 0 0 .6rem; }
.sh-entry .wp-block-post-excerpt { color: #4a5560; margin: 0; }
.sh-journal .wp-block-query-pagination { font-family: var(--wp--preset--font-family--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }

/* piece page: photo left, text right */
.sh-piece { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.sh-piece:not(:has(img)) { display: block; max-width: 36rem; }
.sh-piece-media > * + * { margin-top: 1rem; }
.sh-piece-media .sh-more { display: grid; gap: 1rem; }
.sh-piece-media img { display: block; width: 100%; height: auto; max-height: 85vh; object-fit: contain; object-position: left top; }
body.single .sh-piece-media .wp-block-post-featured-image img { width: 100% !important; max-height: 85vh; }
.sh-piece-text { position: sticky; top: 2.5rem; }
.sh-piece-text .wp-block-post-title { font-size: 1.3rem !important; margin: 0 0 1rem; }
.sh-details { margin: 0 0 1.5rem; font-size: .9rem; }
.sh-details > div { display: grid; grid-template-columns: 6rem 1fr; gap: .5rem; padding: .35rem 0; border-top: 1px solid #e6e9ed; }
.sh-details dt { font-family: var(--wp--preset--font-family--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #8a929b; padding-top: .15rem; }
.sh-details dd { margin: 0; }
.sh-piece-text .wp-block-post-content { font-size: .95rem; }
.sh-piece-nav { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid #e6e9ed; font-family: var(--wp--preset--font-family--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; gap: 1rem; }
.sh-piece-nav a { color: #8a929b; text-decoration: none; }
.sh-piece-nav a:hover { color: var(--wp--preset--color--ink); }
.sh-piece-nav .post-navigation-link__label { display: block; font-size: .65rem; opacity: .7; }
@media (max-width: 860px) { .sh-piece { grid-template-columns: minmax(0, 1fr); } .sh-piece-text { position: static; } }

/* piece page: single column, big image */
.sh-piece, .sh-piece:not(:has(img)) { display: block; max-width: none; }
.sh-piece-text { position: static; max-width: 36rem; margin-top: 2rem; }
.sh-piece-media img, body.single .sh-piece-media .wp-block-post-featured-image img { width: auto !important; max-width: 100%; height: auto; max-height: 92vh; object-fit: contain; object-position: left top; }
.sh-piece-media .sh-more { display: block; }
.sh-piece-media .sh-more img { margin-top: 1.5rem; }

/* home: no page padding so the image touches the left edge */
body.home { padding-left: 0 !important; padding-right: 0 !important; }

/* phone: keep two columns (core collapses columns-2 to one under 600px) */
@media (max-width: 700px) {
  .sh-shell ul.wp-block-post-template.is-layout-grid.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 1.5rem .75rem; }
}
body.page-id-58 .sh-card .wp-block-post-featured-image img { object-fit: contain !important; }
