/*
Theme Name: RRR Theme
Theme URI: https://roundrotherham.com
Description: Rowbotham's Round Rotherham — standalone theme. Steel Precision palette, Montserrat + Lora.
Author: Consulting Brain / Phil Tidmarsh
Version: 1.0.4
Text Domain: rrr-theme
*/

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800;900&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

/* ─── Design tokens ───────────────────────────────────── */
:root {
  --rrr-dark:      #111a14;
  --rrr-dark2:     #1c2b1f;
  --rrr-green:     #4ade80;
  --rrr-green-dk:  #22c55e;
  --rrr-text:      #e8f0ea;
  --rrr-muted:     #8fa98f;
  --rrr-white:     #ffffff;
  --rrr-radius:    6px;
  --rrr-font-head: 'Montserrat', sans-serif;
  --rrr-font-body: 'Lora', Georgia, serif;
}

/* ─── Reset / base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--rrr-font-body);
  font-size: 1rem;
  line-height: 1.7;
  background-color: var(--rrr-dark);
  color: var(--rrr-text);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--rrr-font-head);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--rrr-white);
  line-height: 1.15;
}

a {
  color: var(--rrr-green);
  text-decoration: none;
}
a:hover {
  color: var(--rrr-green-dk);
  text-decoration: underline;
}

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.5rem; }

/* ─── Site wrapper ────────────────────────────────────── */
.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-content { flex: 1; }

/* ─── Header ──────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: var(--rrr-dark);
  border-bottom: 1px solid rgba(74, 222, 128, 0.2);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* Site branding */
.site-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.site-branding a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none !important;
}

.site-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.site-title {
  font-family: var(--rrr-font-head);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--rrr-white) !important;
  white-space: nowrap;
}

/* Desktop nav */
.main-nav {
  display: none;
}

@media (min-width: 768px) {
  .main-nav {
    display: flex;
    align-items: center;
  }

  .main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    margin: 0;
  }

  .main-nav > ul > li {
    position: relative;
  }

  .main-nav > ul > li > a {
    display: block;
    padding: 0.5rem 0.85rem;
    font-family: var(--rrr-font-head);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--rrr-text) !important;
    text-decoration: none !important;
    border-radius: var(--rrr-radius);
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
  }

  .main-nav > ul > li > a:hover,
  .main-nav > ul > li.current-menu-item > a,
  .main-nav > ul > li.current-page-ancestor > a {
    color: var(--rrr-green) !important;
    background: rgba(74, 222, 128, 0.07);
  }

  /* Submenu / dropdown */
  .main-nav ul ul {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: var(--rrr-dark2);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: var(--rrr-radius);
    padding: 0.4rem 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
    z-index: 100;
  }

  .main-nav ul li:hover > ul,
  .main-nav ul li:focus-within > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .main-nav ul ul li a {
    display: block;
    padding: 0.55rem 1.1rem;
    font-family: var(--rrr-font-head);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--rrr-text) !important;
    text-decoration: none !important;
    transition: color 0.12s, background 0.12s;
    white-space: nowrap;
  }

  .main-nav ul ul li a:hover {
    color: var(--rrr-green) !important;
    background: rgba(74, 222, 128, 0.08);
  }
}

/* Hamburger button — hidden site-wide; desktop uses .main-nav, mobile uses .rrr-bottom-nav
   (both cover the same links, so the hamburger/drawer would just be a redundant third nav) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--rrr-radius);
  transition: background 0.15s;
  flex-shrink: 0;
}

.nav-toggle:hover { background: rgba(74, 222, 128, 0.1); }

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--rrr-text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s, width 0.25s;
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 768px) {
  .nav-toggle { display: none; }
}

/* Mobile drawer */
.mobile-menu {
  display: none;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--rrr-dark2);
  border-bottom: 1px solid rgba(74, 222, 128, 0.15);
  z-index: 9998;
  padding: 1rem 0;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.mobile-menu.open { display: block; }

.mobile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu ul ul {
  padding-left: 1.25rem;
  border-left: 2px solid rgba(74, 222, 128, 0.15);
  margin: 0.25rem 0 0.5rem 1.5rem;
}

.mobile-menu li a {
  display: block;
  padding: 0.65rem 1.5rem;
  font-family: var(--rrr-font-head);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rrr-text) !important;
  text-decoration: none !important;
  transition: color 0.12s, background 0.12s;
}

.mobile-menu li a:hover,
.mobile-menu li.current-menu-item a {
  color: var(--rrr-green) !important;
  background: rgba(74, 222, 128, 0.06);
}

.mobile-menu ul ul li a {
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
}

/* ─── Hero section ────────────────────────────────────── */
.rrr-hero {
  min-height: auto;
  background: linear-gradient(160deg, var(--rrr-dark) 60%, #0e2b18 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  position: relative;
  overflow: hidden;
}
@media (min-width: 769px) {
  .rrr-hero { min-height: 70svh; padding: 4rem 1.5rem; }
}

.rrr-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 70%, rgba(74,222,128,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.rrr-hero__logo {
  width: 180px;
  height: auto;
  margin: 0 auto 1.5rem;
  display: block;
}

.rrr-hero__eyebrow {
  font-family: var(--rrr-font-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rrr-green);
  margin-bottom: 1rem;
}

.rrr-hero__title {
  font-family: var(--rrr-font-head);
  font-size: clamp(2.4rem, 8vw, 5.5rem);
  font-weight: 900;
  line-height: 1.0;
  color: var(--rrr-white);
  margin-bottom: 0.5rem;
}

.rrr-hero__subtitle {
  font-family: var(--rrr-font-body);
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: var(--rrr-muted);
  margin-bottom: 2.5rem;
  font-style: italic;
}

/* ─── Stats strip ─────────────────────────────────────── */
.rrr-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(74,222,128,0.15);
  border-radius: var(--rrr-radius);
  overflow: hidden;
  margin: 2rem auto;
  max-width: 640px;
  width: 100%;
}

.rrr-stat {
  flex: 1;
  padding: 0.75rem 0.5rem;
  text-align: center;
  border-right: 1px solid rgba(74,222,128,0.12);
}
.rrr-stat:last-child { border-right: none; }
@media (min-width: 769px) {
  .rrr-stat { padding: 1.25rem 1rem; }
}

.rrr-stat__number {
  font-family: var(--rrr-font-head);
  font-size: clamp(1.25rem, 5vw, 2rem);
  font-weight: 900;
  color: var(--rrr-green);
  line-height: 1;
}

.rrr-stat__label {
  font-size: clamp(0.6rem, 2vw, 0.7rem);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rrr-muted);
  margin-top: 0.3rem;
}

/* ─── CTA buttons ─────────────────────────────────────── */
.rrr-btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: var(--rrr-radius);
  font-family: var(--rrr-font-head);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s ease;
  text-decoration: none !important;
  cursor: pointer;
  border: none;
}

.rrr-btn--primary {
  background: var(--rrr-green);
  color: var(--rrr-dark) !important;
}
.rrr-btn--primary:hover {
  background: var(--rrr-green-dk);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(74,222,128,0.3);
  text-decoration: none !important;
}

.rrr-btn--outline {
  border: 2px solid rgba(74,222,128,0.5);
  color: var(--rrr-green) !important;
  background: transparent;
}
.rrr-btn--outline:hover {
  border-color: var(--rrr-green);
  background: rgba(74,222,128,0.08);
  text-decoration: none !important;
}

/* ─── Quick-nav cards ─────────────────────────────────── */
.rrr-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  padding: 3rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.rrr-card {
  background: var(--rrr-dark2);
  border: 1px solid rgba(74,222,128,0.12);
  border-radius: var(--rrr-radius);
  padding: 1.75rem 1.25rem 1.5rem;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none !important;
  display: block;
  color: inherit;
}
.rrr-card:hover {
  border-color: var(--rrr-green);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.rrr-card__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.rrr-card__title {
  font-family: var(--rrr-font-head);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rrr-white);
}

.rrr-card__desc {
  font-size: 0.78rem;
  color: var(--rrr-muted);
  margin-top: 0.4rem;
  line-height: 1.4;
}

/* ─── Section blocks ──────────────────────────────────── */
.rrr-section {
  padding: 4rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.rrr-section--full {
  max-width: 100%;
  background: var(--rrr-dark2);
  padding: 4rem 1.5rem;
}

.rrr-section--full .rrr-section__inner {
  max-width: 900px;
  margin: 0 auto;
}

.rrr-section__label {
  font-family: var(--rrr-font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rrr-green);
  margin-bottom: 0.5rem;
}

.rrr-section__title {
  font-family: var(--rrr-font-head);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 900;
  color: var(--rrr-white);
  margin-bottom: 1.25rem;
  line-height: 1.1;
}

/* ─── Entry content (WP block editor) ─────────────────── */
.entry-content {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.entry-content > * + * { margin-top: 1.25rem; }
.entry-content h2 { margin-top: 2rem; }
.entry-content h3 { margin-top: 1.5rem; }

.entry-content ul,
.entry-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.entry-content li { margin-bottom: 0.25rem; }

.entry-content blockquote {
  border-left: 3px solid var(--rrr-green);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--rrr-muted);
  font-style: italic;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.entry-content th,
.entry-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(74,222,128,0.15);
  text-align: left;
}

.entry-content th {
  background: rgba(74,222,128,0.08);
  color: var(--rrr-green);
  font-family: var(--rrr-font-head);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Results table ───────────────────────────────────── */
.rrr-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.rrr-results-table th {
  background: rgba(74,222,128,0.1);
  color: var(--rrr-green);
  font-family: var(--rrr-font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(74,222,128,0.2);
}
.rrr-results-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--rrr-text);
}
.rrr-results-table tr:hover td {
  background: rgba(74,222,128,0.04);
}
.rrr-results-table .pos { color: var(--rrr-muted); font-weight: 700; width: 3rem; }
.rrr-results-table .time { font-family: var(--rrr-font-head); font-weight: 700; color: var(--rrr-green); }

/* ─── Checkpoint / timeline list ─────────────────────── */
.rrr-checkpoints {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  position: relative;
}
.rrr-checkpoints::before {
  content: '';
  position: absolute;
  left: 1.1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--rrr-green), transparent);
}
.rrr-checkpoint {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0 0.75rem 0.5rem;
  position: relative;
}
.rrr-checkpoint__dot {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--rrr-green);
  flex-shrink: 0;
  margin-top: 0.15rem;
  position: relative;
  z-index: 1;
}
.rrr-checkpoint__name {
  font-family: var(--rrr-font-head);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--rrr-white);
}
.rrr-checkpoint__meta {
  font-size: 0.8rem;
  color: var(--rrr-muted);
  margin-top: 0.1rem;
}

/* ─── Autocomplete (results search) ──────────────────── */
.rrr-autocomplete-wrap { position: relative; }
#rrr-autocomplete-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--rrr-dark2);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 0 0 var(--rrr-radius) var(--rrr-radius);
  list-style: none;
  padding: 0.25rem 0;
  margin: 0;
  max-height: 260px;
  overflow-y: auto;
}
#rrr-autocomplete-list.open { display: block; }
#rrr-autocomplete-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.1s;
}
#rrr-autocomplete-list li:hover,
#rrr-autocomplete-list li.active {
  background: rgba(74,222,128,0.08);
}
#rrr-autocomplete-list em { font-style: normal; color: var(--rrr-green); font-weight: 700; }
.rrr-ac-count { font-size: 0.75rem; color: var(--rrr-muted); white-space: nowrap; margin-left: 1rem; }

/* ─── Form inputs ─────────────────────────────────────── */
input[type="text"],
input[type="search"],
input[type="email"],
select,
textarea {
  font-family: var(--rrr-font-body);
  font-size: 0.95rem;
  color: var(--rrr-text);
  background: var(--rrr-dark2);
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: var(--rrr-radius);
  padding: 0.6rem 0.9rem;
  width: 100%;
  transition: border-color 0.15s;
  appearance: none;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--rrr-green);
  box-shadow: 0 0 0 3px rgba(74,222,128,0.12);
}

/* ─── Mobile bottom nav ───────────────────────────────── */
@media (max-width: 767px) {
  .rrr-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--rrr-dark);
    border-top: 1px solid rgba(74,222,128,0.2);
    z-index: 9999;
    align-items: stretch;
  }

  .rrr-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--rrr-muted);
    text-decoration: none !important;
    font-family: var(--rrr-font-head);
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    gap: 0.2rem;
    padding: 0 0.15rem;
    transition: color 0.15s;
  }

  .rrr-bottom-nav__item svg {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
  }

  .rrr-bottom-nav__item:hover,
  .rrr-bottom-nav__item.current {
    color: var(--rrr-green);
  }

  body { padding-bottom: 64px; }
}

@media (min-width: 768px) {
  .rrr-bottom-nav { display: none; }
}

/* ─── Footer ──────────────────────────────────────────── */
.site-footer {
  background: var(--rrr-dark2);
  border-top: 1px solid rgba(74,222,128,0.1);
  color: var(--rrr-muted);
  font-size: 0.85rem;
  padding: 2.5rem 1.5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.site-footer a { color: var(--rrr-green); }
.site-footer a:hover { color: var(--rrr-green-dk); }

/* ─── 404 / empty states ──────────────────────────────── */
.rrr-empty {
  text-align: center;
  padding: 6rem 1.5rem;
  color: var(--rrr-muted);
}
.rrr-empty h1 {
  font-size: clamp(3rem, 10vw, 7rem);
  color: var(--rrr-green);
  margin-bottom: 0.5rem;
  line-height: 1;
}

/* ─── Utilities ───────────────────────────────────────── */
.text-green  { color: var(--rrr-green); }
.text-muted  { color: var(--rrr-muted); }
.text-white  { color: var(--rrr-white); }
.font-head   { font-family: var(--rrr-font-head); }
.bg-dark2    { background-color: var(--rrr-dark2); }
.rrr-dnf td  { opacity: 0.5; }
.rrr-dnf .pos { color: var(--rrr-muted) !important; font-style: italic; }

/* WordPress required alignment classes */
.alignleft  { float: left; margin-right: 1.5rem; margin-bottom: 1rem; }
.alignright { float: right; margin-left: 1.5rem; margin-bottom: 1rem; }
.aligncenter { display: block; margin: 0 auto 1rem; }
.alignwide  { max-width: 100%; }
.alignfull  { max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }

/* Results page: year dropdown matches page background, not the panel */
#rrr-year-select {
  background-color: var(--rrr-dark);
}
