/*
Theme Name: FG Guild
Theme URI: https://theguildoffalconers.org.uk
Author: The Guild of Falconers & Raptor Keepers
Description: Standalone classic theme for The Guild of Falconers & Raptor Keepers. Reproduces the purple/gold brand, tile/card components, page hero, and responsive layout of the Guild's Astro site. Includes committee_member and event custom post types with seed content.
Version: 1.6.1
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fg-guild
*/

/* ==========================================================================
   Design tokens — sampled exactly from the logo PNGs (ported from global.css)
   ========================================================================== */
:root {
  --guild-gold: #D3AB06;
  --guild-purple: #5F1E79;
  --guild-white: #FFFFFF;

  --ink: #1c1320;          /* near-black with a purple cast, for body text */
  --muted: #5d5560;
  --bg: #ffffff;
  --bg-alt: #f6f2ec;       /* warm off-white section background */
  --gold-dark: #7a6007;    /* darker gold for text/links on white — WCAG AA */

  --maxw: 1080px;
  --radius: 8px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --card-border: #e3dccf;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

h1, h2, h3 { color: var(--guild-purple); line-height: 1.2; }

a { color: var(--gold-dark); }
a:hover { color: var(--guild-purple); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

.section { padding: 3rem 0; }
.section--alt { background: var(--bg-alt); }

/* Full-bleed tinted band for use inside editable page content (.container).
   Breaks out to the full viewport width, then re-insets its content to the
   container width — reproducing the alternating section backgrounds. */
.container .section-alt-band {
  background: var(--bg-alt);
  margin: 3rem calc(50% - 50vw);
  padding: 3rem calc(50vw - 50%);
}
.container .section-alt-band > :first-child { margin-top: 0; }
.container .section-alt-band > :last-child { margin-bottom: 0; }
/* Prevent the full-bleed breakout from introducing a horizontal scrollbar. */
html, body { overflow-x: hidden; }

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

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--card-border); vertical-align: top; }
th { color: var(--guild-purple); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.visually-hidden:focus {
  position: fixed;
  top: 0; left: 0;
  z-index: 9999;
  width: auto; height: auto;
  padding: 0.5rem 1rem;
  background: var(--guild-purple);
  color: var(--guild-white);
  font-weight: 700;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ==========================================================================
   Site header / navigation (ported from Header.astro)
   ========================================================================== */
.site-header { border-bottom: 1px solid #eee; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; padding-top: 0.75rem; padding-bottom: 0.75rem; flex-wrap: wrap; }
.site-header__logo img { display: block; }
.site-nav ul { list-style: none; display: flex; gap: 1.1rem; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a { color: var(--guild-purple); text-decoration: none; font-weight: 600; }
.site-nav a:hover { color: var(--gold-dark); }
.site-nav .current-menu-item > a,
.site-nav a[aria-current="page"] { border-bottom: 2px solid var(--guild-gold); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; color: var(--guild-purple); cursor: pointer; padding: 0.25rem 0.5rem; }
.nav-toggle:focus-visible { outline: 3px solid var(--guild-gold); outline-offset: 2px; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav { flex-basis: 100%; display: none; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0.5rem; padding: 0.5rem 0; }
}

/* ==========================================================================
   Site footer (ported from Footer.astro)
   ========================================================================== */
.site-footer { background: var(--guild-purple); color: var(--guild-white); margin-top: 3rem; }
.site-footer__inner { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; padding: 2rem 1.25rem; max-width: var(--maxw); margin: 0 auto; }
.site-footer__meta p { margin: 0.2rem 0; font-size: 0.9rem; }
.site-footer a { color: var(--guild-gold); }
.site-footer__credit { margin: 0 0 0 auto; align-self: flex-end; text-align: right; font-size: 0.8rem; color: rgba(255, 255, 255, 0.75); }

/* ==========================================================================
   Page hero (ported from PageHero.astro)
   ========================================================================== */
.hero { background: var(--bg-alt); padding: 2.5rem 0; border-bottom: 3px solid var(--guild-gold); }
.hero h1 { margin: 0 0 0.5rem; }
.hero__intro { margin: 0; font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
/* Hero with call-to-action buttons to the right of the heading (Contact page). */
.hero--actions .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.hero--actions .hero__heading { flex: 1 1 22rem; }
.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ==========================================================================
   Buttons (ported from Button.astro)
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.btn:hover { opacity: 0.9; }
.btn:focus-visible { outline: 3px solid var(--guild-gold); outline-offset: 2px; }
.btn--primary { background: var(--guild-gold); color: #2b2208; }
.btn--secondary { background: var(--guild-purple); color: var(--guild-white); }

/* ==========================================================================
   Home page (ported from index.astro)
   ========================================================================== */
.home-tagline { font-size: 1.3rem; color: var(--muted); max-width: 60ch; }
.home-lead { max-width: 65ch; }
.home-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ==========================================================================
   Generic tile/card grid (Events, Members, Links)
   ========================================================================== */
.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* Single-column variant: one card per row at every width (events listings). */
.card-grid--single { grid-template-columns: 1fr; }

.tile-card {
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--guild-gold);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tile-card h3 { margin: 0; color: var(--guild-purple); }
.tile-card p { margin: 0; }
.tile-card--fill p { flex: 1; }

/* ==========================================================================
   Event cards (ported from EventCard.astro)
   ========================================================================== */
.event-card { border: 1px solid var(--card-border); border-left: 4px solid var(--guild-gold); border-radius: var(--radius); padding: 1.1rem 1.25rem; background: #fff; }
.event-card h3 { margin: 0 0 0.35rem; }
.event-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.55rem; margin: 0 0 0.4rem; }
.event-card__dates { font-weight: 700; color: var(--gold-dark); }
.event-card__loc { margin: 0 0 0.4rem; color: var(--muted); font-style: italic; }
.badge { display: inline-block; margin-left: 0.5rem; padding: 0.1rem 0.5rem; font-size: 0.75rem; font-weight: 700; color: var(--guild-white); background: var(--guild-purple); border-radius: 999px; vertical-align: middle; }
.event-card__meta .badge { margin-left: 0; }

/* Event type tag. Colour carries no meaning on its own — the label always
   spells the type out — so the palette is decorative, not information. */
.tag {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 999px;
  white-space: nowrap;
}
.tag--in-person { color: var(--guild-purple); background: #f3ecf6; }
.tag--workshop { color: var(--gold-dark); background: #faf4dd; }
.tag--online, .tag--online-talk { color: #35606b; background: #e9f2f4; }

/* Past events read as a quieter archive than the upcoming programme. */
.event-card--past { border-left-color: var(--card-border); background: #fcfaf6; }
.event-card--past h3 { color: var(--muted); }
.event-card--past .event-card__dates { color: var(--muted); }

/* Link between the upcoming and past events pages. */
.events-nav { margin: 1.75rem 0 0; }

/* Standing note at the top of the events page — how to join an online talk. */
.events-doc-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin: 0 0 1.75rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--guild-purple);
  border-radius: var(--radius);
  background: #faf7fb;
}

/* ==========================================================================
   Committee profile cards (ported from members/committee.astro)
   ========================================================================== */
.committee-grid { display: grid; gap: 1.5rem; }
.profile-card { display: flex; gap: 1.25rem; align-items: flex-start; border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1.25rem; background: #fff; }
.profile-card__photo { flex: 0 0 auto; width: 160px; height: 160px; border-radius: var(--radius); object-fit: cover; }
.profile-card__photo--placeholder { display: flex; align-items: center; justify-content: center; background: var(--guild-purple); color: var(--guild-white); font-size: 2.5rem; font-weight: 700; }
.profile-card__body h2 { margin: 0 0 0.2rem; }
.profile-card__role { margin: 0 0 0.6rem; font-weight: 700; color: var(--gold-dark); }
.profile-card__bio p { margin: 0 0 0.6rem; }
.profile-card__bio p:last-child { margin-bottom: 0; }
@media (max-width: 560px) {
  .profile-card { flex-direction: column; align-items: center; text-align: center; }
}

/* ==========================================================================
   Useful links cards (ported from members/links.astro)
   ========================================================================== */
.link-card__logo { max-width: 200px; max-height: 80px; width: auto; height: auto; object-fit: contain; }
.link-card h2 { margin: 0; font-size: 1.15rem; color: var(--guild-purple); }

/* ==========================================================================
   Members auth prompt & buttons (ported from members.astro)
   ========================================================================== */
.auth-buttons { display: flex; flex-direction: column; gap: 0.75rem; max-width: 340px; margin: 1.25rem 0; }
.auth-buttons .btn { text-align: center; }
.auth-error { color: #b00020; font-weight: 600; }

/* ==========================================================================
   Contact Form 7 form (styled to match the Guild brand)
   ========================================================================== */
.wpcf7-form { max-width: 560px; margin-top: 1.5rem; }
.wpcf7-form label { display: block; margin-bottom: 1rem; font-weight: 600; color: var(--guild-purple); }
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}
.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form textarea:focus {
  outline: 3px solid var(--guild-gold);
  outline-offset: 1px;
  border-color: var(--guild-gold);
}
.wpcf7-form textarea { min-height: 8rem; resize: vertical; }
.wpcf7-form .wpcf7-submit {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border: 0;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  background: var(--guild-gold);
  color: #2b2208;
  transition: opacity 0.15s ease;
}
.wpcf7-form .wpcf7-submit:hover { opacity: 0.9; }
.wpcf7-form .wpcf7-submit:focus-visible { outline: 3px solid var(--guild-gold); outline-offset: 2px; }
.wpcf7-form .wpcf7-not-valid-tip { color: #b00020; font-weight: 600; }
.wpcf7-form .wpcf7-response-output { margin: 1rem 0 0; padding: 0.6rem 0.9rem; border-radius: var(--radius); }

/* ==========================================================================
   Cookie consent banner
   ========================================================================== */
.guild-consent {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 680px;
  margin: 0 auto;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--guild-gold);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  padding: 1rem 1.25rem;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
/* The banner's display:flex would otherwise override the [hidden] attribute,
   so it never hides on Accept/Decline. This makes hidden win. */
.guild-consent[hidden] { display: none; }
.guild-consent__text { margin: 0; font-size: 0.95rem; }
.guild-consent__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.guild-consent__actions .btn { border: 0; cursor: pointer; font: inherit; }
@media (min-width: 600px) {
  .guild-consent { flex-direction: row; align-items: center; justify-content: space-between; gap: 1.25rem; }
  .guild-consent__actions { flex: 0 0 auto; }
}
.fg-consent-reopen {
  background: none;
  border: 0;
  padding: 0;
  margin: 0.2rem 0;
  color: var(--guild-gold);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}
.fg-consent-reopen:hover { color: var(--guild-white); }

/* ==========================================================================
   Code of Conduct ordered list (ported from code-of-conduct.astro)
   ========================================================================== */
.conduct { display: grid; gap: 1.25rem; }
.conduct h2 { margin: 0 0 0.25rem; }
.conduct > li::marker { color: var(--guild-purple); font-size: 1.5em; font-weight: 700; }
.conduct ul li { list-style-type: disc; }
.conduct ul li::marker { color: var(--guild-gold); }
