/* ---------------- ARTLE STYLESHEET -------------------- */
/* HEADER */
/* LAYOUT */
/* HOMEPAGE */
/* ARTLE GAME */
/* ARTIST DATABASE */
/* ARTIST PANEL */
/* INFO PAGES */
/* FOOTER */


html {
  font-size: 80%;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ochre:       #C8651A;
  --ochre-light: #F2DCC0;
  --ochre-dark:  #8A4210;
  --earth:       #2C1A0E;
  --cream:       #FAF5EE;
  --text:        #1A1109;
  --muted:       #7A6B5A;
  --border:      #DDD0BC;
  --correct:     #4A7A3A;
  --wrong:       #A33030;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;

}







/* ----------------------- HEADER ----------------------------- */
header {
  width: 100%;
  background: var(--earth);
  display: flex;
  align-items: baseline;
  gap: 1rem;
  justify-content: center;
  padding: 1.1rem 2rem;
  position: relative;
}

/* The whole header is wrapped in an <a> for home navigation */
header a.header-home {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  /* extend clickable padding generously around the logo */
  padding: 0.5rem 1.5rem;
  margin: -0.5rem -1.5rem;
  border-radius: 4px;
  transition: opacity 0.15s;
}
header a.header-home:hover { opacity: 0.82; }

header h1 {
  font-family: 'Playfair Display', serif;
  color: var(--ochre-light);
  font-size: 2rem;
  letter-spacing: 0.04em;
  pointer-events: none;
}
header span {
  color: #8A7060;
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

/* Keep old #nav-logo-link styles for any stray references */
#nav-logo-link {
  color: inherit;
  text-decoration: none;
}












/* ---------------- LAYOUT ------------------------- */
/* index and game */
.container {
  width: 100%;
  max-width: 580px;
  padding: 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}



button, .thumb, .artist-list-item, .ac-item, .work-card {
  touch-action: manipulation;
}










/* --------------------- HOMEPAGE -------------------- */

#home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 85vh;
  padding: 0 2rem 4rem;
  gap: 2.5rem;
  max-width: 800px;
  text-align: center;
  width: 100%;
}

/* Push the hero (first child: main) down to feel centered — index page only */
body.page-index #home-container > main {
  margin-top: 22vh;
}

/* "Identify the Artist" */
.hero-h2 {
  font-family: 'Playfair Display', serif;
  font-size: 3.5rem;
  color: var(--ochre-dark);
  margin-bottom: 1.5rem;
}

/* "Four artworks, one artist. Test your knowledge of Australian art history." */
.hero-p {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 2rem auto;
}

/* "Play Game" */
.btn-play {
  display: inline-block;
  padding: 1rem 3rem; 
  margin-top: 1.5rem;
  background: var(--ochre);
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 1.3rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-play:hover {
  background: var(--ochre-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(138, 66, 16, 0.2);
}

/* horizontal line */
.home-divider {
  width: 100%;
  max-width: 300px;
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 auto;
}

/* "Select a game mode" */
.mode-title {
  font-weight: 300; 
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

/* mode buttons */
.mode-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 1rem;
  }

    .btn-mode {
      padding: 0.7rem 1.4rem;
      background: transparent;
      border: 1px solid var(--border);
      border-radius: 4px;
      font-size: 1.1rem;
      color: var(--earth);
      cursor: pointer;
      transition: all 0.2s;
    }

    .btn-mode:hover {
      border-color: var(--ochre);
      background: rgba(200, 101, 26, 0.05);
    }

    .btn-mode.active {
      background: var(--earth);
      color: var(--cream);
      border-color: var(--earth);
    }

    /* mode description */
    .mode-desc-text {
      font-size: 0.85rem;
      color: var(--muted);
      font-style: italic;
      margin-top: 8px;
      min-height: 1.2rem;
    }

/* ------------------- DIFFICULTY SELECTOR -------------------- */
.btn-difficulty {
  padding: 0.7rem 1.4rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1.1rem;
  color: var(--earth);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-difficulty:hover {
  border-color: var(--ochre);
  background: rgba(200, 101, 26, 0.05);
}

.btn-difficulty.active {
  background: var(--earth);
  color: var(--cream);
  border-color: var(--earth);
}

/* ------------------- CLASSIC MODE CHOICES ------------------- */
.adept-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-adept-choice {
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  line-height: 1.3;
  transition: border-color 0.15s, background 0.15s, color 0.15s, opacity 0.15s;
}

.btn-adept-choice:hover:not(:disabled) {
  border-color: var(--ochre);
  background: var(--ochre-light);
}

.btn-adept-choice.choice-wrong {
  background: #FDF0F0;
  border-color: #F5C5C5;
  color: var(--wrong);
  opacity: 0.7;
  cursor: default;
}

.btn-adept-choice.choice-correct {
  background: #F0FAF0;
  border-color: #B5D5B5;
  color: var(--correct);
  font-weight: 500;
}

.btn-adept-choice:disabled:not(.choice-wrong):not(.choice-correct) {
  opacity: 0.4;
  cursor: default;
}

@media (max-width: 480px) {
  .adept-choices {
    grid-template-columns: 1fr;
  }
}


















/* --------------------------- ARTLE GAME ------------------------ */

#game {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

    /* ---------------------- ARTWORK FRAME ------------------------ */
    /* fixed height */
    .artwork-frame {
      position: relative;
      background: var(--earth);
      border-radius: 4px;
      padding: 10px;
      box-shadow: 0 6px 24px rgba(44,26,14,0.18);
      height: 340px;
    }
    .artwork-frame img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
      border-radius: 2px;
      background: #1a1009;
      transition: opacity 0.3s;
    }

    /* -------------------- Wikimedia API LOADING ---------------------- */
    .img-loading {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #1a1009;
      border-radius: 2px;
      pointer-events: none;
      transition: opacity 0.3s;
    }
    .img-loading.hidden { opacity: 0; pointer-events: none; }
    .img-loading-dot {
      width: 8px; height: 8px; border-radius: 50%;
      background: var(--ochre-light); opacity: 0.4;
      animation: pulse 1.2s ease-in-out infinite;
      margin: 0 3px;
    }
    .img-loading-dot:nth-child(2) { animation-delay: 0.2s; }
    .img-loading-dot:nth-child(3) { animation-delay: 0.4s; }
    @keyframes pulse { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 0.9; } }

    

    /* --------------------- THUMBNAIL STRIP ----------------------- */
    .thumb-strip {
      display: none;
      gap: 8px;
      justify-content: center;
      flex-wrap: wrap;
    }
    .thumb-strip.visible { display: flex; }
    .thumb {
      width: 64px; height: 48px;
      object-fit: cover;
      border-radius: 3px;
      cursor: pointer;
      opacity: 0.55;
      border: 2px solid transparent;
      transition: opacity 0.2s, border-color 0.2s, transform 0.15s;
      background: var(--earth);
    }
    .thumb:hover { opacity: 0.85; transform: translateY(-2px); }
    .thumb.active { opacity: 1; border-color: var(--ochre); }
    .thumb.locked {
      cursor: default;
      opacity: 0.18;
      filter: blur(3px);
      pointer-events: none;
    }
    /* The immediately-next locked thumb is clickable (acts as skip) */
    .thumb.locked.locked-next {
      pointer-events: auto;
      cursor: pointer;
      opacity: 0.28;
    }
    .thumb.locked.locked-next:hover {
      opacity: 0.45;
      transform: translateY(-2px);
    }

    .thumb-caption {
      text-align: center;
      font-size: 0.78rem;
      color: var(--muted);
      font-style: italic;
      min-height: 2.8em;
      line-height: 1.5;
    }
    .caption-venue {
      display: block;
      font-style: normal;
      font-size: 0.74rem;
      color: #9A8A7A;
      margin-top: 2px;
    }


    /* ----------------------- ATTEMPT COUNTER ------------------------------- */
    .attempts-row { display: flex; gap: 8px; justify-content: center; }
    .dot {
      width: 36px; height: 8px;
      border-radius: 4px;
      background: var(--border);
      transition: background 0.3s;
    }
    .dot.wrong   { background: var(--wrong); }
    .dot.correct { background: var(--correct); }
    .dot.current { background: var(--ochre); }
    .dot.skipped { background: #BBA88A; }


    /* --------------------------- GUESS INPUT ----------------------------- */
    .guess-section { display: flex; flex-direction: column; gap: 0.75rem; }
    .guess-label {
      font-size: 0.8rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--muted);
      font-weight: 500;
    }
    .input-row { display: flex; gap: 8px; position: relative; }
    #guess-input {
      flex: 1;
      padding: 0.75rem 1rem;
      font-size: 1rem;
      border: 1.5px solid var(--border);
      border-radius: 4px;
      background: #fff;
      color: var(--text);
      outline: none;
      transition: border-color 0.2s;
    }
    #guess-input:focus { border-color: var(--ochre); }
    #guess-input:disabled { background: #f5f0ea; color: var(--muted); }

    /* -------------- AUTOCOMPLETE --------------------- */
    .ac-list {
      position: absolute;
      top: 100%; left: 0; right: 0;
      background: #fff;
      border: 1.5px solid var(--border);
      border-top: none;
      border-radius: 0 0 4px 4px;
      z-index: 10;
      max-height: 220px;
      overflow-y: auto;
      display: none;
    }
    .ac-list.open { display: block; }
    .ac-item {
      padding: 0.6rem 1rem;
      cursor: pointer;
      font-size: 0.95rem;
      border-bottom: 0.5px solid var(--border);
    }
    .ac-item:last-child { border-bottom: none; }
    .ac-item:hover, .ac-item.hi { background: var(--ochre-light); }

    /* ----------------- GUESS BUTTON ------------------ */
    .btn-guess {
      padding: 0.75rem 1.5rem;
      background: var(--ochre); color: #fff;
      border: none; border-radius: 4px;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.95rem; font-weight: 500;
      cursor: pointer;
      transition: background 0.2s, transform 0.1s;
      white-space: nowrap;
    }
    .btn-guess:hover { background: var(--ochre-dark); }
    .btn-guess:active { transform: scale(0.97); }
    .btn-guess:disabled { background: var(--border); color: var(--muted); cursor: default; transform: none; }

    /* ------------------ SKIP AND HINT ------------------- */
    .footer-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
    .btn-skip {
      background: none;
      border: 1.5px solid var(--border); border-radius: 4px;
      padding: 0.55rem 1rem;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.85rem; color: var(--muted);
      cursor: pointer;
      transition: border-color 0.2s, color 0.2s;
    }
    .btn-skip:hover { border-color: var(--muted); color: var(--text); }
    .btn-skip:disabled { opacity: 0.4; cursor: default; }

    @keyframes skipFlash {
      0%   { background: transparent;         border-color: var(--border); color: var(--muted); transform: scale(1); }
      25%  { background: var(--ochre-light);  border-color: var(--ochre);  color: var(--ochre-dark); transform: scale(1.06); }
      60%  { background: var(--ochre-light);  border-color: var(--ochre);  color: var(--ochre-dark); transform: scale(1.06); }
      100% { background: transparent;         border-color: var(--border); color: var(--muted); transform: scale(1); }
    }
    .skip-flash { animation: skipFlash 0.5s ease; }

    /* gap between input row and footer row in master mode */
    #master-mode-input { display: flex; flex-direction: column; gap: 0.6rem; }

    /* shake for invalid guess attempt */
    @keyframes shake {
      0%, 100% { transform: translateX(0); }
      20%       { transform: translateX(-6px); }
      40%       { transform: translateX(6px); }
      60%       { transform: translateX(-4px); }
      80%       { transform: translateX(4px); }
    }
    .shake { animation: shake 0.4s ease; }

    /* dropdown-hint tooltip */
    .dropdown-hint {
      font-size: 0.8rem;
      color: var(--wrong);
      font-style: italic;
      padding: 0.25rem 0;
      animation: slideIn 0.2s ease;
    }

    /* ------------------------- GUESS HISTORY --------------------- */
    .guesses-history { display: flex; flex-direction: column; gap: 6px; }
    .g-result {
      display: flex; align-items: center; gap: 10px;
      padding: 0.65rem 1rem;
      border-radius: 4px;
      font-size: 0.95rem; font-weight: 500;
      animation: slideIn 0.25s ease;
    }
    .g-num {
      font-size: 0.78rem;
      font-weight: 400;
      opacity: 0.55;
      min-width: 1.2em;
      text-align: right;
    }
    .g-icon { min-width: 1em; text-align: center; }
    .g-icon-skip { min-width: 1em; text-align: center; color: #999; }
    @keyframes slideIn {
      from { opacity: 0; transform: translateY(-5px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .g-result.wrong   { background: #FDF0F0; border: 1px solid #F5C5C5; color: var(--wrong); }
    .g-result.right   { background: #F0FAF0; border: 1px solid #B5D5B5; color: var(--correct); }
    .g-result.skipped { background: #F5F2EE; border: 1px solid var(--border); color: var(--muted); }

    /* --------------------------- HINT -------------------------------- */
    .progress-hint { font-size: 0.82rem; color: var(--muted); }

    .hint-area { display: none; }
    .hint-area.visible { display: block; }
    .btn-reveal-hint {
      background: none;
      border: 1.5px solid var(--ochre-light); border-radius: 4px;
      padding: 0.5rem 1rem;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.85rem; color: var(--ochre);
      cursor: pointer;
      transition: background 0.2s, border-color 0.2s;
    }
    .btn-reveal-hint:hover { background: var(--ochre-light); border-color: var(--ochre); }
    .hint-text {
      font-size: 0.85rem; color: var(--muted); font-style: italic;
      padding: 0.5rem 0.75rem;
      border-left: 3px solid var(--ochre-light);
      background: rgba(200,101,26,0.05);
      border-radius: 0 4px 4px 0;
      display: none;
    }
    .hint-text.revealed { display: block; }



















/* -------------- ARTIST DATABASE ----------------------- */

/* TWO-COLUMN LAYOUT */
.directory-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  width: 100%;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  align-items: start;
}

/* ------------- LEFT COLUMN: ARTISTS LIST -------------------------- */
    .artist-sidebar {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 6px;
      max-height: 80vh;
      overflow-y: auto;
    }

    /* game.js OVERRIDE */
        .sidebar-item {
          padding: 1rem;
          border-bottom: 1px solid var(--border);
          cursor: pointer;
          transition: background 0.2s;
        }

        .sidebar-item:hover { background: var(--ochre-light); }
        .sidebar-item.active { 
          background: var(--earth); 
          color: var(--ochre-light); 
        }

        .sidebar-item h3 { font-size: 1rem; margin-bottom: 2px; }
        .sidebar-item p { font-size: 0.75rem; opacity: 0.8; }



/* ------------- RIGHT COLUMN: ARTIST PANEL -------------------------- */
    #details-placeholder {
      text-align: center;
      padding: 4rem 2rem;
      color: var(--muted);
      border: 2px dashed var(--border);
      border-radius: 6px;
      font-style: italic;
    }

    /* game.js OVERRIDE */
        .reveal-panel.static {
          display: flex;
          animation: fadeIn 0.3s ease;
        }

        .reveal-outcome.directory-label {
          color: var(--ochre-light); 
        }

        /* mobile adjustment */
        @media (max-width: 800px) {
          .directory-container { grid-template-columns: 1fr; }
          .artist-sidebar { max-height: 300px; }
        }

        /* TODO: DELETE */
        /*.modal-backdrop {
          position: fixed; inset: 0;
          background: rgba(44,26,14,0.6);
          z-index: 100;
          display: none; align-items: flex-end; justify-content: center;
        }
        .modal-backdrop.open { display: flex; }
        .modal {
          background: var(--cream);
          border-radius: 10px 10px 0 0;
          width: 100%; max-width: 740px; max-height: 80vh;
          display: flex; flex-direction: column; overflow: hidden;
        }
        .modal-header {
          background: var(--earth);
          padding: 1rem 1.5rem;
          display: flex; justify-content: space-between; align-items: center;
          flex-shrink: 0;
        }
        .modal-header h2 {
          font-family: 'Playfair Display', serif;
          color: var(--ochre-light); font-size: 1.2rem;
        }
        .modal-close {
          background: none; border: none;
          color: var(--ochre-light); font-size: 1.4rem;
          cursor: pointer; line-height: 1; padding: 0 4px;
        }
        .modal-body { padding: 1.25rem 1.5rem; overflow-y: auto; }
        .artist-grid { columns: 2; column-gap: 1.5rem; }
        @media (min-width: 500px) { .artist-grid { columns: 3; } }
        .artist-entry {
          display: block; font-size: 0.88rem; color: var(--text);
          text-decoration: none; padding: 4px 0;
          border-bottom: 0.5px solid var(--border);
          break-inside: avoid; line-height: 1.3;
        }
        .artist-entry:hover { color: var(--ochre); }
        .artist-entry .artist-name { display: block; }
        .artist-entry .artist-years {
          display: block; font-size: 0.74rem;
          color: var(--muted); font-weight: 300; margin-top: 1px;
        }*/












/* ---------------- ARTIST PANEL ----------------- */
    .reveal-panel {
      background: var(--earth); color: var(--cream);
      border-radius: 6px;
      padding: 1.75rem;
      display: none; flex-direction: column; gap: 1.25rem;
      animation: fadeIn 0.4s ease;
    }
    .reveal-panel.show { display: flex; }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    .reveal-outcome { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; }
    .reveal-outcome.won  { color: #7EC87E; }
    .reveal-outcome.lost { color: #E07070; }
    .reveal-artist {
      font-family: 'Playfair Display', serif;
      font-size: 1.8rem; color: var(--ochre-light); line-height: 1.2;
    }
    .reveal-meta { display: flex; gap: 1.5rem; flex-wrap: wrap; }
    .meta-item { display: flex; flex-direction: column; gap: 2px; }
    .meta-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: #8A7A6A; }
    .meta-value { font-size: 0.9rem; color: var(--ochre-light); font-weight: 500; }
    .reveal-bio {
      font-size: 0.9rem; line-height: 1.75; color: #D4C4B0;
      border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1rem;
    }
    .reveal-bio p + p { margin-top: 0.75em; }
    .reveal-link a { color: #BBA88A; font-size: 0.85rem; }
    .reveal-link a:hover { color: var(--ochre-light); }
    .share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .share-text { font-family: monospace; font-size: 0.85rem; color: #BBA88A; }
    .btn-copy {
      padding: 0.4rem 0.9rem;
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.15); border-radius: 4px;
      color: var(--cream); font-size: 0.8rem;
      cursor: pointer; transition: background 0.2s;
    }
    .btn-copy:hover { background: rgba(255,255,255,0.15); }
    .btn-next {
      align-self: flex-start;
      padding: 0.7rem 1.5rem;
      background: var(--ochre); color: #fff;
      border: none; border-radius: 4px;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.9rem; font-weight: 500;
      cursor: pointer; transition: background 0.2s;
    }
    .btn-next:hover { background: var(--ochre-dark); }













/* --------------------- INFO PAGES CONTAINER -------------------- */
/* about, contact — centered like the rest of the site, but no hero margin */
.info-container {
  width: 100%;
  max-width: 800px;
  padding: 4.5rem 2rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

.paragraph-section {
  padding-top: 30px;
  padding-bottom: 30px;
}

p a {
  color: inherit;
}

.list {
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
}

ul {
  display: inline-block;
  text-align: left;
  font-style: italic;
  margin: 0.75rem auto 1rem;
  padding-left: 1rem;
}

li {
  margin-bottom: 0.35rem;
  line-height: 1.6;
}

li::marker {
  color: #444;
  font-size: 0.9em;
}


.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* each field takes full container width */
.contact-form input,
.contact-form textarea,
.contact-form button {
  width: 100%;
  box-sizing: border-box;
  font-size: 16px;
  resize: vertical;
  font-family: inherit;
}
.contact-form button {
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.contact-form button:hover {
  opacity: 0.85;
}

/* taller fields */
.contact-form input,
.contact-form textarea {
  min-height: 48px;
  padding: 14px;
}

.contact-form textarea {
  min-height: 180px;
}

/* button styling override */
.contact-form button {
  background: var(--ochre-dark);
  border: none;
  padding: 14px;
  font-family: 'Playfair Display', serif;
  color: var(--ochre-light);
}

#submitted {
  text-align: center;
  margin-top: 100px;
  margin-bottom: 100px;
  font-style: italic;
  color: var(--muted);
}




/* -------------------------- FOOTER -------------------------- */
footer {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  text-align: center; font-size: 0.8rem; color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: auto; width: 100%;
  
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  gap: 1.5rem 4rem; /* [row-gap] [column-gap] */
}

footer a { color: var(--muted); }
footer button {
  background: none; border: none; color: var(--muted);
  font-size: 0.8rem; cursor: pointer; text-decoration: underline;
  font-family: 'DM Sans', sans-serif;
}
footer button:hover { color: var(--ochre); }