/*
Theme Name: Cold Ash Parish Fete — Bright
Theme URI: https://coldashfete.example
Author: Cold Ash Parish Council
Author URI: https://coldashfete.example
Description: The bunting redesign of the Cold Ash Parish Fete poster theme — sky-blue gradients, tilted noticeboard-style info cards and hand-drawn-style headings, with the homepage boxes built from Appearance > Widgets. Installs alongside the original theme so you can switch between them.
Version: 1.3.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cold-ash-fete-bright
Tags: block-patterns, custom-menu, custom-colors, custom-logo, one-column, event, blog
*/

/* ---------- Design tokens ---------- */
:root {
  --navy: #16244b;
  --sky-top: #6fc6e8;
  --sky-mid: #eaf6fb;
  --sky-bottom: #f7ecd9;
  --card-bg: #ffffff;

  /* Card accent palette — cycled automatically, add more and the grid uses them */
  --pink: #d6127a;
  --yellow: #f4c00f;
  --orange: #f07d1a;
  --teal: #159bb5;
  --green: #4a9d2f;
  --purple: #7a3bb0;

  --accent: var(--pink);
  --max-width: 1100px;
  --radius: 14px;
  --shadow: 5px 6px 0 rgba(22, 36, 75, 0.14);

  /* Drop a woff2 into /fonts/fete-display.woff2 and the theme picks it up
     automatically (see cold_ash_fete_bright_scripts in functions.php). Until then the
     stack falls through to whatever rounded face the visitor has. */
  --font-display: 'Fete Display', 'Fredoka', 'Baloo 2', 'Segoe UI Variable Display',
    'Trebuchet MS', 'Segoe UI', sans-serif;
  --font-body: 'Trebuchet MS', 'Segoe UI', Verdana, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--navy);
  background-color: var(--sky-mid);
  background-image:
    /* faint confetti dots */
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.55) 0 4px, transparent 4px),
    radial-gradient(circle at 68% 22%, rgba(255, 255, 255, 0.4) 0 5px, transparent 5px),
    radial-gradient(circle at 34% 46%, rgba(255, 255, 255, 0.35) 0 3px, transparent 3px),
    linear-gradient(to bottom, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-bottom) 100%);
  background-size: 220px 220px, 340px 340px, 180px 180px, auto;
  background-attachment: fixed;
  line-height: 1.55;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
}

a {
  /* Navy body links keep AA contrast against the sky gradient; pink is reserved
     for the underline and hover state, where it always sits on a white card. */
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--pink);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover,
a:focus {
  color: var(--pink);
}

:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 3px;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Bunting ---------- */
.bunting {
  display: flex;
  flex-wrap: nowrap;
  border-top: 4px solid var(--navy);
  padding: 0;
  margin: 0;
}

.bunting span {
  flex: 1 1 46px;
  height: 42px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  animation: bunting-sway 3.6s ease-in-out infinite alternate;
}

.bunting span:nth-child(6n + 1) { background: var(--pink); }
.bunting span:nth-child(6n + 2) { background: var(--yellow); }
.bunting span:nth-child(6n + 3) { background: var(--teal); }
.bunting span:nth-child(6n + 4) { background: var(--orange); }
.bunting span:nth-child(6n + 5) { background: var(--green); }
.bunting span:nth-child(6n + 6) { background: var(--purple); }

.bunting span:nth-child(3n + 2) { animation-delay: -1.2s; }
.bunting span:nth-child(3n + 3) { animation-delay: -2.4s; }

@keyframes bunting-sway {
  from { transform: rotate(-2.5deg); }
  to   { transform: rotate(2.5deg); }
}

/* ---------- Site header ---------- */
.site-header {
  position: relative;
  text-align: center;
  padding: 40px 20px 24px;
  overflow: hidden;
}

.site-header > .container {
  position: relative;
  z-index: 1;
}

.site-logo img {
  margin: 0 auto 12px;
}

.site-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  line-height: 1.05;
  color: var(--navy);
  margin: 0 0 10px;
  letter-spacing: 0.5px;
  text-shadow: 3px 3px 0 rgba(255, 255, 255, 0.65);
}

.site-title--small {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: bold;
  margin: 0;
}

.main-navigation {
  margin-top: 22px;
}

.main-navigation ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
  margin: 0;
  padding: 0;
}

.main-navigation a {
  display: inline-block;
  font-family: var(--font-display);
  color: var(--navy);
  font-weight: bold;
  font-size: 1.05rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 3px solid transparent;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.main-navigation a:hover,
.main-navigation a:focus {
  background: var(--card-bg);
  border-color: var(--pink);
  color: var(--navy);
  transform: translateY(-2px);
}

.main-navigation .current-menu-item > a {
  background: var(--card-bg);
  border-color: var(--navy);
}

/* ---------- Poster-style box ----------
   An optional look, not a separate content system: on any block (a Group is
   the natural choice), open Advanced > Additional CSS Class(es) and add
   "fete-card" for the tilted poster-box look, plus "accent-1" through
   "accent-6" to pick its colour (used for the heading underline, the bullet
   points, and the icon badge border). Lay several out side by side with a
   core Columns block — that already handles the column count and stacks
   them on mobile on its own, so no extra CSS is needed for that part. */
.fete-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 30px 28px 26px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* Pinned-to-the-noticeboard tilt */
.fete-card:nth-child(odd)  { transform: rotate(-0.7deg); }
.fete-card:nth-child(even) { transform: rotate(0.6deg); }

.fete-card:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 7px 9px 0 rgba(22, 36, 75, 0.18);
}

/* Accent cycle — colour comes from position, so new cards colour themselves */
.fete-card.accent-1 { --accent: var(--pink); }
.fete-card.accent-2 { --accent: var(--teal); }
.fete-card.accent-3 { --accent: var(--yellow); }
.fete-card.accent-4 { --accent: var(--green); }
.fete-card.accent-5 { --accent: var(--orange); }
.fete-card.accent-6 { --accent: var(--purple); }

/* Icon badge */
.fete-card .card-icon {
  position: absolute;
  top: -22px;
  left: -14px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  line-height: 1;
  background: var(--card-bg);
  border: 4px solid var(--accent);
  border-radius: 50%;
  transform: rotate(-8deg);
  box-shadow: 3px 3px 0 rgba(22, 36, 75, 0.12);
}

.fete-card h2,
.fete-card h3 {
  text-align: center;
  font-family: var(--font-display);
  margin-top: 0;
  text-decoration: underline wavy var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
  text-decoration-skip-ink: none;
}

.fete-card h2 {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
}

.fete-card ul {
  padding-left: 1.2em;
  margin-bottom: 0;
}

.fete-card li {
  margin: 4px 0;
}

.fete-card li::marker {
  color: var(--accent);
}

.fete-card p {
  text-align: center;
  margin: 6px 0;
}

.card-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-time {
  font-family: var(--font-display);
  text-align: center;
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  margin: 0 0 4px;
  color: var(--accent);
  font-weight: bold;
}

.sponsor-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.sponsor-block img {
  max-height: 90px;
}

.sponsor-label {
  font-style: italic;
  margin: 0;
}

.sponsor-name {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: bold;
  margin: 0;
  color: var(--accent);
}

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

.qr-block img {
  margin: 16px auto 0;
  max-width: 220px;
  border: 6px solid var(--navy);
  border-radius: 8px;
}

/* ---------- Content / posts ---------- */
.site-main {
  padding-bottom: 60px;
}

.entry {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 4px solid var(--teal);
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.entry-title {
  font-family: var(--font-display);
  color: var(--navy);
  margin-top: 0;
}

.entry-title a {
  text-decoration: none;
}

.entry-title a:hover {
  text-decoration: underline wavy var(--pink);
  text-underline-offset: 6px;
}

.entry-meta {
  font-size: 0.9rem;
  color: #4a4a4a;
  margin-bottom: 16px;
}

.entry-content > * + * {
  margin-top: 1em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-family: var(--font-display);
}

.entry-content blockquote {
  margin: 1em 0;
  padding: 4px 0 4px 20px;
  border-left: 5px solid var(--yellow);
  font-style: italic;
}

.entry-content img,
.entry-thumbnail img {
  border-radius: var(--radius);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
}

.entry-content th,
.entry-content td {
  border: 2px solid rgba(22, 36, 75, 0.15);
  padding: 8px 10px;
  text-align: left;
}

/* Pagination */
.pagination,
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding-bottom: 40px;
}

.pagination .page-numbers {
  display: inline-block;
  background: var(--card-bg);
  border: 3px solid var(--navy);
  border-radius: 999px;
  padding: 6px 14px;
  text-decoration: none;
}

.pagination .page-numbers.current {
  background: var(--yellow);
}

/* ---------- Comments ---------- */
.comments-area {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 4px solid var(--purple);
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.comments-area ol {
  list-style: none;
  padding-left: 0;
}

.comments-area input[type='text'],
.comments-area input[type='email'],
.comments-area input[type='url'],
.comments-area textarea,
.search-form input[type='search'] {
  width: 100%;
  max-width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 3px solid var(--navy);
  border-radius: 8px;
  background: #fff;
}

.comments-area input[type='submit'],
.search-form button,
.search-form input[type='submit'] {
  font-family: var(--font-display);
  font-weight: bold;
  background: var(--pink);
  color: #fff;
  border: 3px solid var(--navy);
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
}

.search-form {
  display: flex;
  gap: 8px;
}

.search-form label {
  flex: 1;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #fff;
  text-align: center;
  padding: 32px 20px;
}

.site-footer a {
  color: var(--yellow);
  text-decoration-color: var(--yellow);
}

.site-footer a:hover,
.site-footer a:focus {
  color: #fff;
}

.footer-navigation ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  padding: 0;
  margin: 14px 0 0;
}

.tent-strip {
  height: 80px;
  margin-top: 40px;
  background: repeating-linear-gradient(
    90deg,
    var(--pink) 0 40px,
    var(--yellow) 40px 80px,
    var(--teal) 80px 120px,
    var(--orange) 120px 160px
  );
  clip-path: polygon(0 100%, 0 30%, 5% 0, 10% 30%, 15% 0, 20% 30%, 25% 0, 30% 30%, 35% 0, 40% 30%, 45% 0, 50% 30%, 55% 0, 60% 30%, 65% 0, 70% 30%, 75% 0, 80% 30%, 85% 0, 90% 30%, 95% 0, 100% 30%, 100% 100%);
}

/* ---------- Widgets / sidebar ---------- */
.widget-area {
  padding-bottom: 40px;
}

.widget {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  border: 4px solid var(--yellow);
  box-shadow: var(--shadow);
}

.widget-title {
  font-family: var(--font-display);
  margin-top: 0;
}

.widget ul {
  padding-left: 1.2em;
}

/* ---------- Accessibility helpers ---------- */
.screen-reader-text {
  border: 0;
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--navy);
  border-radius: 8px;
  clip-path: none;
  color: #fff;
  display: block;
  font-size: 1rem;
  font-weight: bold;
  height: auto;
  left: 10px;
  line-height: normal;
  padding: 12px 20px;
  text-decoration: none;
  top: 10px;
  width: auto;
  z-index: 100000;
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .bunting span {
    transform: none;
  }
}

/* ---------- Print (handy for putting the poster on the noticeboard) ---------- */
@media print {
  body {
    background: #fff;
  }

  .bunting,
  .tent-strip,
  .main-navigation,
  .site-header::before {
    display: none;
  }

  .fete-card {
    transform: none;
    box-shadow: none;
    break-inside: avoid;
  }
}
