/* =========================================================================
   FREE SAILING — the classes surface: the browse page and one class.

   Two rules run through all of it.

   1. A CREDIT IS NEVER POSITIONED. Every photograph on this site carries its
      own photographer and its own licence, several of them share-alike, and
      the previous build lost that line off the right edge at 390px because it
      was an absolutely-positioned overlay with a max-width in ch. Here every
      credit sits in normal flow underneath its own picture, wraps, and breaks
      inside a long word rather than leaving the box.
   2. THERE IS NO STAND-IN. A class nobody has photographed gets a typographic
      plate with its own name on it and a way to send one in. It never gets a
      drawing of a boat: one line drawing exists in this whole estate and it
      belongs to the ILCA 7.
   ========================================================================= */

/* ------------------------------------------------------------ the browse card
   The site's one card geometry, in its class variant: a picture, a kind, a
   name, the two facts a person asks first, and who looks after it. */
.k-card{ display:flex; flex-direction:column; overflow:hidden; }
.k-shot{
  display:block; margin:0; position:relative; aspect-ratio:4/3;
  background:linear-gradient(150deg,#E7EEF7,#DCE7F3);
}
.k-shot img{
  width:100%; height:100%; object-fit:cover; display:block;
  opacity:0; transition:opacity .5s var(--ease);
}
.k-shot img.on{ opacity:1; }
@media (prefers-reduced-motion:reduce){ .k-shot img{ transition:none; } }

/* the class nobody has photographed. Its own name, set large, on paper. */
.k-plate{
  aspect-ratio:4/3; display:flex; align-items:center; justify-content:center;
  padding:18px 20px; text-align:center;
  background:
    repeating-linear-gradient(135deg,rgba(2,43,131,.028) 0 2px,transparent 2px 9px),
    linear-gradient(160deg,#F2F6FB,#E8EFF8);
  border-bottom:1px solid var(--line);
}
.k-plate span{
  font-size:clamp(17px,2.1vw,22px); line-height:1.15; letter-spacing:-.02em;
  font-weight:700; color:#8FA4C4; overflow-wrap:anywhere;
}
.k-bd{ padding:15px 17px 0; flex:1; }
.k-bd h3{ margin:10px 0 0; font-size:17px; line-height:1.25; color:var(--navy); letter-spacing:-.015em; }
/* DEFECT C, THE CARD CONTRACT: classes.js now prints all three of these on
   every card, empty or not -- an empty <p> collapses to nothing on its own,
   so each gets a min-height reserving ONE line at its own font-size/leading.
   That is what turns "some cards have 2 fewer lines than their neighbour"
   into "every card has the same three slots, some just sit blank". */
.k-alias{ margin-top:4px; font-size:12px; line-height:1.4; min-height:16.8px; color:var(--ink-25); }
.k-meta{ margin-top:7px; font-size:13.5px; line-height:1.35; min-height:18.2px; color:var(--ink-40); }
.k-assoc{ margin-top:7px; font-size:13.5px; line-height:1.35; min-height:18.2px; color:var(--ink-60); }
.k-chips{ display:flex; gap:6px; flex-wrap:wrap; }

/* the credit, and the only place the browse page ever puts one. Photographer
   names and licences run from "CC0" to a full name plus a URL in parens, so
   this is the one card line that can genuinely run to 2-3 lines -- reserving
   a floor for it (rather than the ~1 line some credits need) is what stops
   THIS line, not just the three above it, from re-introducing ragged rows
   whenever a short credit lands beside a long one. */
.k-cr{
  margin:13px 0 0; padding:9px 17px 12px; border-top:1px solid var(--line-2);
  font-size:10.5px; line-height:1.5; color:var(--ink-25); min-height:47px;
  overflow-wrap:anywhere; word-break:break-word; hyphens:auto;
  box-sizing:content-box;
}
.k-cr a{ color:var(--ink-40); text-decoration:underline; text-underline-offset:2px; }
.k-cr a:hover{ color:var(--cyan-text); }

/* the send-one-in line, on a class with no picture */
.k-add{
  margin:13px 0 0; padding:10px 17px 13px; border-top:1px dashed var(--line);
  font-size:12.5px;
}
.k-add a{ color:var(--cyan-text); font-weight:700; text-decoration:none; }
.k-add a:hover{ text-decoration:underline; }

/* --------------------------------------------------------------- the lane
   173 of 301 have never been photographed. They are sorted last and they stay
   on the page, behind one honest divider that says why and offers the fix. */
.k-lane{
  grid-column:1/-1; margin:16px 0 2px; padding:20px 22px;
  border:1px dashed var(--line); border-radius:var(--r); background:#fff;
  display:flex; gap:18px; align-items:baseline; flex-wrap:wrap;
}
.k-lane h2{ font-size:19px; color:var(--navy); letter-spacing:-.018em; }
.k-lane p{ margin-top:5px; font-size:14px; color:var(--ink-40); max-width:56ch; }
.k-lane .btn{ margin-left:auto; }
@media (max-width:640px){ .k-lane .btn{ margin-left:0; } }

/* =========================================================================
   ONE CLASS
   ========================================================================= */

/* ------------------------------------------------------------ the hero
   Half a photograph, half the boat's identity — the editorial hero out of the
   slice build, rebuilt so the picture is a real <img> in the flow rather than
   a background. That is what lets the credit sit under it and never clip. */
.cl-hero{ background:#fff; border-bottom:1px solid var(--line); }
.cl-hero-in{
  max-width:var(--wrap); margin:0 auto; display:grid; gap:0;
  grid-template-columns:minmax(0,1.06fr) minmax(0,1fr); align-items:stretch;
}
.cl-shot{ margin:0; position:relative; background:#E7EEF7; min-height:280px; }
.cl-shot img{ width:100%; height:100%; object-fit:cover; display:block; }
.cl-say{ padding:44px 40px 38px; display:flex; flex-direction:column; justify-content:center; }
.cl-say h1{
  font-size:clamp(31px,4vw,50px); letter-spacing:-.03em; line-height:1.03;
  color:var(--navy); margin:12px 0 0; overflow-wrap:anywhere;
}
.cl-lede{ margin-top:16px; font-size:clamp(15px,1.35vw,18px); color:var(--ink-60); max-width:44ch; }
.cl-go{ margin-top:26px; display:flex; gap:10px; flex-wrap:wrap; }

/* the credit, in the flow, under the identity it belongs to */
.cl-cred{
  margin:22px 0 0; padding-top:14px; border-top:1px solid var(--line-2);
  font-size:11.5px; line-height:1.6; color:var(--ink-40);
  overflow-wrap:anywhere; word-break:break-word;
}
.cl-cred b{ color:var(--ink-60); font-weight:700; }
.cl-cred a{ color:var(--ink-60); text-decoration:underline; text-underline-offset:2px; }
.cl-cred a:hover{ color:var(--cyan-text); }

/* no photograph: the identity takes the whole width and says so plainly */
.cl-hero.bare .cl-hero-in{ grid-template-columns:1fr; }
.cl-hero.bare .cl-say{ padding:52px 40px 46px; }
.cl-none{
  margin-top:26px; padding:18px 20px; border:1px dashed var(--line);
  border-radius:var(--r); background:#FBFCFE; max-width:60ch;
}
.cl-none b{ display:block; color:var(--navy); font-size:15px; }
.cl-none p{ margin-top:6px; font-size:14px; color:var(--ink-40); }

@media (max-width:900px){
  .cl-hero-in{ grid-template-columns:1fr; }
  .cl-shot{ min-height:0; aspect-ratio:16/10; order:-1; }
  .cl-say{ padding:30px 22px 32px; }
  .cl-hero.bare .cl-say{ padding:34px 22px 34px; }
}

/* ------------------------------------------------------------ the facts */
.cl-facts{ display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:20px 26px; margin-top:16px; }
.cl-facts dt{ font-size:11px; letter-spacing:.11em; text-transform:uppercase; color:var(--cyan-text); font-weight:700; }
.cl-facts dd{ margin:6px 0 0; font-size:19px; color:var(--navy); letter-spacing:-.015em; overflow-wrap:anywhere; }
.cl-facts dd small{ display:block; margin-top:3px; font-size:12.5px; color:var(--ink-40); letter-spacing:0; }

/* the ILCA 7's own line drawing, and only ever the ILCA 7's */
.cl-draw{ flex:0 0 auto; width:min(240px,38vw); text-align:center; }
.cl-draw img{ width:100%; max-height:250px; height:auto; object-fit:contain; display:block; }
.cl-draw span{ display:block; margin-top:6px; font-size:11px; color:var(--ink-25); }

/* --------------------------------------------------------- the measured */
.cl-meas{ width:100%; border-collapse:collapse; margin-top:14px; }
.cl-meas th, .cl-meas td{ text-align:left; padding:10px 12px 10px 0; border-bottom:1px solid var(--line-2); font-size:14.5px; }
.cl-meas th{ font-weight:400; color:var(--ink-60); width:44%; }
.cl-meas td{ color:var(--navy); font-weight:700; font-variant-numeric:tabular-nums; }
.cl-meas td small{ display:block; font-weight:400; color:var(--ink-25); font-size:12px; font-variant-numeric:normal; }
.cl-ratio{ margin-top:10px; }
.cl-ratio > div{ padding:14px 0; border-top:1px solid var(--line-2); }
.cl-ratio .rn{ display:flex; gap:14px; align-items:baseline; justify-content:space-between; }
.cl-ratio .rk{ font-size:15px; color:var(--navy); font-weight:700; }
.cl-ratio .rv{ font-size:22px; color:var(--navy); font-variant-numeric:tabular-nums; letter-spacing:-.02em; }
.cl-ratio .rp{ margin-top:5px; font-size:13.5px; color:var(--ink-40); max-width:62ch; }
.cl-ratio .rf{ margin-top:5px; font-size:11.5px; color:var(--ink-25); overflow-wrap:anywhere; }

/* ------------------------------------------------------- on the water
   The gallery out of the slice build: a calm grid, every picture linking to
   its own source page, and one pooled credit underneath naming every
   photographer and linking every licence. Pooled is not shorthand — each
   distinct photographer and licence appears, once. */
.cl-gal{ display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:14px; }
.cl-gal a{ display:block; border-radius:var(--r-s); overflow:hidden; border:1px solid var(--line); background:#EDF2F9; }
.cl-gal img{ width:100%; aspect-ratio:4/3; object-fit:cover; display:block; transition:transform .5s var(--ease); }
.cl-gal a:hover img{ transform:scale(1.035); }
@media (prefers-reduced-motion:reduce){ .cl-gal img{ transition:none; } }
.cl-pool{
  margin-top:15px; font-size:12.5px; line-height:1.65; color:var(--ink-40);
  max-width:96ch; overflow-wrap:anywhere; word-break:break-word;
}
.cl-pool a{ color:var(--ink-60); text-decoration:underline; text-underline-offset:2px; }
.cl-pool a:hover{ color:var(--cyan-text); }

/* --------------------------------------------------------- the map band
   Full bleed, dark, out of the slice build. The line under the heading names
   exactly what the pins are, because the join we hold is country-level and a
   heading alone would claim more than that. */
.cl-band{ position:relative; height:min(56vh,520px); background:#04173A; overflow:hidden; }
.cl-band #cl-map{ position:absolute; inset:0; }
.cl-band .lay{
  position:absolute; left:0; right:0; bottom:0; z-index:500; pointer-events:none;
  padding:26px 22px; background:linear-gradient(to top,rgba(2,14,36,.88),transparent);
}
.cl-band .lay-in{ max-width:var(--wrap); margin:0 auto; }
.cl-band h2{ font-size:clamp(22px,2.6vw,32px); color:#fff; letter-spacing:-.025em; }
.cl-band p{ margin-top:6px; font-size:14px; color:#B6CEE6; max-width:64ch; }
.cl-band .btn{ pointer-events:auto; margin-top:14px; }
.cl-band .leaflet-container{ background:#04173A; }
@media (max-width:640px){ .cl-band{ height:min(52vh,400px); } }

/* ------------------------------------------- four things you can do with it */
.cl-do{ display:grid; grid-template-columns:repeat(4,1fr); gap:18px; }
.cl-do a{ display:flex; flex-direction:column; padding:22px 20px 20px; text-decoration:none; }
.cl-do h3{ font-size:19px; color:var(--navy); letter-spacing:-.018em; }
.cl-do p{ margin-top:9px; font-size:14px; color:var(--ink-40); flex:1; }
.cl-do .go{ margin-top:16px; font-size:13.5px; font-weight:700; color:var(--cyan-text); }
@media (max-width:1080px){ .cl-do{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:560px){ .cl-do{ grid-template-columns:1fr; } }

/* ----------------------------------------------------------- odds and ends */
.cl-orgs{ display:grid; gap:10px; margin-top:14px; }
.cl-orgs a{
  display:flex; gap:12px; align-items:baseline; flex-wrap:wrap; padding:14px 16px;
  border:1px solid var(--line); border-radius:var(--r-s); background:#fff; text-decoration:none;
}
.cl-orgs a:hover{ border-color:#C9D8EA; background:#FBFCFE; }
.cl-orgs b{ color:var(--navy); font-size:15.5px; overflow-wrap:anywhere; }
.cl-orgs .lvl{ margin-left:auto; font-size:11px; letter-spacing:.09em; text-transform:uppercase; color:var(--teal-text); font-weight:700; }
.cl-note{ margin-top:10px; font-size:13.5px; color:var(--ink-40); max-width:70ch; }

/* --------------------------------------------------- owners' register
   LOCKED: "both numbers shown honestly." Two figures side by side so
   neither can be shown without the other — never a single number that
   only ever grows. */
.reg-figs{ display:flex; gap:28px; flex-wrap:wrap; margin-top:14px; }
.reg-figs div{ min-width:70px; }
.reg-figs b{ display:block; font-size:27px; line-height:1.05; color:var(--navy); font-variant-numeric:tabular-nums; letter-spacing:-.01em; }
.reg-figs span{ display:block; margin-top:5px; font-size:12px; line-height:1.35; color:var(--ink-40); max-width:15ch; }
.reg-go{ margin-top:16px; max-width:56ch; }
.reg-go .dm-two{ margin-bottom:2px; }

.cl-split{ display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); gap:22px; align-items:start; }
@media (max-width:980px){ .cl-split{ grid-template-columns:1fr; } }
.cl-head{ display:flex; gap:26px; align-items:flex-start; flex-wrap:wrap; }
.cl-head > div:first-child{ flex:1; min-width:min(260px,100%); }

/* ------------------------------------------------------ one card geometry
   Every card in a row has to start its title on the same line, or the grid
   reads as an accident. The chip line is reserved whether a class has chips
   or not — 470er has neither a kind nor an association, and it still has to
   sit level with the boat beside it. */
.k-chips{ min-height:26px; }
.k-bd h3{ margin-top:11px; }

/* Two across on a phone. 301 boats one-at-a-time is a scroll nobody finishes,
   and at 167px the photograph still reads as a boat, which is the test. */
@media (max-width:640px){
  .grid.g4{ grid-template-columns:repeat(2,1fr); gap:12px; }
  .k-shot, .k-plate{ aspect-ratio:3/2; }
  .k-bd{ padding:12px 13px 0; }
  .k-bd h3{ font-size:15.5px; margin-top:9px; }
  .k-meta, .k-assoc{ font-size:12.5px; }
  /* one chip only. Two will not sit on one 167px line, and a wrapped chip
     row drops that card's title a line below its neighbour's. DEFECT C:
     this used to zero the reserved height out again on top of capping the
     chip count -- so a class with no chip at all (470er has neither a kind
     nor an association) sat ~24px shorter than the boat beside it on the
     one viewport where the two-up grid makes that gap most visible. Reserve
     the phone-sized chip's own measured height instead of nothing. */
  .k-chips{ min-height:24.5px; }
  .k-chips .chip ~ .chip{ display:none; }
  .k-chips .chip{ padding:4px 9px; font-size:10px; letter-spacing:.06em; }
  .k-cr{ padding:8px 13px 10px; font-size:10px; min-height:41px; }
  .k-add{ padding:9px 13px 11px; font-size:12px; }
  .k-plate span{ font-size:16px; }
}

/* THE TWO LENSES — classes.html?view=where / ?view=who.
   A grouped list needs to say which grouping you are in and how to leave it,
   or the reader cannot tell an empty group from a filtered one. Both rules
   sit inside the existing card grid, so they span it rather than breaking it. */
.k-lens{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;
  padding:0 0 2px;margin:0 0 4px}
.k-lens b{font-size:15px;letter-spacing:.01em}
.k-lens-out{font-size:13px;text-decoration:none;border-bottom:1px solid currentColor;
  opacity:.72}
.k-lens-out:hover,.k-lens-out:focus-visible{opacity:1}
.k-group{font-size:14px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;
  margin:22px 0 -4px;padding-top:14px;border-top:1px solid rgba(128,148,178,.28);
  opacity:.78}
.k-group:first-of-type{margin-top:6px;border-top:0;padding-top:0}
@media (prefers-reduced-motion:reduce){.k-lens-out{transition:none}}
