/*
  Home page only - loaded via the Head section in Views/Home/Index.cshtml (layout: _HomeLayout).
  Rules are from the "Editorial Field Guide" design export (styles.css); nav/footer/page-column styles are in
  chrome.css and the colour tokens (--green-*, --brown-*, --red-*, --ink, --paper) in tokens.css.
*/

/* site.css colours every heading green and bolds it; the design's headings are ink, regular weight. */
.ed-h2,.ed-card-name,.ed-tool-name{margin-bottom:0}

/* Phylum colour key: each card sets --k (dark accent) / --ktint (pale) for its own accents. A key may also set
   --kpill / --kpill-ink to recolour its species pills (background / text); unset, pills use --ktint / --ink. */
.k-green{--k:var(--green-700);--ktint:var(--green-100)}
.k-brown{--k:var(--brown-700);--ktint:var(--brown-100)}
.k-red{--k:var(--red-700);--ktint:var(--red-100);--kpill:var(--red-600);--kpill-ink:#fff}

img.photo{display:block;width:100%;object-fit:cover}

/* Hero - boxed to the page width like the species hero (see chrome.css .pb-hero). */
.page.ed .ed-hero{width:100%;max-width:var(--soa-page-width);margin-inline:auto}
.ed-hero{position:relative}
.ed-hero-img{height:clamp(380px,52vw,600px)}
/* Scrim shaped to the text: a vertical darkening under the headline band plus a left-weighted layer under the
   title column, so the text always has contrast while the upper/right part of the photo stays clear. */
.ed-hero-grad{position:absolute;inset:0;z-index:2;pointer-events:none;background:linear-gradient(90deg,rgba(18,24,18,.45) 0%,rgba(18,24,18,.2) 40%,rgba(18,24,18,0) 65%),linear-gradient(180deg,rgba(20,28,20,.15) 0%,rgba(20,28,20,0) 22%,rgba(18,24,18,0) 35%,rgba(18,24,18,.55) 70%,rgba(18,24,18,.85) 100%)}
/* z-index keeps the overlay above the active slide (Bootstrap gives it z-index:1 while fading); pointer-events:none so it never blocks the indicators. */
.ed-hero-cap{position:absolute;left:0;right:0;bottom:0;color:#fff;padding:0 clamp(16px,4vw,56px) clamp(24px,4vw,54px);z-index:3;pointer-events:none}
@media (max-width:767.98px){.ed-hero-cap{padding-bottom:100px}.ed-hero-img{height:clamp(480px,120vw,640px)}.ed-hero-grad{background:linear-gradient(180deg,rgba(20,28,20,.15) 0%,rgba(18,24,18,0) 25%,rgba(18,24,18,.55) 55%,rgba(18,24,18,.88) 100%)}}

/* Carousel (vwCarouselImage). Indicators and the per-slide caption sit bottom-right, lifted clear of the
   search bar that overlaps the hero's bottom 44px; the fixed title block occupies the bottom-left. */
.ed-hero .carousel-indicators{margin:0;left:auto;right:clamp(16px,4vw,56px);bottom:clamp(58px,5vw,70px);justify-content:flex-end;z-index:4;padding:8px 10px;background:#1b35248c;width:380px;box-sizing:border-box;border-radius:0 0 3px 3px}
.ed-hero .carousel-indicators [data-bs-target]{width:12px;height:12px;border-radius:0;opacity:.5;margin:0 4px;box-shadow:none}
.ed-hero .carousel-indicators .active{opacity:1}
/* Pause/play toggle at the left end of the indicator strip (js/hero-carousel.js). */
.ed-hero-toggle{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;margin:0 8px 0 0;padding:10px 0 0;border:0;border-radius:2px;background:transparent;color:#fff;opacity:.7;cursor:pointer}
.ed-hero-toggle:hover,.ed-hero-toggle:focus-visible{opacity:1;background:rgba(255,255,255,.15);outline:none}
.ed-hero-toggle .ed-ico-play,#heroCarousel.is-paused .ed-ico-pause{display:none}
#heroCarousel.is-paused .ed-ico-play{display:block}
/* Caption (.ed-hero-caption, filled by js/hero-carousel.js) and indicators sit on solid --green-900 panels ABOVE the
   scrim (z-index 4): anything inside a slide is under .ed-hero-grad and gets greyed by it. Opaque, so the text has the
   same contrast on every photo. */
.ed-hero-caption{position:absolute;z-index:4;right:clamp(16px,4vw,56px);bottom:calc(clamp(58px,5vw,70px) + 48px);width:380px;padding:12px 16px 10px;text-align:right;color:#fff;background:#1b35248c;border-radius:3px 3px 0 0}
.ed-hero-caption.is-empty{display:none!important}
.ed-hero-caption p{margin:0;color:#fff;font-family:'Newsreader',serif;font-style:italic;font-weight:500;font-size:19px;line-height:1.4}
@media (max-width:767.98px){.ed-hero .carousel-indicators{left:50%;right:auto;transform:translateX(-50%);width:max-content;bottom:56px}}
.ed-eyebrow{font-size:16px;letter-spacing:.26em;text-transform:uppercase;font-weight:600;opacity:.9;margin-bottom:14px;text-shadow:0 1px 2px rgba(0,0,0,.55),0 2px 16px rgba(0,0,0,.45)}
/* site.css colours every h1 green; this one sits on the photo, so force white. */
.ed-hero-title{font-family:'Newsreader',serif;font-weight:400;font-size:clamp(34px,6vw,74px);line-height:.98;letter-spacing:-.01em;max-width:900px;text-wrap:balance;color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.5),0 2px 28px rgba(0,0,0,.45)}
.ed-hero-title em{font-style:italic}
.ed-hero-sub{margin-top:18px;max-width:560px;font-size:clamp(16px,2vw,18px);line-height:1.5;color:rgba(255,255,255,.92);text-shadow:0 1px 2px rgba(0,0,0,.55),0 2px 18px rgba(0,0,0,.45)}

/* Search bar overlapping the bottom of the hero */
.ed-search-wrap{margin-top:-44px;position:relative;z-index:3}
.ed-search{background:#fff;border:1px solid var(--line);box-shadow:0 18px 50px -28px rgba(40,44,30,.5);border-radius:4px;padding:clamp(18px,3vw,26px) clamp(18px,3vw,30px)}
.ed-search-field{flex:1 1 320px;display:flex;align-items:center;gap:14px;border-bottom:1.5px solid var(--ink);padding-bottom:10px}
.ed-search-field svg{flex:0 0 auto;color:var(--ink-soft)}
.ed-search-field .form-control{border:0;outline:0;box-shadow:none;background:transparent;font-family:'Newsreader',serif;font-size:clamp(18px,2.5vw,24px);color:var(--ink);padding:0;border-radius:0}
.ed-search-field .form-control::placeholder{color:#9b9c8e}
/* Live suggestions (React, js/search-suggest.js): a panel hanging under the search field, over the content below. */
.ed-search-field{position:relative}
.ed-suggest{position:absolute;top:calc(100% + 1.5px);left:0;right:0;z-index:20;list-style:none;margin:0;padding:6px 0;max-height:min(420px,60vh);overflow-y:auto;background:#fff;border:1px solid var(--line);border-top:0;box-shadow:0 18px 40px -20px rgba(40,44,30,.45)}
.ed-suggest a{display:flex;align-items:center;gap:12px;padding:7px 14px;color:var(--ink);text-decoration:none}
.ed-suggest li.is-active a{background:var(--green-100)}
.ed-suggest-thumb{flex:0 0 44px;width:44px;height:44px;object-fit:cover;border-radius:3px;background:var(--line)}
.ed-suggest-text{display:flex;flex-direction:column;min-width:0}
.ed-suggest-name{font-family:'Newsreader',serif;font-size:17px;line-height:1.25}
.ed-suggest-common{font-size:13px;color:var(--ink-soft);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ed-suggest-phylum{margin-left:auto;font-size:11.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-soft)}
@media (max-width:575.98px){.ed-suggest-phylum{display:none}}
.ed-scope{font-size:13px;padding:7px 14px;border-radius:999px;border:1px solid var(--line);color:var(--ink-soft);white-space:nowrap;cursor:pointer;margin-bottom:0}
.ed-scope.on,.ed-scope:has(:checked){background:var(--ink);color:#fff;border-color:var(--ink)}
.ed-scope:has(:focus-visible){outline:2px solid var(--green-500);outline-offset:1px}
.ed-go{background:var(--green-700);color:#fff;border:0;font-weight:600;font-size:14px;letter-spacing:.04em;padding:13px 26px;border-radius:3px}
.ed-go:hover,.ed-go:focus{background:var(--green-900);color:#fff}
.ed-algaebase{font-size:13px;color:var(--ink-soft);margin-top:12px}
.ed-algaebase a{text-decoration:none}
.ed-algaebase b{color:var(--green-700);border-bottom:1px solid var(--green-300);white-space:nowrap}
.ed-algaebase .ed-fieldguide{margin-left:22px;white-space:nowrap}
/* Mobile-only search tweaks (no effect >= 768px): display:contents lifts the scope pills into the
   outer wrapping flex row so the Search button flows inline after whichever pills have wrapped, and
   the AlgaeBase / Field Guide line scales with the viewport so it keeps to one line. */
@media (max-width: 767.98px){
  .ed-search .ed-scopes{display:contents!important} /* !important to beat Bootstrap's .d-flex */
  .ed-algaebase{font-size:clamp(10px,3vw,13px)}
  .ed-algaebase .ed-fieldguide{margin-left:clamp(8px,2.5vw,22px)}
}

/* Section headings */
.ed-sec{padding-top:clamp(48px,6vw,78px)}
.ed-sec-head{margin-bottom:30px}
.ed-kicker{font-size:12.5px;letter-spacing:.24em;text-transform:uppercase;color:var(--green-700);font-weight:600}
.ed-h2{font-family:'Newsreader',serif;font-size:clamp(28px,4vw,40px);line-height:1.05;margin:10px 0 0;letter-spacing:-.01em;color:var(--ink);font-weight:400}
.ed-lead{max-width:420px;color:var(--ink-soft);font-size:15.5px;margin:0}

/* Browse-by-phylum cards */
.ed-card{background:#fff;border:1px solid var(--line);border-radius:5px;overflow:hidden}
.ed-card-img{height:230px}
.ed-card-tag{position:absolute;top:14px;left:14px;z-index:2;background:var(--k);color:#fff;font-size:11.5px;letter-spacing:.16em;text-transform:uppercase;font-weight:600;padding:6px 11px;border-radius:3px}
.ed-card .card-body{padding:24px 24px 26px}
.ed-card-sci{font-family:'Newsreader',serif;font-style:italic;font-size:14px;color:var(--k)}
.ed-card-name{font-family:'Newsreader',serif;font-size:29px;line-height:1.05;margin:3px 0 12px;color:var(--ink);font-weight:400}
.ed-card-desc{font-size:15px;color:var(--ink-soft);margin-bottom:18px}
.ed-genera-groups{margin-top:auto;padding-top:18px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:12px}
.ed-genera{display:flex;flex-wrap:wrap;gap:7px}
.ed-genera-label{flex-basis:100%;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-soft)}
.ed-genus{font-family:'Newsreader',serif;font-size:14px;color:var(--kpill-ink,var(--ink));background:var(--kpill,var(--ktint));padding:4px 10px;border-radius:3px;text-decoration:none; white-space:nowrap;}
a.ed-genus:hover{color:var(--kpill-ink,var(--ink));text-decoration:underline;text-underline-offset:2px}
/* Herbarium pressing image between the genus pills and the Explore link. */
.ed-card-pressing{margin-top:18px;width:100%;height:170px;object-fit:cover;border-radius:4px;border:1px solid var(--line)}
.ed-card-link{margin-top:18px;font-weight:600;font-size:14px;color:var(--k);display:flex;align-items:center;gap:7px;white-space:nowrap;text-decoration:none}
.ed-card-link:hover{color:var(--k)}

.ed-genus-additional {
   padding:10px 0;
}
.ed-genus-additional a {
   background-color:var(--kpill,#e2e7ef);
   font-style:normal;
   padding: 3px 6px;
   margin:4px;
   border-radius: 5px;
   display:inline-block;
}

/* Additional catalog sections: the phylum card pattern, de-emphasised so the phyla stay primary -
   tighter section spacing, smaller heading, shorter image, smaller name, ink-soft accent instead of a phylum colour. */
.ed-sec-minor{padding-top:clamp(36px,4.5vw,56px)}
.ed-h2-minor{font-size:clamp(24px,3vw,30px)}
.ed-card-minor{--k:var(--ink-soft);background:var(--paper)}
/* Pill colour per minor card (same --kpill hook as the phylum keys). */
.k-seagrass{--kpill:#b4e6c7}
.k-lichen{--kpill:#d8d8d8}
.k-plant{--kpill:#dcd2ee}
.ed-card-minor .ed-card-img{height:170px}
.ed-card-minor .card-body{padding:20px 22px 22px;display:flex;flex-direction:column}
.ed-card-minor .ed-card-name{font-size:24px;margin:0 0 10px}
.ed-card-minor .ed-card-desc{font-size:14.5px;margin-bottom:auto}
.ed-card-minor .ed-card-link{margin-top:18px;color:var(--green-700)}
.ed-card-minor .ed-card-link:hover{color:var(--green-900)}
/* Line the cards' parts up across a row (pills start under the longest description, links share a
   baseline, cards stay equal height): the row becomes a grid and each column -> card -> card body
   shares its five row tracks (image, name, description, pills, link) via subgrid. Without subgrid
   the flex layout above applies (pills sit just above the link). */
@supports (grid-template-rows:subgrid){
  .ed-minor-row{display:grid;grid-template-columns:1fr}
  .ed-minor-row>[class*="col-"]{width:auto;display:grid;grid-row:span 5;grid-template-rows:subgrid}
  .ed-minor-row .ed-card-minor{display:grid;grid-row:span 5;grid-template-rows:subgrid}
  .ed-minor-row .ed-card-minor .card-body{display:grid;grid-row:span 4;grid-template-rows:subgrid}
  .ed-minor-row .ed-card-minor .ed-card-desc{margin-bottom:0}
  .ed-minor-row .ed-genus-additional{align-self:start}
}
@media (min-width:768px){@supports (grid-template-rows:subgrid){.ed-minor-row{grid-template-columns:repeat(2,1fr)}}}
@media (min-width:992px){@supports (grid-template-rows:subgrid){.ed-minor-row{grid-template-columns:repeat(3,1fr)}}}

/* "Ways in" tool grid */
.ed-tools{border:1px solid var(--line);border-radius:5px;overflow:hidden}
.ed-tool{background:var(--paper);padding:26px 24px;display:flex;flex-direction:column;gap:10px;min-height:150px;height:100%;border-right:1px solid var(--line);border-bottom:1px solid var(--line);margin-right:-1px;margin-bottom:-1px;color:inherit;text-decoration:none}
.ed-tool:hover{background:#fff;color:inherit}
.ed-tool-ix{font-family:'Newsreader',serif;font-size:14px;color:var(--ink-soft)}
.ed-tool-icon{color:var(--green-700)}
.ed-tool-name{font-family:'Newsreader',serif;font-size:21px;line-height:1.1;margin-top:auto;color:var(--ink);font-weight:400}
.ed-tool-sub{font-size:13.5px;color:var(--ink-soft)}

/* Companion volume band */
.ed-guide{background:var(--green-900);color:#eef0e6;border-radius:6px;overflow:hidden}
.ed-guide-art{background:linear-gradient(150deg,#28503a,#163024);display:flex;align-items:center;justify-content:center;padding:clamp(28px,4vw,48px);height:100%}
img.ed-guide-img{width:266px;max-width:70%;height:auto;aspect-ratio:266/360;box-shadow:0 30px 60px -20px rgba(0,0,0,.6)}
.ed-guide-body{padding:clamp(28px,4vw,58px) clamp(20px,4vw,60px)}
.ed-guide-kick{font-size:12.5px;letter-spacing:.24em;text-transform:uppercase;color:var(--green-300);font-weight:600}
.ed-guide-title{font-family:'Newsreader',serif;font-size:clamp(28px,4vw,42px);line-height:1.05;margin:14px 0 8px;color:inherit;font-weight:400}
.ed-guide-authors{font-family:'Newsreader',serif;font-style:italic;font-size:19px;color:#c7d2bd}
.ed-guide-award{display:inline-flex;align-items:center;gap:12px;margin-top:18px;padding:7px 0 7px 14px;border-left:1px solid rgba(169,203,163,.4);font-size:11.5px;letter-spacing:.16em;text-transform:uppercase;line-height:1.5;color:var(--green-300)}
.ed-guide-psa{flex:none;width:23px;height:28px;background:#c7d2bd;-webkit-mask:url(../images/psa-logo.png) center/contain no-repeat;mask:url(../images/psa-logo.png) center/contain no-repeat}
.ed-guide-award span{max-width:48ch}
.ed-guide-pub{margin-top:18px;font-size:15px;color:#aebba2;max-width:440px}
.ed-guide-btn{display:inline-flex;align-items:center;gap:9px;margin-top:26px;background:#eef0e6;color:var(--green-900);font-weight:600;font-size:14.5px;letter-spacing:.02em;padding:14px 26px;border-radius:3px;border:0}
.ed-guide-btn:hover,.ed-guide-btn:focus{background:#fff;color:var(--green-900)}
