.species-directory,.species-single{padding-top:clamp(24px,3.2vw,46px)}
/* Species directory landing only; species detail presentation stays unchanged. */
.species-directory{padding-top:clamp(10px,1.3vw,20px)}
.species-directory__hero{padding:clamp(10px,1.35vw,18px) 0 clamp(14px,1.5vw,22px);border-bottom:1px solid var(--wpia-border)}
.species-directory__hero h1{font-size:clamp(2.45rem,4vw,4.3rem);line-height:.98;letter-spacing:-.05em}
.species-directory__hero>p:not(.eyebrow){max-width:780px;margin-top:8px;color:var(--wpia-muted);font-size:clamp(.86rem,.9vw,.95rem);line-height:1.45}
.species-directory__count{margin-top:10px;font:800 .76rem/1.2 var(--wpia-sans);letter-spacing:.08em;text-transform:uppercase}
.species-directory__controls{padding:clamp(20px,2.4vw,30px) 0}
.species-directory__control-heading{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-bottom:16px}
.species-directory__control-heading h2{font-size:clamp(1.45rem,2.3vw,2.2rem)}
.species-directory__control-heading>a{display:inline-flex;align-items:center;min-height:44px;color:var(--wpia-forest);font-size:.76rem;font-weight:800}
.species-directory__search{display:grid;gap:7px;max-width:760px}
.species-directory__search>label{font-size:.72rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.species-directory__search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;border:1px solid var(--wpia-border);background:#fff}
.species-directory__search-row input{min-width:0;min-height:46px;padding:9px 12px;border:0;background:transparent;color:var(--wpia-ink);outline:0}
.species-directory__search-row input:focus-visible{outline:3px solid var(--wpia-forest);outline-offset:-3px}
.species-directory__search-row button{min-width:96px;min-height:46px;padding:8px 16px;border:0;border-left:1px solid var(--wpia-border);background:var(--wpia-forest);color:#fff;font-size:.78rem;font-weight:800}
.species-class-strip{display:flex;gap:8px;overflow-x:auto;margin-top:20px;padding-bottom:6px;overscroll-behavior-inline:contain;scroll-snap-type:x proximity;scrollbar-width:thin}
.species-class-strip a{flex:0 0 auto;display:inline-flex;align-items:center;min-height:44px;padding:8px 12px;border:1px solid var(--wpia-border);background:#fff;color:var(--wpia-muted);font-size:.74rem;font-weight:750;text-decoration:none;scroll-snap-align:start}
.species-class-strip a:hover,.species-class-strip a:focus-visible,.species-class-strip a.is-current{border-color:var(--wpia-forest);background:var(--wpia-forest);color:#fff}
.species-directory__result-summary{margin:-28px 0 34px;color:var(--wpia-muted);font-size:.78rem}
.species-directory__reset{display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin-top:18px;padding:9px 14px;border:1px solid var(--wpia-forest);background:var(--wpia-forest);color:#fff;font-size:.78rem;font-weight:800;text-decoration:none}
.species-alphabet{display:grid;grid-template-columns:repeat(29,minmax(0,1fr));border-block:1px solid var(--wpia-border);margin:0 0 clamp(42px,6vw,78px)}
.species-alphabet a,.species-alphabet span{display:flex;align-items:center;justify-content:center;min-height:44px;border-right:1px solid var(--wpia-border);font:800 .77rem/1 var(--wpia-sans)}
.species-alphabet a:last-child,.species-alphabet span:last-child{border-right:0}
.species-alphabet a:hover,.species-alphabet a:focus-visible{background:var(--wpia-ink);color:#fff}
.species-alphabet span{color:var(--wpia-muted);opacity:.42}
.species-directory__groups{display:grid;gap:clamp(26px,3.3vw,44px)}
.species-letter-group{scroll-margin-top:120px}
.species-letter-group__heading{display:flex;align-items:end;justify-content:space-between;gap:16px;padding-bottom:8px;border-bottom:2px solid var(--wpia-ink);margin-bottom:12px}
.species-letter-group__heading h2{font-size:clamp(2rem,2.8vw,2.85rem);line-height:1}
.species-letter-group__heading span{color:var(--wpia-muted);font-size:.78rem}
.species-grid--directory{grid-template-columns:repeat(7,minmax(0,1fr));gap:18px 12px}
.species-directory__fallback{padding:clamp(26px,3.8vw,42px) 0 clamp(42px,5vw,64px)}
.species-directory__fallback .section-heading{margin-bottom:10px}
.species-directory__fallback-copy{max-width:860px;margin:0 0 20px;color:var(--wpia-muted);font-size:.86rem;line-height:1.5}
.species-grid--content-groups{grid-template-columns:repeat(6,minmax(0,1fr));gap:20px 14px}
.species-grid--content-groups .species-card{padding-top:0;border-top:0}
.species-grid--content-groups .species-card__media{aspect-ratio:1/1;margin-bottom:7px}
.species-grid--content-groups .species-card__name{font-size:.9rem;line-height:1.08}
.species-grid--content-groups .species-card__discovery-label{margin-top:2px;font-size:.6rem;line-height:1.15}
.species-directory__empty{padding:clamp(50px,8vw,110px) 0;max-width:720px}
.species-directory__empty h2,.species-directory__empty h1{font-size:clamp(2rem,4vw,4rem)}
.species-directory__empty p{margin-top:12px;color:var(--wpia-muted)}
.species-single .breadcrumbs{margin-bottom:22px}
.species-single__hero{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr);min-height:min(68vh,760px);background:var(--wpia-ink);color:#fff}
.species-single__media{min-width:0;overflow:hidden}
.species-single__media img,.species-single__media .wikipetsia-media-placeholder{display:block;width:100%;height:100%;min-height:100%;object-fit:cover}
.species-single__copy{align-self:end;padding:clamp(28px,4vw,58px)}
.species-single__copy .eyebrow{color:rgba(255,255,255,.72)}
.species-single__copy h1{font-size:clamp(3rem,6vw,6.2rem);line-height:.92;letter-spacing:-.055em}
.species-single__scientific{margin-top:12px;font-family:var(--wpia-serif);font-size:clamp(1.2rem,2vw,1.8rem);color:rgba(255,255,255,.82)}
.species-single__description{margin-top:22px;max-width:54ch;color:rgba(255,255,255,.82)}
.species-single__overview{margin:0 0 clamp(54px,7vw,92px);border-bottom:1px solid var(--wpia-border)}
.species-single__facts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
.species-single__facts>div{min-width:0;padding:18px 20px;border-top:1px solid var(--wpia-border);border-right:1px solid var(--wpia-border)}
.species-single__facts>div:nth-child(4n){border-right:0}
.species-single__facts dt{font:800 .69rem/1.2 var(--wpia-sans);letter-spacing:.08em;text-transform:uppercase;color:var(--wpia-muted)}
.species-single__facts dd{margin:7px 0 0;font-family:var(--wpia-serif);font-size:1.05rem;overflow-wrap:anywhere}
.species-single__content,.species-single__documentaries,.species-single__related{margin-top:clamp(56px,8vw,112px)}
.species-grid--related{grid-template-columns:repeat(6,minmax(0,1fr))}

@media(max-width:1199px){
.species-grid--content-groups{grid-template-columns:repeat(4,minmax(0,1fr))}
.species-alphabet{grid-template-columns:repeat(15,minmax(0,1fr))}
.species-alphabet a,.species-alphabet span{border-bottom:1px solid var(--wpia-border)}
.species-grid--directory{grid-template-columns:repeat(5,minmax(0,1fr))}
.species-single__facts{grid-template-columns:repeat(3,minmax(0,1fr))}
.species-single__facts>div:nth-child(n){border-right:1px solid var(--wpia-border)}
.species-single__facts>div:nth-child(3n){border-right:0}
.species-grid--related{grid-template-columns:repeat(4,minmax(0,1fr))}
}

@media(max-width:959px){
.species-grid--content-groups{grid-template-columns:repeat(3,minmax(0,1fr))}
.species-single__hero{grid-template-columns:minmax(0,1fr);min-height:0}
.species-single__media{aspect-ratio:16/10}
.species-single__copy{padding:28px;color:#fff;background:var(--wpia-ink)}
.species-single__copy .eyebrow,.species-single__scientific,.species-single__description{color:rgba(255,255,255,.78)}
.species-grid--directory{grid-template-columns:repeat(4,minmax(0,1fr))}
.species-single__facts{grid-template-columns:repeat(2,minmax(0,1fr))}
.species-single__facts>div:nth-child(n){border-right:1px solid var(--wpia-border)}
.species-single__facts>div:nth-child(2n){border-right:0}
.species-grid--related{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media(min-width:1200px){
.species-grid--related.species-grid--count-1{grid-template-columns:minmax(0,220px)}
.species-grid--related.species-grid--count-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.species-grid--related.species-grid--count-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.species-grid--related.species-grid--count-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.species-grid--related.species-grid--count-5{grid-template-columns:repeat(5,minmax(0,1fr))}
}
@media(min-width:960px) and (max-width:1199px){
.species-grid--related.species-grid--count-1{grid-template-columns:minmax(0,220px)}
.species-grid--related.species-grid--count-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.species-grid--related.species-grid--count-3{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(min-width:768px) and (max-width:959px){
.species-grid--related.species-grid--count-1{grid-template-columns:minmax(0,220px)}
.species-grid--related.species-grid--count-2,.species-grid--related.species-grid--count-4{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:767px){
.species-directory__hero{padding:10px 0 14px}
.species-directory__hero h1{font-size:clamp(2rem,8vw,2.45rem);line-height:.98}
.species-directory__hero>p:not(.eyebrow){margin-top:8px;font-size:.82rem;line-height:1.4}
.species-directory__controls{padding:18px 0}
.species-directory__control-heading{align-items:flex-start}
.species-directory__search-row{grid-template-columns:minmax(0,1fr) 74px}
.species-directory__search-row button{min-width:74px;padding-inline:10px}
.species-class-strip{margin-inline:calc(-1 * var(--wpia-gutter));padding-inline:var(--wpia-gutter)}
.species-alphabet{grid-template-columns:repeat(6,minmax(0,1fr));margin-bottom:38px}
.species-alphabet a,.species-alphabet span{min-height:44px}
.species-directory__result-summary{margin-top:-24px}
.species-grid--directory{grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 14px}
.species-directory__fallback{padding:28px 0 54px}
.species-directory__fallback .section-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px}
.species-directory__fallback-copy{font-size:.82rem}
.species-grid--content-groups{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 10px}
.species-grid--content-groups .species-card{min-width:0;padding:0;border:0}
.species-grid--content-groups .species-card__media{display:block;width:100%;aspect-ratio:1/1;margin:0 0 6px;overflow:hidden}
.species-grid--content-groups .species-card__media img,.species-grid--content-groups .species-card__media .wikipetsia-media-placeholder{width:100%;height:100%;object-fit:cover}
.species-grid--content-groups .species-card__body{min-width:0;padding:0}
.species-grid--content-groups .species-card__name{font-size:.78rem;line-height:1.08;overflow-wrap:normal;word-break:normal}
.species-grid--content-groups .species-card__discovery-label{display:block;margin-top:3px;font-size:.58rem;line-height:1.18}
.species-single__media{aspect-ratio:4/3}
.species-single__copy h1{font-size:clamp(2.2rem,10.5vw,3.25rem);line-height:.96;letter-spacing:-.035em;overflow-wrap:normal}
/* Mobile species profile density: keep short taxonomy facts paired while
   long-form facts retain full reading width. This stays in the existing
   species profile owner; the shared fact markup and Core fields are unchanged. */
.species-single__facts{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:16px}
.species-single__facts>div:nth-child(n){min-width:0;padding:11px 0 12px;border-right:0}
.species-single__facts>.species-fact--habitat,
.species-single__facts>.species-fact--diet,
.species-single__facts>.species-fact--social_structure,
.species-single__facts>.species-fact--lifespan,
.species-single__facts>.species-fact--iucn_status{grid-column:1/-1}
.species-single__overview{margin-bottom:36px}
.species-single__content,.species-single__documentaries,.species-single__related{margin-top:40px}
.species-grid--related{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:379px){.species-grid--content-groups{grid-template-columns:repeat(2,minmax(0,1fr))}}

@media(max-width:359px){
.species-alphabet{grid-template-columns:repeat(5,minmax(0,1fr))}
.species-grid--directory,.species-grid--related{grid-template-columns:minmax(0,1fr)}
}
/* Desktop/tablet A–Z density refinement only; the 320–767px layout is unchanged. */
@media(min-width:768px){
.species-directory__groups{gap:clamp(20px,2.4vw,34px)}
.species-letter-group__heading{padding-bottom:6px;margin-bottom:10px}
.species-letter-group__heading h2{font-size:clamp(1.8rem,2.3vw,2.6rem)}
.species-grid--directory{grid-template-columns:repeat(8,minmax(0,1fr));gap:14px 11px}
.species-grid--directory .species-card{padding-top:8px}
.species-grid--directory .species-card__media{margin-bottom:7px}
.species-grid--directory .species-card__name{font-size:clamp(.88rem,1.15vw,1rem)}
.species-directory__result-summary{margin-bottom:24px}
}
@media(min-width:768px) and (max-width:1199px){
.species-grid--directory{grid-template-columns:repeat(6,minmax(0,1fr))}
}
@media(min-width:768px) and (max-width:959px){
.species-grid--directory{grid-template-columns:repeat(5,minmax(0,1fr))}
}

/* Desktop/tablet species-directory entrance only; keep mobile and species profiles untouched. */
@media(min-width:768px){
.species-directory{padding-top:clamp(6px,.65vw,10px)}
.species-directory__hero{padding:6px 0 10px}
.species-directory__hero .breadcrumbs{margin-bottom:7px}
.species-directory__hero h1{font-size:clamp(2.15rem,3vw,3.2rem);line-height:1}
.species-directory__hero>p:not(.eyebrow){margin-top:6px;max-width:790px;font-size:.86rem;line-height:1.38}
.species-directory__count{margin-top:7px}
.species-directory__controls{padding:clamp(10px,1.1vw,16px) 0 clamp(10px,1vw,14px)}
.species-directory__control-heading{margin-bottom:7px}
.species-directory__control-heading h2{font-size:clamp(1.35rem,1.7vw,1.85rem)}
.species-directory__search{gap:4px}
.species-class-strip{margin-top:10px;padding-bottom:4px}
.species-alphabet{margin-bottom:clamp(20px,2vw,30px)}
.species-directory__result-summary{margin-top:-8px;margin-bottom:16px}
}

/* 0.2.34: single species PROFILE only — reduce desktop hero's initial viewport
 * footprint. The A–Z directory, 320–959px stacked species layout, existing
 * split-grid ordering and species image source remain untouched. Content-rich
 * profiles may grow naturally; do not clip, fix height or truncate the copy. */
@media (min-width:960px) {
  .species-single__hero {
    min-height: clamp(300px, 28vw, 410px);
  }
  /* Remove the image intrinsic aspect ratio from grid-row sizing; the same
     WP attachment/placeholder still fills its original left-hand cell. */
  .species-single__media {
    position: relative;
    min-height: 0;
  }
  .species-single__media img,
  .species-single__media .wikipetsia-media-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
  }
  .species-single__copy {
    padding: clamp(20px, 2.5vw, 36px);
  }
  .species-single__copy h1 {
    font-size: clamp(2.15rem, 3.3vw, 3.65rem);
    line-height: 1.02;
    letter-spacing: -.04em;
  }
  .species-single__scientific {
    margin-top: 8px;
    font-size: clamp(1.05rem, 1.45vw, 1.4rem);
  }
  .species-single__description {
    margin-top: 12px;
  }
}
