/* The home page ("/"): hero with search and the report cards.
   Layered on landing.css, which keeps the nav, notes, newsletter and footer. */

:root {
  --lavender: #f4f0fc;
  --lavender-deep: #e7def8;
  --card-radius: 18px;
  --card-shadow: 0 10px 30px rgba(49, 24, 97, 0.07);
  --card-shadow-hover: 0 16px 40px rgba(49, 24, 97, 0.14);
}

/* Hero */

.sp-home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(60% 80% at 85% 30%, rgba(201, 188, 236, 0.45), transparent 70%),
    linear-gradient(180deg, #faf8fe 0%, var(--lavender) 100%);
}

.sp-home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('../img/bg-pattern.svg') left bottom / 1434px 294px repeat-x;
  opacity: 0.18;
  pointer-events: none;
}

.sp-home-hero-art {
  position: absolute;
  top: 0;
  right: max(-40px, calc((100% - 1434px) / 2 - 40px));
  z-index: -1;
  width: min(54%, 760px);
  height: 100%;
  object-fit: contain;
  object-position: right center;
  pointer-events: none;
}

.sp-home-hero-inner {
  max-width: 1434px;
  margin-inline: auto;
  padding: 72px var(--gutter) 56px;
}

.sp-home-hero-inner > * { max-width: 640px; }

.sp-home-hero-inner > .sp-popular { max-width: 780px; flex-wrap: nowrap; }

.sp-home-eyebrow {
  color: var(--ink);
  font-family: var(--font-inter);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 5px;
  text-transform: uppercase;
}

.sp-home-title {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 92px;
  font-weight: 500;
  /* Room for Thai marks: the first line's ู and the second's ั/ิ/ป would otherwise touch. */
  line-height: 1.3;
  letter-spacing: -1.5px;
}

.sp-home-title span { display: block; }

.sp-home-title > span:first-child { color: var(--purple-dark); }

.sp-home-title-accent {
  margin-top: 0.08em;
  padding-bottom: 6px;
  background: linear-gradient(90deg, #0c9aa6, var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sp-home-lead {
  margin-top: 20px;
  color: #2a2338;
  font-size: 20px;
  line-height: 32px;
}

.sp-search {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  margin-top: 32px;
  padding: 6px 6px 6px 22px;
  border: 1px solid rgba(83, 49, 147, 0.12);
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(49, 24, 97, 0.08);
}

.sp-search:focus-within { border-color: rgba(83, 49, 147, 0.45); }

.sp-search .sp-icon { flex-shrink: 0; color: var(--purple-dark); }

.sp-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  outline: none;
}

.sp-search input::placeholder { color: #8a8496; }

.sp-search button {
  flex-shrink: 0;
  height: 48px;
  padding: 0 34px;
  border: 0;
  border-radius: 9999px;
  background: linear-gradient(180deg, #6245b2, var(--purple));
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: filter 160ms var(--ease);
}

.sp-search button:hover { filter: brightness(1.12); }

.sp-popular {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 20px;
  font-size: 14px;
}

.sp-popular > span { color: var(--ink); }

.sp-popular ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sp-popular a {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border: 1px solid rgba(83, 49, 147, 0.25);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--purple);
  font-size: 14px;
  text-decoration: none;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}

.sp-popular a:hover { border-color: var(--purple); background: #fff; }

/* Sections */

.sp-section { padding-top: 56px; }

.sp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.sp-section-head-center {
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  margin-bottom: 28px;
  text-align: center;
}

.sp-section-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--purple-dark);
  font-size: 28px;
  font-weight: 600;
  line-height: 40px;
}

.sp-ornament { flex-shrink: 0; }

.sp-section-desc { color: var(--body); font-size: 16px; line-height: 26px; }

.sp-section-desc a, .sp-empty a { color: var(--purple); }

.sp-empty {
  padding: 48px 24px;
  border-radius: var(--card-radius);
  background: var(--lavender);
  color: var(--body);
  text-align: center;
}

/* Report cards */

.sp-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* card_spans() sizes the cards so every row of three columns is full. */
.sp-report-grid:not(.sp-report-grid-plain) > .sp-rc-span-2 { grid-column: span 2; }
.sp-report-grid:not(.sp-report-grid-plain) > .sp-rc-span-3 { grid-column: span 3; }

.sp-rc { --tone-a: var(--lavender); --tone-b: var(--lavender-deep); }

.sp-rc > a {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
  min-height: 210px;
  padding: 26px 28px 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--card-radius);
  background: linear-gradient(135deg, var(--tone-a), var(--tone-b));
  box-shadow: var(--card-shadow);
  color: var(--ink);
  text-decoration: none;
  transition: box-shadow 200ms var(--ease), transform 200ms var(--ease);
}

.sp-rc > a:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }

.sp-rc-art {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: -1;
  width: auto;
  max-width: 52%;
  height: 100%;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
}

.sp-rc-span-2 .sp-rc-art, .sp-rc-span-3 .sp-rc-art { max-width: 46%; }

/* A staff-uploaded background. The white scrim stays solid under the text column (58%, or
   52% on a wide card) and fades out over the right of the picture. */
.sp-rc-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.sp-rc-has-bg > a::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.94) 60%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.sp-rc-icon { color: var(--purple-dark); line-height: 0; }

.sp-rc-title,
.sp-rc-eyebrow,
.sp-rc-desc,
.sp-rc-range { max-width: 58%; }

.sp-rc-span-2 .sp-rc-title, .sp-rc-span-2 .sp-rc-desc,
.sp-rc-span-3 .sp-rc-title, .sp-rc-span-3 .sp-rc-desc { max-width: 52%; }

.sp-rc-title {
  margin-top: 14px;
  color: var(--purple-dark);
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.sp-rc-eyebrow {
  margin-top: 4px;
  color: var(--purple-muted);
  font-family: var(--font-inter);
  font-size: 11px;
  line-height: 16px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
}

.sp-rc-desc {
  margin-top: 10px;
  color: #3d3550;
  font-size: 14px;
  line-height: 22px;
}

.sp-rc-range {
  margin-top: 6px;
  color: var(--body);
  font-size: 12px;
  line-height: 18px;
}

.sp-rc-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-top: auto;
  border: 1.5px solid var(--purple);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--purple);
  transition: background-color 200ms var(--ease), color 200ms var(--ease);
}

.sp-rc-desc + .sp-rc-more, .sp-rc-range + .sp-rc-more { margin-top: 18px; }

.sp-rc > a:hover .sp-rc-more { background: var(--purple); color: #fff; }

.sp-rc-ecosystem { --tone-a: #f3eefc; --tone-b: #e2d6f6; }
.sp-rc-craft { --tone-a: #fdf7f0; --tone-b: #f5e3cf; }
.sp-rc-export { --tone-a: #eef4fe; --tone-b: #dbe5fa; }
.sp-rc-ceramic { --tone-a: #edf7f5; --tone-b: #d5ece6; }
.sp-rc-handicraft { --tone-a: #fdf1f6; --tone-b: #f7dce9; }
.sp-rc-textile { --tone-a: #f1f8ee; --tone-b: #deefd6; }
.sp-rc-jewelry { --tone-a: #fcf7ea; --tone-b: #f1e4c4; }

.sp-section + .sp-notes,
.sp-section + * + .sp-notes { margin-top: 56px; }

@media (max-width: 1279px) {
  .sp-home-title { font-size: 76px; }
}

@media (max-width: 1023px) {
  .sp-home-hero-inner > .sp-popular { flex-wrap: wrap; }
  .sp-home-hero-art { width: 46%; opacity: 0.5; }
  .sp-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-report-grid:not(.sp-report-grid-plain) > .sp-rc-span-2,
  .sp-report-grid:not(.sp-report-grid-plain) > .sp-rc-span-3 { grid-column: auto; }
  .sp-report-grid > :last-child:nth-child(odd) { grid-column: span 2; }
}

@media (max-width: 767px) {
  .sp-home-hero-art { position: static; display: block; width: 100%; height: 220px; margin-bottom: -24px; opacity: 1; object-position: center; }
  .sp-home-hero { display: flex; flex-direction: column; }
  .sp-home-hero-inner { padding-top: 32px; padding-bottom: 40px; }
  .sp-home-title { font-size: 60px; }
  .sp-home-lead { font-size: 17px; line-height: 28px; }
  .sp-home-lead br { display: none; }
  .sp-section-title { font-size: 22px; line-height: 32px; }
}

@media (max-width: 639px) {
  .sp-eyebrow, .sp-home-eyebrow { letter-spacing: 3px; font-size: 11px; }
  .sp-home-title { font-size: 50px; }
  .sp-search { height: 54px; padding-left: 16px; }
  .sp-search button { height: 42px; padding: 0 20px; }
  .sp-report-grid { grid-template-columns: 1fr; gap: 14px; }
  .sp-report-grid > :last-child:nth-child(odd) { grid-column: auto; }
  .sp-rc > a { min-height: 190px; padding: 22px; }
  .sp-rc-art { max-width: 46% !important; height: 80%; }
  .sp-section-head { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .sp-rc > a, .sp-rc > a:hover { transform: none; }
}

/* The reports list (/reports): the home hero, shorter. */

.sp-list-hero .sp-home-hero-inner { padding-top: 56px; padding-bottom: 48px; }

.sp-list-hero .sp-home-title { font-size: 72px; }

@media (max-width: 1279px) {
  .sp-list-hero .sp-home-title { font-size: 60px; }
}

@media (max-width: 767px) {
  .sp-list-hero .sp-home-title { font-size: 48px; }
}

@media (max-width: 639px) {
  .sp-list-hero .sp-home-title { font-size: 40px; }
}
