/* Custom styles for Pouch Blog using Pico.css and TinyMCE compatibility */

/* Accessibility improvements */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
  padding: 8px;
  border-radius: 4px;
  text-decoration: none;
  z-index: 1000;
  font-weight: 600;
}

.skip-link:focus {
  top: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Ensure sufficient color contrast for better accessibility */
.delete-btn {
  color: #dc3545; /* Improved contrast */
  background-color: transparent;
  border: 1px solid #dc3545;
}

.delete-btn:hover, 
.delete-btn:focus {
  background-color: #dc3545;
  color: white;
}

/* Improved contrast for post indicators */
.post-indicator.excerpt-indicator {
  color: #0056b3 !important; /* Darker blue for better contrast */
  font-weight: bold;
}

.post-indicator.hidden-indicator {
  color: #a71e22 !important; /* Darker red for better contrast */
  font-weight: bold;
}

.post-indicator.static-page-indicator {
  color: #086f08 !important; /* Darker green for better contrast */
  font-weight: bold;
}

.post-indicator.pinned-indicator {
  color: #b8860b !important; /* Dark goldenrod for pinned posts */
  font-weight: bold;
}

/* Improve muted text contrast */
small,
.muted {
  color: #666666; /* Darker than default pico muted color for better contrast */
}

/* Status message improvements for better contrast */
.success-message {
  background-color: #155724;
  border: 1px solid #c3e6cb;
  color: #d4edda;
}

.error-message {
  background-color: #721c24;
  border: 1px solid #f5c6cb;
  color: #f8d7da;
}

.warning-message {
  background-color: #856404;
  border: 1px solid #ffeaa7;
  color: #fff3cd;
}

/* Focus indicators for better keyboard navigation */
button:focus,
input:focus,
textarea:focus,
select:focus,
a:focus {
  outline: 2px solid var(--pico-primary);
  outline-offset: 2px;
}

/* Improve form label associations and help text styling */
label span[aria-label="required"] {
  color: #dc3545;
  font-weight: bold;
  margin-left: 0.2em;
}

small {
  display: block;
  margin-top: 0.25rem;
  color: var(--pico-muted-color);
  font-size: 0.875rem;
}

/* Ensure fieldset legends are properly styled */
fieldset {
  border: 1px solid var(--pico-border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

legend {
  font-weight: 600;
  padding: 0 0.5rem;
  color: var(--pico-color);
}


@font-face {
  font-family: "NotePaper";
  src: url('../fonts/note-paper/NotePaper-regular.otf') format('opentype');
}
@font-face {
  font-family: "MetalMania";
  src: url('../fonts/metal-mania/MetalMania-Regular.ttf') format('truetype');
}

/* REQUIRES letter-spacing: .3rem; to be easily readable */
@font-face {
  font-family: "GreenFuz";
  src: url('../fonts/green-fuz/GreenFuz.otf') format('opentype');
}

@font-face {
  font-family: "Yatsurano Western";
  src: url('../fonts/yatsurano-western/gomarice_yatsurano_western.ttf') format('truetype');
}


/* keep */
@font-face {
  font-family: "AvQest";
  src: url('../fonts/avqest/AvQest.ttf') format('truetype');
}

/* Better with letter-spacing: 2px; */
@font-face {
  font-family: "Special Elite";
  src: url('../fonts/special-elite/SpecialElite.ttf') format('truetype');
}

/* keep */
@font-face {
  font-family: "Mystery Quest";
  src: url('../fonts/mystery-quest/MysteryQuest-Regular.ttf') format('truetype');
}






/* Ensure TinyMCE content fits Pico's look */
.tox .tox-edit-area__iframe {
  border-radius: 0.5rem;
}

.tox .tox-statusbar {
  background: var(--pico-background);
  color: var(--pico-muted-color);
  border-top: 1px solid var(--pico-border-color);
}

.tox .tox-toolbar {
  background: var(--pico-background);
  border-bottom: 1px solid var(--pico-border-color);
}

/* Ensure images are responsive */
img {
  max-width: 100%;
  height: auto;
}

/* Article styling */
article {
  padding: 1.5rem 1rem;
  background: var(--pico-card-background);
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Tags styling */
footer p {
  font-size: 0.9em;
  color: var(--pico-muted-color);
}


/* Container for main content */
main.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 0;
}

.delete-btn {
  color: rgba(210, 0, 0, 1.0);
}

/* Pagination nav centering and button spacing */
#internal-pagination,
#public-pagination,
#editor-pagination {
  display: flex;
  justify-content: center;   /* center horizontally */
  gap: 1em;                /* even space between buttons */
  margin-bottom: 2em;
}

#internal-pagination button,
#public-pagination button,
#editor-pagination button {
  min-width: 3.0em;
  margin: 0;
  /* Optional: add more style to match your theme */
}



/* Add spacing before the response form to separate it visually from the post */
.response-form-separator {
  margin-top: 2.5em;
}


/* Make card boundaries visible in both light and dark mode */
.card {
  border: 1.5px solid #444 !important;        /* dark neutral border */
  box-shadow: none !important;                /* remove shadow for clarity */
  margin-bottom: 3em !important;            /* extra space between cards */
  padding: 3em 2em 1em 2em;
}
@media (max-width: 700px) {
  .card {
    margin-bottom: 3.5em !important;
  }
}

/* High contrast mode support for Windows users */
@media (prefers-contrast: high) {
  .skip-link {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
  }
  
  button:focus,
  input:focus,
  textarea:focus,
  select:focus,
  a:focus {
    outline: 3px solid #ffff00;
    outline-offset: 2px;
  }
  
  .delete-btn {
    border-width: 2px;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .skip-link:focus {
    transition: none;
  }
}


/* Gratitude feature styles */
.gratitude-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.gratitude-button {
  /* FIX: Use a light neutral background for light mode */
  background: #f9f9f6; /* fallback for light mode, matches Pico v2 default background */
  border: 2px solid var(--pico-muted-border-color);
  border-radius: 50%;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  color: var(--pico-muted-color);
}

@media (prefers-color-scheme: dark) {
  .gratitude-button {
    /* In dark mode, use Pico's background variable */
    background: var(--pico-background-color, #181a1b);
  }
}

/* On hover (both modes), use Pico's primary background */
.gratitude-button:hover {
  background: var(--pico-primary-background);
  border-color: var(--pico-primary);
  color: var(--pico-primary);
  transform: scale(1.05);
}

.gratitude-button.clicked {
  background: var(--pico-primary);
  border-color: var(--pico-primary);
  color: var(--pico-primary-inverse);
}

.gratitude-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.gratitude-icon {
  width: 32px;
  height: 32px;
}

.gratitude-counter {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 24px;
  padding: 0 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.gratitude-counter:empty {
  display: none;
}

/* Ensure proper spacing in article context */
article .gratitude-container {
  margin-left: 0;
  margin-right: auto;
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
  .gratitude-button {
    border-width: 3px;
  }
  
  .gratitude-button:focus {
    outline: 3px solid #ffff00;
    outline-offset: 3px;
  }
}

/* Reduced motion adjustments */
@media (prefers-reduced-motion: reduce) {
  .gratitude-button {
    transition: none;
  }
  
  .gratitude-button:hover {
    transform: none;
  }
}

/* Pinned post styling */
.pinned-internal-post {
  background-color: var(--pico-code-background-color);
  border-left: 4px solid var(--pico-primary);
  border-radius: var(--pico-border-radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.pinned-internal-post h3 {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

/* Dark mode support for pinned posts */
[data-theme="dark"] .pinned-internal-post {
  background-color: var(--pico-card-background-color);
  border-left-color: var(--pico-primary);
}

/* Light mode explicit styling for pinned posts */
[data-theme="light"] .pinned-internal-post {
  background-color: #f8f9fa;
  border-left-color: var(--pico-primary);
}

