/**
 * Tutorial Page Styles - WCAG Compliant
 */

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip to main content link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--gmu-primary-green, #006633);
  color: white;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

.tutorial-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.tutorial-page .tutorial-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 3px solid var(--gmu-primary-green, #006633);
}

.tutorial-page .tutorial-header h1 {
  color: #004422; /* WCAG AAA contrast ratio 10.35:1 on white */
  font-size: 2.5rem;
  margin: 0 0 1rem 0;
  line-height: 1.2;
  font-weight: 700;
}

/* Tutorial metadata */






.tutorial-tags-display {
  margin-top: 1rem;
}

.tutorial-content {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tutorial-intro {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #2c2c2c; /* WCAG AAA contrast ratio 14.42:1 */
  margin-bottom: 2rem;
}

.tutorial-intro p {
  margin-bottom: 1rem;
}

.tutorial-intro a {
  color: #004422; /* High contrast green */
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.tutorial-intro a:hover,
.tutorial-intro a:focus {
  color: #002211;
  background-color: #e6f7ed;
  outline: 2px solid #004422;
  outline-offset: 2px;
}

/* Tutorial body content */
.tutorial-body {
  color: #2c2c2c;
  line-height: 1.8;
}

.tutorial-body h2 {
  color: #004422;
  font-size: 1.8rem;
  margin: 2rem 0 1rem 0;
  font-weight: 700;
}

.tutorial-body h3 {
  color: #004422;
  font-size: 1.4rem;
  margin: 1.5rem 0 0.75rem 0;
  font-weight: 600;
}

.tutorial-body p {
  margin-bottom: 1rem;
}

.tutorial-body a {
  color: #004422;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.tutorial-body a:hover,
.tutorial-body a:focus {
  color: #002211;
  background-color: #e6f7ed;
  outline: 2px solid #004422;
  outline-offset: 2px;
}

/* Video Container - Accessible */
.tutorial-video {
  margin: 2rem 0;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background-color: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Ensure iframe has proper title for screen readers */
.video-container iframe:not([title]) {
  border: 2px solid #ff0000; /* Alert if missing title */
}

/* Instructions Section - Enhanced WCAG */
.tutorial-instructions {
  margin-top: 3rem;
}

.tutorial-instructions h2 {
  color: #004422;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.instruction-steps {
  list-style: none;
  padding: 0;
  counter-reset: step-counter;
}

.instruction-steps li {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #004422;
  position: relative;
}

/* Focus indicator for keyboard navigation */
.instruction-steps li:focus-within {
  outline: 3px solid #004422;
  outline-offset: 2px;
}

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: #004422; /* Higher contrast */
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
}

.step-content {
  flex: 1;
}

.step-content p {
  margin: 0 0 0.5rem 0;
  line-height: 1.8;
  color: #2c2c2c;
}

.step-content p:last-child {
  margin-bottom: 0;
}

.step-hint {
  background: #fff9e6; /* Better contrast than #fff3cd */
  padding: 0.75rem;
  border-radius: 4px;
  border-left: 3px solid #b8860b; /* Darker gold for better contrast */
  margin-top: 0.75rem !important;
  color: #2c2c2c;
}

.step-content a {
  color: #004422;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.step-content a:hover,
.step-content a:focus {
  color: #002211;
  background-color: #e6f7ed;
  outline: 2px solid #004422;
  outline-offset: 2px;
}

/* Footer Section - Accessible */
.tutorial-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #d1d1d1; /* Better contrast */
}

.license {
  font-size: 0.9rem;
  color: #4a4a4a; /* Better contrast than #666 */
  font-style: italic;
  margin-bottom: 1.5rem;
}

.license a {
  color: #004422;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.license a:hover,
.license a:focus {
  color: #002211;
  background-color: #e6f7ed;
  outline: 2px solid #004422;
  outline-offset: 2px;
}

.tutorial-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Buttons - WCAG Enhanced */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 44px; /* WCAG touch target size */
  min-width: 44px;
}

/* Focus visible for keyboard navigation */
.btn:focus {
  outline: 3px solid #004422;
  outline-offset: 3px;
}

.btn:focus:not(:focus-visible) {
  outline: none;
}

.btn:focus-visible {
  outline: 3px solid #004422;
  outline-offset: 3px;
}

.btn-primary {
  background: #004422; /* Higher contrast */
  color: white;
  border-color: #004422;
}

.btn-primary:hover {
  background: #002211;
  border-color: #002211;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 68, 34, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 68, 34, 0.3);
}

.btn-secondary {
  background: white;
  color: #004422;
  border: 2px solid #004422;
}

.btn-secondary:hover {
  background: #004422;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 68, 34, 0.2);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 68, 34, 0.2);
}
.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 68, 34, 0.2);
}

/* External link indicator */
.tutorial-external-link {
  margin-top: 2rem;
}

.tutorial-external-link .btn svg {
  transition: transform 0.2s ease;
}

.tutorial-external-link .btn:hover svg {
  transform: translateX(2px);
}

/* Responsive Design - Enhanced */
@media (max-width: 768px) {
  .tutorial-page {
    padding: 1rem;
  }

  .tutorial-page .tutorial-header h1 {
    font-size: 1.8rem;
  }

  .tutorial-meta {
    flex-direction: column;
    gap: 0.75rem;
  }

  .tutorial-content {
    padding: 1.5rem;
  }

  .tutorial-body h2 {
    font-size: 1.5rem;
  }

  .tutorial-body h3 {
    font-size: 1.2rem;
  }

  .instruction-steps li {
    flex-direction: column;
    gap: 1rem;
  }

  .step-number {
    align-self: flex-start;
  }

  .tutorial-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn-primary {
    border: 2px solid white;
  }
  
  .tutorial-page .tutorial-header {
    border-bottom-width: 4px;
  }
  
  .instruction-steps li {
    border-left-width: 6px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .btn:hover,
  .btn:active {
    transform: none;
  }
}

/* Print styles */
@media print {
  .tutorial-page {
    max-width: 100%;
    padding: 0;
  }
  
  .tutorial-actions,
  .tutorial-external-link {
    display: none;
  }
  
  .tutorial-content {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .btn {
    display: none;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8rem;
    color: #666;
  }
}

/* ============================================================
   TUTORIAL CONTENT COMPONENTS — research-topics page & reuse
   ============================================================ */

/* Callout grid */
.callout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* Green callout box */
.callout-green {
  background: var(--gmu-primary-green, #005239);
  color: #fff;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Gold bordered callout */
.callout-gold {
  border: 3px solid var(--gmu-accent-yellow, #ffc733);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  background: #fffdf0;
  font-size: 0.9375rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.callout-gold .callout-label {
  font-family: var(--font-heading, 'Figtree', sans-serif);
  font-weight: 700;
  color: var(--gmu-primary-green, #005239);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.35rem;
}

/* Green quote block */
.quote-green {
  color: var(--gmu-primary-green, #005239);
  font-weight: 600;
  font-style: italic;
  border-left: 4px solid var(--gmu-accent-yellow, #ffc733);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: #f2f9f6;
  border-radius: 0 0.5rem 0.5rem 0;
}

/* Characteristic list with keyword badges */
.characteristic-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.characteristic-list li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.9375rem;
  margin-bottom: 0;
}
.keyword-badge {
  background: var(--gmu-primary-green, #005239);
  color: #fff;
  padding: 0.1em 0.55em;
  border-radius: 0.25rem;
  font-family: var(--font-heading, 'Figtree', sans-serif);
  font-weight: 700;
  font-size: 0.875rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.char-pdf-link {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* Icon + text row */
.icon-text {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.icon-text img { flex-shrink: 0; }

/* Weak / strong example pairs */
.example {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 0.6rem;
  font-size: 0.9375rem;
}
.example img { flex-shrink: 0; margin-top: 0.1rem; }
.example--weak   { background: #fff5f5; border-left: 4px solid #e57373; }
.example--strong { background: #f0fff4; border-left: 4px solid #66bb6a; }
.example-label {
  font-weight: 600;
  font-size: 0.8125rem;
  color: #555;
  display: block;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.example-pair { margin-bottom: 1.5rem; }

/* Refinement 5-card grid */
.refinement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.875rem;
  margin: 1rem 0 1.5rem;
}
.refinement-card {
  background: var(--gmu-primary-green, #005239);
  color: #fff;
  padding: 1rem 0.75rem;
  border-radius: 0.5rem;
  text-align: center;
  font-family: var(--font-heading, 'Figtree', sans-serif);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* References list */
.references-list {
  list-style: none;
  padding: 0;
}
.references-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--gmu-light-gray, #e1e1e1);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0;
}
.references-list li:last-child { border-bottom: none; }

/* CC license footer */
.cc-license {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding-top: 1.5rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--gmu-light-gray, #e1e1e1);
  font-size: 0.85rem;
  color: #666;
}
.cc-license img { flex-shrink: 0; width: 110px; }

/* Responsive */
@media (max-width: 600px) {
  .callout-grid { grid-template-columns: 1fr; }
  .refinement-grid { grid-template-columns: repeat(2, 1fr); }
  .cc-license { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   TUTORIAL META TAGS — pill badges
   ============================================================ */

.tutorial-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tutorial-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-heading, 'Figtree', sans-serif);
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
}

.tutorial-tag--format {
  background: var(--gmu-primary-green, #005239);
  color: #fff;
}

.tutorial-tag--audience {
  background: rgba(0, 82, 57, 0.08);
  color: var(--gmu-primary-green, #005239);
  border: 1px solid rgba(0, 82, 57, 0.25);
}

.tutorial-tag--category {
  background: #f0f0f0;
  color: #444;
}

.tutorial-tag--duration {
  background: #fff8e1;
  color: #7a5800;
  border: 1px solid #ffc733;
}

/* Three-column method grid responsive */
@media (max-width: 680px) {
  [style*="repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

/* Hide default page title block on all /tutorials/* pages (index + individual) */
body[class*="is-path--tutorials"] #block-gmu-libraries-pagetitle {
  display: none;
}
