/* ==========================================================================
   Royal Naval Association — Japan Branch
   rnaj.css — the ONLY stylesheet. Every page uses this file.
   Change a colour or size here and it changes everywhere.
   ========================================================================== */

/* --- 1. COLOURS AND SIZES -------------------------------------------------
   These are the site's settings. Change a value here to restyle the
   whole site. Nothing else needs touching.
   ------------------------------------------------------------------------ */
:root {
  --navy:        #0B2545;   /* main brand navy — header, footer, headings */
  --navy-deep:   #071A31;   /* darker navy — footer base                  */
  --slate:       #3E5C76;   /* muted blue for secondary text              */
  --gold:        #B08D2F;   /* brass accent — rules, small marks          */
  --ensign:      #A6192E;   /* ensign red — used sparingly for emphasis   */
  --ink:         #16202B;   /* body text                                  */
  --paper:       #F7F9FB;   /* page background                            */
  --chart:       #E3E8ED;   /* panel background / hairlines               */

  --measure:     1120px;    /* max width of the content column            */
  --base-size:   18px;      /* body text size — raise to 19/20px if you   */
                            /* want it larger for readability             */

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
           Helvetica, Arial, sans-serif;
}

/* --- 2. RESET AND BASE ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--base-size);
  line-height: 1.65;
  font-weight: 400;
}

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

a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--ensign); }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 24px;
}

/* Visible only to screen readers */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px;
  background: var(--gold); color: #fff; padding: 12px 20px; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* --- 3. TYPE ------------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--serif);
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 600;
}

h1 { font-size: clamp(2rem, 5vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.45rem); }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

/* The small letterspaced label used above headings */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.6em;
}

.lead {
  font-size: 1.15em;
  color: var(--slate);
}

/* --- 4. HEADER ----------------------------------------------------------- */
.site-header {
  background: var(--navy);
  color: #fff;
  border-bottom: 3px solid var(--gold);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  flex-wrap: wrap;
}

.crest { width: 74px; flex: none; }
.crest img { width: 100%; }

.wordmark { flex: 1 1 260px; }

.wordmark .name {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 3.2vw, 1.85rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  color: #fff;
}

.wordmark .values {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #9FB4C7;
  margin: 6px 0 0;
}

.lang-link {
  flex: none;
  font-size: 0.8rem;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 6px 12px;
  text-decoration: none;
}
.lang-link:hover { background: #fff; color: var(--navy); }

/* --- 5. NAVIGATION ------------------------------------------------------- */
.site-nav {
  background: var(--navy-deep);
  border-top: 1px solid rgba(255,255,255,0.12);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}

.site-nav a {
  display: block;
  padding: 14px 22px;
  color: #DCE5ED;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
}

.site-nav a:hover { color: #fff; background: rgba(255,255,255,0.07); }

/* Add class="current" to the <a> for the page you're on */
.site-nav a.current {
  color: #fff;
  border-bottom-color: var(--gold);
}

/* --- 6. HERO ------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  background: var(--navy) center/cover no-repeat;
  color: #fff;
}

.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(7,26,49,0.88) 0%, rgba(7,26,49,0.25) 70%);
}

.hero .wrap { position: relative; z-index: 1; padding-top: 70px; padding-bottom: 40px; width: 100%; }
.hero h1 { color: #fff; margin-bottom: 0.25em; }
.hero p  { color: #C9D6E2; max-width: 44em; margin: 0; }
.hero .eyebrow { color: var(--gold); }

/* --- 7. SECTIONS AND PANELS ---------------------------------------------- */
.section { padding: 64px 0; }
.section + .section { padding-top: 0; }

/* Thin navy rule with a small gold mark — the site's divider */
.rule {
  position: relative;
  height: 2px;
  background: var(--chart);
  margin: 56px 0;
  border: 0;
}
.rule::before {
  content: "";
  position: absolute;
  left: 0; top: -3px;
  width: 56px; height: 8px;
  background: var(--gold);
}

.panel {
  background: #fff;
  border: 1px solid var(--chart);
  border-left: 4px solid var(--navy);
  padding: 32px;
}

/* Two-column text + image. Collapses to one column on phones. */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: start;
}

@media (min-width: 800px) {
  .split          { grid-template-columns: 1fr 1.6fr; }
  .split.wide-left{ grid-template-columns: 1.6fr 1fr; }
}

.figure figcaption {
  font-size: 0.82rem;
  color: var(--slate);
  margin-top: 8px;
  font-style: italic;
}

/* --- 8. EVENT CARDS ------------------------------------------------------
   To add an event, copy one <article class="event"> block in events.html
   and change the text. Nothing else needed.
   ------------------------------------------------------------------------ */
.events { display: grid; gap: 40px; }

.event {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: #fff;
  border: 1px solid var(--chart);
  overflow: hidden;
}

@media (min-width: 760px) {
  .event { grid-template-columns: 320px 1fr; }
}

.event-photo {
  min-height: 200px;
  background: var(--navy) center/cover no-repeat;
}

.event-body { padding: 30px 32px; }

.event-when {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ensign);
  margin: 0 0 0.5em;
}

/* --- 9. NOTICEBOARD — the "next event" strip on the home page ------------- */
.noticeboard {
  background: var(--navy);
  color: #fff;
  border-top: 3px solid var(--gold);
  border-bottom: 3px solid var(--gold);
}

.noticeboard .wrap {
  padding-top: 28px;
  padding-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
}

.noticeboard .eyebrow { color: var(--gold); margin: 0; }
.noticeboard h2 { color: #fff; margin: 0; font-size: 1.4rem; }
.noticeboard p  { color: #C9D6E2; margin: 0; font-size: 0.95rem; }
.noticeboard .nb-text { flex: 1 1 320px; }

/* --- 10. BUTTONS --------------------------------------------------------- */
.btn {
  display: inline-block;
  background: var(--ensign);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 15px 30px;
  border: 2px solid var(--ensign);
}
.btn:hover { background: #fff; color: var(--ensign); }

.btn-quiet {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-quiet:hover { background: var(--navy); color: #fff; }

/* --- 11. LISTS ----------------------------------------------------------- */
.ticks { list-style: none; padding: 0; margin: 0 0 1.4em; }
.ticks li {
  padding: 10px 0 10px 28px;
  border-bottom: 1px solid var(--chart);
  position: relative;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0; top: 19px;
  width: 9px; height: 9px;
  background: var(--gold);
}

/* --- 12. FOOTER ---------------------------------------------------------- */
.site-footer {
  background: var(--navy-deep);
  color: #B7C6D4;
  margin-top: 80px;
  border-top: 3px solid var(--gold);
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding: 52px 0 40px;
}

@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1.4fr; }
}

.site-footer h3 {
  color: #fff;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #B7C6D4; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

/* Partner logos come in wildly different shapes — square crests, wide
   wordmarks, a flag. Each sits in an identical white tile and is scaled to
   fit inside it, so the row stays even however odd the source files are. */
.friends {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.friends a {
  background: #fff;
  border-radius: 3px;
  width: 104px;
  height: 62px;
  padding: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.friends img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.footer-base {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 20px 0 40px;
  font-size: 0.82rem;
  color: #7F94A8;
}

/* --- 13. LEGAL PAGE ------------------------------------------------------ */
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.legal-nav a {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 9px 16px;
  border: 1px solid var(--chart);
  background: #fff;
  color: var(--navy);
}
.legal-nav a:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

.legal h2 { scroll-margin-top: 24px; }
.legal dt {
  font-weight: 700;
  color: var(--navy);
  margin-top: 1.3em;
}
.legal dd { margin: 0.3em 0 0; }

.updated {
  font-size: 0.85rem;
  color: var(--slate);
  font-style: italic;
}

/* --- 14. ACCESSIBILITY --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
