/* Version 3.4.0: homepage media, calibrated maps and streamlined collection dashboards. */

/* Keep homepage country signals and the SVG in the same 820 x 380 coordinate plane. */
.had-reach-map-stage{
  position:relative;
  width:100%;
  max-width:100%;
  aspect-ratio:820/380;
  margin:auto;
  overflow:hidden;
  flex:0 0 auto;
}
.had-reach-map-stage>img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  max-height:none;
  display:block;
  object-fit:fill;
}
.had-reach-map-stage>.had-map-scan{position:absolute;inset:0}
.had-reach-map-stage>.had-reach-dot{position:absolute;transform:translate(-50%,-50%)}

/* All six publication categories now use one comparable evidence-card design. */
.had-publications-final .had-publication-evidence-summary{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  min-height:62px;
}
.had-publications-final .had-publication-evidence-summary>span{
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  border:1px solid #24566c;
  background:rgba(5,26,39,.56);
  text-align:center;
}
.had-publications-final .had-publication-evidence-summary b{color:var(--card-accent,var(--had-cyan))}

/* Doctoral theses are records, not a selected state. */
[data-had-collection-type="theses"] .had-record-row.is-doctoral{
  border-left-color:transparent!important;
  background:transparent!important;
  box-shadow:none!important;
}
[data-had-collection-type="theses"] .had-record-row.is-doctoral label{color:var(--had-amber)!important}

@media(min-width:901px){
  /* Give the right-hand portfolio index more usable width without shrinking the map excessively. */
  .had-home-v320{
    grid-template-columns:minmax(0,1.38fr) minmax(395px,.82fr)!important;
  }
  .had-home-v320 .had-home-top{
    grid-template-columns:minmax(0,1.02fr) minmax(0,.98fr) minmax(0,1.18fr)!important;
  }

  /* Larger, cleaner portrait with the face retained rather than cropped. */
  .had-home-v320 .had-profile-card{
    grid-template-columns:minmax(0,1.12fr) minmax(210px,.88fr)!important;
  }
  .had-home-v320 .had-portrait-radar{display:none!important}
  .had-home-v320 .had-protected-portrait-image{
    background-size:auto 100%!important;
    background-position:50% 50%!important;
    background-repeat:no-repeat!important;
    background-color:#dce8ee!important;
    filter:saturate(.9) contrast(1.02)!important;
  }
  .had-home-v320 .had-portrait:after{
    height:25%!important;
    background:linear-gradient(transparent,rgba(3,15,24,.72))!important;
  }
  .had-home-v320 .had-profile-copy{
    padding:10px 10px 7px 12px!important;
    justify-content:flex-start!important;
  }
  .had-home-v320 .had-profile-copy .had-kicker{margin:0 0 2px!important}
  .had-home-v320 .had-profile-copy h1{
    margin:3px 0 2px!important;
    font-size:clamp(20px,1.55vw,27px)!important;
    line-height:1.02!important;
  }
  .had-home-v320 .had-profile-role{
    margin:0 0 4px!important;
    font-size:10px!important;
  }
  .had-home-v320 .had-profile-summary{
    margin:0 0 4px!important;
    padding-top:5px!important;
    font-size:10px!important;
    line-height:1.3!important;
    -webkit-line-clamp:2!important;
  }
  .had-home-v320 .had-home-primary-links{
    gap:3px!important;
    margin:3px 0!important;
  }
  .had-home-v320 .had-home-primary-links a{
    min-height:29px!important;
    padding:4px 5px!important;
    font-size:8px!important;
  }
  .had-home-v320 .had-profile-telemetry{margin-top:auto!important;gap:3px!important}
  .had-home-v320 .had-profile-telemetry span{padding:3px 4px!important}
  .had-home-v320 .had-profile-telemetry b{font-size:14px!important}
  .had-home-v320 .had-profile-telemetry small{font-size:6px!important;line-height:1.1!important}
  .had-home-v320 .had-profile-actions{margin-top:4px!important}
  .had-home-v320 .had-profile-actions a{min-height:27px!important;padding:0 7px!important;font-size:8px!important}

  /* Each news slide now carries a record image or a branded local fallback. */
  .had-home-v320 .had-news-item,
  .had-home-v320 .had-news-item.is-active{
    height:100%!important;
    padding:9px 2px 7px!important;
    grid-template-columns:minmax(118px,.78fr) minmax(0,1.22fr)!important;
    grid-template-rows:minmax(0,1fr)!important;
    gap:9px!important;
    align-items:stretch!important;
  }
  .had-home-v320 .had-news-item{display:none!important}
  .had-home-v320 .had-news-item.is-active{display:grid!important}
  .had-home-v320 .had-news-media{
    min-width:0;
    min-height:0;
    position:relative;
    display:block;
    overflow:hidden;
    border:1px solid #245b72;
    border-radius:5px;
    background-position:center;
    background-size:cover;
    box-shadow:inset 0 0 30px rgba(1,10,17,.22);
  }
  .had-home-v320 .had-news-media:before{
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(180deg,rgba(4,18,28,.04) 35%,rgba(3,15,24,.88));
  }
  .had-home-v320 .had-news-media i{
    position:absolute;
    inset:8px;
    border:1px solid rgba(34,211,238,.34);
    pointer-events:none;
  }
  .had-home-v320 .had-news-media b{
    position:absolute;
    left:9px;
    right:9px;
    bottom:8px;
    z-index:1;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:#dffaff;
    font:700 8px ui-monospace,monospace;
    letter-spacing:.08em;
    text-transform:uppercase;
  }
  .had-home-v320 .had-news-copy{
    min-width:0;
    min-height:0;
    display:flex;
    flex-direction:column;
    overflow:hidden;
  }
  .had-home-v320 .had-news-copy .had-signal-line{flex:0 0 auto}
  .had-home-v320 .had-news-copy h3{
    margin:7px 0 3px!important;
    font-size:clamp(15px,1.18vw,21px)!important;
    line-height:1.14!important;
    -webkit-line-clamp:5!important;
  }
  .had-home-v320 .had-news-copy p{
    margin:3px 0!important;
    font-size:10px!important;
  }
  .had-home-v320 .had-news-copy>strong{
    margin-top:auto;
    display:flex;
    align-items:center;
    gap:5px;
    color:var(--had-cyan);
    font:700 9px ui-monospace,monospace;
  }

  /* Aspect-ratio stage centers inside the available map cell without marker drift. */
  .had-home-v320 .had-reach-map{
    display:grid!important;
    place-items:center!important;
  }
  .had-home-v320 .had-reach-map-stage{
    width:100%!important;
    height:100%!important;
    max-height:none!important;
    aspect-ratio:auto!important;
  }

  /* Make the portfolio index legible and use the additional right-column width. */
  .had-home-v320 .had-dashboard-zone{padding:8px 9px!important}
  .had-home-v320 .had-dashboard-zone-head h2{font-size:13px!important}
  .had-home-v320 .had-home-dashboard-grid{gap:4px!important}
  .had-home-v320 .had-home-dashboard-grid .had-dashboard-card{
    grid-template-columns:21px minmax(0,1fr) 29px!important;
    padding:4px 7px!important;
    gap:5px!important;
  }
  .had-home-v320 .had-home-dashboard-grid .had-dash-card-head .dashicons{
    font-size:14px!important;width:14px!important;height:14px!important;
  }
  .had-home-v320 .had-home-dashboard-grid .had-dash-card-head>b{font-size:12px!important}
  .had-home-v320 .had-home-dashboard-grid h3{
    font-size:9px!important;
    line-height:1.08!important;
  }

  /* Conferences: retain the map and the complementary topic/host panel only. */
  [data-had-collection-type="conferences"] .had-analytics-grid{
    height:100%!important;
    grid-template-columns:minmax(0,1.45fr) minmax(255px,.55fr)!important;
    grid-template-rows:minmax(0,1fr)!important;
  }
  [data-had-collection-type="conferences"] .had-analytics-grid>.had-analytics-wide:first-child{
    grid-column:1!important;
    grid-row:1!important;
    min-height:0!important;
    height:100%!important;
  }
  [data-had-collection-type="conferences"] .had-analytics-grid>.had-analytics-panel:nth-child(2){
    grid-column:2!important;
    grid-row:1!important;
    min-height:0!important;
    height:100%!important;
    overflow-y:auto!important;
  }
  [data-had-collection-type="conferences"] [data-had-conference-analytics-body="map"]{
    min-height:0!important;
    height:calc(100% - 30px)!important;
    display:flex!important;
    flex-direction:column!important;
  }
  [data-had-collection-type="conferences"] .had-europe-map{flex:1 1 auto!important;min-height:250px!important}

  /* Research visits: the map becomes the entire analysis surface. */
  [data-had-collection-type="research-visits"] .had-analytics-grid{
    height:100%!important;
    grid-template-columns:1fr!important;
    grid-template-rows:minmax(0,1fr)!important;
  }
  [data-had-collection-type="research-visits"] .had-visit-map-panel{
    grid-column:1/-1!important;
    grid-row:1!important;
    height:100%!important;
    min-height:0!important;
    display:flex!important;
    flex-direction:column!important;
  }
  [data-had-collection-type="research-visits"] .had-visit-map-panel>.had-europe-map{
    flex:1 1 auto!important;
    min-height:320px!important;
  }

  /* Editorial and media analytics now provide only non-duplicated summaries. */
  [data-had-collection-type="editorial-referee"] .had-analytics-grid,
  [data-had-collection-type="media"] .had-analytics-grid{
    height:100%!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:minmax(0,1fr)!important;
    align-content:stretch!important;
  }
  [data-had-collection-type="editorial-referee"] .had-analytics-panel,
  [data-had-collection-type="media"] .had-analytics-panel{
    height:100%!important;
    min-height:0!important;
    overflow-y:auto!important;
  }
  [data-had-collection-type="editorial-referee"] .had-editorial-role-list{
    display:grid!important;
    align-content:start!important;
    gap:0!important;
  }
  [data-had-collection-type="editorial-referee"] .had-editorial-role-list>span{
    min-height:40px!important;
    padding:8px 4px!important;
    border-bottom:1px solid #174258!important;
  }
  [data-had-collection-type="editorial-referee"] .had-editorial-role-list b{font-size:11px!important}
  [data-had-collection-type="editorial-referee"] .had-editorial-role-list em{font-size:12px!important}
}

@media(min-width:901px) and (max-width:1280px){
  .had-home-v320{grid-template-columns:minmax(0,1.36fr) minmax(330px,.84fr)!important}
  .had-home-v320 .had-home-top{grid-template-columns:minmax(0,1fr) minmax(0,.92fr) minmax(0,1.2fr)!important}
  .had-home-v320 .had-profile-card{grid-template-columns:minmax(0,1.14fr) minmax(150px,.86fr)!important}
  .had-home-v320 .had-news-item.is-active{grid-template-columns:minmax(96px,.68fr) minmax(0,1.32fr)!important}
}

@media(max-width:900px){
  .had-home-v320 .had-news-item.is-active{
    display:grid!important;
    grid-template-columns:minmax(120px,.7fr) minmax(0,1.3fr)!important;
    gap:10px!important;
  }
  .had-home-v320 .had-news-media{min-height:210px;background-size:cover;background-position:center;border:1px solid #245b72}
  .had-home-v320 .had-news-copy{display:flex;flex-direction:column;min-width:0}
  .had-home-v320 .had-news-copy>strong{margin-top:auto;color:var(--had-cyan)}
  .had-home-v320 .had-reach-map{display:grid;place-items:center}
  .had-home-v320 .had-reach-map-stage{width:100%;height:auto}
}

@media(max-width:560px){
  .had-home-v320 .had-news-item.is-active{grid-template-columns:1fr!important}
  .had-home-v320 .had-news-media{min-height:190px}
}
