:root {
  /* Sampled directly from the Communityhub.ie logo: blue #1800AD, orange #FF751F. */
  --color-primary: #1800ad;
  --color-primary-dark: #100070;
  --color-accent: #ff751f;
  --color-bg: #f5f6fa;
  --color-surface: #ffffff;
  --color-border: #dde1ea;
  --color-text: #1a1a2e;
  --color-muted: #5c6270;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(24, 0, 173, 0.1), 0 1px 2px rgba(24, 0, 173, 0.06);
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
}

h1, h2, h3 { line-height: 1.2; color: var(--color-primary-dark); }
h1 { font-size: 2rem; margin: 0.4em 0 0.5em; }
h2 { font-size: 1.35rem; margin-top: 2em; }
h3 { font-size: 1.1rem; margin: 0 0 0.3em; }
p { margin: 0 0 1em; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  background: var(--color-primary-dark);
  color: white;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0.9rem 1.25rem;
  gap: 0.75rem;
}
.brand { display: inline-flex; align-items: center; }
.brand:hover { text-decoration: none; }
.brand-logo {
  height: 42px;
  width: auto;
  display: block;
  background: white;
  border-radius: 8px;
  padding: 4px 10px;
}
.main-nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.main-nav a { color: rgba(255,255,255,0.85); font-size: 0.95rem; }
.nav-toggle {
  display: none; background: none; border: 1px solid rgba(255,255,255,0.4); border-radius: 6px;
  color: white; font-size: 1.3rem; line-height: 1; cursor: pointer;
  min-width: 44px; min-height: 44px;
}

@media (max-width: 700px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none; flex-direction: column; align-items: flex-start; width: 100%;
    gap: 0.75rem; padding-top: 0.75rem;
  }
  .main-nav.nav-open { display: flex; }
  .header-inner { position: relative; }
}
.main-nav a:hover { color: white; text-decoration: none; }
.main-nav a.active { color: white; font-weight: 600; border-bottom: 2px solid var(--color-accent); }
.nav-form { display: inline; }
.link-button {
  background: none; border: none; color: rgba(255,255,255,0.85); font-size: 0.95rem;
  cursor: pointer; padding: 0; font-family: inherit;
}
.link-button:hover { color: white; text-decoration: underline; }

main.container { padding-top: 1.75rem; padding-bottom: 3rem; min-height: 60vh; }

/* Hero */
.hero { text-align: center; padding: 2rem 0 2.5rem; }
.hero h1 { font-size: 2.3rem; }
.hero p { color: var(--color-muted); font-size: 1.1rem; }
.search-box { display: flex; justify-content: center; gap: 0.5rem; max-width: 520px; margin: 1.25rem auto 0; }
.search-box input {
  flex: 1; padding: 0.65rem 0.9rem; border: 1px solid var(--color-border); border-radius: var(--radius);
  font-size: 1rem;
}

.stats-row {
  display: flex; justify-content: center; gap: 3rem; text-align: center;
  padding: 1.5rem 0; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}
.stat strong { display: block; font-size: 1.8rem; color: var(--color-primary); }
.stat span { color: var(--color-muted); font-size: 0.9rem; }

.section-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.75rem; }
.section-heading h2 { margin-top: 0; }

/* Buttons */
button, .button-link {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
}
button:hover, .button-link:hover { background: var(--color-primary-dark); text-decoration: none; color: white; }
.button-danger { background: #b3261e; }
.button-danger:hover { background: #8c1d17; }
.main-nav a.button-link { padding: 0.4rem 0.85rem; border-radius: 999px; background: var(--color-accent); color: white; }
.main-nav a.button-link:hover { background: #b96305; }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
  color: var(--color-text);
}
.card:hover { text-decoration: none; border-color: var(--color-primary); }
.card h3 { margin-top: 0.4rem; }

/* Group logos */
.card-logo, .card-logo-placeholder {
  width: 48px; height: 48px; border-radius: 8px; margin-bottom: 0.5rem;
  object-fit: cover;
}
.card-logo-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary); color: white; font-weight: 700; font-size: 1.2rem;
}
.detail-header-with-logo { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.detail-logo, .detail-logo-placeholder {
  width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
}
.detail-logo-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary); color: white; font-weight: 700; font-size: 2.2rem;
}
.logo-preview { display: flex; align-items: center; gap: 0.6rem; margin: 0.3rem 0 0.5rem; }
.group-logo-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; border: 1px solid var(--color-border); }

.flyer-image {
  max-width: 100%; max-height: 480px; border-radius: var(--radius); border: 1px solid var(--color-border);
  display: block; margin: 1rem 0; object-fit: contain;
}
.flyer-image-small {
  max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--color-border);
  display: block; margin-bottom: 0.6rem; object-fit: contain;
}

.badge-row { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.55rem;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.02em;
}
.badge-founding { background: #fef3c7; color: #92400e; }
.badge-volunteers { background: #dbeafe; color: #1e40af; }
.badge-free { background: #d1fae5; color: #065f46; }
.badge-price { background: #ede9fe; color: #5b21b6; }
.badge-status-pending { background: #fef3c7; color: #92400e; }
.badge-status-approved { background: #d1fae5; color: #065f46; }
.badge-status-rejected { background: #fee2e2; color: #991b1b; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-national { background: #fce7f3; color: #9d174d; }
.badge-local { background: #e0e7ff; color: #3730a3; }
.badge-charity { background: #d1fae5; color: #065f46; }
.badge-meeting-type { background: #f3f4f6; color: #374151; }

.muted { color: var(--color-muted); font-size: 0.92rem; }
.empty { color: var(--color-muted); font-style: italic; }

/* Filter bars & forms */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 0.9rem; margin-bottom: 1.25rem;
}
.filter-bar input, .filter-bar select {
  padding: 0.5rem 0.7rem; border: 1px solid var(--color-border); border-radius: 6px; font-size: 0.92rem;
}
.reset-link { font-size: 0.9rem; }
.status-tabs a { padding: 0.35rem 0.7rem; border-radius: 999px; color: var(--color-text); }
.status-tabs a.active { background: var(--color-accent); color: white; }

.stacked-form { display: flex; flex-direction: column; gap: 0.35rem; max-width: 520px; }
.stacked-form label { font-weight: 600; font-size: 0.88rem; margin-top: 0.6rem; }
.stacked-form input, .stacked-form select, .stacked-form textarea {
  padding: 0.55rem 0.7rem; border: 1px solid var(--color-border); border-radius: 6px; font-size: 0.95rem;
  font-family: inherit;
}
.stacked-form button { margin-top: 1rem; align-self: flex-start; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400 !important; margin-top: 0.7rem; }
.checkbox-label input { width: auto; }
.radio-group { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.3rem; }
.radio-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400 !important; margin-top: 0 !important; }
.radio-label input { width: auto; }

.form-page { max-width: 560px; }
.form-error {
  background: #fee2e2; color: #991b1b; padding: 0.6rem 0.9rem; border-radius: 6px; font-size: 0.92rem;
}

.enquiry-form { display: flex; flex-direction: column; gap: 0.3rem; }
.enquiry-form label { font-weight: 600; font-size: 0.85rem; margin-top: 0.5rem; }
.enquiry-form input, .enquiry-form textarea {
  padding: 0.5rem 0.65rem; border: 1px solid var(--color-border); border-radius: 6px; font-family: inherit;
}
.enquiry-form button { margin-top: 0.75rem; }

/* Detail pages */
.back-link { display: inline-block; margin-bottom: 1rem; }
.detail-header { margin-bottom: 1.5rem; }
.detail-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.detail-sidebar {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 1.1rem; align-self: start;
}
.contact-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.contact-list li { margin-bottom: 0.4rem; }

@media (max-width: 760px) {
  .detail-layout { grid-template-columns: 1fr; }
}

/* Events / notices lists */
.event-list { list-style: none; padding: 0; margin: 0; }
.event-list-item {
  display: flex; gap: 1rem; align-items: center; padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}
.event-date {
  min-width: 60px; text-align: center; background: var(--color-primary); color: white;
  border-radius: 6px; padding: 0.4rem 0.3rem; font-size: 0.85rem; font-weight: 600;
}
.event-title { font-weight: 600; font-size: 1.02rem; }

.notice-card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--color-accent);
  border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 0.9rem;
}

.resource-list { display: grid; gap: 1rem; }
.resource-item {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 1rem 1.2rem;
}

.faq-section { margin: 1.75rem 0; }
.faq-section h2 {
  border-bottom: 2px solid var(--color-accent); padding-bottom: 0.35rem; margin-bottom: 0.75rem;
}
.faq-list { display: grid; gap: 0.6rem; }
.faq-item {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 0.2rem 1.1rem;
}
.faq-item summary {
  cursor: pointer; font-weight: 600; padding: 0.8rem 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; color: var(--color-accent); font-size: 1.3rem; font-weight: 700; flex-shrink: 0;
}
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { margin: 0 0 0.9rem; color: var(--color-muted); }

.guide-article { max-width: 760px; }
.guide-article > .muted { font-size: 1.05rem; margin-bottom: 1.5rem; }
.guide-step {
  background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--color-accent);
  border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem;
}
.guide-step h2 { margin-top: 0; font-size: 1.05rem; color: var(--color-primary); }
.guide-step p { margin-bottom: 0; }
.guide-disclaimer {
  margin-top: 1.5rem; padding: 0.9rem 1.1rem; border-radius: var(--radius);
  background: var(--color-bg); border: 1px solid var(--color-border); font-size: 0.9rem; color: var(--color-muted);
}
.guide-disclaimer p { margin: 0; }

/* Homepage ticker: a continuous CSS marquee of soonest events and recent
   notices. The item list is rendered twice back-to-back and the track is
   animated exactly -50% so the loop is seamless. */
.ticker-bar {
  background: var(--color-primary-dark); overflow: hidden; white-space: nowrap;
  border-bottom: 2px solid var(--color-accent);
}
.ticker-track {
  display: inline-flex; animation: ticker-scroll 45s linear infinite;
}
.ticker-bar:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  color: #fff; text-decoration: none; padding: 0.55rem 1.5rem; font-size: 0.9rem;
  display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
}
.ticker-item:hover { text-decoration: underline; }
.ticker-icon { font-size: 0.95rem; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; overflow-x: auto; }
}

.share-links {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1rem 0;
}
.share-label { font-weight: 600; color: var(--color-muted); margin-right: 0.2rem; }
.share-link {
  color: #fff; text-decoration: none; font-size: 0.85rem; font-weight: 600;
  padding: 0.4rem 0.85rem; border-radius: 999px;
  border: none; font-family: inherit; cursor: pointer;
}
.share-link:hover { opacity: 0.88; }
.share-whatsapp { background: #25D366; }
.share-facebook { background: #1877F2; }
.share-x { background: #000; }
.share-threads { background: #000; }
.share-instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.share-email { background: var(--color-muted); }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; margin-top: 0.75rem; }
@media (max-width: 700px) {
  /* Scrolls the table horizontally within itself rather than forcing the
     whole page (including the header) to overflow. */
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
}
.data-table th, .data-table td {
  text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--color-border); font-size: 0.92rem;
}
.data-table th { color: var(--color-muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; }
.row-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.inline-form { display: inline; }
.inline-form button { padding: 0.35rem 0.7rem; font-size: 0.85rem; }

/* Flash */
.flash { padding: 0.7rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: 0.95rem; }
.flash-success { background: #d1fae5; color: #065f46; }
.flash-info { background: #dbeafe; color: #1e40af; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border); padding: 1.5rem 0; margin-top: 2rem;
  color: var(--color-muted); font-size: 0.85rem;
}
.footer-links { margin-top: 0.4rem; }
.footer-links a { color: var(--color-muted); text-decoration: underline; }

/* Honeypot spam-trap field: visually hidden but present in the DOM (unlike
   display:none, which some bots specifically detect and skip). */
.hp-field { position: absolute; left: -9999px; top: -9999px; }

.pagination {
  display: flex; justify-content: space-between; align-items: center;
  margin: 1.5rem 0; padding-top: 1rem; border-top: 1px solid var(--color-border);
  font-size: 0.92rem;
}
.pagination-info { color: var(--color-muted); }
.pagination-disabled { color: var(--color-border); }

.report-details { margin-top: 1.5rem; font-size: 0.88rem; }
.report-details summary { cursor: pointer; color: var(--color-muted); }
.report-details summary:hover { color: var(--color-text); }
.report-form { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.6rem; max-width: 360px; }
.report-form label { font-weight: 600; font-size: 0.85rem; margin-top: 0.4rem; }
.report-form textarea, .report-form input:not([type="checkbox"]) {
  padding: 0.5rem 0.6rem; border: 1px solid var(--color-border); border-radius: 6px; font-size: 0.9rem; font-family: inherit;
}
.report-form button { margin-top: 0.5rem; align-self: flex-start; font-size: 0.85rem; padding: 0.4rem 0.8rem; }

.claim-box {
  background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 0.9rem; margin-bottom: 1.25rem;
}
.claim-box p { margin-bottom: 0.5rem; }
.claim-box .button-link { display: inline-block; }

.rss-link { margin-top: -0.5rem; margin-bottom: 1rem; }
.rss-link a { color: var(--color-accent); font-size: 0.9rem; font-weight: 600; }
