/*
Theme Name: NAMCSS Precision
Theme URI: https://namcss.org
Author: IndigoChilli
Author URI: https://indigochilli.com
Description: A modern WordPress theme for the National Association of Masonic Clay Shooting Societies. Clean, authoritative design with Highland Sky palette.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: namcss
Tags: clay-shooting, masonic, sports, events
*/

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  /* Brand colours */
  --navy:        #0d1b2e;
  --navy-mid:    #1a2f4a;
  --navy-light:  #2a4a6b;
  --sky-bg:      #eef2f7;
  --sky-mid:     #dce6f0;
  --clay:        #c0502a;
  --clay-dark:   #a03e1e;
  --gold:        #e8a020;
  --gold-light:  #f5c842;
  --white:       #ffffff;
  --text-dark:   #0d1b2e;
  --text-body:   #3a4a5c;
  --text-muted:  #6b7a8d;
  --border:      #cdd5df;

  /* Typography */
  --font-heading: 'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body:    'Inter', ui-sans-serif, system-ui, sans-serif;

  /* Spacing */
  --section-pad: clamp(3rem, 8vw, 6rem);
  --container:   1200px;
  --radius:      6px;
  --radius-lg:   12px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-body);
  background: var(--white);
}

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

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--navy);
  line-height: 1.15;
  font-weight: 800;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); font-weight: 700; }
h4 { font-size: 1.15rem; font-weight: 700; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

.entry-content h2,
.entry-content h3,
.entry-content h4 { margin: 1.8rem 0 0.75rem; }

.entry-content ul,
.entry-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }

/* ============================================================
   Layout utilities
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 5vw, 2.5rem);
}

.section-pad { padding-block: var(--section-pad); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1.5rem; }

.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

.text-center { text-align: center; }

/* Section labels */
.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 0.75rem;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--clay);
  color: var(--white);
  border-color: var(--clay);
}
.btn-primary:hover {
  background: var(--clay-dark);
  border-color: var(--clay-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.6);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--white);
}

.btn-navy {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-navy:hover {
  background: var(--navy-mid);
  transform: translateY(-1px);
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover {
  box-shadow: 0 8px 32px rgba(13,27,46,0.12);
  transform: translateY(-3px);
}

.card-body { padding: 1.5rem; }

.card-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--sky-bg);
  color: var(--navy-mid);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.card-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* ============================================================
   Header / Navigation
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--navy);
  box-shadow: 0 2px 16px rgba(13,27,46,0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: 72px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img {
  height: 42px;
  width: auto;
}

.logo-text { display: flex; flex-direction: column; }

.logo-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.logo-tagline {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Primary nav */
.primary-nav { display: flex; align-items: center; gap: 0.25rem; }

.primary-nav a {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  transition: all 0.18s ease;
}

.primary-nav a:hover,
.primary-nav a.current-menu-item {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}

.primary-nav .nav-cta {
  background: var(--clay);
  color: var(--white) !important;
  margin-left: 0.5rem;
}
.primary-nav .nav-cta:hover {
  background: var(--clay-dark) !important;
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.25s ease;
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .primary-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.5rem 1.5rem;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  .primary-nav.open { display: flex; }

  .primary-nav a {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    border-radius: 0;
  }
  .primary-nav .nav-cta { margin: 1rem 0 0; border-radius: var(--radius); text-align: center; }
}

/* ============================================================
   Hero — Home
   ============================================================ */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1e3a5f 100%);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  opacity: 0.18;
  filter: grayscale(40%);
}

/* Diagonal decorative lines */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(-45deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 740px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(232,160,32,0.15);
  border: 1px solid rgba(232,160,32,0.4);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255,255,255,0.75);
  margin-bottom: 2.5rem;
  max-width: 520px;
  line-height: 1.7;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-stats {
  margin-top: 4rem;
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}

.stat-item { }
.stat-num {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

/* Divider line accent */
.hero-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--clay), var(--gold), var(--clay));
}

/* ============================================================
   Home: About snippet
   ============================================================ */
.home-about {
  background: var(--sky-bg);
}

.home-about .about-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
}
.home-about .about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-about .about-copy { display: flex; flex-direction: column; justify-content: center; }
.home-about .about-copy h2 { margin-bottom: 1rem; }
.home-about .about-copy p { color: var(--text-body); margin-bottom: 1.25rem; }

/* ============================================================
   Events preview
   ============================================================ */
.events-section { background: var(--white); }

.events-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.event-card {
  display: flex;
  gap: 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}
.event-card:hover {
  box-shadow: 0 6px 24px rgba(13,27,46,0.1);
  transform: translateY(-2px);
}

.event-date-box {
  flex-shrink: 0;
  width: 60px;
  text-align: center;
  background: var(--navy);
  border-radius: 8px;
  padding: 0.6rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.event-day {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}
.event-month {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-top: 0.2rem;
}

.event-info { flex: 1; }
.event-info h4 { margin-bottom: 0.3rem; font-size: 1rem; }
.event-info .event-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.event-info .event-type {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--sky-bg);
  color: var(--navy-mid);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* ============================================================
   Societies / Clubs
   ============================================================ */
.societies-section { background: var(--sky-bg); }

.society-card { cursor: pointer; }
.society-card .card-body { padding: 1.5rem; }

.society-emblem {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
}

.society-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.society-card .location {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}
.society-card .location svg { flex-shrink: 0; }

.society-card .members {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--clay);
}

/* ============================================================
   Map section
   ============================================================ */
.map-section { background: var(--navy); color: var(--white); }
.map-section h2 { color: var(--white); }
.map-section p { color: rgba(255,255,255,0.7); }

#societies-map {
  width: 100%;
  height: 480px;
  border-radius: var(--radius-lg);
  margin-top: 2rem;
  background: var(--navy-mid);
}

/* ============================================================
   CTA Banner
   ============================================================ */
.cta-banner {
  background: linear-gradient(135deg, var(--clay) 0%, var(--clay-dark) 100%);
  color: var(--white);
  text-align: center;
  padding-block: clamp(3rem, 6vw, 5rem);
}
.cta-banner h2 { color: var(--white); margin-bottom: 1rem; }
.cta-banner p { color: rgba(255,255,255,0.85); margin-bottom: 2rem; font-size: 1.1rem; }

.cta-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   About page
   ============================================================ */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 4vw, 3rem);
  color: var(--white);
}
.page-hero h1 { color: var(--white); margin-bottom: 0.75rem; }
.page-hero p { color: rgba(255,255,255,0.7); font-size: 1.1rem; }

.about-values { background: var(--sky-bg); }

.value-item {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border-top: 4px solid var(--clay);
}
.value-icon {
  width: 48px;
  height: 48px;
  background: var(--sky-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--navy);
}
.value-item h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.value-item p { color: var(--text-muted); font-size: 0.9375rem; margin: 0; }

/* Timeline */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  display: flex;
  gap: 1.5rem;
  padding-bottom: 2rem;
  position: relative;
}
.timeline-dot {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--gold);
  z-index: 1;
  border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--border);
}
.timeline-content h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.timeline-content p { color: var(--text-muted); font-size: 0.9375rem; margin: 0; }

/* ============================================================
   Contact page
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 3rem; align-items: start; }

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-info h2 { margin-bottom: 1rem; }
.contact-info p { color: var(--text-body); }

.contact-detail {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 2rem;
}
.contact-detail-icon {
  width: 44px;
  height: 44px;
  background: var(--sky-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--navy);
}
.contact-detail-text strong { display: block; font-size: 0.85rem; font-weight: 700; color: var(--navy); margin-bottom: 0.2rem; }
.contact-detail-text span { color: var(--text-muted); font-size: 0.9375rem; }

/* Contact form */
.contact-form-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(192,80,42,0.15);
}
.form-group textarea { height: 130px; resize: vertical; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

/* ============================================================
   Events Calendar page
   ============================================================ */
.events-filter {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.filter-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--sky-bg);
  color: var(--navy);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.18s ease;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.events-list { display: flex; flex-direction: column; gap: 1rem; }

.event-list-card {
  display: flex;
  gap: 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  align-items: center;
  transition: box-shadow 0.22s ease;
}
.event-list-card:hover { box-shadow: 0 6px 24px rgba(13,27,46,0.1); }

.event-list-date {
  flex-shrink: 0;
  text-align: center;
  min-width: 68px;
}
.event-list-date .day {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.event-list-date .mon {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clay);
}

.event-list-body { flex: 1; }
.event-list-body h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.event-list-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.event-list-action { flex-shrink: 0; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding-top: clamp(3rem, 6vw, 5rem);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand .logo-name { font-size: 1.2rem; }
.footer-brand p { color: rgba(255,255,255,0.55); font-size: 0.875rem; margin-top: 1rem; line-height: 1.6; }

.footer-col h4 {
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  transition: color 0.15s ease;
}
.footer-col ul li a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.4);
}

.footer-bottom a { color: rgba(255,255,255,0.5); }
.footer-bottom a:hover { color: var(--white); }

/* ============================================================
   Accessibility
   ============================================================ */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  z-index: 9999;
}
.skip-link:focus { left: 0; }

/* ============================================================
   WordPress core alignment classes
   ============================================================ */
.alignleft  { float: left;  margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 1rem auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.8125rem; color: var(--text-muted); text-align: center; margin-top: 0.4rem; }

/* ============================================================
   Responsive tweaks
   ============================================================ */
@media (max-width: 600px) {
  .hero-stats { gap: 1.5rem; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .events-header { flex-direction: column; align-items: flex-start; }
}
