/**
 * Basic content pages, blog, archive, and search.
 */

.ms-page-main,
.ms-post-main,
.ms-archive-main {
  width: min(100% - var(--ms-container-gutter), var(--ms-container));
  margin: 0 auto;
  padding: 54px 0 96px;
}

.ms-page-header,
.ms-archive-header {
  margin-bottom: 42px;
  text-align: center;
}

.ms-page-title,
.ms-post-title,
.ms-archive-title {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.25;
}

.ms-page-content,
.ms-post-content,
.ms-entry-summary {
  max-width: 820px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.9;
}

.ms-page-content > *:first-child,
.ms-post-content > *:first-child {
  margin-top: 0;
}

.ms-page-content a,
.ms-post-content a,
.ms-entry-summary a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ms-post-meta {
  margin: 16px 0 0;
  color: var(--ms-muted);
  font-size: 13px;
  text-align: center;
}

.ms-post-list {
  display: grid;
  gap: 28px;
  max-width: 900px;
  margin: 0 auto;
}

.ms-post-card {
  border: 1px solid var(--ms-border);
  padding: 28px;
}

.ms-post-card__title {
  margin: 0 0 14px;
  font-size: 24px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ms-post-card__title a {
  text-decoration: none;
}

.ms-post-card__title a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ms-post-card__meta {
  margin: 0 0 18px;
  color: var(--ms-muted);
  font-size: 13px;
}

.ms-read-more {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 0 26px;
  background: var(--ms-cream);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.ms-pagination {
  margin-top: 42px;
  text-align: center;
}

.ms-pagination .page-numbers {
  display: inline-flex;
  min-width: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  margin: 0 3px;
  border: 1px solid var(--ms-border);
  text-decoration: none;
}

.ms-pagination .current {
  background: var(--ms-navy);
  color: #fff;
  border-color: var(--ms-navy);
}

.ms-not-found {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

/* WooCommerce shortcode pages must use the same full site container as product pages.
   The default page content max-width is for text pages only; cart/checkout need full width. */
.woocommerce-cart .ms-page-content,
.woocommerce-checkout .ms-page-content,
.woocommerce-account .ms-page-content {
  max-width: none;
  width: 100%;
  margin: 0;
}

.woocommerce-cart .ms-page-header,
.woocommerce-checkout .ms-page-header,
.woocommerce-account .ms-page-header {
  display: none;
}

.woocommerce-cart .ms-page-main,
.woocommerce-checkout .ms-page-main,
.woocommerce-account .ms-page-main {
  width: min(100% - var(--ms-container-gutter), var(--ms-container));
  max-width: var(--ms-container);
  margin-inline: auto;
}

.woocommerce-cart .ms-page-content > .woocommerce,
.woocommerce-checkout .ms-page-content > .woocommerce,
.woocommerce-account .ms-page-content > .woocommerce {
  width: 100%;
}

.woocommerce-cart .ms-page-content .ms-cart-page,
.woocommerce-checkout .ms-page-content .ms-checkout-page,
.woocommerce-account .ms-page-content .ms-account-page {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

/* Editorial pages: Stores and News */
.ms-editorial-page {
  width: min(100% - var(--ms-container-gutter), var(--ms-container));
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 54px;
  align-items: start;
}

.ms-editorial-sidebar {
  min-height: 820px;
  padding: 28px 24px;
  background: var(--ms-cream);
}

.ms-editorial-nav {
  display: grid;
  gap: 13px;
  font-size: 14px;
  line-height: 1.45;
}

.ms-editorial-nav a {
  color: var(--ms-text);
  text-decoration: none;
}

.ms-editorial-nav a.is-active {
  font-weight: 700;
}

.ms-editorial-content {
  min-width: 0;
}

.ms-editorial-header {
  margin: 28px 0 26px;
  text-align: center;
}

.ms-editorial-header h1 {
  margin: 0;
  font-size: clamp(24px, 2.4vw, 34px);
  letter-spacing: 0.04em;
}

/* Stores */
.ms-stores-content {
  max-width: 980px;
}

.ms-store-search {
  display: grid;
  grid-template-columns: 90px minmax(180px, 230px) auto;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.44);
}

.ms-store-search label {
  max-width: 70px;
  font-size: 14px;
  line-height: 1.5;
}

.ms-store-search input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--ms-border);
  background: var(--ms-bg);
}

.ms-store-search button {
  height: 34px;
  padding: 0 18px;
  border: 1px solid var(--ms-border);
  background: #e8e8e8;
  color: var(--ms-text);
  cursor: pointer;
}

.ms-store-finder {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  align-items: start;
}

.ms-store-list {
  max-height: 520px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.24);
}

.ms-store-card {
  padding: 18px 18px 20px;
  border-bottom: 1px solid var(--ms-border);
}

.ms-store-card h2 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: 0.06em;
}

.ms-store-card p {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.45;
}

.ms-store-card__distance {
  margin-top: 14px !important;
}

.ms-store-card a {
  font-size: 14px;
  text-decoration: none;
}

.ms-store-map {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 58% 45%,
      rgba(255, 255, 255, 0.75) 0 16%,
      transparent 17%
    ),
    radial-gradient(
      circle at 38% 42%,
      rgba(255, 255, 255, 0.82) 0 20%,
      transparent 21%
    ),
    radial-gradient(
      circle at 48% 64%,
      rgba(255, 255, 255, 0.76) 0 17%,
      transparent 18%
    ),
    linear-gradient(135deg, #d9e3df, #eef1ef 48%, #cad8d6 49%, #d8e2de);
  border-left: 1px solid var(--ms-border);
}

.ms-store-map::before,
.ms-store-map::after {
  content: "";
  position: absolute;
  border-radius: 48% 52% 44% 56%;
  background: rgba(245, 248, 247, 0.82);
}

.ms-store-map::before {
  width: 45%;
  height: 62%;
  left: 16%;
  top: 18%;
  transform: rotate(-18deg);
}

.ms-store-map::after {
  width: 34%;
  height: 34%;
  right: 12%;
  top: 28%;
  transform: rotate(18deg);
}

.ms-map-pin {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  border: 4px solid #2e7fa3;
  border-radius: 50% 50% 50% 0;
  background: #f7fbfb;
  transform: rotate(-45deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
}

.ms-map-pin::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #2e7fa3;
}

.ms-map-label {
  position: absolute;
  z-index: 3;
  font-size: 12px;
  color: #505a5d;
}

.ms-map-label--top {
  left: 43%;
  top: 12%;
}
.ms-map-label--middle {
  left: 38%;
  top: 44%;
}
.ms-map-label--bottom {
  right: 24%;
  bottom: 22%;
}

/* News */
.ms-news-page {
  grid-template-columns: 220px minmax(0, 760px);
  justify-content: start;
}

.ms-news-content {
  padding-top: 10px;
}

.ms-news-item {
  margin-bottom: 70px;
}

.ms-news-image {
  width: min(100%, 640px);
  min-height: 520px;
  margin: 0 auto 26px;
  position: relative;
  overflow: hidden;
}

.ms-news-image span,
.ms-news-image::before,
.ms-news-image::after {
  content: "";
  position: absolute;
  display: block;
}

.ms-news-image span {
  inset: 13% 18%;
  background: var(--ms-cream);
  border: 8px solid #fff;
  box-shadow: 0 12px 18px rgba(0, 0, 0, 0.12);
}

.ms-news-image span::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 16%;
  height: 38%;
  background:
    linear-gradient(to top, #345f54 0 24%, transparent 24%),
    repeating-linear-gradient(
      90deg,
      #7b342f 0 18px,
      #d7b48c 18px 36px,
      #315f56 36px 54px,
      #c8d6d4 54px 72px
    );
}

.ms-news-image span::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 56%;
  height: 26%;
  background: repeating-linear-gradient(
    90deg,
    #cc8a50 0 20px,
    #efe6cc 20px 38px,
    #2f6155 38px 56px
  );
  clip-path: polygon(
    0 100%,
    8% 45%,
    17% 100%,
    26% 25%,
    36% 100%,
    48% 0,
    58% 100%,
    72% 30%,
    82% 100%,
    92% 48%,
    100% 100%
  );
}

.ms-news-image--prints {
  background: #d2d2cf;
}

.ms-news-image--prints span {
  inset: 12% 20% 12% 12%;
  transform: rotate(-7deg);
}

.ms-news-image--prints::before {
  width: 42%;
  height: 54%;
  left: 44%;
  top: 17%;
  background: var(--ms-cream);
  border: 8px solid #fff;
  box-shadow: 0 12px 18px rgba(0, 0, 0, 0.12);
  transform: rotate(10deg);
}

.ms-news-image--bookmarks {
  min-height: 480px;
}

.ms-news-image--bookmarks span {
  inset: 16% 16%;
  border: 0;
  background: linear-gradient(
    90deg,
    transparent 0 25%,
    var(--ms-cream) 25% 42%,
    transparent 42% 50%,
    var(--ms-cream) 50% 67%,
    transparent 67% 75%,
    var(--ms-cream) 75% 92%,
    transparent 92%
  );
  box-shadow: none;
}

.ms-news-image--poster {
  background: #d8dcdd;
}

.ms-news-image--poster span {
  inset: 12% 18%;
}

.ms-news-image--room {
  min-height: 620px;
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.48),
      rgba(255, 255, 255, 0.48)
    ),
    linear-gradient(90deg, #d2d4d2 0 50%, #f3f0e9 50%);
}

.ms-news-image--room span {
  inset: 14% 20% 18%;
}

.ms-news-copy {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  max-width: 640px;
  margin: 0 auto;
}

.ms-news-copy time {
  font-size: 13px;
  line-height: 1.6;
}

.ms-news-copy h2 {
  grid-column: 2;
  margin: 0 0 8px;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.ms-news-copy p {
  grid-column: 2;
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .ms-editorial-page,
  .ms-news-page {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 42px;
  }

  .ms-editorial-sidebar {
    min-height: 0;
  }

  .ms-editorial-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
  }

  .ms-store-finder {
    grid-template-columns: 1fr;
  }

  .ms-store-map {
    min-height: 420px;
    border-left: 0;
    border-top: 1px solid var(--ms-border);
  }

  .ms-news-image {
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  .ms-store-search {
    grid-template-columns: 1fr;
  }

  .ms-news-copy {
    grid-template-columns: 1fr;
  }

  .ms-news-copy h2,
  .ms-news-copy p {
    grid-column: 1;
  }
}

/* Block editor alignment — wide breaks to the full container, full to viewport edge */
.ms-page-content .alignwide,
.ms-post-content .alignwide {
  --_aw: min(var(--ms-wide-container), 100vw - var(--ms-container-gutter));
  width: var(--_aw);
  margin-left: calc(50% - var(--_aw) / 2);
  margin-right: calc(50% - var(--_aw) / 2);
}

@media (min-width: 1420px) {
  .ms-page-content .alignwide,
  .ms-post-content .alignwide {
    --_aw: calc(var(--ms-container) - 80px);
  }
}

.ms-page-content .alignfull,
.ms-post-content .alignfull {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
