/* Comms.Church PCO → TEC — front.css
   Scoped to .cctec-* classes. --cctec-brand is set per-shortcode via inline style. */

:root {
  --cctec-brand:   #1a4a8a;
  --cctec-radius:  8px;
  --cctec-gap:     1.25rem;
  --cctec-card-bg: #ffffff;
  --cctec-shadow:  0 2px 12px rgba(0,0,0,.07);
  --cctec-text:    #1e293b;
  --cctec-muted:   #64748b;
  --cctec-border:  #e2e8f0;
  --cctec-font-sm: .875rem;
  --cctec-font-xs: .8rem;
}

/* ── Register button ─────────────────────────────────────────────────────── */
.cctec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .55rem 1.4rem;
  border-radius: calc(var(--cctec-radius) / 1.5);
  font-size: var(--cctec-font-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: filter .15s, opacity .15s;
  white-space: nowrap;
  line-height: 1.4;
}

.cctec-btn-primary {
  background-color: var(--cctec-brand);
  color: #fff !important;
}

.cctec-btn-primary:hover {
  filter: brightness(.92);
  color: #fff !important;
  text-decoration: none;
}

.cctec-btn:active { transform: scale(.97); transition: transform 100ms ease-out; }
.cctec-btn:focus-visible,
.cctec-card-title a:focus-visible {
  outline: 2px solid var(--cctec-brand);
  outline-offset: 2px;
}

/* ── Event card ──────────────────────────────────────────────────────────── */
.cctec-event-card {
  background: var(--cctec-card-bg);
  border-radius: var(--cctec-radius);
  box-shadow: var(--cctec-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s ease;
  /* Stops a lone card stretching full-width; set --cctec-card-max: none to let
     cards fill a grid column. */
  max-width: var(--cctec-card-max, 480px);
}

/* Shadow only — the card isn't one link, so it shouldn't lift like one. */
.cctec-event-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.11); }

/* ── Card image ──────────────────────────────────────────────────────────── */
.cctec-card-image {
  position: relative;
  overflow: hidden;
  background: #f1f5f9;
}

.cctec-shape-cinematic { padding-top: 56.25%; } /* 16:9 */
.cctec-shape-square    { padding-top: 100%;    } /* 1:1 */
.cctec-shape-portrait  { padding-top: 133%;    } /* 3:4 */

.cctec-card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* The card prints .cctec-img-placeholder; keep the long name for custom CSS. */
.cctec-image-placeholder,
.cctec-img-placeholder {
  position: absolute;
  inset: 0;
  background: var(--cctec-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  padding: 1rem;
  text-align: center;
}

/* ── Card body ───────────────────────────────────────────────────────────── */
.cctec-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex: 1;
}

.cctec-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cctec-text);
  margin: 0 0 .2rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

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

.cctec-card-title a:hover {
  color: var(--cctec-brand);
  text-decoration: none;
}

/* ── Meta row (date / location / price) ─────────────────────────────────── */
.cctec-card-meta {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.cctec-meta-item,
.cctec-meta-date,
.cctec-meta-location,
.cctec-meta-price {
  display: flex;
  align-items: flex-start;
  gap: .35rem;
  font-size: var(--cctec-font-sm);
  color: var(--cctec-muted);
  margin: 0;
}

.cctec-meta-item svg,
.cctec-meta-date svg,
.cctec-meta-location svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--cctec-brand);
}

/* ── Price ───────────────────────────────────────────────────────────────── */
.cctec-price      { font-weight: 600; color: var(--cctec-brand); }
.cctec-price-free { font-weight: 600; color: #15803d; }

/* ── Description ─────────────────────────────────────────────────────────── */
.cctec-card-desc {
  font-size: var(--cctec-font-sm);
  color: var(--cctec-muted);
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* ── Actions ─────────────────────────────────────────────────────────────── */
.cctec-card-actions {
  margin-top: auto;
  padding-top: .75rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .cctec-event-card { max-width: 100%; }
  .cctec-btn { width: 100%; text-align: center; }
}

/* ── Auto-injected button on TEC single event pages ─────────────────────── */
.cctec-single-register {
  margin: 1.5rem 0;
}

.cctec-single-register .cctec-btn {
  font-size: 1rem;
  padding: .65rem 1.75rem;
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cctec-event-card,
  .cctec-btn { transition: none !important; }
}
