/*
Theme Name: Tarbolton Community Hub
Description: Custom theme for Tarbolton Community Development Trust — brand colours teal #0e4c4b and green #aeca59.
Author: Tarbolton Community Development Trust
Version: 1.0
Text Domain: tarbolton
*/

:root {
  --teal: #0e4c4b;
  --teal-dark: #0a3a39;
  --green: #aeca59;
  --green-dark: #93b13f;
  --cream: #f7f6f1;
  --text: #23302f;
  --max-width: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.6;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Header */
.site-header {
  border-bottom: 1px solid #e7e7e2;
  padding: 16px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.logo {
  height: 42px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--green-dark);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff;
  padding: 80px 0;
  text-align: center;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.6rem;
  margin: 0 0 20px;
  line-height: 1.2;
}

.hero-lede {
  font-size: 1.15rem;
  color: #e4ede3;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--green);
  color: var(--teal-dark);
}

.btn-primary:hover {
  background: var(--green-dark);
}

.btn-secondary {
  background: transparent;
  color: #fff;
  border-color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Sections */
.section {
  padding: 72px 0;
}

.section-alt {
  background: var(--cream);
}

.section h2 {
  font-size: 2rem;
  color: var(--teal);
  margin-top: 0;
}

.section-lede {
  font-size: 1.05rem;
  max-width: 640px;
}

.two-col {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: center;
}

.stat-card {
  background: #fff;
  border: 1px solid #e7e7e2;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
}

.section-alt .stat-card {
  background: var(--cream);
  border-color: #e0ded2;
}

.stat-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
}

/* Idea form */
.idea-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
  margin-top: 24px;
}

.idea-form textarea {
  width: 100%;
  padding: 16px;
  font-family: inherit;
  font-size: 1rem;
  border: 2px solid #d7d5c8;
  border-radius: 12px;
  resize: vertical;
}

.idea-form textarea:focus {
  outline: none;
  border-color: var(--green-dark);
}

.idea-form .btn {
  align-self: flex-start;
}

.idea-feedback {
  margin-top: 12px;
  font-weight: 600;
  min-height: 1.5em;
}

.idea-feedback.success {
  color: var(--teal);
}

.idea-feedback.error {
  color: #a4342c;
}

/* Footer */
.site-footer {
  background: var(--teal-dark);
  color: #cfe0dd;
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.logo-footer {
  height: 36px;
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
}

/* Page / post content */
.page-content,
.entry-content {
  max-width: 760px;
  margin: 0 auto;
}

.page-content h1,
.entry-title {
  color: var(--teal);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  color: var(--teal);
}

.entry-content a {
  color: var(--teal);
}

.entry-content blockquote {
  margin: 0;
  padding-left: 16px;
  border-left: 4px solid var(--green);
  color: #556;
}

/* File download blocks (core Gutenberg File block) */
.wp-block-file {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid #e7e7e2;
  border-radius: 12px;
  background: var(--cream);
  margin-bottom: 16px;
}

.wp-block-file a:not(.wp-block-file__button) {
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}

.wp-block-file__button {
  background: var(--green) !important;
  color: var(--teal-dark) !important;
  border-radius: 999px !important;
  padding: 8px 18px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

.wp-block-file__button:hover {
  background: var(--green-dark) !important;
}

/* News */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 24px;
}

.post-card {
  padding-bottom: 24px;
  border-bottom: 1px solid #e7e7e2;
}

.post-card h2 {
  margin: 4px 0 8px;
  font-size: 1.5rem;
}

.post-card h2 a {
  color: var(--teal);
  text-decoration: none;
}

.post-card h2 a:hover {
  text-decoration: underline;
}

.post-card-date {
  font-size: 0.85rem;
  color: #667;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.post-card-link {
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
}

.post-card-link:hover {
  text-decoration: underline;
}

/* Timeline */
.hub-timeline {
  max-width: 760px;
  margin: 32px auto;
  border-left: 3px solid var(--green);
}

.hub-timeline-item {
  position: relative;
  padding: 0 0 36px 32px;
}

.hub-timeline-item::before {
  position: absolute;
  top: 5px;
  left: -10px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--teal);
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.hub-timeline-date {
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hub-timeline-content h2 {
  margin: 4px 0 8px;
  color: var(--teal);
  font-size: 1.45rem;
}

/* Custom and newsletter forms */
.hub-custom-form,
.hub-newsletter-form {
  display: flex;
  max-width: 640px;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.hub-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hub-form-field label,
.hub-newsletter-form > label {
  color: var(--teal);
  font-weight: 700;
}

.hub-form-field input,
.hub-form-field select,
.hub-form-field textarea,
.hub-newsletter-form input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #d7d5c8;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.hub-form-field input[type="checkbox"],
.hub-consent input {
  width: auto;
}

.hub-form-field input:focus,
.hub-form-field select:focus,
.hub-form-field textarea:focus,
.hub-newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--green-dark);
}

.hub-newsletter-row {
  display: flex;
  align-items: end;
  gap: 12px;
}

.hub-newsletter-row input {
  flex: 1;
}

.hub-newsletter-row .btn {
  flex: 0 0 auto;
}

.hub-consent {
  font-size: 0.9rem;
  font-weight: 400 !important;
}

.pagination {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  justify-content: center;
}

.pagination a,
.pagination span {
  padding: 8px 16px;
  border: 1px solid #e7e7e2;
  border-radius: 8px;
  text-decoration: none;
  color: var(--teal);
}

/* Responsive */
@media (max-width: 720px) {
  .hero h1 {
    font-size: 2rem;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .order-first {
    order: -1;
  }

  .site-nav {
    gap: 16px;
  }

  .hub-newsletter-row {
    align-items: stretch;
    flex-direction: column;
  }
}
