/*
Theme Name: Highbury Cricket Club
Description: Highbury Works Cricket Club's own theme, built 30 Oct 2026 to replace RT Theme 19 and its child theme. No parent theme, no page builder.
Author: John Fletcher
Version: 1.0
Requires PHP: 8.0
Text Domain: hwcc
*/

/* ============================================
   Loaded AFTER css/carried-over.css (the old child theme's styling for
   the homepage, History, Honours, Remembered, Contribute and comments).
   This file: the page frame, and the new photo and category pages.
   Older-reader rules (Fletch, 22 Sep 2026): body text 19-21px+, no
   mid-grey text. On dark green: cream #E8E5DB or stone #D8D3C2. On the
   light background: #2C2A24-#4A4637, gold labels #6A5A20.
   ============================================ */

:root {
  --hwcc-green: #1C2B1C;
  --hwcc-green-2: #2A3D2A;
  --hwcc-cream: #EFECE3;
  --hwcc-paper: #F6F4ED;
  --hwcc-line: #C8C1AB;
  --hwcc-ink: #2C2A24;
  --hwcc-ink-2: #4A4637;
  --hwcc-gold: #6A5A20;
  --hwcc-gold-light: #D4C07A;
  --hwcc-on-green: #E8E5DB;
  --hwcc-serif: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  --hwcc-display: 'Cormorant Garamond', Georgia, serif;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--hwcc-cream);
  color: var(--hwcc-ink);
  font-family: var(--hwcc-serif);
  font-size: 21px;
  line-height: 1.6;
  /* The old theme drew text this way; without it everything looks heavier. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; }

/* ---- Homepage: details the old theme set that the carried-over rules
   relied on ---- */
.hwcc-intro__heading { font-style: normal; }
.hwcc-cat-card img { object-position: center top; }
a { color: var(--hwcc-green); text-underline-offset: 3px; }
a:hover { color: var(--hwcc-gold); }
h1, h2, h3, h4 { font-family: var(--hwcc-display); font-weight: 600; color: var(--hwcc-ink); line-height: 1.2; }
:focus-visible { outline: 3px solid var(--hwcc-gold-light); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hwcc-skip { position: absolute; left: -9999px; top: 8px; z-index: 200; background: #fff; color: var(--hwcc-green); padding: 10px 16px; font-size: 19px; }
.hwcc-skip:focus { left: 8px; }
html.hwcc-viewer-open { overflow: hidden; }

/* ---- Header (rules for the header's look are in carried-over.css) ---- */
.hwcc-site-header { position: relative; z-index: 50; }
.hwcc-site-nav .hwcc-nav-list li:focus-within > .sub-menu { display: block; }

@media screen and (max-width: 767px) {
  .hwcc-nav-toggle { display: flex; }
  .hwcc-site-header__inner { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .hwcc-site-nav { display: none; width: 100%; }
  .hwcc-site-nav.hwcc-site-nav--open { display: block; }
  .hwcc-site-nav .hwcc-nav-list { flex-direction: column; }
  .hwcc-site-nav .hwcc-nav-list .sub-menu { display: block; position: static; box-shadow: none; background: transparent; margin: 0 0 0 16px; padding: 0; }
}

/* ---- Footer ---- */
.hwcc-site-footer { background: var(--hwcc-green); color: var(--hwcc-on-green); margin-top: 72px; }
.hwcc-site-footer__inner { max-width: 1240px; margin: 0 auto; padding: 30px 24px; }
.hwcc-site-footer p { margin: 0; font-size: 18px; }
.hwcc-site-footer a { color: var(--hwcc-gold-light); }
body.home .hwcc-site-footer { margin-top: 0; }

/* ---- Shared bits for the new pages ---- */
.hwcc-back {
  display: inline-block;
  margin: 28px 0 10px;
  font-size: 20px;
  font-weight: 600;
  color: var(--hwcc-green);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.hwcc-eyebrow {
  font-size: 16px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--hwcc-gold);
  font-weight: 700;
}

/* ============================================
   PHOTO PAGE (single.php)
   ============================================ */
.hwcc-photo__wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.hwcc-photo__title { font-size: 48px; margin: 6px 0 24px; }
.hwcc-photo__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
.hwcc-photo__layout--names { grid-template-columns: minmax(0, 1fr) 380px; }
.hwcc-photo__main { margin: 0; }
.hwcc-photo__frame { display: block; background: var(--hwcc-green); padding: 14px; border-radius: 4px; cursor: zoom-in; }
.hwcc-photo__frame img { display: block; width: 100%; height: auto; margin: 0 auto; }
.hwcc-photo__layout:not(.hwcc-photo__layout--names) .hwcc-photo__frame img { width: auto; max-height: 78vh; }
/* No names panel: the mat hugs the photo (some trophy photos are small). */
.hwcc-photo__layout:not(.hwcc-photo__layout--names) .hwcc-photo__main { width: fit-content; min-width: min(100%, 420px); max-width: 100%; margin: 0 auto; } /* centred, so a tall photo doesn't leave half the page empty */
.hwcc-enlarge {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; margin-top: 12px; padding: 14px 18px;
  background: var(--hwcc-paper); color: var(--hwcc-green);
  border: 2px solid var(--hwcc-green); border-radius: 4px;
  font: 600 20px var(--hwcc-serif); cursor: pointer;
}
.hwcc-enlarge::before { content: ''; width: 18px; height: 18px; border: 3px solid currentColor; border-radius: 50%; box-shadow: 7px 7px 0 -5px currentColor; flex: none; }
.hwcc-enlarge:hover { background: var(--hwcc-green); color: #fff; }
.hwcc-photo__caption { margin-top: 16px; font-size: 21px; color: var(--hwcc-ink); }
.hwcc-photo__tip { margin: 0 0 18px; font-size: 20px; color: var(--hwcc-ink-2); }

.hwcc-who { background: var(--hwcc-paper); border: 1px solid var(--hwcc-line); border-radius: 4px; padding: 24px 26px; }
.hwcc-who h2 { font-size: 30px; margin: 0 0 2px; }
.hwcc-who__note { font-size: 18px; color: var(--hwcc-ink-2); margin: 0 0 6px; }
.hwcc-who__row { font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--hwcc-gold); font-weight: 700; margin: 18px 0 6px; }
.hwcc-who ol { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: n; }
.hwcc-who__row + ol { margin-top: 0; }
.hwcc-who li { counter-increment: n; display: flex; gap: 12px; padding: 4px 0; border-bottom: 1px solid #E2DDCD; font-size: 21px; }
.hwcc-who li::before { content: counter(n); min-width: 26px; color: var(--hwcc-gold); font-weight: 700; text-align: right; }
.hwcc-who li.hwcc-who__unknown { color: var(--hwcc-ink-2); font-style: italic; }
.hwcc-who__ask { margin: 22px 0 0; padding-top: 18px; border-top: 2px solid var(--hwcc-line); font-size: 20px; }
.hwcc-who__ask a, .hwcc-photo__ask a { font-weight: 600; }

.hwcc-photo__story { max-width: 820px; margin-top: 30px; font-size: 21px; }
.hwcc-photo__story img { border-radius: 3px; }
.hwcc-photo__story figure, .hwcc-photo__story .wp-caption { max-width: 100%; margin: 24px 0; }
.hwcc-photo__story figcaption, .hwcc-photo__story .wp-caption-text { font-size: 20px; color: var(--hwcc-ink); margin-top: 10px; }
.hwcc-photo__ask { max-width: 820px; margin: 26px 0 0; font-size: 20px; }

.hwcc-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.hwcc-gallery__item { margin: 0; background: var(--hwcc-paper); border: 1px solid var(--hwcc-line); border-radius: 4px; overflow: hidden; }
.hwcc-gallery__item a { display: block; background: var(--hwcc-green); cursor: zoom-in; }
.hwcc-gallery__item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 30%; }
.hwcc-gallery__item figcaption { padding: 12px 16px 14px; font-size: 20px; line-height: 1.45; color: var(--hwcc-ink); }

.hwcc-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 48px 0; }
.hwcc-pn {
  display: flex; gap: 18px; align-items: center;
  background: var(--hwcc-paper); border: 1px solid var(--hwcc-line); border-radius: 4px; padding: 14px;
  text-decoration: none; color: var(--hwcc-ink);
}
.hwcc-pn:hover { border-color: var(--hwcc-green); color: var(--hwcc-ink); }
.hwcc-pn--next { flex-direction: row-reverse; text-align: right; }
.hwcc-pn--empty { background: none; border: 0; }
.hwcc-pn img { width: 150px; height: 100px; object-fit: cover; object-position: center 30%; flex: none; }
.hwcc-pn__text { display: block; }
.hwcc-pn__label { display: block; font-size: 16px; letter-spacing: .12em; text-transform: uppercase; color: var(--hwcc-gold); font-weight: 700; }
.hwcc-pn__title { display: block; font-family: var(--hwcc-display); font-size: 26px; font-weight: 600; line-height: 1.15; color: var(--hwcc-green); }

/* ---- Comments (look mostly comes from carried-over.css) ---- */
.hwcc-comments { max-width: 900px; }
.hwcc-comments .commentlist, .hwcc-comments .commentlist .children { list-style: none; margin: 0; padding: 0; }
.hwcc-comments .commentlist .children { margin-left: 48px; }
.hwcc-comments .comment-holder { border-radius: 4px; margin: 0 0 16px; }
.hwcc-comments .comment-author .author-name { display: block; }
.hwcc-comments .comment-text { margin: 10px 0 14px; }
.hwcc-comment__held { font-style: italic; }
.hwcc-comments #respond { margin-top: 32px; }
.hwcc-comments #respond p { margin: 0 0 16px; }
.hwcc-comments #respond label { display: block; margin-bottom: 4px; }
.hwcc-comments #respond input[type="text"], .hwcc-comments #respond input[type="email"],
.hwcc-comments #respond input[type="url"], .hwcc-comments #respond textarea {
  width: 100%; padding: 10px 12px; border-radius: 3px; font-family: var(--hwcc-serif);
}
.hwcc-comments #respond .comment-form-cookies-consent label { display: inline; }
.hwcc-comments #respond input[type="submit"] { border-radius: 3px; cursor: pointer; }

/* ============================================
   CATEGORY PAGE (category.php) and the fallback list (index.php)
   ============================================ */
.hwcc-cat__wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.hwcc-cat__title { font-size: 52px; margin: 6px 0 12px; }
.hwcc-cat__sub { max-width: 760px; margin: 0; font-size: 22px; color: var(--hwcc-ink-2); }
.hwcc-jump { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 8px; }
.hwcc-jump a {
  background: var(--hwcc-paper); border: 2px solid var(--hwcc-green); color: var(--hwcc-green);
  padding: 8px 18px; border-radius: 30px; font-size: 20px; font-weight: 600; text-decoration: none;
}
.hwcc-jump a:hover { background: var(--hwcc-green); color: #fff; }
.hwcc-decade { margin-top: 40px; scroll-margin-top: 16px; }
.hwcc-decade__title { font-size: 38px; margin: 0 0 18px; padding-bottom: 6px; border-bottom: 2px solid var(--hwcc-line); }
.hwcc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.hwcc-cat > .hwcc-cat__wrap > .hwcc-grid { margin-top: 28px; }
.hwcc-card { display: block; background: var(--hwcc-paper); border: 1px solid var(--hwcc-line); border-radius: 4px; overflow: hidden; text-decoration: none; color: var(--hwcc-ink); }
.hwcc-card:hover { border-color: var(--hwcc-green); color: var(--hwcc-ink); }
.hwcc-card__img { display: block; aspect-ratio: 3 / 2; background: var(--hwcc-green); }
.hwcc-card__img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.hwcc-cat--people .hwcc-card__img img { object-position: center 8%; } /* keep heads in */
.hwcc-decade__note { font-size: 19px; margin: -6px 0 18px; }
.hwcc-card__body { display: block; padding: 14px 18px 18px; }
.hwcc-card__year { display: block; font-size: 16px; letter-spacing: .14em; text-transform: uppercase; color: var(--hwcc-gold); font-weight: 700; }
.hwcc-card__title { display: block; font-family: var(--hwcc-display); font-size: 26px; font-weight: 600; line-height: 1.15; color: var(--hwcc-green); margin-top: 2px; }
.hwcc-more { margin: 56px 0 0; padding: 24px 0 0; border-top: 2px solid var(--hwcc-line); font-size: 21px; }
.hwcc-more a { font-weight: 600; }
.hwcc-cat__empty { font-size: 21px; margin-top: 30px; }
.hwcc-paging { margin-top: 32px; font-size: 20px; }
.hwcc-paging .page-numbers { display: inline-block; padding: 6px 14px; }

/* ============================================
   OTHER PAGES (page.php, 404.php): Contribute, About, Privacy Policy
   ============================================ */
.hwcc-page__wrap { max-width: 900px; margin: 0 auto; padding: 8px 24px 0; }
.hwcc-page__title { font-size: 48px; margin: 36px 0 20px; }
.hwcc-page__body { font-size: 21px; }
.hwcc-page__body h2 { font-size: 34px; }
.hwcc-page__body h3 { font-size: 28px; }
/* Leftovers from the old page builder on Contribute and Privacy Policy */
.hwcc-page__body .vc_row { margin-left: 0; margin-right: 0; }
.hwcc-page__body .vc_column-inner { padding-left: 0 !important; padding-right: 0 !important; }
.hwcc-page__body .vc_custom_heading { font-family: var(--hwcc-display) !important; }
.hwcc-page__body .vc_column_container { width: 100% !important; float: none !important; margin-left: 0 !important; }
.hwcc-page__body .vc_column_container:not(:has(.wpb_wrapper > *)) { display: none; }
/* Contribute's own text starts with a "Contribute" heading, so the
   page title would show twice. Goes once its text is plain blocks. */
body.page-id-107 .hwcc-page__title { display: none; }
body.page-id-107 .hwcc-page__body { margin-top: 28px; }

/* ============================================
   PHOTO VIEWER ("Enlarge the photo"), opened by js/site.js
   ============================================ */
.hwcc-viewer { position: fixed; inset: 0; z-index: 300; background: rgba(15, 22, 15, .97); overflow: auto; }
.hwcc-viewer[hidden] { display: none; }
.hwcc-viewer__img { display: block; max-width: none; width: auto; min-width: 100%; height: auto; margin: 72px auto 24px; }
.hwcc-viewer__close {
  position: fixed; top: 16px; right: 16px; z-index: 2;
  background: var(--hwcc-on-green); color: var(--hwcc-green);
  border: 0; border-radius: 4px; padding: 12px 20px;
  font: 700 21px var(--hwcc-serif); cursor: pointer;
}
.hwcc-viewer__hint { position: fixed; top: 22px; left: 20px; margin: 0; color: var(--hwcc-on-green); font-size: 18px; }

/* ============================================
   Tablets and phones
   ============================================ */
@media screen and (max-width: 1000px) {
  .hwcc-photo__layout--names { grid-template-columns: minmax(0, 1fr); }
  .hwcc-grid, .hwcc-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 767px) {
  body { font-size: 20px; }
  .hwcc-photo__wrap, .hwcc-cat__wrap, .hwcc-page__wrap { padding: 0 16px; }
  .hwcc-photo__title, .hwcc-page__title { font-size: 36px; }
  .hwcc-cat__title { font-size: 40px; }
  .hwcc-photo__frame { padding: 8px; }
  .hwcc-photo__layout:not(.hwcc-photo__layout--names) .hwcc-photo__frame img { width: 100%; max-height: none; }
  .hwcc-who { padding: 20px; }
  .hwcc-prevnext { grid-template-columns: 1fr; gap: 14px; }
  .hwcc-pn, .hwcc-pn--next { flex-direction: row; text-align: left; }
  .hwcc-pn--empty { display: none; }
  .hwcc-pn img { width: 110px; height: 80px; }
  .hwcc-pn__title { font-size: 23px; }
  .hwcc-comments .commentlist .children { margin-left: 20px; }
  .hwcc-grid, .hwcc-gallery { gap: 22px; }
  .hwcc-decade__title { font-size: 32px; }
  .hwcc-viewer__img { min-width: 200%; }
  .hwcc-viewer__hint { display: none; }
}

/* Homepage photos on tablets (31 Oct 2026). Between phone and desktop
   the hero was a fixed 540px tall however wide the screen, so on an
   iPad the photos were cropped to a thin strip and the back row lost
   their heads. Let it grow with the width instead. */
@media screen and (min-width: 768px) and (max-width: 1199px) {
  .hwcc-hero,
  .hwcc-hero__overlay { min-height: max(540px, 62vw); }
}
/* "From the Archive" tiles are always people photos - crop from the top
   so tall ones (Elvis, Scholey & Moulton) show faces, not legs. */
.hwcc-post-card__img img { object-position: center 8%; }
/* Contribute: the "Add photos" box ran 23px off a phone screen (a
   fieldset won't shrink below its widest field by default). */
.wpcf7-form .hwcc-cf-photos { min-width: 0; max-width: 100%; box-sizing: border-box; }
.wpcf7-form input[type="file"] { max-width: 100%; box-sizing: border-box; }
/* Photo lists: two across on small tablets too (iPad mini is 744px
   wide and was getting one column - Fletch, 31 Oct 2026). One column
   only on phones. */
@media screen and (max-width: 599px) {
  .hwcc-grid, .hwcc-gallery { grid-template-columns: 1fr; }
}
