/*
 * site.css — Base styles for TLC Events client sites.
 *
 * Layer architecture:
 *   1. Custom properties (design tokens — override per client)
 *   2. Reset / base
 *   3. Layout primitives (site-header, site-footer, site-main)
 *   4. Typography
 *   5. Components (event-card, category-tag, hero, etc.)
 *   6. Utility classes
 *
 * The calendar widget has its own scoped CSS loaded by calendar.js — these
 * styles only affect content outside the .tlc-cal container.
 */

/* ============================================================
   1. Design tokens — customise per client
   ============================================================ */
:root {
  /* Brand */
  --color-primary:        #EF2E44;
  --color-primary-dark:   #c41f32;
  --color-primary-text:   #fff;

  /* Neutrals */
  --color-bg:             #fff;
  --color-surface:        #f5f5f5;
  --color-border:         #e0e0e0;
  --color-text:           #1a1a1a;
  --color-text-secondary: #666;

  /* Typography */
  --font-heading: system-ui, -apple-system, sans-serif;
  --font-body:    system-ui, -apple-system, sans-serif;
  --font-weight-heading: 700;

  /* Layout */
  --max-width:      1140px;
  --gutter:         1.25rem;
  --radius:         6px;
  --radius-sm:      4px;

  /* Header */
  --header-bg:      #1a1a1a;
  --header-text:    #fff;
  --header-height:  64px;
}

/* ============================================================
   2. Reset / base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

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

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--color-primary-dark); }

ul, ol { margin: 0; padding: 0; list-style: none; }

/* ============================================================
   3. Layout
   ============================================================ */

/* Skip link for keyboard / screen reader users */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: var(--color-primary-text);
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* Site header */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.site-header__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__logo {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-heading);
  font-size: 1.15rem;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-header__logo:hover { color: #fff; }

/* Site nav */
.site-nav__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav__link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.site-nav__link:hover { color: #fff; background: rgba(255,255,255,0.1); }

.site-nav__link--cta {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
}
.site-nav__link--cta:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

/* Main content wrapper */
#main-content {
  min-height: calc(100vh - var(--header-height) - 200px);
}

/* Generic page container */
.page-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem var(--gutter);
}

/* Site footer */
.site-footer {
  background: #1a1a1a;
  color: rgba(255,255,255,0.6);
  padding: 2rem var(--gutter);
  font-size: 0.875rem;
  text-align: center;
  margin-top: 4rem;
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-footer p { margin: 0.25rem 0; }
.site-footer__name { color: #fff; font-weight: 600; }
.site-footer a { color: rgba(255,255,255,0.6); }
.site-footer a:hover { color: #fff; }

/* ============================================================
   4. Typography
   ============================================================ */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-heading);
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.875rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; }

.page-title {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  margin-bottom: 0.25rem;
}

.page-subtitle {
  color: var(--color-text-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* ============================================================
   5. Components
   ============================================================ */

/* --- Section heading --- */
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.75rem;
}
.section-heading h2 { margin: 0; font-size: 1.25rem; }
.section-heading a { font-size: 0.875rem; font-weight: 600; }

/* --- Featured hero --- */
.hero {
  background: #1a1a1a;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
}

.hero__bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  opacity: 0.35;
}

.hero__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: 2.5rem var(--gutter);
}

.hero__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.hero__title {
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  margin-bottom: 0.5rem;
  color: #fff;
}

.hero__meta {
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 1.25rem;
}

.hero__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}
.btn--primary:hover { background: var(--color-primary-dark); color: #fff; }

.btn--outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.6);
}
.btn--outline:hover { border-color: #fff; color: #fff; }

/* --- Event card grid --- */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* --- Event card --- */
.event-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
}
.event-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

.event-card__image-link { display: block; overflow: hidden; }

.event-card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.event-card__image-link:hover .event-card__image { transform: scale(1.03); }

.event-card__body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.event-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.event-card__time { color: var(--color-text-secondary); font-weight: 400; }

.event-card__title {
  font-size: 1rem;
  margin: 0 0 0.35rem;
}
.event-card__title a {
  color: var(--color-text);
  text-decoration: none;
}
.event-card__title a:hover { color: var(--color-primary); }

.event-card__performer {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 0 0 0.5rem;
}

.event-card__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.event-card__ticket-btn {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  margin-top: auto;
  align-self: flex-start;
  transition: background 0.15s;
}
.event-card__ticket-btn:hover { background: var(--color-primary-dark); color: #fff; }

/* --- Category tag --- */
.category-tag {
  display: inline-block;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid var(--color-border);
  transition: background 0.12s, color 0.12s;
}
.category-tag:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-secondary);
}
.empty-state p { margin: 0 0 1rem; }

/* --- Event detail page --- */
.event-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem var(--gutter);
}

.event-detail__image {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  max-height: 480px;
  object-fit: cover;
}

.event-detail__header { margin-bottom: 1.5rem; }

.event-detail__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.event-detail__title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-bottom: 0.25rem;
}

.event-detail__performer {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
}

.event-detail__info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.event-detail__info-item strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  margin-bottom: 0.2rem;
}

.event-detail__description { line-height: 1.8; margin-bottom: 2rem; }

.event-detail__ticket-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-primary);
  color: #fff;
  padding: 0.875rem 2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
}
.event-detail__ticket-btn:hover { background: var(--color-primary-dark); color: #fff; }

.event-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}
.event-detail__back:hover { color: var(--color-primary); }

/* --- Category archive --- */
.category-archive__header { margin-bottom: 2rem; }
.category-archive__count { color: var(--color-text-secondary); font-size: 0.95rem; }

/* ============================================================
   6. Utilities
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
  .site-nav__link--cta { padding: 0.35rem 0.6rem; font-size: 0.85rem; }
  .hero { min-height: 280px; }
  .event-grid { grid-template-columns: 1fr; }
  .event-detail__info { flex-direction: column; gap: 0.75rem; }
}
