/*
 * Office location page (page-asukoht.php). Loaded after uudis.css, which
 * provides the article grid, side panel, section navigation and FAQ accordion.
 */

/* The office page has no author row, so the meta column spans only the title row. */
.article--with-aside.article--no-lead.office-article .meta {
  grid-row: 1;
}

/* Contact card in the side panel */
.office-card {
  padding: 0 0 26px;
  margin-bottom: 26px;
  border-bottom: 1px solid rgba(138, 87, 66, 0.14);
  color: rgba(43, 38, 31, 0.78);
  font-size: 0.98rem;
  line-height: 1.5;
}

.office-card p {
  margin: 0;
}

.office-card .news-section-nav__eyebrow {
  margin-bottom: 14px;
}

.office-card__map {
  margin-top: 6px !important;
}

.office-card__map a {
  color: var(--menu-base);
  font-weight: 560;
  text-decoration: none;
}

.office-card__map a span {
  display: inline-block;
  transition: transform 180ms ease;
}

.office-card__map a:hover span,
.office-card__map a:focus-visible span {
  transform: translateX(4px);
}

.office-card__hours {
  margin-top: 14px !important;
}

.office-card__meta {
  display: grid;
  gap: 4px;
  margin-top: 14px !important;
}

.office-card__meta a {
  color: var(--menu-base);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.office-card__meta a:hover,
.office-card__meta a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* Other offices in the left column */
.office-meta {
  gap: 10px;
}

.office-meta__title {
  margin: 0 0 4px;
  color: var(--news-article-muted);
}

.office-meta__link {
  color: var(--news-article-accent);
  font-weight: 700;
  text-decoration: none;
  transition: color 180ms ease;
}

.office-meta__link:hover,
.office-meta__link:focus-visible {
  color: var(--news-article-ink);
}

/* Team block inside the text */
.body .office-team {
  margin: 6px 0 8px;
}

.body .office-team__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 30px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: inherit;
}

.body .office-team--duo .office-team__list {
  grid-template-columns: repeat(2, minmax(0, 230px));
}

.body .office-team__list > li {
  padding-left: 0;
}

.body .office-team__list > li::before {
  content: none;
}

.body .office-team__link {
  display: grid;
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.body .office-team__photo-wrap {
  display: block;
  position: relative;
  aspect-ratio: 3 / 4;
  margin-bottom: 14px;
  overflow: hidden;
  background: rgba(138, 87, 66, 0.08);
  transition: transform 260ms ease, box-shadow 320ms ease;
}

.body .office-team__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  transform: scale(1.02);
  transition: transform 820ms cubic-bezier(0.2, 0.72, 0.18, 1), filter 300ms ease;
}

/* Same hover as the people page: the photo lifts and zooms in slowly. */
@media (hover: hover) and (pointer: fine) {
  .body .office-team__link:hover .office-team__photo-wrap,
  .body .office-team__link:focus-visible .office-team__photo-wrap {
    transform: translateY(-3px);
    box-shadow: 0 16px 26px rgba(0, 0, 0, 0.1);
  }

  .body .office-team__link:hover .office-team__photo,
  .body .office-team__link:focus-visible .office-team__photo {
    transform: scale(1.07);
    filter: saturate(1.04);
  }
}

.body .office-team__text {
  display: grid;
  gap: 2px;
}

.body .office-team__name {
  color: var(--news-article-accent);
  font-size: 1.06rem;
  font-weight: 620;
  line-height: 1.3;
  transition: color 180ms ease;
}

.body .office-team__role {
  color: var(--news-article-muted);
  font-size: 0.92rem;
  font-weight: 420;
  line-height: 1.4;
}

.body .office-team__link:hover .office-team__name,
.body .office-team__link:focus-visible .office-team__name {
  color: var(--news-article-ink);
}

/* One person: heading and text on the left, photo on the right (see .office-team-split) */
.office-team-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
  column-gap: clamp(28px, 4vw, 56px);
  align-items: start;
  margin-top: clamp(18px, 2.6vw, 34px);
}

.office-team-split__text {
  display: grid;
  gap: clamp(22px, 2.8vw, 32px);
  align-content: start;
}

.body .office-team-split .office-team {
  margin: 0;
}

.body .office-team--single .office-team__list {
  grid-template-columns: 1fr;
}

/* Square crop, as on the people page, keeps the photo about as tall as the text beside it. */
.body .office-team--single .office-team__photo-wrap {
  aspect-ratio: 1 / 1;
}

@media (prefers-reduced-motion: reduce) {
  .office-card__map a span,
  .office-meta__link,
  .body .office-team__name,
  .body .office-team__photo-wrap,
  .body .office-team__photo {
    transition: none;
  }
}

@media (max-width: 900px) {
  /* Contact details matter most on a phone: show the card above the text. */
  .office-page .news-aside {
    display: block;
    margin-top: 0;
    padding-top: 22px;
  }

  .office-page .news-aside__inner {
    position: static;
    max-height: none;
  }

  .office-page .office-section-nav,
  .office-page .news-side-cta {
    display: none;
  }

  .office-page .office-card {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
  }

  .office-meta {
    gap: 6px 14px;
  }

  .office-meta__title {
    flex-basis: 100%;
    margin: 0;
  }

  .body .office-team__list,
  .body .office-team--duo .office-team__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .office-team-split {
    grid-template-columns: 1fr;
    row-gap: clamp(22px, 2.8vw, 32px);
  }

  .body .office-team--single .office-team__item {
    max-width: 260px;
  }
}
