/* Mobile improvements 2026-11. Plain CSS, loaded after main.min.css. Theme breakpoint: 720px. */

/* Tables in page content: scroll sideways instead of being cut off */
.hy-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* "Verkkokauppaan" button (front page): under the cart on desktop */
.logo { position: relative; }
.hy-shop-button {
  position: absolute;
  top: 26px;
  right: 15px;
  margin: 0;
  padding: 0.9em 1.6em;
  font-size: 13px !important;
}

/* Anchor the sub-navigation and category links jump to; the fixed bar is 43 px */
.hy-anchor { display: block; height: 0; scroll-margin-top: 50px; }

@media screen and (max-width: 720px) {
  /* tables use the full screen width (8 px margins) instead of the narrow text column */
  .hy-table-scroll { width: calc(100vw - 16px); max-width: none; margin-left: calc(50% - 50vw + 8px); }
  .hy-table-scroll table { width: 100% !important; }
  .hy-table-scroll table, .hy-table-scroll tr, .hy-table-scroll td, .hy-table-scroll th { height: auto !important; }
  .hy-table-scroll td, .hy-table-scroll th {
    width: auto !important;
    padding: 6px 5px !important;
  }
  .hy-table-scroll td, .hy-table-scroll th, .hy-table-scroll td p, .hy-table-scroll th p, .hy-table-scroll td strong {
    font-size: 14px !important;
    line-height: 1.35;
    overflow-wrap: break-word;  /* whole words; a table that still does not fit scrolls sideways */
    -webkit-hyphens: auto;
    hyphens: auto;
  }


  .hy-shop-button {
    position: static;
    display: block;
    margin: 6px 16px 14px;
    padding: 1.1em 0;
    font-size: 14px !important;
    text-align: center;
  }

  /* Sub-navigation collapsed behind its heading (added by hy-mobile.js) */
  .sub-navigation.hy-collapsed .mobile-hint {
    display: block;
    margin: 0 16px;
    padding: 12px 40px 12px 14px;
    border: 1px solid #b9b6a8;
    background: #fff;
    position: relative;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
  }
  .sub-navigation.hy-collapsed .mobile-hint::after {
    content: "\25BE";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
  }
  .sub-navigation.hy-collapsed.is-open .mobile-hint::after { content: "\25B4"; }
  .sub-navigation.hy-collapsed:not(.is-open) li { display: none !important; }
  .sub-navigation.hy-collapsed.is-open li { display: block; }

  /* "Katso lisätietoa" (added by hy-mobile.js) */
  .hy-readmore.is-clamped { position: relative; overflow: hidden; max-height: 320px; }
  /* variety texts: clip without a new formatting context, so the text still flows around the photo */
  .hy-readmore.hy-readmore-short.is-clamped { max-height: var(--hy-clamp, 7em); overflow: hidden; overflow: clip; }
  .hy-readmore.is-clamped::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 70px;
    background: linear-gradient(rgba(253, 252, 247, 0), #fdfcf7);
    pointer-events: none;
  }
  .hy-readmore-btn {
    display: inline-block;
    margin: 6px 0 14px;
    padding: 0;
    border: 0;
    background: none;
    color: #4b4b40;
    font: inherit;
    font-size: 15px;
    text-decoration: underline;
    cursor: pointer;
  }

  /* Rows placed straight inside another row (shop front, palstat sections) have no padded column
     around them, so their -5px margins stuck out of the screen. Rows inside columns keep theirs. */
  .row > .row, .row > .section > .row { margin-left: 0; margin-right: 0; }
  /* Long links and words in page texts wrap instead of widening the page */
  .content.column-block p, .content.column-block li, .tip-content p { overflow-wrap: anywhere; }

  /* Shop: A–Ö row and long category names must fit */
  #js-alphabet { display: flex; flex-wrap: wrap; justify-content: center; margin-left: 0; margin-right: 0; }
  h3.sub-picture a, .product-category h3 { overflow-wrap: anywhere; hyphens: auto; }
}
