/**
 * Hamed Academic Dashboard 5.0.2
 * Main-page layout refinement: roomy project cards, record indexes,
 * compact annual trends, homepage languages, and credential layout swap.
 */

/* --------------------------------------------------------------------------
 * Shared record index used by Research, Career & Education, and Portfolio.
 * ----------------------------------------------------------------------- */
.had-record-index-side{
  min-width:0;
  height:100%;
  min-height:0;
}
.had-record-index-panel{
  min-width:0;
  height:100%;
  min-height:0;
  padding:12px;
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  overflow:hidden;
}
.had-record-index-panel .had-section-title{
  min-height:42px;
  margin:0 0 4px;
  padding:0 0 8px;
}
.had-record-index-panel .had-section-title h2{
  margin:0;
  font-size:15px;
  line-height:1.2;
}
.had-record-index-panel .had-section-title span{
  font-size:8px;
  line-height:1.25;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.had-career-index-lists{
  min-height:0;
  height:100%;
  overflow:hidden;
}
.had-career-index-lists>.had-record-index-scroll{height:100%}
.had-record-index-scroll{
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  scrollbar-width:thin;
  padding-right:3px;
}
.had-project-index-row,
.had-career-index-row,
.had-code-index-row{
  width:100%;
  min-width:0;
  display:grid;
  grid-template-columns:31px minmax(0,1fr) 18px;
  gap:8px;
  align-items:center;
  padding:10px 4px;
  border:0;
  border-bottom:1px solid #173b4f;
  background:transparent;
  color:#d9edf3;
  text-align:left;
  cursor:pointer;
  transition:background .18s ease,border-color .18s ease,transform .18s ease;
}
.had-project-index-row:hover,
.had-project-index-row:focus-visible,
.had-career-index-row:hover,
.had-career-index-row:focus-visible,
.had-code-index-row:hover,
.had-code-index-row:focus-visible{
  outline:0;
  background:linear-gradient(90deg,rgba(34,211,238,.09),rgba(34,211,238,.025));
  border-bottom-color:#1d6377;
  transform:translateX(2px);
}
.had-index-number{
  color:#28d5e8;
  font:700 10px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  letter-spacing:.05em;
}
.had-project-index-row>span:nth-child(2),
.had-career-index-row>span:nth-child(2),
.had-code-index-row>span:nth-child(2){
  min-width:0;
  display:grid;
  gap:3px;
}
.had-project-index-row label,
.had-career-index-row label,
.had-code-index-row label{
  color:#f2bf4c;
  font:700 7px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.had-project-index-row b,
.had-career-index-row b,
.had-code-index-row b{
  color:#e4f3f7;
  font-size:10px;
  line-height:1.28;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}
.had-project-index-row em,
.had-career-index-row em,
.had-code-index-row em{
  color:#7897a5;
  font-size:8px;
  line-height:1.3;
  font-style:normal;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.had-project-index-row>.dashicons,
.had-career-index-row>.dashicons,
.had-code-index-row>.dashicons{
  color:#1dd7e9;
  font-size:16px;
  width:16px;
  height:16px;
}

/* --------------------------------------------------------------------------
 * Research Projects and Roles.
 * ----------------------------------------------------------------------- */
.had-research-v502 .had-research-layout{
  grid-template-columns:minmax(0,1fr) minmax(285px,.30fr)!important;
  gap:10px!important;
  min-height:0!important;
  align-items:stretch!important;
}
.had-research-v502 .had-project-sections{
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding-right:4px!important;
  scrollbar-width:thin;
}
.had-research-v502 .had-project-group{
  min-width:0!important;
  margin:0 0 10px!important;
}
.had-research-v502 .had-project-group:last-child{margin-bottom:0!important}
.had-research-v502 .had-project-grid,
.had-research-v502 .had-project-group-current .had-project-grid,
.had-research-v502 .had-project-group-scheduled .had-project-grid,
.had-research-v502 .had-project-group-completed .had-project-grid,
.had-research-v502 .had-project-group:last-child .had-project-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-template-rows:none!important;
  grid-auto-rows:auto!important;
  gap:8px!important;
  align-items:stretch!important;
}
.had-research-v502 .had-project-card,
.had-research-v502 .had-project-card:nth-child(n),
.had-research-v502 .had-project-group-completed .had-project-card,
.had-research-v502 .had-project-group-completed .had-project-card:last-child{
  grid-column:auto!important;
  grid-row:auto!important;
  position:relative!important;
  inset:auto!important;
  width:100%!important;
  height:auto!important;
  min-height:350px!important;
  padding:12px!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
.had-research-v502 .had-project-card-image,
.had-research-v502 .had-project-group-completed .had-project-card-image{
  height:112px!important;
  min-height:112px!important;
  margin:-12px -12px 9px!important;
  overflow:hidden!important;
  flex:0 0 112px!important;
}
.had-research-v502 .had-project-card-image img{
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
  object-position:center!important;
}
.had-research-v502 .had-project-meta{
  min-height:24px!important;
  gap:8px!important;
  align-items:flex-start!important;
  flex:0 0 auto!important;
}
.had-research-v502 .had-project-meta span{font-size:13px!important}
.had-research-v502 .had-project-meta b{
  max-width:76%!important;
  font-size:7.5px!important;
  line-height:1.25!important;
  white-space:normal!important;
  text-align:right!important;
}
.had-research-v502 .had-project-card h3{
  min-height:0!important;
  margin:7px 0 5px!important;
  font-size:15px!important;
  line-height:1.23!important;
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:3!important;
  overflow:hidden!important;
}
.had-research-v502 .had-project-card>p{
  min-height:0!important;
  margin:0!important;
  font-size:9.5px!important;
  line-height:1.42!important;
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:4!important;
  overflow:hidden!important;
}
.had-research-v502 .had-project-role{
  min-height:34px!important;
  margin:7px 0 0!important;
  flex:0 0 auto!important;
  overflow:hidden!important;
}
.had-research-v502 .had-project-role span{
  font-size:8.5px!important;
  line-height:1.32!important;
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
  overflow:hidden!important;
}
.had-research-v502 .had-project-card .had-tag-row{
  position:static!important;
  margin-top:auto!important;
  padding-top:7px!important;
  max-height:28px!important;
  overflow:hidden!important;
  flex:0 0 auto!important;
}
.had-research-v502 .had-project-card .had-tag-row span{
  font-size:7px!important;
  padding:3px 6px!important;
}
.had-research-v502 .had-open-detail{
  position:static!important;
  margin-top:7px!important;
  font-size:8px!important;
  flex:0 0 auto!important;
}
.had-research-v502 .had-research-side{
  position:sticky!important;
  top:0!important;
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  display:block!important;
}

/* --------------------------------------------------------------------------
 * Career & Education: timeline plus record selector only.
 * ----------------------------------------------------------------------- */
.had-experience-v502 .had-experience-layout{
  grid-template-columns:minmax(0,1.46fr) minmax(300px,.54fr)!important;
  gap:10px!important;
  height:100%!important;
  min-height:0!important;
  align-items:stretch!important;
  overflow:hidden!important;
}
.had-experience-v502 .had-timeline-panel{
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
}
.had-experience-v502 .had-timeline,
.had-experience-v502 .had-timeline-scroll{
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  scrollbar-width:thin;
}
.had-experience-v502 .had-experience-side{
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  display:block!important;
}

/* --------------------------------------------------------------------------
 * Code/Data/Research portfolio: project-card language plus record selector.
 * ----------------------------------------------------------------------- */
.had-portfolio-v502 .had-portfolio-layout{
  grid-template-columns:minmax(0,1.45fr) minmax(300px,.55fr)!important;
  gap:10px!important;
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  align-items:stretch!important;
}
.had-portfolio-v502 .had-portfolio-index{
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr)!important;
}
.had-portfolio-v502 .had-portfolio-project-grid{
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  scrollbar-width:thin;
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-auto-rows:auto!important;
  gap:8px!important;
  padding-right:4px!important;
}
.had-portfolio-v502 .had-code-project,
.had-portfolio-v502 .had-code-project:nth-child(n){
  grid-column:auto!important;
  width:100%!important;
  min-width:0!important;
  min-height:315px!important;
  height:auto!important;
  padding:12px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:0!important;
  text-align:left!important;
  overflow:hidden!important;
}
.had-portfolio-v502 .had-code-project-visual{
  position:relative;
  height:95px;
  min-height:95px;
  margin:-12px -12px 9px;
  padding:15px 16px;
  overflow:hidden;
  border-bottom:1px solid #1b5366;
  background:
    linear-gradient(120deg,rgba(34,211,238,.13),transparent 46%),
    repeating-linear-gradient(135deg,transparent 0 27px,rgba(34,211,238,.11) 28px 29px),
    #061c29;
  display:grid;
  grid-template-columns:34px minmax(0,1fr);
  grid-template-rows:auto 1fr;
  gap:2px 9px;
}
.had-portfolio-v502 .had-code-project-visual>span{
  grid-row:1/3;
  align-self:center;
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border:1px solid #1ccbdd;
  background:rgba(1,39,51,.72);
  color:#28d9ea;
}
.had-portfolio-v502 .had-code-project-visual>small{
  align-self:end;
  color:#24d7e8;
  font:700 7px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.had-portfolio-v502 .had-code-project-visual>b{
  align-self:start;
  color:#e4f6f8;
  font-size:11px!important;
  line-height:1.2;
}
.had-portfolio-v502 .had-code-project-visual>i{
  position:absolute;
  right:-24px;
  width:150px;
  height:1px;
  background:linear-gradient(90deg,transparent,#1bcfe1,transparent);
  transform:rotate(-21deg);
  opacity:.38;
}
.had-portfolio-v502 .had-code-project-visual>i:nth-of-type(1){top:25px}
.had-portfolio-v502 .had-code-project-visual>i:nth-of-type(2){top:62px}
.had-portfolio-v502 .had-code-project-meta{
  min-height:24px;
  display:flex!important;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  color:#7699a7;
  font:700 7px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.had-portfolio-v502 .had-code-project-meta span{color:#20d5e6}
.had-portfolio-v502 .had-code-project-meta b{
  max-width:65%;
  color:#668794!important;
  font-size:7px!important;
  line-height:1.25;
  text-align:right;
}
.had-portfolio-v502 .had-code-project h3{
  margin:7px 0 5px!important;
  color:#eef9fb;
  font-size:14px!important;
  line-height:1.24!important;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  overflow:hidden;
}
.had-portfolio-v502 .had-code-project>p{
  margin:0!important;
  color:#89a7b4;
  font-size:9px!important;
  line-height:1.42!important;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:4;
  overflow:hidden;
}
.had-portfolio-v502 .had-code-project .had-tag-row{
  margin-top:auto!important;
  padding-top:7px!important;
  max-height:29px!important;
  overflow:hidden;
}
.had-portfolio-v502 .had-code-project .had-tag-row span{
  font-size:7px!important;
  padding:3px 6px!important;
}
.had-portfolio-v502 .had-code-project .had-open-detail{
  margin-top:7px!important;
  color:#20d8e9;
  font-size:8px!important;
}
.had-portfolio-v502 .had-portfolio-side{
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  display:block!important;
}

/* --------------------------------------------------------------------------
 * Homepage languages: compact, high-value profile information.
 * ----------------------------------------------------------------------- */
.had-home-v320>.had-profile-card .had-profile-languages{
  margin-top:10px;
  padding-top:9px;
  border-top:1px solid #1b4355;
}
.had-home-v320>.had-profile-card .had-profile-languages>small{
  display:block;
  margin-bottom:6px;
  color:#6f96a6;
  font:700 8px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  letter-spacing:.14em;
  text-transform:uppercase;
}
.had-home-v320>.had-profile-card .had-profile-languages>div{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;
}
.had-home-v320>.had-profile-card .had-profile-languages span{
  position:relative;
  min-width:0;
  min-height:39px;
  padding:7px 8px;
  border:1px solid #195064;
  border-radius:6px;
  background:linear-gradient(135deg,rgba(34,211,238,.08),rgba(3,20,31,.72));
  display:grid;
  gap:2px;
  overflow:hidden;
  transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease;
}
.had-home-v320>.had-profile-card .had-profile-languages span:after{
  content:"";
  position:absolute;
  right:-18px;
  bottom:-23px;
  width:52px;
  height:52px;
  border:1px solid rgba(34,211,238,.13);
  border-radius:50%;
}
.had-home-v320>.had-profile-card .had-profile-languages span:hover{
  border-color:#27cfe0;
  box-shadow:0 0 15px rgba(34,211,238,.09);
  transform:translateY(-1px);
}
.had-home-v320>.had-profile-card .had-profile-languages b{
  color:#dff7fa;
  font-size:9px;
  line-height:1.15;
}
.had-home-v320>.had-profile-card .had-profile-languages em{
  color:#26d7e8;
  font:700 7px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-style:normal;
  line-height:1.2;
}

/* --------------------------------------------------------------------------
 * Credentials: large detail first (left), compact index second (right).
 * ----------------------------------------------------------------------- */
@media(min-width:901px){
  .had-credentials-v3 .had-credential-layout{
    grid-template-columns:minmax(0,1.48fr) minmax(300px,.52fr)!important;
    gap:10px!important;
  }
  .had-credentials-v3 .had-credential-detail{
    grid-column:1!important;
    grid-row:1!important;
  }
  .had-credentials-v3 .had-credential-list{
    grid-column:2!important;
    grid-row:1!important;
  }
}

/* --------------------------------------------------------------------------
 * Annual trend panels: fit year/value labels in the standard desktop viewport.
 * ----------------------------------------------------------------------- */
@media(min-width:901px){
  [data-had-collection-type="journal-papers"] .had-analytics-grid,
  [data-had-collection-type="book"] .had-analytics-grid,
  [data-had-collection-type="theses"] .had-analytics-grid,
  [data-had-collection-type="persian-articles"] .had-analytics-grid,
  [data-had-collection-type="conference-presentations"] .had-analytics-grid,
  [data-had-collection-type="editorial-referee"] .had-analytics-grid,
  [data-had-collection-type="media"] .had-analytics-grid,
  [data-had-collection-type="teaching-experience"] .had-analytics-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:minmax(145px,.82fr) minmax(150px,.72fr)!important;
    grid-auto-rows:unset!important;
    align-content:stretch!important;
    align-items:stretch!important;
    gap:7px!important;
  }
  [data-had-collection-type="journal-papers"] .had-analytics-panel,
  [data-had-collection-type="book"] .had-analytics-panel,
  [data-had-collection-type="theses"] .had-analytics-panel,
  [data-had-collection-type="persian-articles"] .had-analytics-panel,
  [data-had-collection-type="conference-presentations"] .had-analytics-panel,
  [data-had-collection-type="editorial-referee"] .had-analytics-panel,
  [data-had-collection-type="media"] .had-analytics-panel,
  [data-had-collection-type="teaching-experience"] .had-analytics-panel{
    min-height:0!important;
    height:auto!important;
  }
  [data-had-collection-type="journal-papers"] .had-journal-trend-panel,
  [data-had-collection-type="book"] .had-book-trend-panel,
  [data-had-collection-type="theses"] .had-thesis-trend-panel,
  [data-had-collection-type="persian-articles"] .had-persian-trend-panel,
  [data-had-collection-type="conference-presentations"] .had-presentation-trend-panel,
  [data-had-collection-type="editorial-referee"] .had-editorial-trend-panel,
  [data-had-collection-type="media"] .had-media-trend-panel,
  [data-had-collection-type="teaching-experience"] .had-teaching-trend-panel{
    grid-column:1/-1!important;
    grid-row:2!important;
    min-height:150px!important;
    max-height:205px!important;
    height:clamp(150px,22vh,205px)!important;
    overflow:hidden!important;
  }
  .had-journal-trend-panel [data-had-journal-analytics-body="years"],
  .had-book-trend-panel [data-had-book-analytics-body="years"],
  .had-thesis-trend-panel [data-had-thesis-analytics-body="years"],
  .had-persian-trend-panel [data-had-persian-analytics-body="years"],
  .had-presentation-trend-panel [data-had-presentation-analytics-body="years"],
  .had-editorial-trend-panel [data-had-editorial-analytics-body="years"],
  .had-media-trend-panel [data-had-media-analytics-body="years"],
  .had-teaching-trend-panel [data-had-teaching-analytics-body="years"]{
    height:calc(100% - 27px)!important;
    min-height:120px!important;
    max-height:176px!important;
    overflow:hidden!important;
  }
  .had-journal-trend-panel .had-year-trend,
  .had-book-trend-panel .had-year-trend,
  .had-thesis-trend-panel .had-year-trend,
  .had-persian-trend-panel .had-year-trend,
  .had-presentation-trend-panel .had-year-trend,
  .had-editorial-trend-panel .had-year-trend,
  .had-media-trend-panel .had-year-trend,
  .had-teaching-trend-panel .had-year-trend{
    width:100%!important;
    height:100%!important;
    min-height:120px!important;
    max-height:176px!important;
    overflow:hidden!important;
  }
  .had-journal-trend-panel .had-year-trend>svg,
  .had-book-trend-panel .had-year-trend>svg,
  .had-thesis-trend-panel .had-year-trend>svg,
  .had-persian-trend-panel .had-year-trend>svg,
  .had-presentation-trend-panel .had-year-trend>svg,
  .had-editorial-trend-panel .had-year-trend>svg,
  .had-media-trend-panel .had-year-trend>svg,
  .had-teaching-trend-panel .had-year-trend>svg{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    display:block!important;
    overflow:visible!important;
  }
}

/* --------------------------------------------------------------------------
 * Pedagogical Training: only the verified programme summary remains.
 * ----------------------------------------------------------------------- */
.had-pedagogy-volume-body{
  display:block!important;
  min-height:0!important;
  overflow:visible!important;
}
.had-pedagogy-volume-body .had-programme-summary{
  min-height:92px;
  height:auto!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:12px!important;
  align-items:center!important;
}
.had-pedagogy-volume-body .had-programme-summary>span{
  min-width:0;
  display:grid;
  gap:4px;
}
.had-pedagogy-volume-body .had-programme-summary em{
  white-space:normal!important;
  text-align:right!important;
}

/* --------------------------------------------------------------------------
 * Responsive fallbacks.
 * ----------------------------------------------------------------------- */
@media(max-width:1100px) and (min-width:901px){
  .had-research-v502 .had-research-layout,
  .had-experience-v502 .had-experience-layout,
  .had-portfolio-v502 .had-portfolio-layout{
    grid-template-columns:minmax(0,1fr) minmax(250px,.34fr)!important;
  }
  .had-home-v320>.had-profile-card .had-profile-languages>div{
    grid-template-columns:1fr 1fr;
  }
  .had-home-v320>.had-profile-card .had-profile-languages span:last-child{
    grid-column:1/-1;
  }
}

@media(max-width:900px){
  .had-research-v502 .had-research-layout,
  .had-experience-v502 .had-experience-layout,
  .had-portfolio-v502 .had-portfolio-layout{
    display:block!important;
    height:auto!important;
    overflow:visible!important;
  }
  .had-research-v502 .had-project-sections,
  .had-experience-v502 .had-timeline,
  .had-experience-v502 .had-timeline-scroll,
  .had-portfolio-v502 .had-portfolio-index,
  .had-portfolio-v502 .had-portfolio-project-grid{
    height:auto!important;
    overflow:visible!important;
  }
  .had-research-v502 .had-project-grid,
  .had-research-v502 .had-project-group-current .had-project-grid,
  .had-research-v502 .had-project-group-scheduled .had-project-grid,
  .had-research-v502 .had-project-group-completed .had-project-grid,
  .had-research-v502 .had-project-group:last-child .had-project-grid,
  .had-portfolio-v502 .had-portfolio-project-grid{
    grid-template-columns:1fr!important;
  }
  .had-research-v502 .had-project-card,
  .had-portfolio-v502 .had-code-project{
    min-height:0!important;
  }
  .had-research-v502 .had-research-side,
  .had-experience-v502 .had-experience-side,
  .had-portfolio-v502 .had-portfolio-side{
    position:static!important;
    height:auto!important;
    margin-top:10px!important;
    overflow:visible!important;
  }
  .had-record-index-panel{height:auto!important;max-height:none!important}
  .had-record-index-scroll{max-height:430px!important}
  .had-home-v320>.had-profile-card .had-profile-languages>div{
    grid-template-columns:1fr!important;
  }
  .had-credentials-v3 .had-credential-detail,
  .had-credentials-v3 .had-credential-list{
    grid-column:auto!important;
    grid-row:auto!important;
  }
}
