/* -------------------------------------------------------------
   WIKI STYLE – Chronicles of Glom (Fantasy Unified Theme)
-------------------------------------------------------------- */

/* -------------------------------------------------------------
   PALETTE
-------------------------------------------------------------- */
:root {
  --bg: #0d1220;
  --panel: #151b2a;
  --accent: #6c8cff;
  --text: #e7eaf3;
  --muted: #b7c0d9;
  --border: #2a3246;
  --panel-light: #1c2438;
  --prova_colore: #ff6cb0;
}

/* -------------------------------------------------------------
   GLOBAL
-------------------------------------------------------------- */
body {
  margin: 0;
  font-family: "Georgia", serif;
  background: linear-gradient(180deg, #0d1220 30%, #10172b 40%, #0d1220);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: 0.2s;
}

a:hover {
  text-shadow: 0 0 8px var(--accent);
}

.lista{
    color: var(--panel);
}

/* -------------------------------------------------------------
   HEADER
------------------------------------------------------------- */
header {
    padding: 0 0 16px 0;
    background: linear-gradient(180deg, #0d1220, #10172b 40%, #0d1220 );
    backdrop-filter: blur(6px);
    text-align: center;
    position: relative;
    z-index: 100;
}

@font-face {
    font-family: "Lucida Handwriting";
    src: url("./font/LucidaHandwritingStd-Light.woff") format("woff"),
         url("./font/LucidaHandwritingStd-Light.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
}

/*-------------------------------------------------------------
   TITLE
-------------------------------------------------------------- */
.title {
    padding: 15px;
    flex: 1;
    text-align: center;
    font-size: 60px;
    font-weight: 700;
    font-family: "Lucida Handwriting", cursive;
    margin: 0;
    z-index: 1;
}

/* Sottotitolo */
.subtitle {
    color: var(--muted);
    margin-top: 6px;
    font-size: 25px;
}

/* -------------------------------------------------------------
   NAV MOBILE
------------------------------------------------------------- */
@media (max-width: 575.98px) and (max-width: 480px) {

    nav {
        display: none !important;
        flex-direction: column;
        gap: 14px;

        position: fixed;
        top: 90px;
        right: 20px;

        width: 260px;
        padding: 20px;

        background: rgba(21,27,42,0.95);
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: 0 0 12px rgba(108,140,255,0.4);

        z-index: 9999;
        animation: fadeDown 0.25s ease;
    }

    nav.show {
        display: flex !important;
    }

    .topbar .hamburger {
        display: flex;
    }

    /* Improve mobile nav spacing */
    nav a {
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* Extra small mobile screens */
@media (max-width:575.98px) and (max-width: 480px) {
    nav {
        width: 240px;
        right: 10px;
        top: 80px;
    }

    .topbar {
        padding: 0 15px;
        height: 60px;
    }
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* -------------------------------------------------------------
   LAYOUT A DUE COLONNE (Wiki style)
-------------------------------------------------------------- */
.wiki-layout {
  display: flex;
  max-width: 1300px;
  margin: 40px auto;
  padding: 0 20px;
  gap: 24px;
}

/* -------------------------------------------------------------
   SIDEBAR (Fantasy Card)
-------------------------------------------------------------- */
.sidebar {
  width: 220px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  height: fit-content;
  position: static;
  top: auto;
  box-shadow: 0 0 18px rgba(108,140,255,0.35);
  backdrop-filter: blur(4px);
}

/* Responsive sidebar */
@media (max-width: 992px) and (max-width: 575.98px) {
  .wiki-layout {
    flex-direction: column;
    padding: 0 16px;
  }

  .sidebar {
    width: auto;
    position: static;
    margin-bottom: 20px;
  }
}

.sidebar h3 {
  margin-top: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
}

.sidebar ul {
  list-style: none;
  padding-left: 0;
}

.sidebar li {
  margin: 10px 0;
  color: var(--muted);
}

/* -------------------------------------------------------------
   MAIN CONTENT (Fantasy Scroll)
-------------------------------------------------------------- */
.content {
  flex: 1;
  background: var(--panel-light);
  padding: 28px;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 0 18px rgba(108,140,255,0.35);
  backdrop-filter: blur(4px);
}

.content h1 {
  margin-top: 0;
  font-size: 2.2rem;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  color: var(--accent);
}

.content h2 {
  margin-top: 30px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

/* -------------------------------------------------------------
    LINK WITH IMAGE PREVIEW
-------------------------------------------------------------- */
#image-preview {
    max-width: 280px;
    max-height: 200px;
    width: auto;
    height: auto;

    object-fit: contain;

    background: #fff;
    padding: 6px;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);

    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.20s ease;
}

/* -------------------------------------------------------------
   ANIMAZIONE ACCORDION
-------------------------------------------------------------- */
details > summary {
    cursor: pointer;
    font-weight: bold;
}

details[open] > summary {
    border-bottom: 2px solid var(--accent);
}

details > summary::-webkit-details-marker {
    display: none;
}

details > summary::marker {
    display: none;
}

details > summary::-moz-list-bullet {
    list-style-image: none;
}

details > summary::-ms-bullet {
    list-style-image: none;
}


/* -------------------------------------------------------------
   INFOBOX (Fantasy Creature Box)
-------------------------------------------------------------- */
.infobox {
  float: right;
  width: 250px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 14px;
  margin: 0 0 10px 10px;
  border-radius: 10px;
  box-shadow: 0 0 18px rgba(108,140,255,0.35);
  font-size: 0.95rem;
}

.infobox img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 10px;
}

.infobox table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

.infobox td {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

/* Responsive infobox */
@media (max-width: 768px) and (max-width: 575.98px) {
  .infobox {
    float: none;
    width: 100%;
    margin: 20px 0;
  }

  .infobox table {
    font-size: 14px;
  }
}

/* -------------------------------------------------------------
   SEARCH BAR
-------------------------------------------------------------- */

.wiki-search {
    display: inline-block;
    margin-left: 20px;
}

.wiki-search input {
    background: var(--panel-light);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: 0.2s;
    width: 180px;
}

.wiki-search input::placeholder {
    color: var(--muted);
}

.wiki-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(108,140,255,0.5);
}

/* -------------------------------------------------------------
   ALLINEAMENTO MODIFICATORI
-------------------------------------------------------------- */
.stat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stat-list li {
    display: flex;
    gap: 20px; /* distanza costante tra le colonne */
    margin: 2px 0;
}

.stat-list .label {
    width: 120px; /* colonna nomi */
}

.stat-list .value {
    width: 30px; /* colonna valori */
    text-align: right;
}

.stat-list .mod {
    width: 30px; /* colonna modificatori */
    text-align: right;
}

/* -------------------------------------------------------------
   FOOTER
-------------------------------------------------------------- */
footer {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  background: rgba(21,27,42,0.7);
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.back{
display: block;
    align-items: left;
margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    background: var(--panel);
    box-shadow: 0 0 18px rgba(108,140,255,0.35);
max-width: fit-content;
}

/* -------------------------------------------------------------
   RESPONSIVE TYPOGRAPHY
-------------------------------------------------------------- */
@media (max-width: 768px) {
    .topbar .title {
        font-size: 48px;
    }

    .subtitle {
        font-size: 22px;
    }

    /* General responsive typography */
    body {
        font-size: 15px;
    }

    .content h1 {
        font-size: 1.8rem;
    }

    .content h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 600px) {
    .topbar .title {
        font-size: 38px;
        font-family: "Lucida Handwriting", cursive;
    }

    .subtitle {
        font-size: 18px;
    }

    /* General responsive typography */
    body {
        font-size: 14px;
    }

    .content h1 {
        font-size: 1.6rem;
    }

    .content h2 {
        font-size: 1.3rem;
    }

    .wiki-search input {
        width: 150px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .topbar .title {
        font-size: 32px;
    }

    .subtitle {
        font-size: 16px;
    }

    /* General responsive typography */
    body {
        font-size: 13px;
    }

    .content h1 {
        font-size: 1.4rem;
    }

    .content h2 {
        font-size: 1.2rem;
    }

    footer {
        font-size: 12px;
        padding: 12px 16px;
    }

    .wiki-search {
        margin-left: 10px;
    }

    .wiki-search input {
        width: 120px;
        font-size: 12px;
    }
}
