/*
Theme Name: Stokesley Rotary
Theme URI: https://rotary.stokesley-hosting.online
Author: Stokesley Rotary Club
Description: Temporary lookalike theme matching the Stokesley Rotary RIBI club homepage.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: stokesley-rotary
*/

:root {
  --rotary-blue: #005daa;
  --rotary-blue-deep: #17458f;
  --rotary-blue-dark: #0d47a1;
  --rotary-navy: #001a5a;
  --rotary-gold: #f7a81b;
  --rotary-bg: #e3f2fd;
  --rotary-muted: #5a7281;
  --rotary-text: #222;
  --rotary-white: #fff;
  --rotary-footer: #17458f;
  --max: 1100px;
  --font: Arial, Helvetica, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--rotary-text);
  background: var(--rotary-bg);
}

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

a {
  color: var(--rotary-blue-deep);
  text-decoration: none;
}

a:hover {
  color: var(--rotary-blue);
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  background: var(--rotary-white);
  border-bottom: 3px solid var(--rotary-blue);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 26, 90, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 80px;
  padding-block: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--rotary-navy);
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover {
  text-decoration: none;
  color: var(--rotary-blue-deep);
}

.brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1.15rem;
  font-weight: 700;
}

.brand-text span {
  font-size: 0.8rem;
  color: var(--rotary-muted);
  font-weight: 400;
}

.nav-toggle {
  display: none;
  background: var(--rotary-blue);
  color: #fff;
  border: 0;
  padding: 0.55rem 0.85rem;
  font: inherit;
  cursor: pointer;
  border-radius: 2px;
}

.nav-toggle:hover {
  background: var(--rotary-blue-dark);
  color: var(--rotary-gold);
}

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.25rem;
  align-items: center;
}

.primary-nav a {
  display: block;
  padding: 0.55rem 0.7rem;
  color: var(--rotary-blue-deep);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 2px;
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a {
  background: var(--rotary-blue-dark);
  color: #fff;
  text-decoration: none;
}

.btn,
.wp-block-button__link,
button[type="submit"],
input[type="submit"] {
  display: inline-block;
  background: var(--rotary-blue);
  color: #fff !important;
  border: 1px solid var(--rotary-blue);
  padding: 0.65rem 1.15rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border-radius: 2px;
  text-decoration: none !important;
}

.btn:hover,
.wp-block-button__link:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
  background: var(--rotary-blue-dark);
  border-color: var(--rotary-blue-dark);
  color: gold !important;
}

.btn-gold {
  background: var(--rotary-gold);
  border-color: var(--rotary-gold);
  color: var(--rotary-navy) !important;
}

.btn-gold:hover {
  background: #e09a10;
  color: #fff !important;
}

/* Hero carousel */
.hero {
  background: #001a5a;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.carousel {
  position: relative;
  min-height: 320px;
}

.carousel-slide {
  display: none;
  position: relative;
  min-height: 360px;
}

.carousel-slide.is-active {
  display: block;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.carousel-slide img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  opacity: 0.85;
}

.carousel-caption {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(transparent, rgba(0, 26, 90, 0.92));
  padding: 2.5rem 1.5rem 1.5rem;
  color: #fff;
}

.carousel-caption h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
}

.carousel-caption p {
  margin: 0;
  max-width: 40rem;
  opacity: 0.95;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 93, 170, 0.85);
  color: #fff;
  border: 0;
  width: 42px;
  height: 42px;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 2;
}

.carousel-nav:hover {
  background: var(--rotary-blue-dark);
  color: gold;
}

.carousel-nav.prev { left: 0.75rem; }
.carousel-nav.next { right: 0.75rem; }

.carousel-dots {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
  z-index: 2;
}

.carousel-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 0;
}

.carousel-dots button.is-active {
  background: var(--rotary-gold);
}

/* Sections */
.section {
  padding: 2.5rem 0;
}

.section-white {
  background: #fff;
}

.section-blue {
  background: var(--rotary-bg);
}

.section h2 {
  margin: 0 0 1rem;
  color: var(--rotary-blue-deep);
  font-size: 1.65rem;
  border-bottom: 2px solid var(--rotary-gold);
  padding-bottom: 0.4rem;
  display: inline-block;
}

.section h3 {
  color: var(--rotary-blue-deep);
  margin: 1.25rem 0 0.5rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--rotary-navy);
  font-weight: 600;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.media-aside img {
  width: 100%;
  border: 3px solid var(--rotary-blue);
}

.media-aside figcaption {
  font-size: 0.85rem;
  color: var(--rotary-muted);
  margin-top: 0.4rem;
}

/* Events */
.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.event-item {
  background: #fff;
  border-left: 4px solid var(--rotary-blue);
  padding: 1rem 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.event-item time {
  display: block;
  color: var(--rotary-blue);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.event-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.event-item p {
  margin: 0;
  color: #444;
  font-size: 0.95rem;
}

/* Venue */
.venue-box {
  background: #fff;
  padding: 1.25rem;
  border-top: 4px solid var(--rotary-blue);
}

.venue-box address {
  font-style: normal;
  margin: 0.75rem 0;
}

.venue-meta {
  color: var(--rotary-muted);
  font-size: 0.95rem;
}

/* Social / donate */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.donate-block {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  background: #fff;
  padding: 1.25rem;
  border: 1px solid #cfe2f5;
}

.donate-block img.qr {
  width: 140px;
  height: 140px;
  object-fit: contain;
}

/* Page content */
.page-hero {
  background: linear-gradient(135deg, var(--rotary-blue-deep), var(--rotary-blue));
  color: #fff;
  padding: 2rem 0;
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.site-main {
  padding: 2rem 0 3rem;
}

.content-card {
  background: #fff;
  padding: 1.75rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.content-card > *:first-child {
  margin-top: 0;
}

.entry-meta {
  color: var(--rotary-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.post-list {
  display: grid;
  gap: 1.25rem;
}

.post-teaser {
  background: #fff;
  padding: 1.25rem;
  border-left: 4px solid var(--rotary-gold);
}

.post-teaser h2 {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  border: 0;
  padding: 0;
  display: block;
}

.post-teaser h2 a {
  color: var(--rotary-blue-deep);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.team-card {
  background: #f8fafc;
  border-top: 3px solid var(--rotary-blue);
  padding: 1rem;
}

.team-card .role {
  color: var(--rotary-blue);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.team-card .name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

/* Forms */
.contact-form label {
  display: block;
  font-weight: 700;
  margin: 0.85rem 0 0.3rem;
  color: var(--rotary-blue-deep);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
  width: 100%;
  max-width: 36rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #b7c9db;
  font: inherit;
  background: #fff;
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

.form-notice {
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: #e8f5e9;
  border-left: 4px solid #2e7d32;
}

.form-notice.error {
  background: #ffebee;
  border-left-color: #c62828;
}

/* Footer */
.site-footer {
  background: var(--rotary-footer);
  color: #d6d7d8;
  padding: 2.5rem 0 1.5rem;
  margin-top: 2rem;
}

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

.site-footer a:hover {
  color: var(--rotary-gold);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-grid h3 {
  margin: 0 0 0.75rem;
  color: #fff;
  font-size: 1rem;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-grid li {
  margin-bottom: 0.4rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 1rem;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
}

/* News strip on home */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.news-card {
  background: #fff;
  padding: 1.1rem;
  border-top: 3px solid var(--rotary-blue);
}

.news-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.news-card time {
  color: var(--rotary-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 860px) {
  .grid-2,
  .grid-3,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-block;
  }

  .primary-nav {
    display: none;
    width: 100%;
  }

  .primary-nav.is-open {
    display: block;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .primary-nav ul {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 0.75rem;
  }

  .carousel-slide img {
    height: 280px;
  }
}
