/* Sitewide mobile rhythm and typography polish — 12 Sep 2026. */

@media (max-width: 767px) {
  :root {
    --cw-mobile-gutter: 18px;
    --cw-mobile-section-space: 56px;
    --cw-mobile-heading-gap: 24px;
    --cw-mobile-content-gap: 16px;
  }

  /* One site-wide editorial gutter. Nested containers must not add it twice. */
  .site-main .cw-container,
  .site-main .container {
    width: calc(100% - (var(--cw-mobile-gutter) * 2));
  }

  .site-main .cw-container .cw-container,
  .site-main .container .container,
  .site-main .cw-container .container,
  .site-main .container .cw-container {
    width: 100%;
    max-width: none;
  }

  /* Preserve each component's desktop font family while improving line breaks. */
  .site-main h1,
  .site-main h2,
  .site-main h3 {
    text-wrap: balance;
  }

  /* Desktop-authored title breaks must not force awkward mobile wrapping. */
  .site-main h1 br,
  .site-main h2 br,
  .site-main h3 br {
    display: none;
  }

  .site-main p,
  .site-main li {
    overflow-wrap: break-word;
    word-break: normal;
    text-wrap: wrap;
  }

  /* Intro copy is one continuous mobile paragraph; real paragraphs stay separate. */
  .cw-home-intro__body p br,
  .cw-about-split__copy p br,
  .cw-why-wood-properties > p br,
  .cw-finishes-intro p br,
  .cw-gallery-intro p br,
  .cw-resources-intro p br,
  .cw-program-single-intro p br {
    display: none;
  }

  /* Full-width About copy follows the shared gutter instead of desktop staggering. */
  .cw-about-page .cw-about-split__copy,
  .cw-about-page .cw-about-split--image-text .cw-about-split__copy {
    padding-right: var(--cw-mobile-gutter);
    padding-left: var(--cw-mobile-gutter);
  }

  /* The Sustainability builder owns the gutter; its nested blocks must not add it twice. */
  .site-main .cw-why-page .cw-media-builder {
    width: calc(100% - (var(--cw-mobile-gutter) * 2));
  }

  .site-main .cw-why-page .cw-media-builder > .cw-container {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
  }

  /* Primary editorial copy: readable and consistent without enlarging card metadata. */
  .cw-about-split__copy p,
  .cw-about-work__text p,
  .cw-program-card__content p,
  .cw-news-card p,
  .cw-blog-card p,
  .cw-success-card p {
    font-size: 16px;
    line-height: 1.5;
  }

  .cw-contact-office__body p,
  .cw-contact-office__info,
  .cw-contact-person p,
  .privacy-policy-page__content p,
  .privacy-policy-page__content li {
    font-size: 17px;
    line-height: 1.6;
  }

  /* One shared scale for section headings; display/hero headings keep their own scale. */
  .cw-about-work > h2,
  .cw-species-section-title,
  .cw-finishes-intro h2,
  .cw-resources-group__title,
  .cw-program-single-intro h2,
  .cw-program-offer h2,
  .cw-program-benefits h2 {
    font-size: 28px;
    line-height: 1.15;
  }

  .cw-gallery-category__text h2,
  .cw-contact-overview h1,
  .cw-contact-overview h2 {
    font-size: 30px;
    line-height: 1.15;
  }

  .cw-program-card__content h2 {
    font-size: 28px;
    line-height: 1.05;
  }

  .cw-program-card__content p {
    line-height: 1.3;
  }

  .cw-resources-intro__copy h2 {
    font-size: 38px;
    line-height: 1.05;
  }

  .cw-resources-intro__text {
    font-size: 22px;
    line-height: 1.3;
  }

  /* Consistent section rhythm for regular content flows. */
  .cw-about-work,
  .cw-why-wood-properties,
  .cw-finishes-intro,
  .cw-gallery-intro,
  .cw-programs-list,
  .cw-events-list,
  .cw-success-intro,
  .privacy-policy-page {
    padding-top: var(--cw-mobile-section-space);
    padding-bottom: var(--cw-mobile-section-space);
  }

  .cw-species-panel,
  .cw-species-characteristics,
  .cw-species-properties,
  .cw-species-resources,
  .cw-species-collections {
    padding-top: var(--cw-mobile-section-space);
    padding-bottom: var(--cw-mobile-section-space);
  }

  /* Reusable internal rhythm: title → copy → action/media. */
  .cw-home-section-title,
  .cw-about-work > h2,
  .cw-species-section-title,
  .cw-resources-group__title,
  .cw-gallery-category__text h2 {
    margin-bottom: var(--cw-mobile-heading-gap);
  }

  .cw-about-split__copy > div > * + *,
  .cw-home-intro__body > * + *,
  .cw-home-section-text > * + *,
  .cw-resources-intro__text > * + *,
  .cw-program-card__content > * + * {
    margin-top: var(--cw-mobile-content-gap);
  }

  /* Sustainability: keep the hero word intact and return staggered content to flow. */
  .cw-why-page .cw-page-hero--slider .cw-page-hero__content h1 {
    width: auto;
    max-width: none;
    font-size: clamp(30px, 9vw, 38px);
    line-height: 1.08;
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
  }

  .cw-why-page .cw-why-forest-column {
    height: auto;
    min-height: 0;
    gap: 28px;
  }

  .cw-why-page .cw-why-forest-copy {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    padding-right: 0;
    padding-left: 0;
    overflow: visible;
  }

  .cw-why-page .cw-why-forest-image {
    flex: 0 0 auto;
    height: 320px;
    min-height: 320px;
  }

  .cw-why-page .cw-why-forest-copy--top,
  .cw-why-page .cw-why-forest-copy--lower,
  .cw-why-page .cw-why-forest-image--top,
  .cw-why-page .cw-why-forest-image--bottom {
    align-self: stretch;
    transform: none !important;
  }

  /* Certification: remove desktop hard breaks and compact the four facts. */
  .cw-why-page .cw-why-cert__columns > :first-child h2 br {
    display: none;
  }

  .cw-why-page .cw-why-cert__columns > :first-child h2 {
    font-size: clamp(20px, 6.2vw, 26px);
    line-height: 1.18;
    text-wrap: balance;
  }

  .cw-why-page .cw-why-cert__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 38px 16px;
    align-items: start;
  }

  .cw-why-page .cw-why-cert-stat__icon {
    width: clamp(88px, 27vw, 108px);
    height: clamp(88px, 27vw, 108px);
    margin-bottom: 16px;
  }

  .cw-why-page .cw-why-cert-stat strong {
    margin-bottom: 10px;
    font-size: clamp(42px, 13vw, 54px);
  }

  .cw-why-page .cw-why-cert-stat span {
    font-size: 15px;
    line-height: 1.3;
  }

  /* Species detail: halve the left inset of expanded accordion content. */
  .cw-species-accordion__panel {
    padding-left: 10px;
  }

  .cw-species-accordion__panel ul,
  .cw-species-accordion__panel ol {
    padding-left: 20px;
  }

  /* Forms: a little more breathing room around the field group, less height within it. */
  .cw-end-form__fields,
  .cw-company-form__fields,
  .cw-program-form__fields,
  .cw-media-single-form__fields,
  .cw-contact-lead__fields,
  .cw-species-contact__fields {
    gap: 12px;
    padding: 4px;
  }

  .cw-end-form__field,
  .cw-contact-lead__field,
  .cw-species-contact__field {
    gap: 0;
  }

  .cw-end-form input,
  .cw-end-form select,
  .cw-contact-lead__field input,
  .cw-species-contact__field input {
    min-height: 28px;
  }

  .cw-end-form textarea,
  .cw-contact-lead__field textarea,
  .cw-species-contact__field textarea,
  .cw-media-single-form__field textarea {
    min-height: 52px;
  }

  .cw-company-form input,
  .cw-company-form textarea,
  .cw-company-form select,
  .cw-program-form input,
  .cw-program-form textarea,
  .cw-program-form select,
  .cw-media-single-form__field input,
  .cw-media-single-form__field textarea,
  .cw-media-single-form__field select {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .cw-end-form--forest .cw-end-form__panel {
    padding: 21px 17px 23px;
  }

  .cw-end-form--forest .cw-end-form__fields {
    gap: 12px;
  }

  .cw-end-form--forest .cw-end-form__field {
    display: grid;
    gap: 0;
  }

  /* Match the Finishes action to the standard mobile Home button. */
  .cw-finishes-load-more {
    min-width: 118px;
    min-height: 40px;
    margin-top: 26px;
    padding: 10px 18px;
    font-size: 16px;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
  }

  /* News/Event detail rhythm: halve excess whitespace around article framing. */
  .cw-media-single--news .cw-media-single-head {
    padding-top: 36px;
    padding-bottom: 11px;
  }

  .cw-media-single--news .cw-media-single-head time {
    margin-bottom: 7px;
  }

  .cw-media-single--news .cw-media-single-body > :first-child {
    margin-top: 0;
  }

  .cw-media-single--news .cw-media-related,
  .cw-media-single--event .cw-media-related {
    padding-bottom: 30px;
  }

  /* Listing pagination stays compact and on one line. */
  .cw-media-pagination {
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 21px;
    margin-bottom: 44px;
    font-size: 16px;
  }

  .cw-media-pagination .prev,
  .cw-media-pagination .next {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .cw-media-pagination .cw-pagination-page-word {
    display: none;
  }

  /* Event listing: compact calendar at left, useful information at right. */
  .cw-event-card {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
    padding: 16px;
  }

  .cw-event-card__date {
    width: 84px;
    min-height: 108px;
    margin-top: 0;
  }

  .cw-event-card__date div {
    padding: 7px 4px;
    font-size: 13px;
  }

  .cw-event-card__date strong {
    margin-top: 10px;
    font-size: 34px;
    line-height: 1;
  }

  .cw-event-card__date span {
    margin-top: 8px;
    margin-bottom: 7px;
    font-size: 15px;
  }

  .cw-event-card h2 {
    margin-bottom: 12px;
    font-size: 22px;
  }

  .cw-event-card__location {
    margin-bottom: 14px;
    font-size: 16px;
  }

  .cw-event-card .cw-media-button {
    min-width: 0;
    padding: 10px;
  }

  .cw-event-card__media {
    grid-column: 1 / -1;
  }

  /* Species samples: let each image define its own height; no empty warm panel below. */
  .cw-species-panel__media {
    align-items: start;
    grid-template-rows: auto;
    height: auto;
  }

  .cw-species-panel__image,
  .cw-species-panel__image--1,
  .cw-species-panel__image--2,
  .cw-species-panel__image--3 {
    align-self: start;
    height: auto;
    background: transparent;
  }

  .cw-species-panel__image img {
    height: auto;
  }

  /* Compact section-heading controls, matching the Other News carousel. */
  .cw-species-collections,
  .cw-home-programs {
    position: relative;
  }

  .cw-species-collections > .cw-species-section-title,
  .cw-home-programs > .cw-home-section-title {
    padding-right: 88px;
  }

  .cw-species-collections__viewport {
    position: static;
    margin-top: var(--cw-mobile-heading-gap);
  }

  .cw-species-collections__viewport > .cw-species-arrow,
  .cw-home-programs__arrow {
    top: var(--cw-mobile-section-space);
    bottom: auto;
    width: 34px;
    height: 34px;
    border: 1px solid var(--cw-dark-evergreen);
    background: var(--cw-color-surface);
    transform: none;
  }

  .cw-species-collections__viewport > .cw-species-arrow--prev {
    right: 44px;
    left: auto;
  }

  .cw-species-collections__viewport > .cw-species-arrow--next {
    right: 0;
    left: auto;
  }

  .cw-species-arrow::before {
    top: 11px;
    width: 9px;
    height: 9px;
    border-width: 2px;
    border-color: var(--cw-dark-evergreen);
  }

  .cw-species-arrow--prev::before {
    left: 13px;
  }

  .cw-species-arrow--next::before {
    right: 13px;
  }

  .cw-home-programs__slider {
    position: static;
    margin-top: var(--cw-mobile-heading-gap);
    transform: none !important;
    will-change: auto !important;
  }

  .cw-home-programs__arrow {
    top: 54px;
    color: var(--cw-dark-evergreen);
  }

  .cw-home-programs__arrow--prev {
    right: 44px;
    left: auto;
  }

  .cw-home-programs__arrow--next {
    right: 0;
    left: auto;
  }

  .cw-home-programs__arrow span {
    width: 9px;
    height: 9px;
    margin: auto;
    border-width: 2px;
    border-color: var(--cw-dark-evergreen);
  }

  /* Motion styles use translateY(-50%) on focus; keep both heading controls fixed. */
  .cw-home.has-motion .cw-home-programs__arrow:hover,
  .cw-home.has-motion .cw-home-programs__arrow:focus,
  .cw-home.has-motion .cw-home-programs__arrow:focus-visible,
  .cw-home.has-motion .cw-home-programs__arrow:active {
    transform: none;
  }
}

@media (max-width: 360px) {
  .cw-page-hero__title,
  .cw-species-hero__title,
  .cw-media-hero__title {
    font-size: 36px;
    line-height: 1.08;
  }

  .cw-resources-intro__copy h2 {
    font-size: 34px;
  }
}
