/*
Theme Name: RYTS Waterfront
Description: Lohkoteema, jonka ilme pohjautuu rakennetun ympäristön pienoismalleihin ja suunnittelupiirroksiin.
Version: 1.1.5
Text Domain: ryts-waterfront
*/

:root {
  --ryts-rule: #b9beb1;
  --ryts-muted: #4b594b;
}

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.23em;
}

a:hover { text-decoration-thickness: 2px; }

:where(a, button):focus-visible {
  outline: 3px solid #687755;
  outline-offset: 4px;
}

.waterfront-header__inner {
  min-height: 5.75rem;
  padding-block: 0.8rem;
  border-bottom: 1px solid var(--ryts-rule);
}

.waterfront-logo {
  width: 6rem;
  margin: 0;
}

.waterfront-logo a {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 713 / 671;
}

/* Fit the visible mark while keeping the supplied image at its original dimensions. */
.waterfront-logo img {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 198%;
  max-width: none;
  height: auto;
  transform: translate(-50%, -50%);
}

.waterfront-header .wp-block-navigation {
  font-size: 0.97rem;
  font-weight: 600;
  --navigation-layout-gap: clamp(1rem, 3.3vw, 2.85rem);
}

.waterfront-header .wp-block-navigation-item__content[aria-current="page"],
.waterfront-header .wp-block-navigation-item__content:hover {
  text-decoration: underline;
  text-underline-offset: 0.55em;
}

.waterfront-header .wp-block-navigation__responsive-container.is-menu-open {
  background-color: var(--wp--preset--color--paper);
  color: var(--wp--preset--color--ink);
  padding: 1.5rem;
}

.waterfront-main {
  padding-block: clamp(1.1rem, 3.3vw, 3.5rem) clamp(4rem, 9vw, 9rem);
}

.waterfront-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.42fr);
  align-items: stretch;
  border: 1px solid var(--ryts-rule);
}

.waterfront-hero > * { margin: 0; }

.waterfront-hero__title {
  position: relative;
  display: grid;
  align-items: center;
  padding: clamp(1.65rem, 3.15vw, 3.85rem);
  background: var(--wp--preset--color--limestone);
  isolation: isolate;
}

.waterfront-hero__title::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("assets/images/plan.webp") center / cover;
  opacity: 0.58;
  mix-blend-mode: multiply;
  content: "";
}

.waterfront-hero h1 {
  margin: 0;
  font-size: clamp(2.45rem, 4.1vw, 4.4rem);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.waterfront-hero figure {
  overflow: hidden;
  background: var(--wp--preset--color--limestone);
}

.waterfront-hero figure { border-inline-start: 1px solid var(--ryts-rule); }

.waterfront-hero figure img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: clamp(25rem, 40vw, 36rem);
  object-fit: cover;
  object-position: center;
}

.waterfront-hero--article { grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.2fr); }
.waterfront-hero--article figure img { min-height: clamp(18rem, 29vw, 26rem); }
.waterfront-hero--article h1 { font-size: clamp(2.45rem, 3.85vw, 4.15rem); }

.waterfront-story {
  margin-block-start: clamp(2rem, 4.4vw, 4.75rem);
}

.waterfront-story > * { margin: 0; }

.waterfront-story .entry-content > :not(.home-intro) {
  max-width: 720px;
  margin-inline: auto;
}

.waterfront-story .home-intro {
  position: relative;
  isolation: isolate;
  padding-block: clamp(1.4rem, 3.8vw, 3.25rem);
}

.waterfront-story .home-intro::before {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 22%;
  background: url("assets/images/landscape.webp") center / cover;
  opacity: 0.5;
  mask-image: linear-gradient(to right, transparent, black 65%),
    linear-gradient(to bottom, transparent, black 16%, black 76%, transparent);
  mask-composite: intersect;
  content: "";
}

.waterfront-story .home-intro > * {
  max-width: 40rem;
  margin-inline-start: 0 !important;
}

.waterfront-story .home-intro > p {
  color: var(--ryts-muted);
  font-size: clamp(1.18rem, 1.8vw, 1.42rem);
  line-height: 1.5;
}

.waterfront-story .home-intro .wp-block-buttons { margin-block-start: 1.7rem; }

.waterfront-story .home-activities,
.waterfront-story .home-board,
.waterfront-prose .membership-details {
  margin-block-start: clamp(2.75rem, 5.6vw, 5.25rem);
  padding-block-start: clamp(1.3rem, 2.5vw, 2.75rem);
  border-block-start: 1px solid var(--ryts-rule);
}

.waterfront-story .home-activities h3 { margin-block-start: 1.25em; }

.waterfront-main :is(h2, h3, h4) {
  hyphens: auto;
  overflow-wrap: anywhere;
}

.waterfront-story .home-board ul {
  display: grid;
  gap: 0.4rem;
  padding-inline-start: 1.15rem;
}

.waterfront-prose { margin-block-start: clamp(2.8rem, 5.5vw, 5rem); }
.waterfront-prose h2:not(:first-child), .waterfront-prose h3:not(:first-child) { margin-block-start: 1.2em; }
.waterfront-prose .wp-block-image img { max-height: 36rem; object-fit: contain; }
.waterfront-prose .wp-block-separator { border-color: var(--ryts-rule); }

.wp-block-image.is-style-ryts-photo-fade img {
  --ryts-fade-height: clamp(14px, 3vw, 36px);
  mask-image: linear-gradient(
    to bottom,
    rgb(0 0 0 / 4%),
    black var(--ryts-fade-height),
    black calc(100% - var(--ryts-fade-height)),
    rgb(0 0 0 / 4%)
  );
}

.wp-block-button__link:hover {
  background: var(--wp--preset--color--olive);
  color: var(--wp--preset--color--paper);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--wp--preset--color--sage);
  color: var(--wp--preset--color--ink);
}

.waterfront-footer__inner {
  border-top: 1px solid var(--ryts-rule);
  padding-block: clamp(2rem, 5vw, 4.25rem);
}

.waterfront-footer__inner > .wp-block-image:not(.waterfront-logo) {
  margin-block-start: 0;
  border: 1px solid var(--ryts-rule);
}

.waterfront-footer__inner > .wp-block-image:not(.waterfront-logo) img {
  display: block;
  width: 100%;
  aspect-ratio: 3.3 / 1;
  object-fit: cover;
  object-position: center 70%;
}

.waterfront-footer .waterfront-logo {
  width: 4.5rem;
  margin-block-start: clamp(1.5rem, 4vw, 3.25rem);
}

.waterfront-footer .wp-block-site-tagline {
  color: var(--ryts-muted);
  font-size: 0.95rem;
  margin-block-start: 0.8rem;
}

@media (max-width: 820px) {
  .waterfront-hero { grid-template-columns: minmax(0, 1fr); }
  .waterfront-hero figure { border-inline-start: 0; border-block-start: 1px solid var(--ryts-rule); }
  .waterfront-hero figure img { min-height: 0; height: auto; aspect-ratio: 1672 / 941; }
  .waterfront-hero h1 { max-width: 16ch; font-size: clamp(2.5rem, 6.5vw, 3.85rem); text-wrap: initial; }
  .waterfront-story .home-intro::before { inset-inline-start: 0; }
  .waterfront-footer__inner > .wp-block-image:not(.waterfront-logo) img { aspect-ratio: 1672 / 941; }
}

@media (max-width: 600px) {
  .waterfront-header__inner { min-height: 4.35rem; }
  .waterfront-header .waterfront-logo { width: 4rem; }
  .waterfront-hero__title { padding: clamp(1.45rem, 6vw, 2rem); }
  .waterfront-hero h1 { font-size: clamp(1.95rem, 8.2vw, 3.1rem); }
  .waterfront-main h3 { font-size: clamp(1.55rem, 5.5vw, 1.95rem); }
}
