/* Research add-on styles. This file is deliberately separate so the existing
   homepage stylesheet can remain untouched when the Research pages are added. */

.nav-dropdown {
  position: relative;
  height: 68px;
  display: flex;
  align-items: center;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  z-index: 120;
  min-width: 180px;
  display: grid;
  padding: 9px 0;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0, 41, 39, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -5px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.desktop-nav .nav-dropdown-menu a {
  display: block;
  padding: 10px 17px;
  color: #303636;
  font-size: 0.68rem;
  line-height: 1.25;
  white-space: nowrap;
}

.desktop-nav .nav-dropdown-menu a:hover,
.desktop-nav .nav-dropdown-menu a:focus-visible {
  color: var(--hokma-green);
  background: var(--surface);
}

.mobile-nav-group {
  display: grid;
  border-bottom: 1px solid #edf0f0;
}

.mobile-nav-group > a:first-child { border-bottom: 0; }

.mobile-nav .mobile-nav-subitem {
  padding: 8px 0 8px 18px;
  color: var(--hokma-green);
  font-size: 0.78rem;
  border-bottom: 0;
}

.mobile-nav .mobile-nav-subitem:last-child { padding-bottom: 14px; }

.research-hero {
  position: relative;
  min-height: 390px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: white;
  background-color: var(--hokma-black);
  background-image: url("/assets/hokma-brand-pattern.webp");
  background-position: center;
  background-size: cover;
}

.research-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 18, 18, 0.98) 0%, rgba(0, 62, 59, 0.9) 56%, rgba(0, 104, 97, 0.35) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.22), transparent 65%);
}

.research-hero-inner {
  position: relative;
  z-index: 1;
  padding: 80px 0 88px;
}

.research-hero h1 {
  max-width: 750px;
  margin: 0;
  font-size: clamp(2.45rem, 4.6vw, 4rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.research-hero p:not(.kicker) {
  max-width: 590px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.08rem;
  line-height: 1.62;
}

.research-landing-section {
  padding: 88px 0 104px;
}

.research-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.research-entry-card {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 38px;
  color: var(--hokma-black);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.research-entry-card:hover,
.research-entry-card:focus-visible {
  border-color: var(--hokma-teal);
  box-shadow: 0 14px 34px rgba(0, 72, 68, 0.1);
  transform: translateY(-3px);
}

.research-entry-card h2 {
  max-width: 500px;
  margin: 0;
  color: var(--hokma-green);
  font-size: clamp(1.7rem, 2.7vw, 2.35rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.research-entry-card p:not(.kicker) {
  max-width: 500px;
  margin: 20px 0 0;
  color: #4c5555;
  font-size: 1rem;
  line-height: 1.65;
}

.research-entry-card-dark {
  color: white;
  background: var(--hokma-black);
  border-color: var(--hokma-black);
}

.research-entry-card-dark h2 { color: white; }
.research-entry-card-dark p:not(.kicker) { color: rgba(255, 255, 255, 0.76); }

.research-entry-link,
.research-card-link {
  display: inline-flex;
  margin-top: auto;
  padding-top: 28px;
  color: var(--hokma-green);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid #b7c9c6;
}

.research-entry-card-dark .research-entry-link { color: #8be2dc; border-color: rgba(139, 226, 220, 0.55); }

.research-page-heading {
  padding: 72px 0 62px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.research-page-heading h1 {
  max-width: 800px;
  margin: 0;
  color: var(--hokma-black);
  font-size: clamp(2.25rem, 4.2vw, 3.55rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.research-page-heading > .shell > p:not(.kicker) {
  max-width: 720px;
  margin: 20px 0 0;
  color: #515b5b;
  font-size: 1.05rem;
  line-height: 1.65;
}

.research-grid-section {
  padding: 78px 0 104px;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 24px;
}

.research-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: inherit;
  background: white;
  border: 1px solid var(--line);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.research-card:hover,
.research-card:focus-visible {
  border-color: var(--hokma-teal);
  box-shadow: 0 14px 34px rgba(0, 72, 68, 0.11);
  transform: translateY(-3px);
}

.research-card-image {
  aspect-ratio: 0.707;
  overflow: hidden;
  background: #edf1f0;
  border-bottom: 3px solid var(--hokma-green);
}

.research-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 220ms ease;
}

.research-card:hover .research-card-image img { transform: scale(1.015); }

.research-card-copy {
  min-height: 238px;
  display: flex;
  flex-direction: column;
  padding: 20px 20px 22px;
}

.research-card-label {
  margin: 0 0 11px;
  color: var(--hokma-teal);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.research-card-copy h2 {
  margin: 0;
  color: var(--hokma-green);
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.025em;
}

.research-card-copy p:not(.research-card-label) {
  margin: 13px 0 0;
  color: #596262;
  font-size: 0.91rem;
  line-height: 1.55;
}

.research-card-link { margin-top: auto; padding-top: 22px; }

.working-papers-section {
  padding: 44px 0 86px;
  background: #e8eaea;
}

.working-paper-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.working-paper-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid #d6dcdc;
}

.working-paper-band {
  min-height: 63px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 12px;
  color: white;
  background: var(--hokma-green);
}

.working-paper-band span,
.working-paper-band strong {
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.working-paper-band span {
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.working-paper-band strong {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.15;
}

.working-paper-image {
  aspect-ratio: 0.707;
  margin: 12px 11px 0;
  overflow: hidden;
  background: #f5f6f5;
  border: 1px solid #c9d0cf;
}

.working-paper-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.working-paper-copy {
  min-height: 284px;
  display: flex;
  flex-direction: column;
  padding: 19px 13px 14px;
}

.working-paper-copy h2 {
  margin: 0;
  color: var(--hokma-green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.08;
}

.working-paper-copy p {
  margin: 12px 0 0;
  color: #5b6161;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.84rem;
  font-style: italic;
  line-height: 1.36;
}

.request-paper-button {
  align-self: flex-start;
  margin-top: auto;
  padding: 10px 12px;
  color: white;
  background: var(--hokma-green);
  border: 1px solid var(--hokma-green);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
  transition: color 160ms ease, background 160ms ease;
}

.request-paper-button:hover,
.request-paper-button:focus-visible {
  color: var(--hokma-green);
  background: white;
}

.working-paper-note {
  margin: 20px 0 0;
  color: #5c6464;
  font-size: 0.8rem;
  line-height: 1.5;
}

@media (max-width: 1060px) {
  .working-paper-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .nav-dropdown { height: auto; }
  .research-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .research-hero-inner { padding: 62px 0 70px; }
  .research-landing-section,
  .research-grid-section { padding: 62px 0 76px; }
  .research-entry-grid,
  .research-grid { grid-template-columns: 1fr; }
  .research-entry-card { min-height: 260px; padding: 28px; }
  .research-page-heading { padding: 54px 0 46px; }
  .working-papers-section { padding: 30px 0 64px; }
  .working-paper-grid { grid-template-columns: 1fr; gap: 22px; }
  .working-paper-card { max-width: 370px; }
  .working-paper-copy { min-height: 220px; }
}
