/*
Theme Name: MOPED Lab
Theme URI: https://moped-lab.org
Description: A Full Site Editing block theme for the MOPED research group.
Version: 2.0.9
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: moped-lab
*/

/* Base FSE presentation. Content, block order and all visual choices remain editable in WordPress. */
:root{--moped-page-gutter:clamp(1.25rem,3vw,3rem);--moped-touch-target:2.75rem}
.wp-site-blocks{overflow-x:clip}
.wp-block-image img,.wp-block-post-featured-image img{display:block;max-width:100%;height:auto}
.wp-block-cover__image-background{width:100%;height:100%;object-fit:cover}
.wp-block-button__link,.wp-block-navigation-item__content{display:inline-flex;align-items:center;justify-content:center;min-height:var(--moped-touch-target)}
.wp-block-button__link{padding:.7rem 1rem;text-align:center}
.wp-block-navigation a,.moped-publication .wp-block-group{overflow-wrap:anywhere}

/* Header and footer template parts. */
header.wp-block-group.alignfull,footer.wp-block-group.alignfull{padding-inline:var(--moped-page-gutter)}
header.wp-block-group.alignfull>.wp-block-group.alignwide{width:100%;max-width:1440px}
header .wp-block-image{flex:0 0 auto;margin:0}
header .wp-block-image img{width:clamp(3.25rem,6vw,4.75rem)!important}
header .wp-block-navigation{margin-left:auto}
footer.wp-block-group.alignfull>.wp-block-group.alignwide{gap:clamp(1.25rem,3vw,2.5rem)}
footer .wp-block-image{margin:0}

/* Full-width Gutenberg groups and the hero retain their desktop proportions. */
.wp-block-group.alignfull>.wp-block-group.alignwide{width:min(1440px,calc(100% - 3rem));max-width:none!important}
.moped-hero{min-height:clamp(35rem,58vw,44rem)!important;padding-inline:var(--moped-page-gutter)}
.moped-hero .wp-block-cover__inner-container{width:100%;max-width:1440px;margin-inline:auto}
.moped-hero .wp-block-group.alignwide{max-width:46rem}
.moped-hero .wp-block-buttons{gap:.75rem}
.moped-hero .wp-block-button{margin:0}
.wp-block-columns{gap:clamp(1.25rem,2.5vw,2.5rem)}
.moped-card{display:flex;flex-direction:column;height:100%}
.moped-card p:last-child{margin-bottom:0}

/* Data & Tools: both the legacy pattern and the editable core-block cards. */
section.moped-tools-page{display:block;max-width:1500px;margin:0 auto;padding:0 clamp(1.5rem,4vw,4.5rem);background:#fff!important;color:#111!important}
.moped-tools-intro{padding:4.5rem 0 3rem}
.moped-eyebrow{font:700 .7rem/1.4 Arial,sans-serif;letter-spacing:.12em;margin:0 0 1.25rem}
.moped-tools-intro h1{margin:0;font-family:Georgia,serif;font-size:clamp(3rem,5vw,5rem)!important;font-weight:400;letter-spacing:-.06em;line-height:.9;white-space:nowrap}
.moped-tools-intro h1 em{font-style:italic}
.moped-tools-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.25rem;padding-bottom:5rem}
.moped-tool-card{height:100%;overflow:hidden}
.moped-tools-grid .moped-tool-card{height:auto;padding:1rem 0 0;border-top:1px solid #d9d9d9;background:transparent!important;color:#111!important}
.moped-tools-grid .moped-tool-card img,.moped-editable-tool-card .wp-block-image img{display:block;width:100%;max-width:100%;height:auto;aspect-ratio:16/10;object-fit:cover}
.moped-tools-grid .moped-tool-card img{margin:0 0 1.2rem}
.moped-tools-grid h2{margin:.4rem 0 1rem;font:400 clamp(2rem,3vw,2.6rem)/.95 Georgia,serif!important;letter-spacing:-.045em}
.moped-tools-grid .moped-tool-link{color:#195f6f;font-weight:700;text-underline-offset:5px}
.moped-editable-tool-grid{width:min(1240px,calc(100vw - 3rem))!important;max-width:none!important;margin-top:var(--wp--preset--spacing--50)}
.moped-editable-tool-card{height:100%;overflow:hidden;padding:1.15rem;border-top:1px solid var(--wp--preset--color--mist);transition:transform .28s ease,box-shadow .28s ease,background-color .28s ease}
.moped-editable-tool-card .wp-block-image{margin:0 0 var(--wp--preset--spacing--30);overflow:hidden}
.moped-editable-tool-card .wp-block-image img{transition:transform .45s ease}
.moped-editable-tool-card .wp-block-heading{font-size:clamp(1.8rem,2.4vw,2.6rem)!important}
.moped-editable-tool-card .wp-block-buttons{margin-top:var(--wp--preset--spacing--30)}
.moped-editable-tool-card .wp-block-button__link{transition:background-color .2s ease,color .2s ease,border-color .2s ease}
@media(hover:hover){.moped-editable-tool-card:hover{background:#fff;box-shadow:0 18px 40px rgba(128,128,128,.28);transform:translateY(-8px)}.moped-editable-tool-card:hover .wp-block-image img{transform:scale(1.055)}.moped-editable-tool-card .wp-block-button__link:hover{background:#d3d3d3;color:#071a2f;border-color:#d3d3d3}}

.moped-exploration-title{letter-spacing:-.06em;text-transform:none}
.moped-exploration-title::after{content:"";display:block;width:4.25rem;height:.42rem;margin-top:1rem;background:#63d0c7}
main.wp-block-group.alignfull>.wp-block-group.alignwide>.wp-block-heading:first-child{width:min(1240px,calc(100vw - 3rem));max-width:none!important;margin-inline:auto;text-align:left;white-space:nowrap;line-height:.9}

/*
  Single source of truth for tablet and phone reflow.
  It deliberately overrides Gutenberg inline flex-basis values (for example the
  Contact block's 65% column) and the theme's desktop-only tool-grid width.
*/
@media (max-width:1024px){
  :root{--moped-page-gutter:1rem}
  .wp-block-group.alignfull>.wp-block-group.alignwide{width:calc(100% - (var(--moped-page-gutter) * 2))!important;max-width:none!important;margin-inline:auto!important}
  .wp-block-columns{display:flex!important;flex-direction:column!important;align-items:stretch!important;width:100%!important;max-width:100%!important;gap:var(--wp--preset--spacing--40)!important}
  .wp-block-columns>.wp-block-column{flex:0 0 100%!important;width:100%!important;max-width:100%!important;min-width:0!important}
  .wp-block-group.is-layout-grid,.wp-block-post-template.is-flex-container,.wp-block-query-loop.is-flex-container,.wp-block-gallery.has-nested-images{display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;max-width:100%!important;gap:var(--wp--preset--spacing--40)!important}
  .wp-block-media-text{grid-template-columns:minmax(0,1fr)!important;width:100%}
  .wp-block-media-text>.wp-block-media-text__media,.wp-block-media-text>.wp-block-media-text__content{grid-column:1!important;grid-row:auto!important;width:100%}
  .wp-block-media-text>.wp-block-media-text__content{padding:var(--wp--preset--spacing--40) 0 0!important}
  .moped-editable-tool-grid{width:100%!important;max-width:100%!important}
  .moped-tools-page{padding-inline:var(--moped-page-gutter)!important}
  .moped-tools-grid{display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;max-width:100%!important;gap:var(--wp--preset--spacing--40)!important}
  .moped-card,.moped-tool-card,.moped-editable-tool-card{box-sizing:border-box;width:100%!important;max-width:none!important;height:auto;min-width:0!important}
  .moped-editable-tool-card{padding:clamp(1.5rem,3vw,2.5rem)!important}
  .moped-editable-tool-card.is-layout-constrained>*{max-width:none!important;margin-inline:0!important}
  .moped-editable-tool-card .wp-block-image,.moped-editable-tool-card .wp-block-image img{width:100%!important;max-width:none!important}
  .moped-tools-grid .moped-tool-card{padding:clamp(1.25rem,2.5vw,2rem)!important}
  .moped-tools-grid .moped-tool-card img{width:100%;aspect-ratio:16/9;object-fit:cover}
  .moped-tools-intro h1,main.wp-block-group.alignfull>.wp-block-group.alignwide>.wp-block-heading:first-child{white-space:normal;overflow-wrap:anywhere}
  header .wp-block-navigation__responsive-container-open:not(.always-shown){display:flex;padding:.625rem;min-width:var(--moped-touch-target);min-height:var(--moped-touch-target);align-items:center;justify-content:center}
  header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open){display:none}
  header .wp-block-navigation__responsive-container.is-menu-open{padding:clamp(1.25rem,5vw,2rem);background:var(--wp--preset--color--paper);color:var(--wp--preset--color--ink)}
  header .wp-block-navigation__responsive-container-content,header .wp-block-navigation__responsive-container .wp-block-navigation__container{width:100%;align-items:stretch}
  header .wp-block-navigation__responsive-container .wp-block-navigation__container{gap:.25rem}
  header .wp-block-navigation__responsive-container .wp-block-navigation-item{width:100%}
  header .wp-block-navigation__responsive-container .wp-block-navigation-item__content{justify-content:flex-start;width:100%;padding:.7rem 0;font-size:clamp(1rem,3vw,1.2rem)}
  header .wp-block-navigation__responsive-container-close{min-width:var(--moped-touch-target);min-height:var(--moped-touch-target)}
}

@media (max-width:768px){
  :root{--moped-page-gutter:.5rem}
  header.wp-block-group.alignfull{padding-block:var(--wp--preset--spacing--20)!important}
  .moped-hero{min-height:34rem!important;padding-block:var(--wp--preset--spacing--40)}
  .moped-hero .wp-block-group.alignwide{max-width:100%}
  .wp-block-buttons,.moped-hero .wp-block-buttons{align-items:stretch;width:100%}
  .wp-block-buttons .wp-block-button,.moped-hero .wp-block-button{width:100%}
  .wp-block-buttons .wp-block-button__link,.moped-hero .wp-block-button__link{width:100%}
  .moped-card,.moped-tool-card,.moped-editable-tool-card{padding:var(--wp--preset--spacing--30)!important}
  .moped-tools-intro{padding:3.25rem 0 2rem}
  .moped-tools-grid{padding-bottom:3.5rem}
  footer.wp-block-group.alignfull>.wp-block-group.alignwide{align-items:flex-start;gap:1.25rem}
  footer .wp-block-image img{max-width:min(10.5rem,45vw)!important}
}

@media (max-width:479px){
  :root{--moped-page-gutter:.5rem}
  .moped-hero{min-height:31rem!important}
  .moped-hero .has-x-large-font-size{font-size:clamp(2.1rem,11vw,2.7rem)!important}
  .moped-hero .has-large-font-size{font-size:1.1rem!important;line-height:1.55}
  .moped-tools-intro h1{font-size:clamp(2.35rem,13vw,3.4rem)!important;letter-spacing:-.05em}
  .moped-editable-tool-card .wp-block-heading,.moped-tools-grid h2{font-size:clamp(1.75rem,9vw,2.2rem)!important}
  .moped-card,.moped-tool-card,.moped-editable-tool-card{padding:1rem!important}
}
