/* FONT IMPORTS AND RESETS */
@import url('https://fonts.googleapis.com/css2?family=Alegreya:ital,wght@0,400..900;1,400..900&family=Bitter:ital,wght@0,100..900;1,100..900&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Gentium+Book+Plus:ital,wght@0,400;0,700;1,400;1,700&family=Lusitana:wght@400;700&display=swap');

* {
  box-sizing: border-box;
  margin:0;
  padding:0;
}

/* BASE STYLES */
.initial-message {
  position:absolute;
  top:8vh;
  padding-right:26vw;
  padding-left:26vw;
  width:100vw;
  font-family: 'Lusitana', serif;
  font-size: 1.3rem;
  line-height: 1.4;
  text-align: justify;
  overflow-y: auto!important;
  z-index:90;


}
/* --- VISUAL HIDE FOR ACCESSIBILITY --- */ 
 /* For visually hiding labels while keeping them accessible */


.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;
}
html, body {
  height: 100vh; 
  width: 100vw;
  overflow: hidden; 
  background-color: transparent;
  margin:0;
  padding:0;
}

body.shrink {
  --topbar-h: calc(var(--topbar-h-initial) / 2);
}


:root {
 --topbar-h-initial: 15vh;
  --topbar-h: var(--topbar-h-initial);
  
  --topbar-py: .75vh;
  --topbar-px: 3vw;
  --brand-gap: 2rem;
  --bottombar-h: 5vh;  /* reserved for a future bottom bar */
  --drawer-h: 30vh;     /* reserved for a future bottom drawer */

  --rightbar-w:4vw;
  --extra-w: 40vw;

  --mainMargin-l: 9.5vw;  /* left VISUAL margin for main text, hosts bekker signposts */
  --mainMargin-r: 5vw;  /* right VISUAL margin for main text, host frase bekker ID */
  

}

nav{
height: var(--topbar-h);
}

sup {
  vertical-align: 12%;
  font-size: 95%;
}

.hidden {
  display: none;
}

p {
  margin:0;
  margin-top: 15px;
  padding:0;
}
/* --- STYLING FOR NOTA POP-UP --- */

.conceito {
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: #cacac9;
    position: relative; 
    cursor: help;
}

#global-tooltip {
  pointer-events:none;
  z-index:200;
    visibility: hidden;
    position: absolute;
    background-color: #f9f9f9;
    border: black 2px solid; 
    box-shadow: -2px 3px 0px rgba(0,0,0,1);
    padding: 8px 12px;
    border-radius: 0px;
    line-height: 1.2;
    font-size: 90%;
    font-family: "Asap", sans-serif;
    text-align: left;
    max-width:600px;          /* MIO mai più largo del 50% viewport */
    width: max-content;
    overflow-wrap: break-word;
    white-space: normal;
    box-sizing: border-box;     /* conta anche il padding nei limiti */
}
/* --- STYLING FOR THE BEKKER RESULT MODAL --- */

/* The semi-transparent background overlay */
.modal-overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 200; /* Ensure it's on top of other content */
  justify-content: center;
  align-items: center;
}

/* The pop-up box itself */
.modal-content {
  background-color: #fff;
  padding: 25px 30px;
  border-radius: 0px;
  border: black 2px solid; 
  box-shadow: -2px 3px 0px rgba(0,0,0,1);
  position: relative;
  max-width: 500px;
  width: 90%;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 0.9rem;
  text-align: justify;
  z-index:200;
}

/* The close button (X) in the top-right corner */
.modal-close-button {
  position: absolute;
  top: 0px;
  right: 8px;
  border: none;
  background: none;
  font-size: 1.8rem;
  font-weight: bold;
  color: #888;
  cursor: pointer;
}

.modal-close-button:hover {
  color: #000;
}

/* Styling for the content injected by the script */
#modal-result-content .bekker-result h3 {
  margin-top: 0;
}

/* Styling for Frase*/
.frase {
  transition: background-color 0.5s ease;
  color: rgb(47, 52, 52);
  padding:0;
}

.frase:hover {
  background-color:  rgb(255, 255, 255);
  color: #c28042;
  cursor: pointer;
}
.referenzaIN {
  font-optical-sizing: auto;
  font-family: 'Alegreya', serif;
  color:#b02f2f;
  font-weight: 200;
  font-size: 55%;
  position: absolute;
  font-variant-numeric: oldstyle-nums;
  line-height: 0.0rem;
  text-align: right;
  left: calc(var(--mainMargin-l) - 3vw);
  transform:translateY(-0.8rem) translateX(-100%);

}
.selezionata {
  color:rgb(146, 70, 141);
  background-color:  rgb(255, 254, 221);
}
.selezionata:hover {
  color:rgb(146, 70, 141);
  background-color:  rgb(252, 251, 172);
}

/* ========= STYLING da TOP BAR =============== */

button{
  border:none;
  width:fit-content;
  font-family: 'bitter', sans-serif;
  font-weight: 500;
  font-size: 90%;
  color:#3a3632;
}
button:focus{
  /*outline: 2px solid #ffe4b6; 
  outline-offset: -4px;*/
  color:rgb(255, 145, 0);
  font-weight: 700;
  text-decoration: underline;
}
button:hover{
  color:rgb(189, 69, 219);
  cursor:pointer;
  text-decoration: none;
}
header#barra-desktop {
  display: flex;
  position: relative;
 background-color: rgb(238, 195, 115);
  width:100vw;
  height: var(--topbar-h);
  padding: var(--topbar-py) 0;
  justify-content: space-between;
  align-items: center;
  gap: 3vw;
  position: relative;
  z-index: 99;                      /* ensure shadow renders above content */
  transition: height 0.5s ease, box-shadow 0.5s ease;

}

body.shrink header#barra-desktop {
  box-shadow: inset 0 -2px 20px rgba(0,0,0,0.1);
}

/* add transitions to the images so they animate when height var changes */
.branding .logo,
.branding .wordmark {
  transition: height 0.5s ease, transform 0.5s ease;
}




.branding {
  display: flex;
  align-items: center;
  min-width: 0;
  gap:var(--brand-gap);
  /* Compute logo height once and reuse for both images */
  --logo-h: calc(var(--topbar-h) - 2 * var(--topbar-py));
}

.branding img{ 
  display:block;
   width:auto;      /* keep aspect ratio */
}

/* Logo height = header inner height */
.branding .logo    { 
  height: var(--logo-h);
  position:absolute;
  right: calc( 100vw - var(--mainMargin-l));
  max-width: var(--mainMargin-l);
}

/* Wordmark = 30% of logo height */
.branding .wordmark{ 
  height: calc(var(--logo-h) * 0.80); 
  align-self:center;
  transform:translateY(-0%);
  padding-left: calc(0.7vw + var(--mainMargin-l));
}
.topbar-actions {
  margin-inline-start:auto;
   display:flex; 
   align-items:center; 
   align-self: flex-end;
   gap:10px; }

#megaToggle{
  height: auto;
  width:auto;
  z-index: 200;
  background-color:transparent;
  color:rgb(91, 76, 71);
  opacity: 1;
  font-family: 'Bitter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  margin-inline-start: auto;
  margin-right: 3vw;
  cursor:pointer;
}
#megaToggle:focus-within{
   text-decoration: none;
  font-family: 'Bitter', sans-serif;
  font-weight: 600;
    font-size: 0.9rem;

   background-color:transparent;
     color:rgb(91, 76, 71);

}
#megaToggle:focus-visible,
.mega-close:focus-visible,
.mega .acc:focus-visible,
.mega a:focus-visible {
  outline: 2px solid #000; outline-offset: 2px;
}

/* Mega panel base */
.mega[hidden]{ display:none; }
.mega{
  position: absolute;
  /*inset-inline: 0;           /* left:0; right:0 in logical terms */
  top: 100%;                 /* drops just under header */
  background: #fff;
  border: 2px solid #000;
  box-shadow: -4px 6px 0 #000;
  padding: 1rem;
  z-index: 99;
  max-height: 80vh;
  overflow: auto;
  width:fit-content;
  right:1rem;
}

.mega-close, .mega-close:focus{
  position: absolute;
  top: .5rem; right: .5rem;
  background: transparent;
   border: 0; 
   font-size: 1.5rem; 
   cursor: pointer;
   color:black;
   text-decoration: none;
}

/* MEGA MENU : Sections grid */
.mega-sections{
  list-style: none;
  margin: 0;
  padding: 0;
  border:none;
  display: grid; 
  gap: .5rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  font-family: "DM Sans", sans-serif;
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.2;
  color:#edb33e;
  background-color: #ffffff;
}

.section{ 
  background:#ffffff;
   border:none; 
   padding:.5rem; }
.section h3{ 
  margin:0 0 .25rem;
   font-size:1rem; }

.mega .acc{
  width: 100%;
  text-align: left;
  background: #ffffff;
   border-bottom: 1px solid #d4d4d4;
  padding: .5rem .75rem; cursor: pointer;
}
.mega .acc[aria-expanded="true"]{
   background:#fbf6e8;
  color:#6d6350;
  text-align: center;
  font-weight: 600;
 }

.panel{ 
  padding: .5rem 0 0; }
.panel ul{ 
  list-style: none; 
  margin: 0; 
  padding: 0; }
.panel a{ 
  display:block; 
  padding:.25rem 0; 
  color:#000000; 
  font-size: 0.9rem; 
  font-weight: 600; 
}

/* Mobile-only: hide Mega menu; hide bekker search input for desktop */
@media (max-width: 1023px){
  #megaToggle, .mega { display: none !important; }
  
}


#bekker-display {
/*display: inline-block;*/
  position:absolute;
  right:calc(var(--rightbar-w) + var(--extra-w));
  padding: 0.2rem 0.35rem;
  z-index: 190;

  transform:translateY(-205%);

  vertical-align: baseline;
  text-align: center;
  font-family: 'Bitter', sans-serif;
  font-size: 0.75rem;
  line-height: 1;
  font-weight: 800;
  color: #000;
  background-color: #fff;
  border: 2px solid #000;
  box-shadow: -2px 3px 0 rgba(0,0,0,1);
}
.select-wrapperL, .select-wrapperR {
  position: fixed;
  top: 0;
  border: none;
  display: flex;
  flex-direction: row;
  background-color:transparent;
  height: 4vh;
  align-items: center;
  justify-content:flex-end;

}
.select-wrapperR{
  right:4vw;
  width:auto;
  flex-shrink: 2;
  gap:0;

}
.select-wrapperL{
  left:6.5vw;
  width:auto;
  gap:1vw;
  padding-right: 2vw;
  flex-grow: 3;

  
}
.menu {
  margin: 0;
  border: none;
  font-family: 'Bitter', serif;
  font-weight: 400; 
  font-style: italic;
  appearance: none;
  background-color: transparent;
  padding: 0 1vw;
}
#chapters-dropdown{
  text-align:left;
}
.menu:hover {
 box-shadow: 0 -5px 0 0 #e19f63;
  cursor: pointer;
}
.menu:active {
  border:none;
  outline: none;
}
.menu:focus {
    border:none;
    outline: none;
}
.menu li:focus,
.menu li:focus-visible,
.menu li:active {
  outline: none;    /* removes the focus ring */
  border: none;     /* in case UA stylesheet adds border */
}

.bekker {
  width: auto;
  /*position: fixed;*/
  align-self:center;
  justify-self: flex-end;
  right:0w;
  margin-top:0.2vh;
  height: 3vh;
  padding: 0.2vw 0.5vw;
  border: rgb(0, 0, 0) 2px solid; 
  box-shadow: none;
  border-radius: 0px;
  background-color: #e1e1e1 !important;
  color: #7f7f7f;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
}


input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px #fff inset !important;
  -webkit-text-fill-color: #000 !important;
  color:black;
  border: rgb(0, 0, 0) 2px solid; 
  box-shadow: -2px 3px 0px rgb(0, 0, 0);
  border-radius: 0px;

}
.bekker:focus {
  background-color: #ffffff !important;  
  outline: none;
  color:black;
  border: rgb(0, 0, 0) 2px solid; 
  box-shadow: -2px 3px 0px rgb(0, 0, 0);
  border-radius: 0px;

}

/* ======================================================= */
/* LANDSCAPE ORIENTATION STYLES (DEFAULT)               */
/* ======================================================= */

.main-content-area {
  flex-direction: row; /* Horizontal arrangement */

}
/*1. Tradução Content Area */
.tradu-content {
  flex-basis: 55vw; /* 55% of viewport width */
  flex:0 0 auto; /* Prevents shrinking */ 
  position:relative;
  top: 0!important;
  background-color: #ffffff;
  width: calc(100vw);
  height: calc(100vh - var(--topbar-h) - var(--bottombar-h));
  overflow-y: auto;
  padding: 3rem calc(var(--rightbar-w) + var(--extra-w) + var(--mainMargin-r)) 8vh var(--mainMargin-l);
  border: none;
  font-family: 'Lusitana', serif;
  font-size: 1.2rem;
  line-height: 1.5;
  text-align: justify;
}


.tradu-content h1 {
  font-family: "Bitter", serif;
  font-size: 2.3rem;
  margin-bottom: 0;
  margin-top: 0;
      line-height: 1.2;

}

.tradu-content h2 {
  font-family: "Alegreya", sans-serif;
  font-weight: 300;
 font-size: 1.7rem;
  line-height: 1.2;
    margin-bottom:5rem;


}
.tradu-content h4{
  font-family: "DM Sans", sans-serif;
  font-weight: 400;
  font-size: 0.8rem;
  text-align: right;
  line-height: 1.1;
  margin-top:5rem;
}
.external-link { color:inherit; text-decoration-style:dashed; text-decoration-color:#edb33e; text-decoration-thickness: 2px;}
.external-link:hover { text-decoration-style:solid; text-decoration-color:#edb33e; text-decoration-thickness: 3px; }

.chapter-navigation {
  display: flex;
  justify-content: space-between;
  padding: 24px 0 16px 0;
  margin-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.nav-link {
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
  color: #929292;
  cursor: pointer;
  font-weight: 400;
  font-size: 0.8rem;
  padding: 8px 16px;
  border-radius: 5px;
  transition: background-color 0.2s ease-in-out;
}

/* 2 - Right Side Bar */
.right-bar {
    position: fixed;
    top: var(--topbar-h);
    right: var(--extra-w);
    margin: 0;
    width: var(--rightbar-w);
    height: calc(100vh - var(--bottombar-h) - var(--rightbar-w));
    background-color: transparent;
    z-index: 99;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Aligns items to the top */
    gap: 6vw;                   /* Creates a 3vw gap between buttons */
    padding-top: 3vw;           /* Optional: Adds space before the first button */
}
.lil-button {
  display: flex;
  flex: 0 0 auto;
  overflow-y: auto;
  margin: 0;
  align-items: center;
  gap: 0.5vw;
  padding:0.5vh;
  flex-direction: row;
  background-color: transparent;
  border:none;
  rotate: 90deg;
  cursor: pointer;
  color: #000000;
  font-size: 0.7rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  transition: color 0.3s ease;
}

.lil-button:focus{
    text-decoration: none;

}

.lil-button::before {
  content: '';
  display: inline-block;                /* important: actually creates a box */
  align-items: center;
  justify-self: center;
  align-self: center;
  border-radius: 50%;
    width: 3.5vh!important;
    height: 3.5vh!important;
    background-color: #ffffff;
    border:2px solid black;
        box-shadow: 2px 3px 0px rgba(0,0,0,1);

  margin: 0;  
  transition: background-color 0.3s ease;
   /* SVG icon inside the circle */
     rotate: -90deg;
       background-repeat: no-repeat;
  background-position: center;
}
  #Bekker-button::before{
     background: none;                           /* reset in case a shorthand overrode it */
  background-color: #ffffff;
  background-image: url("/images/kai-ligature.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;

;
  }
  #Paraf-button::before{
      background: none;                           /* reset first */
  background-color: #ffffff;
  background-image: url("/images/interrobang.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60% 60%;

;
  }



.lil-button::after { 
    content: attr(data-label); 
}
.lil-button:hover { 
    color:#e19f63; 
}
.lil-button:hover::before { 
    background-color: #e19f63; 
}

/* 3. Greek and Paraph content (Extra panel) */
.extra {
    position:fixed;
    top:var(--topbar-h);
    bottom:var(--bottombar-h);
    right: 1vw;
    flex-basis: 40vw; /* 5% of viewport width */
    width: calc(var(--extra-w) - 1vw);
    height: calc(100vh - var(--topbar-h) - var(--bottombar-h));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content:flex-start;
    background-color: #ffffff;
    padding: 0.5vw 0;
    flex-shrink: 0;
    z-index:50;
}
.grego.active,
.parafrase.active {
  display: block !important;
}


.grego,
.parafrase {
    flex: 0 1 auto;        /* size to fit content, never shrink */
    min-height: 0;      /* take only as much height as needed */
    max-height: 100%;      /* but never exceed the container */
    overflow-y: auto;      /* scroll if the content is too tall */
    padding: 2.2rem;
    background-color: #fff;
    min-height: 0;
    display: none;
    border-bottom: 1px solid #e0e0e0;
    border-top: 1px solid #e0e0e0;
}
.grego { 
    font-family: 'Gentium Book Plus', serif;
    font-size: 1.2rem;
    line-height: 1.5;
}
.parafrase { 
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 400;
    text-align:justify;
}



/* FOOTER */
/* --- New Rules --- */
    .footer {
          display: flex;
          bottom:0;
          justify-content: center;
          align-items: center;
          width: 100%;
          height: var(--bottombar-h);
          text-align: center;
          padding-top: 0;
          background-color:transparent;
          border-top: rgb(242, 242, 242) solid 2px;
          font-family: 'DM Sans', sans-serif;
          font-weight: 500;
          font-size: 0.7rem;
          line-height: 1;
          visibility: hidden; /* Hide the footer initially */
          opacity: 0; /* Make it fully transparent */
          transition: opacity 0.5s ease-in-out; /* Animate the appearance */
          margin: 0;
        }

        .footer.is-visible {
          visibility: visible; /* Make it visible */
          opacity: 1; /* Make it fully opaque */
        }                             
/* =========================
   STEP 1: WIDTH-BASED SCAFFOLD
   (keeps current UI functional)
   ========================= */
@media (max-width: 767px) {
  #global-tooltip {
    max-width: 80vw !important;   /* mai più largo dell’80% viewport */
    padding: 6px 8px;
  }
}
@media (max-width: 1023px) {
  :root { --topbar-h: 8vh;
          --bottombar-h:12vh; }


}



/* SMALL PHONES ≤480px */
@media (max-width: 480px) {

  /* Keep selects where they are for now (visible), but push content below top band */
  .tradu-content {
    position: relative!important;
    top: 0!important;
    width: 100vw!important;
    height: calc(100vh - var(--topbar-h)- var(--bottombar-h))!important;
    padding: 3.5vh 6vw 8vh 6vw !important;
    font-size: 1.2rem;
    text-align: left!important;
    margin-top: 0!important;
    line-height: 1.8;
  }
  .grego{
  font-size:1.2rem!important;
  line-height: 1.8!important;

  }
  .parafrase{
  font-style: 1.3rem!important;
  line-height: 1.8!important;


  }
  .grego, .parafrase {
    padding-left: 8vw!important;
    padding-right: 8vw!important;
    text-align: left!important;
  }
  .referenzaIN {
    font-size: 68%!important;
    right:10px;
    transform:translateY(-100%)!important;

}

}

/* LARGE PHONES 481–767px */
@media (min-width: 481px) and (max-width: 767px) {

  .tradu-content {
    position: relative;
    top: 0;
    width: 100vw;
    /*height: calc(100vh - var(--topbar-h)- var(--bottombar-h))!important;*/
    padding: .5vh 6vw 12vh 8vw !important;
    margin-top: 0;
    text-align: left;
  }
  .grego, .parafrase {
    padding-left: 10vw!important;
    padding-right: 10vw!important;
    text-align: left!important;
  }

}

/* TABLETS 768–1023px */


@media (min-width: 768px) and (max-width: 1023px) {

  .tradu-content {
    position: relative;
    top: 0;
    width: 100vw;
   /* height: calc(100vh - var(--topbar-h)- var(--bottombar-h))!important;*/
    margin-top: 0;
    text-align: justify;
    font-size: 1.6rem !important;
    line-height: 1.5;
    padding-top: 1vh!important;
    padding-right: calc(13vw * (1.9 + ((100vw - 760px) / 263) * 0.4))!important;
    padding-bottom: 8vh!important;
    padding-left: calc(13vw * (1.9 + ((100vw - 760px) / 263) * 0.4))!important;

  }
  .grego, .parafrase {
   padding-right: 7vw!important;
  padding-left: 7vw!important;
  }
  .grego {
    font-size: 1.6rem;
  }
  .parafrase{
    font-size: 1.4rem!important;
    line-height: 1.5!important;
  }
  

}
/* =========== GENERAL MOBILE LAYOUT (≤ 1023px) =======*/
@media (max-width: 1023px) {

  /* Ensure content flows under the 10vh top band */
  .main-content-area { display: block; }
  
  #nav-drawer input.bekker{
  max-width: 70vw!important; /* mai più largo del 70% viewport */
  font-size:0.5rem!important;
 }
 

  .select-wrapperL,
  .select-wrapperR {
    visibility: visible !important;
    display: flex;
    flex-direction: column;
    padding: 1rem;
  }

  #nav-drawer select,
  #nav-drawer input {
    width: 100%;
    margin-bottom: 1rem;
    font-size: 1rem;
  }
  /* Keep right bar behavior AS IS for now (will convert to bottom bar in Step 3) */
  /* Keep .extra behavior AS IS for now (will become bottom drawer in Step 3) */

  /* Avoid odd fixed widths/heights from desktop rules */
  .tradu-content { width: 100vw; }

    #global-tooltip {
   font-size: 105% !important; 
   padding: 1.3vh 2vw;  /* bigger font on desktop */
  }

  .referenzaIN {
    font-size: 70%!important;
    right:10px;
      }
  #bekker-display {
    font-size: 1rem!important;
     position: fixed !important;   /* do NOT scroll with text */
    top: auto !important;            /* cancel JS top positioning */
    bottom: 10px !important;         /* pin to bottom */
    left: 50% !important;         /* center horizontally */
    right: auto !important;       /* avoid 100vw stretch */
    transform: translateX(-50%) !important; /* true center */
    width: auto !important;       /* keep natural width */
    display: inline-block !important; /* prevent full-width block */  
      }

.modal-content {
  
  font-size: 1.25rem;
  padding:2.5rem 2rem;
}

/* The close button (X) in the top-right corner */
.modal-close-button {
  font-size: 2rem;
}
}
/* =========================================
   == DESKTOP LAYOUT ! ===  Top bar + drawer in  (≤ 1023px only, - SUPERIORE a 1024) 
   ================================================ */

@media (min-width: 1023px) {

  .app-nav { display: none; } /* hide app-nav (containing hamburguer and drawer) on desktop */
}




/* Invisible placeholder title for now (optional) */
.nav-title { display: none; }

/* BIG, clickable hamburger; push it to the right */
.hamburger {
  right: 0;
  margin-left: auto;
  position: relative;
  display: inline-block;      /* no flex needed now */
  width: 33px;
  height: 30px;  /* 3 bars total (4px + 6px gap repeated 3 times) */
  background:
  repeating-linear-gradient(
    to bottom,
    #000 0,
    #000 4px,
    transparent 4px,
    transparent 10px   /* 3px bar + 5px gap */);

  border: none;
  cursor: pointer;
}

/* Keep hover subtle — do NOT overwrite background; just reduce opacity */
.hamburger:hover {
  opacity: .8;
}

/* Slight press feedback without shifting layout */
.hamburger:active {
  transform: translateY(1px);
}
.hamburger:focus-visible {
  outline: 2px solid #000;
  outline-offset: 3px;
}



/* ==== DRAWER: baseline on ALL widths ==== */
/* Keep the drawer off-canvas by default */
.nav-drawer {
  position: fixed;
  right: 10px;
  top: calc(var(--topbar-h, 4.5vh)); 
  height: auto;
  background: #fff;
  transform: translateY(-100%);            /* hidden above the viewport */
  opacity: 0;                              /* not visible */
  pointer-events: none;                    /* don't block clicks when closed */
  transition: transform .28s ease, opacity .2s ease;
  border-bottom: 2px solid #eee;
  z-index: 99;                           /* below the hamburger */
  display: grid !important;
  gap: 0.9rem !important;
  padding: 1rem 1.25rem 2rem !important;
  color: #fff; 
  border: 2px solid #000 !important;
  box-shadow: -2px 3px 0 #000 !important;
  background: #fff !important;

}
/* Open state: slide in + enable interaction */
.nav-drawer.open {
  transform: translateY(0)!important;
  opacity: 1;
  pointer-events: auto;
}

/* Make sure the hamburger stays above the drawer */
#nav-toggle.hamburger { z-index: 99; }

/* Keep the app bar above main content */
.app-nav { position: sticky; top: 0; z-index: 99; }



/* 
                ===================
===============  MOBILE LAYOUTS (≤1023px) ====================
                ===================
*/
/* === MOBILE/TABLET  === */
@media (max-width: 1023px) {


  .initial-message {
    padding-right:10vw;
  padding-left:10vw;
  width:100vw;
  height: 80vh;       /* full viewport height */
  font-family: 'Lusitana', serif;
  font-size: 1.3rem;
  line-height: 1.4;
  text-align: justify;
    overflow-y: auto !important;
  overflow-x: hidden;


}


  #global-tooltip{
        font-size: 70%;

  }
  /*0) Drawer and nav*/





    #barra-desktop {
    position: relative;           /* containing block for .app-nav */
    display: flex;
    align-items: center;
    /* Make sure it has the full mobile topbar height */
    height: var(--topbar-h)!important;
    overflow: visible;   /* NEW: make sure children aren't clipped */
  }
  .logo{ display: none !important; }   /* Hide emblem on mobile  */


.branding {
  display: flex;            /*  enforce flex context */
    align-items: center;      /*  vertical centering */
    height: calc(var(--topbar-h) - 2 * var(--topbar-py)) !important;
    max-height: calc(var(--topbar-h) - 2 * var(--topbar-py)) !important;
    min-height: 44px;         /*  mobile safety baseline */
    max-width: 80vw!important;       
    padding-left: 20px;
    padding-right: 66px; 
  } 



.wordmark {
  display: block !important;
  height: calc(var(--topbar-h) - 2 * var(--topbar-py)) !important;
  max-height: calc(var(--topbar-h) - 2 * var(--topbar-py)) !important;
  width: auto !important;
  max-width: 100% !important;
  padding-left: 0 !important;
  transform: none !important;
  object-fit: contain;
  position: relative;
  z-index: 1;
}


   .app-nav {
    position: absolute !important;  /* anchor to header */
    inset: 0 0 0 auto !important;   /* top:0; right:0; height:100% */
    height: 100% !important;
    width: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    padding: 0 var(--topbar-px) !important;
    background: transparent !important;   /* do NOT cover header */
    box-shadow: none !important;
    z-index: 99 !important;             /* above brand art */
  }
  .nav-bar {
    display: contents !important;         /* flatten wrapper; keeps children */
    background: transparent !important;
    height: auto !important;
    padding: 0 !important;
  }
  .hamburger {
    margin-left: 0 !important;            /* we’re right-aligning via flex */
    position: relative !important;
    width: 33px !important;
    height: 30px !important;
  }

  /* Drawer should open below the header */
  .nav-drawer {
    top: var(--topbar-h) !important;
    right: var(--topbar-px) !important;
    left: auto !important;
    transform: translateY(-100%) !important; /* remains hidden until open */
    z-index: 99 !important;                /* below the button */
  }
  




  /* 1) Make the main text scroll */
  .tradu-content,
  .text-inner,
  .textInnerSection,
  #text-inner {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }


  /* Default main text height (bar only) */
  .tradu-content {
    top: 0 !important;
    height: calc(100vh - var(--topbar-h)) !important; /* minus bottom bar */
    width: 100vw !important;
  }
  /* When drawer is open (bar + 30vh drawer) */
  body.extra-open .tradu-content {
    height: calc(100vh - var(--topbar-h, 4.5vh) - 40vh) !important;
  }

  /* 2) Bottom bar layout (fix misalignment) */
  .right-bar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;        /* <-- instead of top: calc(100vh - …) */
    top: auto !important;
    padding-bottom: env(safe-area-inset-bottom, 0px); /* adds clearance only on iOS */
    width: 100vw !important;
    height: var(--bottombar-h);
    border-top: none!important;
    z-index: 120 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0 !important;
    padding: 0  !important;
    overflow: visible !important;
    background: linear-gradient(to top, white, rgba(255, 255, 255, 0))
    }

  /* Buttons: horizontal, full-visible */

.menu:hover {
 box-shadow: 5px 0 0 0 #e19f63;
  cursor: pointer;
}
#chapters-dropdown{
  text-align:right!important;
}


  .lil-button {
    display: flex !important;
    justify-content: end !important;
    font-size: calc(0.5vw + 0.6vh + 0.4rem)!important;   /* cresce/diminuisce con lo schermo */
    color:#000;
    text-shadow: 1px 1px 0 rgb(255, 255, 255), rgb(255, 255, 255)1px 0 ;
    padding: 0.3vw 1.2vw!important;
    height:fit-content;
    flex-direction: column;
    width: 20vw!important;    /* sempre proporzionale */
    position: static !important;
    rotate: 0deg !important;
    display: flex !important;
    align-items: center !important;
    gap: .3rem !important;
    /*flex: 1 1 0 !important;      /* take equal space */
    white-space: nowrap !important;
    background-color: transparent !important;
    border-radius: 4px !important;
  }
  .lil-button::before {
    width: 6vh!important;
    height: 6vh!important;
    background-color: #ffffff;
    border:2px solid black;
         rotate: 0deg;

  }
  .lil-button:hover { 
    color:#000000; 
  }
  .lil-button:hover::before { 
      background-color: #ffffff; 
      color:white;
  }

  #Bekker-button::before{
    box-shadow: 2px 3px 0px rgba(0,0,0,1);
  }
  #Paraf-button::before{
    box-shadow: -2px 3px 0px rgba(0,0,0,1);
  }


  /* 3) Bottom drawer: slide up 30vh above bar */
  .extra {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 10px !important;
    top: auto !important;
    width:100vw !important;
    height: 0 !important;                    /* closed */
    background: #fff !important;
    overflow: hidden !important;
    transition: height .28s ease !important;
    z-index: 99 !important;
    padding: 0 !important;
  }
  .extra.is-open { 
    border-top: grey solid 1px !important;
    height: 33vh !important;
    bottom: 7vh !important;
  }

  .grego, .parafrase {
    display: none !important;
    height: 100% !important;
    overflow-y: auto !important;
    
  }
  .grego.active, .parafrase.active { 
    display: block !important; 
  }


.select-wrapperL,
.select-wrapperR {
    position: static !important;
    top: auto !important; 
    left: auto !important;
    right: 0 !important;
    height: auto !important;
    display: grid !important;
    grid-auto-flow: row !important;
    grid-template-columns: 1fr !important; /* stack by default */
    align-items: stretch !important;
    gap: 0.75rem !important;
    background: transparent !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }
 .select-wrapperL {
        width: auto !important;

  }
.select-wrapperR
  {
    width: auto !important;

  }

  /* If your “right” wrapper contains the Bekker input + a button, use 1fr auto */
  #nav-drawer .select-wrapperR {
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
  }

  /* Inputs/selects full-width, no overflow */
  #nav-drawer select.menu,
  #nav-drawer input.bekker,
  #nav-drawer .menu,
  #nav-drawer .bekker {
    display: block !important;
    padding: 1rem .75rem !important;
    font-size: 1.25rem !important;
  }
#nav-drawer #bekker-search-button,
#nav-drawer .bekker
  {margin-top: 3vh !important;
  }
  /* Optional: search button beside the input (if you have one) */
  #nav-drawer .select-wrapperR button,
  #nav-drawer #bekker-search-button {
    justify-self: end !important;
    padding: 0 !important;
  }
  .select-wrapperR--desktop {
    display: none !important;
  }

}
/*==== HIDING BUTTONS =====*/
/* Hidden by default; revealed only after content injection */
.right-bar {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

/* Becomes visible when <body> gets .has-text */
body.has-text .right-bar {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

