/**
 * Homepage styles
 * Manx International Exhibition of Photography
 * Professional palette: neutrals + slate accent
 */
.hp {
  font-family: 'Outfit', sans-serif;
}

:root {
  --hp-accent: #334155;
  --hp-accent-hover: #1e293b;
  --hp-text: #1e293b;
  --hp-muted: #64748b;
  --hp-border: #e2e8f0;
}

.hp-hero {
  position: relative;
  min-height: 420px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 2.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.hp-hero-bg {
  position: absolute;
  inset: 0;
  background: #1e293b;
  z-index: 0;
}

.hp-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}

.hp-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.85) 100%);
  z-index: 1;
}

.hp-hero-content {
  position: relative;
  z-index: 2;
  padding: 3rem 2rem 2.5rem;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hp-hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.75rem;
}

.hp-hero-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 400;
  color: #fff;
  line-height: 1.15;
  margin: 0 0 0.5rem;
  max-width: 720px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hp-hero-sub {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 560px;
  margin: 0;
  line-height: 1.5;
}

.hp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.hp-stat {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--hp-border);
}

.hp-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--hp-accent);
  line-height: 1.2;
  display: block;
}

.hp-stat-label {
  font-size: 0.8rem;
  color: var(--hp-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

.hp-cta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.hp-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--hp-accent);
  color: #fff !important;
  padding: 0.875rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.hp-cta-primary:hover {
  background: var(--hp-accent-hover);
  color: #fff;
}

.hp-cta-secondary {
  display: inline-flex;
  align-items: center;
  padding: 0.875rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  color: var(--hp-accent);
  border: 1px solid var(--hp-border);
  background: #fff;
  transition: background 0.2s, border-color 0.2s;
}

.hp-cta-secondary:hover {
  background: #f8fafc;
  border-color: var(--hp-accent);
  color: var(--hp-accent);
}

.hp-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.hp-status-open { background: #dcfce7; color: #166534; }
.hp-status-closed { background: #fef3c7; color: #92400e; }
.hp-status-judging { background: #dbeafe; color: #1e40af; }
.hp-status-completed { background: #f1f5f9; color: #475569; }
.hp-status-draft { background: #f1f5f9; color: #64748b; }

.hp-section-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.75rem;
  color: var(--hp-text);
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--hp-accent);
  display: inline-block;
}

.hp-rules-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
  border: 1px solid var(--hp-border);
}

.hp-rules-toggle {
  background: none;
  border: none;
  font-weight: 600;
  color: var(--hp-accent);
  cursor: pointer;
  padding: 0.5rem 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hp-rules-toggle:hover {
  color: var(--hp-accent-hover);
}

.hp-rules-content {
  margin-top: 1rem;
  color: var(--hp-accent);
  line-height: 1.7;
}

.hp-rules-content h1,
.hp-rules-content h2,
.hp-rules-content h3 {
  color: var(--hp-text);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.hp-rules-content p {
  margin-bottom: 0.75rem;
}

.hp-rules-content ul,
.hp-rules-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.hp-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.hp-feature {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--hp-border);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.hp-feature:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--hp-muted);
}

.hp-feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  background: var(--hp-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
}

.hp-feature-title {
  font-weight: 600;
  color: var(--hp-text);
  margin-bottom: 0.25rem;
}

.hp-feature-desc {
  font-size: 0.875rem;
  color: var(--hp-muted);
  margin: 0;
}

.hp-feature a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.hp-galleries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.hp-gallery-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--hp-border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hp-gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.12);
}

.hp-gallery-card-header {
  background: var(--hp-accent);
  color: #fff;
  padding: 1.25rem 1.5rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.hp-gallery-card-body {
  padding: 1rem 1.5rem;
}

.hp-gallery-meta {
  font-size: 0.8rem;
  color: var(--hp-muted);
  margin-bottom: 0.75rem;
}

.hp-gallery-link {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  color: var(--hp-accent);
  text-decoration: none;
}

.hp-gallery-link:hover {
  color: var(--hp-accent-hover);
  text-decoration: underline;
}

/* .hp-countdown removed — replaced by sticky .cd-widget */

.hp-no-contest {
  text-align: center;
  padding: 3rem 2rem;
  background: #f8fafc;
  border-radius: 16px;
  border: 2px dashed #cbd5e1;
}

.hp-no-contest h2 {
  font-family: 'DM Serif Display', serif;
  color: var(--hp-text);
  margin-bottom: 0.5rem;
}

.hp-no-contest p {
  color: var(--hp-muted);
  margin-bottom: 1rem;
}

.hp-other-contests {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.hp-other-card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  border: 1px solid var(--hp-border);
  font-size: 0.9rem;
}

.hp-other-card strong {
  color: var(--hp-text);
  display: block;
  margin-bottom: 0.25rem;
}

.hp-other-card span {
  color: var(--hp-muted);
  font-size: 0.8rem;
}

.hp-judge-notice {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: #1E40AF;
  text-align: center;
}

.hp-judge-notice a {
  color: #1E40AF;
  font-weight: 600;
  text-decoration: underline;
}

/* ── Sticky countdown widget ─────────────────────────────── */
.cd-widget {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 1000;
  background: linear-gradient(135deg, #f97316 0%, #ef4444 60%, #dc2626 100%);
  color: #fff;
  border-radius: 16px;
  padding: 14px 18px 12px;
  box-shadow: 0 8px 32px rgba(239,68,68,0.45), 0 2px 8px rgba(0,0,0,0.2);
  min-width: 220px;
  max-width: 280px;
  user-select: none;
  animation: cd-slide-in 0.5s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes cd-slide-in {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.cd-widget-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.92;
  margin-bottom: 10px;
}

.cd-close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  transition: color 0.15s;
}
.cd-close:hover { color: #fff; }

/* Pulsing live dot */
.cd-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(255,255,255,0.6);
  animation: cd-pulse 1.4s ease-out infinite;
}
@keyframes cd-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.cd-widget-units {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0,0,0,0.18);
  border-radius: 8px;
  padding: 6px 10px 5px;
  min-width: 44px;
}

.cd-unit-secs {
  background: rgba(0,0,0,0.28);
}

.cd-val {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.cd-lbl {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
  margin-top: 3px;
}

.cd-sep {
  font-size: 1.4rem;
  font-weight: 700;
  opacity: 0.6;
  margin-bottom: 10px;
}

.cd-widget-date {
  text-align: center;
  font-size: 0.7rem;
  opacity: 0.75;
  margin-top: 9px;
  letter-spacing: 0.02em;
}

@media (max-width: 480px) {
  .cd-widget {
    bottom: 16px;
    right: 12px;
    left: 12px;
    max-width: none;
    min-width: 0;
  }
}
