/* CIRAS AI Hub — Frontend Styles
 * Based on Iowa State University Visual Identity Guidelines
 * Primary: ISU Red (Pantone 186), ISU Gold (Pantone 142)
 * Typography: Georgia (Berkeley fallback), Arial (Univers fallback)
 * Color palette: ISU primary + secondary palettes
 */

:root {
  /* ISU Primary Palette */
  --isu-red: #C8102E;            /* Pantone 186 — primary brand color */
  --isu-red-dark: #a00d24;       /* Hover state */
  --isu-gold: #F2BF49;           /* Pantone 142 */
  --isu-green: #076D54;          /* Pantone 555 */
  --isu-blue: #3A75C4;           /* Pantone 285 */
  --isu-dark-blue: #256091;      /* Pantone 7462 */
  --isu-navy: #004459;           /* Pantone 548 */
  --isu-deep-navy: #153E5E;      /* Pantone 7463 */
  --isu-orange: #BC5E1E;         /* Pantone 471 */
  --isu-brown: #544726;          /* Pantone 449 */
  --isu-charcoal: #3D3028;       /* Pantone 412 */
  --isu-gray: #827F77;           /* Pantone 424 */

  /* ISU Secondary Palette */
  --isu-cream: #DBCeA5;          /* Pantone 4535 */
  --isu-light-gold: #EAE2B7;     /* Pantone 614 */
  --isu-tan: #C4B796;            /* Pantone 452 */
  --isu-sage: #AAaD75;           /* Pantone 5777 */
  --isu-steel: #8499A5;          /* Pantone 5425 */

  /* Semantic mappings */
  --ciras-primary: var(--isu-navy);
  --ciras-accent: var(--isu-red);
  --ciras-accent-hover: var(--isu-red-dark);
  --ciras-success: var(--isu-green);
  --ciras-error: #dc2626;
  --ciras-bg: #f7f5f0;           /* Warm off-white from ISU palette feel */
  --ciras-card-bg: #ffffff;
  --ciras-border: #d9d5cc;       /* Warm gray border */
  --ciras-text: var(--isu-charcoal);
  --ciras-text-muted: var(--isu-gray);
  --ciras-radius: 8px;
  --ciras-shadow: 0 1px 3px rgba(61,48,40,0.1), 0 1px 2px rgba(61,48,40,0.06);
  --ciras-shadow-lg: 0 10px 15px -3px rgba(61,48,40,0.1), 0 4px 6px -4px rgba(61,48,40,0.1);

  /* Typography — ISU: Georgia (Berkeley fallback), Arial (Univers fallback) */
  --font-heading: Georgia, 'Times New Roman', serif;
  --font-body: Arial, Helvetica, sans-serif;
}

/* ── Base typography ── */

.ciras-schedule,
.ciras-prompt-library,
.ciras-downloads,
.ciras-ai-card,
.ciras-access-gate,
.ciras-related-section {
  font-family: var(--font-body);
}

/* ── Content Width Consistency ── */

.ciras-schedule,
.ciras-prompt-library,
.ciras-downloads,
.ciras-ai-card,
.ciras-access-gate,
.ciras-related-section {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* Match WordPress block theme content width */
.entry-content .ciras-schedule,
.entry-content .ciras-prompt-library,
.entry-content .ciras-downloads,
.entry-content .ciras-ai-card,
.entry-content .ciras-access-gate,
.entry-content .ciras-related-section,
.wp-block-post-content .ciras-schedule,
.wp-block-post-content .ciras-prompt-library,
.wp-block-post-content .ciras-downloads,
.wp-block-post-content .ciras-ai-card,
.wp-block-post-content .ciras-access-gate,
.wp-block-post-content .ciras-related-section {
  max-width: 1200px;
  width: 100%;
}

/* ── Schedule Grid ── */

.ciras-schedule {
  max-width: 1200px;
  margin: 0 auto;
}

.ciras-schedule-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.ciras-filter-btn {
  padding: 8px 16px;
  border: 2px solid var(--ciras-border);
  border-radius: 4px;
  background: var(--ciras-card-bg);
  color: var(--ciras-text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.ciras-filter-btn:hover {
  border-color: var(--track-color, var(--isu-red));
  color: var(--track-color, var(--isu-red));
}

.ciras-filter-btn.active {
  background: var(--track-color, var(--isu-red));
  border-color: var(--track-color, var(--isu-red));
  color: #fff;
}

.ciras-time-slot {
  margin-bottom: 32px;
}

.ciras-time-label {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--isu-navy);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--isu-red);
}

.ciras-time-sessions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.ciras-session-card {
  background: var(--ciras-card-bg);
  border-radius: var(--ciras-radius);
  padding: 20px;
  box-shadow: var(--ciras-shadow);
  border-left: 4px solid var(--track-color, var(--ciras-border));
  transition: box-shadow 0.2s, transform 0.2s;
}

.ciras-session-card:hover {
  box-shadow: var(--ciras-shadow-lg);
  transform: translateY(-2px);
}

.ciras-track-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.ciras-session-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.3;
}

.ciras-session-title a {
  color: var(--isu-navy);
  text-decoration: none;
}

.ciras-session-title a:hover {
  color: var(--isu-red);
}

.ciras-session-meta {
  font-size: 13px;
  color: var(--ciras-text-muted);
  margin-bottom: 8px;
}

.ciras-session-speakers {
  font-size: 14px;
  color: var(--ciras-text);
  font-weight: 700;
  margin-bottom: 8px;
}

.ciras-session-desc {
  font-size: 13px;
  color: var(--ciras-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ── AI Cards ── */

.ciras-ai-card {
  background: var(--isu-light-gold);
  border: 2px solid var(--isu-red);
  border-top: 4px solid var(--isu-red);
  border-radius: var(--ciras-radius);
  padding: 24px;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
}

.ciras-ai-card-header h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--isu-navy);
  margin: 0 0 8px;
}

.ciras-ai-card-header p {
  color: var(--ciras-text-muted);
  margin: 0 0 16px;
  font-size: 14px;
}

.ciras-ai-card-preview summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--isu-dark-blue);
  margin-bottom: 12px;
}

.ciras-ai-context {
  background: var(--ciras-card-bg);
  border: 1px solid var(--ciras-border);
  border-radius: 4px;
  padding: 16px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 400px;
  overflow-y: auto;
}

/* ── Copy Button — ISU Red ── */

.ciras-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--isu-red);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 12px;
}

.ciras-copy-btn:hover {
  background: var(--isu-red-dark);
  transform: translateY(-1px);
}

.ciras-copy-btn.ciras-copied {
  background: var(--isu-green);
}

/* ── Prompt Library ── */

.ciras-prompt-library {
  position: relative;
}

.ciras-prompt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.ciras-tab-btn {
  padding: 8px 16px;
  border: 2px solid var(--ciras-border);
  border-radius: 4px;
  background: var(--ciras-card-bg);
  color: var(--ciras-text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.ciras-tab-btn:hover,
.ciras-tab-btn.active {
  background: var(--isu-red);
  border-color: var(--isu-red);
  color: #fff;
}

.ciras-prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.ciras-prompt-card {
  background: var(--ciras-card-bg);
  border-radius: var(--ciras-radius);
  padding: 24px;
  box-shadow: var(--ciras-shadow);
  border: 1px solid var(--ciras-border);
  border-top: 3px solid var(--isu-red);
  transition: box-shadow 0.2s;
}

.ciras-prompt-card:hover {
  box-shadow: var(--ciras-shadow-lg);
}

.ciras-prompt-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.ciras-prompt-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.ciras-prompt-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  flex: 1;
  min-width: 0;
  color: var(--isu-navy);
}

.ciras-prompt-category-badge {
  padding: 3px 10px;
  border-radius: 3px;
  background: var(--isu-light-gold);
  color: var(--isu-brown);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.ciras-prompt-description {
  font-size: 14px;
  color: var(--ciras-text-muted);
  line-height: 1.5;
  margin: 0 0 12px;
}

.ciras-prompt-text-wrapper {
  max-height: 200px;
  overflow-y: auto;
}

.ciras-prompt-text {
  background: var(--ciras-bg);
  border: 1px solid var(--ciras-border);
  border-radius: 4px;
  padding: 12px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
}

/* ── Downloads ── */

.ciras-downloads {
  position: relative;
}

.ciras-downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.ciras-download-card {
  background: var(--ciras-card-bg);
  border-radius: var(--ciras-radius);
  padding: 24px;
  box-shadow: var(--ciras-shadow);
  border: 1px solid var(--ciras-border);
  text-align: center;
}

.ciras-download-card.ciras-download-featured {
  border-color: var(--isu-red);
  border-width: 2px;
  border-top: 4px solid var(--isu-red);
  background: var(--isu-light-gold);
  grid-column: 1 / -1;
}

.ciras-download-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.ciras-download-card h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: var(--isu-navy);
  margin: 0 0 8px;
}

.ciras-download-card p {
  font-size: 14px;
  color: var(--ciras-text-muted);
  line-height: 1.5;
  margin: 0 0 16px;
}

.ciras-download-btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--isu-red);
  color: #fff !important;
  border-radius: 4px;
  text-decoration: none !important;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s;
}

.ciras-download-btn:hover {
  background: var(--isu-red-dark);
}

/* ── Access Gate ── */

.ciras-access-gate {
  max-width: 480px;
  margin: 40px auto;
  text-align: center;
  padding: 40px;
  background: var(--ciras-card-bg);
  border-radius: var(--ciras-radius);
  border-top: 4px solid var(--isu-red);
  box-shadow: var(--ciras-shadow-lg);
}

.ciras-access-gate h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  margin: 0 0 12px;
  color: var(--isu-navy);
}

.ciras-access-gate p {
  color: var(--ciras-text-muted);
  margin: 0 0 24px;
}

.ciras-access-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ciras-access-email {
  padding: 12px 16px;
  border: 2px solid var(--ciras-border);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 16px;
  text-align: center;
  transition: border-color 0.2s;
}

.ciras-access-email:focus {
  outline: none;
  border-color: var(--isu-red);
}

.ciras-access-submit {
  padding: 12px 24px;
  background: var(--isu-red);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s;
}

.ciras-access-submit:hover {
  background: var(--isu-red-dark);
}

.ciras-access-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.ciras-access-message {
  padding: 12px;
  border-radius: 4px;
  font-weight: 700;
}

.ciras-access-success {
  background: #ecfdf5;
  color: var(--isu-green);
}

.ciras-access-error {
  background: #fef2f2;
  color: var(--ciras-error);
}

.ciras-access-confirmed {
  text-align: center;
  padding: 20px;
  background: #ecfdf5;
  border-radius: var(--ciras-radius);
  color: var(--isu-green);
  font-weight: 700;
}

/* ── Gate Overlay ── */

.ciras-gated {
  position: relative;
}

.ciras-gated > *:not(.ciras-gate-overlay) {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

.ciras-gate-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(2px);
}

.ciras-gate-content {
  text-align: center;
  padding: 32px;
  background: var(--ciras-card-bg);
  border-radius: var(--ciras-radius);
  border-top: 4px solid var(--isu-red);
  box-shadow: var(--ciras-shadow-lg);
  max-width: 400px;
}

.ciras-gate-content p {
  margin: 0 0 16px;
  color: var(--ciras-text);
  font-size: 15px;
}

.ciras-gate-btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--isu-red);
  color: #fff !important;
  border-radius: 4px;
  text-decoration: none !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ciras-gate-btn:hover {
  background: var(--isu-red-dark);
}

/* ── Related Content (Speaker ↔ Presentation) ── */

.ciras-related-section {
  margin: 32px 0;
}

.ciras-related-heading {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--isu-navy);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--isu-red);
}

.ciras-related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.ciras-related-card {
  display: flex;
  gap: 16px;
  background: var(--ciras-card-bg);
  border-radius: var(--ciras-radius);
  padding: 20px;
  box-shadow: var(--ciras-shadow);
  border: 1px solid var(--ciras-border);
  transition: box-shadow 0.2s, transform 0.2s;
}

.ciras-related-card:hover {
  box-shadow: var(--ciras-shadow-lg);
  transform: translateY(-2px);
}

.ciras-related-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--isu-red);
}

.ciras-related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ciras-related-info {
  flex: 1;
  min-width: 0;
}

.ciras-related-name {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.3;
}

.ciras-related-name a {
  color: var(--isu-navy);
  text-decoration: none;
}

.ciras-related-name a:hover {
  color: var(--isu-red);
}

.ciras-related-meta {
  font-size: 13px;
  color: var(--ciras-text-muted);
  margin-bottom: 8px;
}

.ciras-related-excerpt {
  font-size: 14px;
  color: var(--ciras-text);
  line-height: 1.5;
  margin: 0;
}

.ciras-related-card .ciras-track-badge {
  margin-bottom: 8px;
}

/* ── Mobile ── */

@media (max-width: 768px) {
  .ciras-time-sessions {
    grid-template-columns: 1fr;
  }

  .ciras-prompt-grid {
    grid-template-columns: 1fr;
  }

  .ciras-downloads-grid {
    grid-template-columns: 1fr;
  }

  .ciras-schedule-filters,
  .ciras-prompt-tabs {
    justify-content: center;
  }

  .ciras-related-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .ciras-related-thumb {
    width: 60px;
    height: 60px;
  }

  .ciras-download-card.ciras-download-featured {
    grid-column: auto;
  }
}
