/* CFA Chartreux Breed Council — visual language carried over from the
   previous GeneratePress/WordPress site: light gray canvas, white content
   cards, Merriweather body text, Roboto navigation, CFA blue links. */

:root {
  --bg: #efefef;
  --text: #3a3a3a;
  --accent: #1e73be;
  --contrast: #222222;
  --muted: #575760;
  --card: #ffffff;
  --rule: #e3e3e3;
  --max: 1100px;
  /* Type policy (see docs/design-principles.md): the site is a formal
     publication — SERIF almost everywhere; SANS only for navigation and
     genuinely tiny text. Change the faces here, once. */
  --serif: "Merriweather", Georgia, serif;
  --sans: "Roboto", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 300;
}

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { color: #000; text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header { background: var(--card); border-bottom: 1px solid var(--rule); }
.site-header .container {
  display: flex; align-items: center; gap: 24px; padding-top: 18px; padding-bottom: 18px;
}
.site-logo img { width: 110px; display: block; }
.site-title-group { line-height: 1.25; }
.site-title {
  font-family: var(--serif);
  font-size: 30px; font-weight: 700; color: var(--contrast); margin: 0;
}
.site-title a { color: inherit; }
.site-title a:hover { text-decoration: none; }
.site-tagline { margin: 4px 0 0; color: var(--muted); font-size: 15px; font-style: italic; }

/* ---------- navigation (blue bar, white text, like the old site) ---------- */
.site-nav {
  background: var(--accent);
  position: sticky; top: 0; z-index: 50;
  font-family: var(--sans); font-size: 17px; font-weight: 400;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.site-nav .container { display: flex; align-items: center; padding: 0 12px; }
.nav-toggle-box { display: none; }
.nav-toggle {
  display: none; padding: 14px 8px; cursor: pointer; color: #fff;
  font-size: 18px; user-select: none;
}
.nav-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.nav-menu > li { position: relative; }
.nav-menu > li > a, .nav-menu > li > .nav-parent {
  display: block; padding: 15px 16px; color: #fff;
}
.nav-menu a:hover, .nav-menu a:focus {
  color: #fff; text-decoration: none; background: rgba(0,0,0,.18);
}
.nav-menu li.current > a { color: #fff; background: rgba(0,0,0,.25); }
.has-sub > a::after { content: " ▾"; font-size: 12px; color: rgba(255,255,255,.75); }
.sub-menu {
  list-style: none; margin: 0; padding: 6px 0; min-width: 240px;
  position: absolute; left: 0; top: 100%;
  background: var(--accent);
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
  display: none; z-index: 60;
}
.sub-menu a { display: block; padding: 9px 18px; color: #fff; }
.sub-menu a:hover { background: rgba(0,0,0,.18); text-decoration: none; }
.has-sub:hover .sub-menu, .has-sub:focus-within .sub-menu { display: block; }

/* mobile nav */
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-menu { display: none; flex-direction: column; width: 100%; padding-bottom: 8px; }
  .site-nav .container { flex-wrap: wrap; }
  .nav-toggle-box:checked ~ .nav-menu { display: flex; }
  .sub-menu {
    display: block; position: static; border: 0; box-shadow: none; padding: 0 0 4px 18px;
  }
  .site-header .container { gap: 14px; }
  .site-logo img { width: 72px; }
  .site-title { font-size: 22px; }
}

/* ---------- content ---------- */
.breadcrumbs {
  font-family: var(--sans); font-size: 14px; color: var(--muted);
  /* keep the .container auto-centering (this rule wins the class tie) */
  margin: 18px auto 0;
}
.breadcrumbs a { color: var(--muted); }
main.site-main { padding: 20px 0 40px; }
.content-card {
  background: var(--card); border: 1px solid var(--rule); border-radius: 2px;
  padding: 36px 44px; margin-top: 16px;
  /* contain floated figures so a tall image on a short page can never spill
     out of the card and collide with the footer, whatever the markdown holds */
  display: flow-root;
}
@media (max-width: 820px) { .content-card { padding: 22px 18px; } }

.entry-title {
  font-family: var(--serif);
  color: var(--contrast); font-size: 40px; font-weight: 300;
  margin: 0 0 6px; line-height: 1.2;
}
.entry-date { color: var(--muted); font-family: var(--sans); font-size: 14px; margin: 0 0 18px; }
/* headers are set off by SIZE, not weight — serif, LIGHT (300) so they read
   large but airy and don't impose on the reader */
.entry-content h2, .entry-content h3, .entry-content h4 {
  font-family: var(--serif); font-weight: 300;
  color: var(--contrast); line-height: 1.25; letter-spacing: .01em;
}
.entry-content h2 { font-size: 26px; }
.entry-content h3 { font-size: 21px; }
.entry-content figure { margin: 1em 0; }
.entry-content figure.alignright { float: right; margin: 0 0 1em 1.5em; max-width: 46%; }
.entry-content figure.alignleft { float: left; margin: 0 1.5em 1em 0; max-width: 46%; }
.entry-content figure.aligncenter { margin: 1em auto; text-align: center; }
.entry-content figcaption { font-size: 13px; color: var(--muted); font-family: var(--serif); }
.entry-content hr { border: 0; border-top: 1px solid var(--rule); clear: both; margin: 2em 0; }
.entry-content blockquote {
  border-left: 4px solid var(--accent); margin: 1em 0; padding: .3em 1.2em; color: var(--muted);
}
.entry-content table { border-collapse: collapse; }
.entry-content td, .entry-content th { border: 1px solid var(--rule); padding: 6px 10px; }
@media (max-width: 600px) {
  .entry-content figure.alignright, .entry-content figure.alignleft {
    float: none; margin: 1em auto; max-width: 100%; text-align: center;
  }
}

/* ---------- homepage hero (full-bleed, caption top-left) ---------- */
.site-main.full-bleed { padding: 0; }
.site-main.full-bleed + .site-footer { margin-top: 0; }
.home-hero {
  display: flex; align-items: flex-start;
  min-height: min(78vh, 900px);
  background-size: cover; background-position: center;
}
.home-hero:hover { text-decoration: none; }
.home-hero-caption {
  margin: 26px 0 0 40px; padding: 0;
  color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.75);
  font-family: var(--serif); font-weight: 700;
  font-size: 19px; line-height: 1.6;
}
@media (max-width: 820px) {
  .home-hero { min-height: 72vw; }
  .home-hero-caption { margin: 16px 0 0 18px; font-size: 15px; }
}

/* ---------- old-site column layouts ---------- */
/* media-text figures (the breed council logo, Helen's photo) sit in
   their own narrower left column; the text flows beside them */
.entry-content figure.wp-block-media-text__media {
  float: left; width: min(38%, 340px); margin: 6px 30px 16px 0;
  /* each media-text block (e.g. the credits page's photographer signatures)
     starts on a fresh row below any previous floated figure */
  clear: both;
}
/* the paragraph beside a media-text figure is its own block (a BFC) on desktop,
   where the figure floats — so an image + its caption read as one unit and
   don't tangle with neighbours. Long links wrap rather than overflow. On mobile
   the figure stacks full-width, so no BFC is needed (and overflow:hidden there
   would clip long photographer URLs). */
.entry-content figure.wp-block-media-text__media + p { overflow-wrap: break-word; }
@media (min-width: 701px) {
  .entry-content figure.wp-block-media-text__media + p { overflow: hidden; }
}
/* the breed council / breed club Q&A paragraph also gets its gray box */
.p-about-breed-council .entry-content figure.wp-block-media-text__media + p,
.p-about-breed-club .entry-content figure.wp-block-media-text__media + p {
  background: #f1f1f2; padding: 16px 22px; border-radius: 2px;
}

/* Image + text as one LOGICAL BLOCK: wrap the image and its caption in
   <div class="media-block">…</div> and they lay out as a paired row that always
   clears before the next block (the reliable pattern for repeated image+text
   blocks like the photo credits). Stacks on narrow screens. */
.entry-content .media-block {
  display: flex; align-items: center; gap: 22px; margin: 1.3em 0;
}
.entry-content .media-block > img {
  flex: none; width: min(40%, 340px); height: auto; border-radius: 2px; display: block;
}
.entry-content .media-block > div { flex: 1; min-width: 0; overflow-wrap: break-word; }
@media (max-width: 600px) {
  .entry-content .media-block { flex-direction: column; align-items: flex-start; gap: 10px; }
  .entry-content .media-block > img { width: 100%; max-width: 340px; }
}
/* reference library: thumbnail column narrower than the text column */
.p-breed-reference-library .entry-content {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 34px 36px; align-items: center;
}
.p-breed-reference-library .entry-content figure { margin: 0; }
@media (max-width: 700px) {
  .p-breed-reference-library .entry-content { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .entry-content figure.wp-block-media-text__media { float: none; width: 100%; margin: 1em 0; }
}

/* two-column media+text rows (::: right / ::: left in markdown) */
.media-text {
  display: grid; gap: 4px 34px; align-items: start; margin: 1.6em 0;
}
.media-text.media-right { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.media-text.media-left  { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.mt-media { text-align: center; }
.mt-media figure { margin: 0 0 16px; }
.mt-media figure:last-child { margin-bottom: 0; }
.mt-media img { max-width: 100%; height: auto; border-radius: 2px; }
.mt-media figcaption { font-size: 13px; color: var(--muted); font-family: var(--serif); margin-top: 6px; }
.mt-text > :first-child { margin-top: 0; }
@media (max-width: 700px) {
  .media-text, .media-text.media-right, .media-text.media-left {
    grid-template-columns: minmax(0, 1fr); gap: 12px;
  }
  /* media below its prose on narrow screens, whichever side it was on */
  .media-text .mt-media { order: 2; }
}

/* photo grids: scraped event-page figure runs and image-only markdown
   paragraphs (see autoGallery in site.js) */
.md-gallery {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 20px; margin: 1.4em 0; align-items: start;
}
.md-gallery figure { margin: 0 !important; text-align: center; }
.md-gallery img { width: 100%; height: auto; border-radius: 2px; }
.md-gallery figcaption { font-size: 13px; color: var(--muted); font-family: var(--serif); margin-top: 6px; }
@media (max-width: 700px) { .md-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; } }

/* ---------- listing pages ---------- */
.listing { list-style: none; padding: 0; margin: 1em 0 0; }
.listing li { border-bottom: 1px solid var(--rule); padding: 14px 2px; }
.listing li:last-child { border-bottom: 0; }
.listing a { font-family: var(--serif); font-size: 19px; }
.listing .when { color: var(--muted); font-family: var(--sans); font-size: 13px; margin-left: 10px; }

/* ---------- award galleries (generated pages) ---------- */
.award-grid {
  /* max 3 across: bigger photos, and the usual 5 winners per category
     split 3 + 2 instead of an awkward 4 + 1. minmax(0,1fr) keeps the
     columns equal even when a cell's text (e.g. "No Gamon Award given")
     has a wider minimum than its fair share. */
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 24px; margin: 1.2em 0 2em;
}
.award-card { margin: 0; text-align: center; }
.award-card img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 2px; background: #dfe3e8; display: block;
}
.award-card figcaption {
  margin-top: 10px; font-size: 13.5px; line-height: 1.55;
  color: var(--muted); font-family: var(--serif);
}
.award-card figcaption strong { color: var(--contrast); font-size: 14.5px; }
.award-card .photo-credit { display: block; color: #9a9aa2; font-size: 11.5px; margin-top: 3px; }

.award-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px 18px; margin: 1.2em 0 2em;
}
.award-tile { display: block; text-align: center; font-family: var(--sans); }
/* The square itself is the WRAPPER, not the img. `fill` mode places the
   photo with position:absolute and a scale-and-shift, so it needs a
   relative, clipped, square box to sit in; without one it escapes and
   covers the season label. The plain img (a photo with no face frame, or
   the blank) just covers the same box. */
.award-tile-img {
  display: block; width: 100%; aspect-ratio: 1;
  position: relative; overflow: hidden;
  border-radius: 2px; background: #dfe3e8;
}
.award-tile-img img {
  display: block; width: 100%; height: 100%; object-fit: cover;
}
.award-tile:hover { text-decoration: none; }
.award-tile:hover .award-tile-label { text-decoration: underline; }
.award-tile-label { display: block; margin-top: 6px; font-size: 15px; }
/* the publication model: unpublished seasons appear only to the admin,
   dimmed and badged, so the index doubles as the publication map */
.award-tile { position: relative; }
.award-tile.unpublished img { opacity: 0.55; }
.award-tile-unpub {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  background: rgba(40, 40, 40, 0.75); color: #fff;
  font-family: var(--sans); font-size: 11.5px; letter-spacing: 0.04em;
}
/* the admin's banner atop an unpublished season's page */
.preview-banner {
  margin: 0 0 18px; padding: 10px 14px; border-radius: 4px;
  background: #fff6df; border: 1px solid #e8d49a; color: #5f4d1b;
  font-family: var(--sans); font-size: 14.5px; line-height: 1.45;
}
/* article listings (events index): wider tiles, landscape crops */
.listing-tiles { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.listing-tile img { aspect-ratio: 4 / 3; }
.award-card .award-year { font-size: 16px; }
.gamon-gap {
  display: flex; flex-direction: column; justify-content: center; text-align: center;
  aspect-ratio: 3 / 4; border: 1px dashed var(--rule); border-radius: 2px;
  color: var(--muted); font-family: var(--serif); font-size: 13.5px;
}
.gamon-gap strong { color: var(--contrast); font-size: 16px; }
/* national winners: one showcase row per win, photo left, info right */
.nw-row {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  gap: 28px; align-items: center; margin: 2.2em 0;
}
.nw-row .nw-photo img { width: 100%; height: auto; border-radius: 2px; display: block; }
/* uniform showcase frame: every NW/DM photo occupies the same 4:3 box —
   the whole photo (or the admin's crop) fitted inside, the photo's blend
   color (inline) filling the rest */
.nw-frame {
  display: block; width: 100%; aspect-ratio: 4 / 3; position: relative;
  overflow: hidden; border-radius: 2px;
}
.nw-frame img { position: absolute; height: auto; }
/* award-card frame: the admin's crop shown whole; when its shape isn't
   3:4 the blend color (inline) letterboxes it */
.award-frame {
  display: block; width: 100%; aspect-ratio: 3 / 4; position: relative;
  overflow: hidden; border-radius: 2px;
}
.award-frame img { position: absolute; aspect-ratio: auto; }
.nw-info { font-family: var(--serif); font-size: 15.5px; line-height: 1.75; color: var(--muted); }
.nw-info strong { color: var(--contrast); font-size: 16.5px; }
.nw-story {
  font-family: var(--serif); font-style: italic;
  font-size: 15px; line-height: 1.7; color: var(--text);
  margin: 0.9em 0 0; padding-left: 14px; border-left: 3px solid var(--accent);
}
/* DM page hero: a vertical 3:4 portrait (matching the site's other photos)
   at a card-sized width, beside the cat's facts — not the wide showcase.
   The plain image gets the same 3:4 cover crop as an award card; a deliberate
   crop instead arrives already framed 3:4 by .award-frame. */
.dm-hero { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); align-items: start; }
.dm-hero .nw-photo > img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 2px; background: #dfe3e8; display: block; height: auto;
}
@media (max-width: 600px) {
  .nw-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

.award-video { margin: 1em auto 2em; text-align: center; }
.award-video iframe { width: min(400px, 100%); aspect-ratio: 9 / 16; border: 0; border-radius: 2px; }
.award-video-link { font-family: var(--sans); }
@media (max-width: 600px) {
  .award-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .award-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- footer (dark, like the old site) ---------- */
.site-footer {
  margin-top: 20px; background: #1b1c1e; color: #c9c9ce;
  font-family: var(--serif); font-size: 15.5px;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-widgets {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  /* keep the .container 20px side padding (this rule wins the class tie) */
  gap: 28px; padding: 30px 20px 24px; line-height: 1.4;
}
.footer-widgets h4 {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: .5px;
  font-size: 14px; font-weight: 500; color: #8f9094; margin: 0 0 9px;
}
.footer-widgets ul { list-style: none; margin: 0; padding: 0; }
.footer-widgets li { margin-bottom: 5px; }
.footer-widgets p { margin: 0; }
/* About CFA: blurb and the CFA logo side by side on one row (logo at right) */
.about-cfa { display: flex; align-items: center; gap: 16px; }
.about-cfa p { flex: 1; margin: 0; }
/* CFA logo: the official transparent white mark, straight on the dark footer */
.cfa-logo-link { display: inline-block; flex: none; }
.cfa-logo { display: block; width: 90px; height: auto; }
.site-info {
  color: #c9c9ce; padding: 16px 0; font-size: 14px;
}
.site-info .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.site-info-links { display: flex; gap: 22px; }
/* the whole bottom line stays in the muted text color — the copyright link and
   the Facebook/Email links don't pop out in the bright link color */
.site-info a { color: inherit; }
.site-info a:hover { color: inherit; text-decoration: underline; }
