/* style.css */

/* Self-hosted Domine with WOFF2 & WOFF fallback */
@font-face {
  font-family: 'Domine';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/Domine-Regular.woff2') format('woff2'),
       url('./fonts/Domine-Regular.woff')  format('woff');
}

@font-face {
  font-family: 'Domine';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/Domine-Bold.woff2') format('woff2'),
       url('./fonts/Domine-Bold.woff')  format('woff');
}


/* 2. Apply it globally */
html, body {
    font-family: 'Domine', serif;
    font-optical-sizing: auto;
    font-style: normal;
    margin: 0;
    padding: 0;
    background-color: #f9faf7;
    color: #333;
}

/* Highlight placeholders X, Y, Z */
.placeholder {
    font-weight: bold;
    font-size: 1.1rem;
    color: #b23b3b;
}
  
 .container {
    max-width: 768px;
    margin-inline: auto;   /* centers on wide screens */
    padding-inline: 1rem;  /* keeps breathing room on phones */
}
  
 /*  Masthead  */
.masthead {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-block: 1rem;
  
    /* Match the background to the logo’s white/off‐white */
    background-color: #f9faf7;
  
    /* Add a thin bottom border */
    border-bottom: 1px solid #ccc;
  
    /* If you want a little vertical padding so the border doesn’t sit
       flush against the content, you can add: */
    padding: 0.5rem 1rem;
    margin-bottom: 1.2rem;
}
  
.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}
  
.masthead .logo {
    width: 48px;
    height: auto;
}
  
.masthead .brand-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #000;
}

@media (max-width: 600px) {
    .masthead {
      height: 30px;
      overflow: hidden;
      padding: 0.5rem 0.75rem;
    }
    .masthead .logo {
      width: 48px;
    }
    .masthead .brand-name {
      font-size: 1.5rem;
    }
}

/* 1) Spread brand and icon to the edges */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 2) Keep brand items close together */
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 3) Style the archive icon */
.archive-icon {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #333;
  fill: none;

}
.archive-icon svg {
  width: 32px;
  height: 32px;
  display: block;
}

/* 5) Hover state */
.archive-icon:hover {
  stroke: #007bff;
}

  /* keep images responsive inside container */
img {
    max-width: 100%;
    height: auto;
}
  
h1 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

p {
    text-rendering: optimizelegibility !important;
    letter-spacing: .03em;
    font-size: 16px;
    line-height: 1.5em;
}

li {
  text-rendering: optimizelegibility !important;
  letter-spacing: .03em;
  font-size: 16px;
  line-height: 1.5em;
}
  
form label {
    display: block;
    font-weight: 600;
    margin-top: 1rem;
}
  
form input[type="text"] {
    width: 100%;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
    margin-top: 0.25rem;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: "Domine", serif;
}
  
button[type="submit"] {
    display: block;
    margin: 1.5rem auto;
    padding: 0.75rem;
    width: 70%;
    font-size: 1rem;
    background-color: #333;
    color: #f9faf7;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Domine", serif;
}
  
button[type="submit"]:hover {
    background-color: #666;
}
  
#result {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    font-weight: bold;
}
  
.hidden {
    display: none;
}
  
img.question-image, #answerImage {
    max-width: 300px;
    max-height: 250px;
    margin: 1rem 0;
    border-radius: 6px;
    width: auto;
    height: auto;
}
  
#sourceLink {
    margin: 1rem auto 0.5rem auto;
    font-size: 0.75rem;
    color: #555;
    text-align: center;
}
#sourceLink a {
  color: #555;
}
  
.suggestion-item {
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
    background-color: #fff;
    cursor: pointer;
    font-family: "Domine", serif;
}
  
.suggestion-item:hover {
    background-color: #f0f0f0;
}

.footer {
    padding-top: 1rem;
    margin-top: 2rem;             /* space above footer */
    text-align: center;
    font-size: 0.875rem;          /* ~14px */
    color: #666;                  /* a muted gray */
    line-height: 1.4;
    font-size: 0.75rem;
    border-top: 1px solid #ccc;
}

.footer a {
  color: #666;
}
  /* Ensure the footer does not exceed the container’s max-width */
.container .footer {
    max-width: 100%;
}
  
/* Responsive tweaks for larger screens */
 @media (min-width: 768px) {
    h1 {
      font-size: 1.5rem;
    }
  
    form input[type="text"],
    button[type="submit"] {
      font-size: 1.1rem;
    }
}

/* Responsive tweaks for very small screens */
@media (max-width: 360px) {
    #questionHeading {
      font-size: 1.125rem;
    }
    #questionSubheading {
      font-size: 0.875rem;
    }
    #question {
      font-size: 1rem;
    }
    button[type="submit"] {
      width: 90%;
    }
}

/* Question Heading + Subheading */
#questionHeading {
    font-size: 1.25rem;      
    font-weight: 600;
    margin: 1rem 0 0.25rem;
    text-align: center;
    color: #222;
}
  #questionDateSubheading {
    font-size: 1rem;         
    font-weight: 500;
    margin: 0 0 1rem;
    text-align: center;
    color: #555;
}
  
  /* Question text */
  #question {
    font-size: 1rem; 
    line-height: 1.5;
    font-weight: 400;
    margin-bottom: 1.5rem;
}
  
  /* Inputs (X, Y, Z groups) */
  .answer-group {
    margin-bottom: 1rem;
    position: relative;
}
  .answer-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
}
  .answer-group input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #555;
    border-radius: 4px;
    box-sizing: border-box;
}
  .answer-group input:focus {
    outline: none;
    border-color: #007bff;   /* blue highlight on focus */
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}
  
  /* Suggestion dropdown container */
  .suggestions-container {
    position: absolute;
    bottom: 100%;       /* pin its bottom to the top of the input */
    left: 0;
    right: 0;
    max-height: 200px;  /* cap the height, scroll if it overflows */
    overflow-y: auto;
    background: #fff;  
    border: 2px solid #eee;
    border-radius: 4px;
    z-index: 1000;      /* float above other elements */
}
  .suggestions-container .suggestion-item {
    background-color: #fff;
    padding: 0.5rem;
    cursor: pointer;
    border: 2px solid #eee;
}
  /* .suggestions-container .suggestion-item:last-child {
    border-bottom: none;
} */
  .suggestions-container .suggestion-item:hover {
    background-color: #f0f0f0;
}
.suggestion-item.highlighted {
  background-color: #eee;
}
.suggestions-container.hidden {
  display: none;
}
/* 3) Hide/show via your existing “hidden” class */
.suggestions-container.hidden {
  display: none;
}

/* Feedback & answer images on answer page */
#feedback {
    text-align: center;
    font-size: 1rem;
    margin: 1rem 0;
    font-weight: 600;
}
#repeatFeedback {
  text-align: center;
  font-size: 1rem;
  margin: 1rem 0;
  font-weight: 550;
}
#repeatFeedbackContainer {
  background-color: #f1f1f1;
  padding: 0.5rem;
  border-radius: 6px;
  margin: 0.5rem 0;
}
  #correctAnswers p {
    font-size: 1rem;
    color: #b23b3b;
    margin: 0.5rem 0;
    font-weight: 600;
}
  .question-image,
  #answerImage {
    display: block;
    max-width: 100%;
    margin: 1rem auto;
    border-radius: 4px;
}

#qn-back-link {
  margin: 0.5rem 0;
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
  font-weight: 550;
}

#qn-back-link a {
    text-decoration: none;
    color: #333;
  }

.share-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem auto;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    background-color: #333;
    color: #f9faf7;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Domine", serif;
}

.share-button:hover {
    background-color: #666;
}
/* SVG share icon */
.share-button svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

/* Donate‐button styling */
.donate-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.5rem auto;  
    padding: 0.5rem;
    width: 70%;
    font-size: 1.1rem;
    font-weight: 550;
    color: #333;
    background-color: #f9faf7;
    border: 1px solid #333;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-family: "Domine", serif;
}
  
  .donate-button:hover {
    background-color: #666; /* slightly darker on hover */
}
  
  /* Ensure the SVG icon matches text color and has proper spacing */
  .donate-button svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.image-attribution {
  font-size: 0.6rem;
  color: #666;
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.image-attribution a {
  text-decoration: none;
  color: #666;
}


.disclaimer {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.disclaimer a {
  color: #222;
  text-decoration: none;
}

/* Center the disclaimer that comes right after the footer */
.footer-links {
  text-align: center;
  font-size: 0.8rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
  color: #666;
}

.footer-links a {
  color: #666;
  text-decoration: none;
}

.archive-link {
  text-decoration: none;
  color: #333;
  font-size: 1rem;
  text-align: center;
  margin: 1.5rem auto;
  font-weight: 600;
}

.archive-link a {
  text-decoration: none;
  color: #333;
}

/* Grid container */
.archive-grid,
#archiveGrid {
  display: grid;
  gap: 1rem;
  /* grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  /* center each grid‐cell */
  /* justify-items: center; */
  grid-template-columns: repeat(3, 1fr);  /* always 3 equal-width slots */
  justify-content: start;                 /* keep them left-aligned */
  margin: 2rem 0;
}

/* Wrapper around each #ID + date */
.archive-item-wrapper {
  display: grid;
  row-gap: 0.25rem;      /*space between #ID and date*/
  justify-items: center; /* center contents */
  text-align: center;
}

  
/* month navigation */
.month-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 2rem 0 1rem 0;
  /* justify-content: space-between; */
}
.month-nav a {
  text-decoration: none;
  color: #333;
  font-weight: 600;
  font-size: 0.9rem;
}
.month-nav span {
  font-size: 1rem;
  font-weight: 600;
}
/* Prev link in the first column, left-aligned */
#prevMonth {
  justify-self: start;
}

/* Month name in the center column, always centered */
#currentMonthName {
  justify-self: center;
}

/* Next link in the third column, right-aligned */
#nextMonth {
  justify-self: end;
}

/* calendar grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

/* individual day cell */
.calendar-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #333;
  background: #fefefa;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.5rem;
  transition: background-color 0.2s;
  min-height: 30px;
}
.calendar-cell:hover {
  background-color: #f0f0f0;
}
.calendar-day {
  font-size: 1rem;
  color: #555;
  font-weight: 600;
  margin-top: 0.5rem;
}

.calendar-cell.answered::after {
  content: '✓';
  margin-top: 0.25rem;
  position: absolute;
  top: 4px;
  right: 6px;
  color: #333;
  font-size: 1rem;
  font-weight: bold;
}

.answer-card {
  background: #f9faf7;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}
.wiki-logo {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
  display: inline-block;
}