/*
Theme Name: TLMS Refresh
Theme URI: https://tlms.net
Author: Thomson-Leng Musical Society
Author URI: https://tlms.net
Description: A refreshed, accessible, SEO-friendly WordPress theme built for Thomson-Leng Musical Society (TLMS) and Thomson-Leng Youth Music Theatre (TLYMT). Designed to keep existing content and images, while improving navigation, mobile usability, page speed and structured data for shows/events. Brand palette: #EF0500 (red), #2B2B2B (charcoal), #FFFFFF (white).
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: tlms-refresh
Tags: accessibility-ready, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, theatre, events
*/

/* =========================================================
   1. BRAND VARIABLES
   -----------------------------------------------------------
   Locked to the three brand colours: #EF0500 (red), #2B2B2B
   (charcoal) and #FFFFFF (white). Everything below reads from
   these values — change one here and it updates site-wide.
   ========================================================= */
:root {
  --color-primary: #EF0500;      /* brand red */
  --color-primary-dark: #2B2B2B; /* brand charcoal — also used as the "dark" hover/heading tone */
  --color-accent: #EF0500;       /* same red, reused for tags/badges/borders */
  --color-accent-light: #fbe3e1; /* light tint of the brand red, for subtle tag backgrounds only */
  --color-ink: #2B2B2B;          /* brand charcoal — body text */
  --color-paper: #ffffff;        /* brand white */
  --color-paper-alt: #f4f4f4;    /* light neutral for alternating section backgrounds */
  --color-white: #ffffff;
  --color-border: #e3e3e3;
  --color-success: #2e6b3e;
  --color-focus: #1b6fc9;        /* kept distinct from red on purpose — focus rings should never be mistaken for hover/error states */

  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;

  --radius: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.14);
  --container-max: 1180px;
}

/* =========================================================
   2. RESET / BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--color-primary-dark); }
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--color-primary-dark);
}
h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.3em; }
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Accessible focus states — visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 0.75em 1.25em;
  z-index: 10000;
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
  left: 0;
  top: 0;
}

/* =========================================================
   3. BUTTONS
   ========================================================= */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  padding: 0.85em 1.6em;
  border-radius: var(--radius);
  text-decoration: none;
  text-align: center;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--color-primary); color: var(--color-white); }
.btn-primary:hover { background: var(--color-primary-dark); color: var(--color-white); }
/* White fill / red text — reads clearly against the red-to-black hero,
   instead of the red-on-red you'd get from using --color-accent directly. */
.btn-accent { background: var(--color-white); color: var(--color-primary); }
.btn-accent:hover { background: var(--color-accent-light); color: var(--color-primary-dark); }
.btn-outline { background: transparent; border-color: var(--color-white); color: var(--color-white); }
.btn-outline:hover { background: rgba(255,255,255,0.15); }

/* =========================================================
   4. SITE HEADER / NAV
   ========================================================= */
.site-header {
  background: var(--color-white);
  border-bottom: 4px solid var(--color-accent);
  position: sticky;
  top: 0;
  z-index: 999;
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.75rem;
  gap: 1rem;
}
.site-branding { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.site-branding img { max-height: 56px; width: auto; }
.site-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin: 0;
  color: var(--color-primary-dark);
}
.site-title a { text-decoration: none; color: inherit; }
.site-description { font-size: 0.8rem; margin: 0; color: #665; }

.menu-toggle {
  display: none;
  background: var(--color-primary);
  color: var(--color-white);
  border: 0;
  padding: 0.6em 0.9em;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
}

.primary-navigation ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
.primary-navigation a {
  color: var(--color-ink);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5em 0.1em;
  border-bottom: 3px solid transparent;
}
.primary-navigation a:hover,
.primary-navigation .current-menu-item > a,
.primary-navigation a[aria-current="page"] {
  border-bottom-color: var(--color-accent);
  color: var(--color-primary);
}
.primary-navigation .sub-menu {
  display: none;
  position: absolute;
  background: var(--color-white);
  box-shadow: var(--shadow-md);
  padding: 0.5rem 0;
  min-width: 200px;
  border-radius: var(--radius);
}
.primary-navigation li { position: relative; }
.primary-navigation li:hover > .sub-menu,
.primary-navigation li:focus-within > .sub-menu { display: block; }
.primary-navigation .sub-menu li { width: 100%; }
.primary-navigation .sub-menu a { display: block; padding: 0.6em 1em; border: 0; }

@media (max-width: 860px) {
  .menu-toggle { display: inline-block; }
  .primary-navigation {
    display: none;
    width: 100%;
    order: 3;
  }
  .primary-navigation.is-open { display: block; }
  .primary-navigation ul { flex-direction: column; gap: 0; }
  .primary-navigation .sub-menu { position: static; box-shadow: none; display: block; padding-left: 1em; }
  .site-header-inner { flex-wrap: wrap; }
}

/* =========================================================
   5. HERO
   ========================================================= */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white);
  padding: 4.5rem 0;
  text-align: center;
}
.hero h1 { color: var(--color-white); }
.hero .hero-tagline { font-size: 1.2rem; opacity: .92; max-width: 640px; margin: 0 auto 1.75rem; }
.hero .hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero .hero-badge {
  display: inline-block;
  background: var(--color-white);
  color: var(--color-primary);
  padding: 0.3em 1em;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* =========================================================
   6. SECTIONS / CARDS
   ========================================================= */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--color-paper-alt); }
.section-heading { text-align: center; margin-bottom: 2rem; }
.section-heading p { color: #554; max-width: 640px; margin-inline: auto; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.75rem;
}
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.card-body { padding: 1.2rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-meta { font-size: 0.85rem; color: #665; text-transform: uppercase; letter-spacing: .03em; }
.card-title { margin: 0; font-size: 1.25rem; }
.card-title a { text-decoration: none; color: var(--color-primary-dark); }
.card-excerpt { color: #443; flex: 1; }
.card-tag {
  display: inline-block;
  background: var(--color-accent-light);
  color: var(--color-ink);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2em 0.7em;
  border-radius: 999px;
  align-self: flex-start;
}

/* Show detail page */
.show-hero { display: grid; grid-template-columns: 340px 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 780px) { .show-hero { grid-template-columns: 1fr; } }
.show-hero img { border-radius: var(--radius); box-shadow: var(--shadow-md); }
.show-facts {
  list-style: none;
  margin: 1.25rem 0;
  padding: 1.25rem;
  background: var(--color-paper-alt);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius);
}
.show-facts li { margin-bottom: 0.5em; }
.show-facts strong { color: var(--color-primary-dark); }

/* =========================================================
   7. FOOTER
   ========================================================= */
.site-footer {
  background: var(--color-ink);
  color: #e6e6e6;
  padding-top: 3rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
/* White, not red, for footer headings — red text on the charcoal
   footer background doesn't clear accessible contrast at this size,
   white does (red is still used for the hover state below). */
.site-footer h2 { color: var(--color-white); font-size: 1.1rem; }
.site-footer a { color: #e6e6e6; }
.site-footer a:hover { color: var(--color-primary); }
.footer-bottom {
  text-align: center;
  padding: 1.25rem 0;
  font-size: 0.85rem;
  color: #999999;
}
.widget ul { list-style: none; padding: 0; }
.widget li { margin-bottom: .5em; }

/* =========================================================
   8. FORMS / SEARCH
   ========================================================= */
input[type="text"], input[type="search"], input[type="email"], textarea, select {
  width: 100%;
  padding: 0.7em 0.9em;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
}
.search-form { display: flex; gap: 0.5rem; }
.search-form input[type="submit"] {
  background: var(--color-primary);
  color: var(--color-white);
  border: 0;
  padding: 0 1.2em;
  border-radius: var(--radius);
  cursor: pointer;
}

/* =========================================================
   9. UTILITIES / MISC
   ========================================================= */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
  white-space: nowrap;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.entry-content img { border-radius: var(--radius); }
.entry-content figcaption { font-size: .85rem; color: #665; text-align: center; }
.post-meta { color: #665; font-size: .9rem; margin-bottom: 1rem; }
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 2rem; }
.pagination a, .pagination span {
  padding: .5em .9em; border: 1px solid var(--color-border); border-radius: var(--radius); text-decoration: none;
}
.pagination .current { background: var(--color-primary); color: var(--color-white); border-color: var(--color-primary); }

@media print {
  .site-header, .site-footer, .hero-actions { display: none; }
}
