@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,500&display=swap');

/* ==========================================================================
   1. CSS VARIABLES & DESIGN TOKENS
   ========================================================================== */
:root {
  --bg-main: #b5be8a;
  --text-main: #2b331f;
  --header-footer-bg: #757d57;
  --card-dark: #1e2319;
  --white: #ffffff;

  --parchment: #efe8d3;
  --parchment-edge: #ddd3ae;
  --rule-line: rgba(43, 51, 31, 0.3);
  --ink-live: #8a3b2b;
  --ink-beta: #8a6a2b;
  --ink-dev: #5c5f3f;
}

/* ==========================================================================
   2. RESET & BASE STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding-top: 90px;
}

/* ==========================================================================
   3. UTILITY CLASSES (Selection blocking)
   ========================================================================== */
.no-select,
button, 
input[type="button"], 
input[type="submit"], 
input[type="reset"],
.role-btn,
.floating-qa-btn {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* ==========================================================================
   4. HEADER & NAVIGATION
   ========================================================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--header-footer-bg);
  border-bottom: 1px solid rgba(43, 51, 31, 0.15);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 40px;
}

.logo-sara {
  height: 40px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
}

.nav-links a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 10px;
  opacity: 0.8;
  display: inline-block;
  min-width: 110px;
  text-align: center;
  padding: 6px 12px;
  box-sizing: border-box;
  position: relative;
  transition: opacity 0.2s;
}

.nav-links a:hover,
.nav-links a.active-tab:hover {
  opacity: 1;
}

.nav-links a.active-tab {
  color: var(--bg-main);
  opacity: 0.8;
}

.nav-links a.active-tab::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  transform: translateX(-50%);
  width: 55%;
  height: 2px;
  background-color: var(--bg-main);
  border-radius: 1px;
}

.nav-link-main.active-tab::after {
  left: 12px;
  right: 12px;
  width: auto;
  transform: none;
}

.nav-dropdown a.active-tab::after {
  left: 18px;
  right: 18px;
  width: auto;
  transform: none;
}

/* ---------- Nav dropdown (Project Index) ---------- */

.nav-item {
  display: inline-flex;
  align-items: center;
  position: relative;
  min-width: 130px;
}

.nav-item .nav-link-main {
  margin-right: 0;
}

.nav-dropdown-toggle {
  background: none;
  border: none;
  color: var(--text-main);
  opacity: 0.8;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 6px 8px 6px 2px;
  margin-left: -8px;
  transition: opacity 0.2s, transform 0.2s ease;
}

.nav-dropdown-toggle:hover {
  opacity: 1;
}

.nav-item.dropdown-open .nav-dropdown-toggle {
  transform: rotate(180deg);
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 10px;
  min-width: 180px;
  background-color: var(--parchment);
  border: 1px solid var(--parchment-edge);
  border-radius: 4px;
  box-shadow: 0 12px 26px rgba(43, 51, 31, 0.35);
  padding: 6px 0;
  margin-top: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  z-index: 1001;
}

.nav-dropdown a {
  display: block;
  min-width: 0;
  text-align: left;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.9;
  padding: 8px 18px;
  margin: 0;
}

.nav-dropdown a:hover {
  opacity: 1;
  background-color: rgba(43, 51, 31, 0.08);
}

.nav-item.dropdown-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 100;
}

.hamburger span {
  width: 100%;
  height: 3px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.close-menu-btn {
  display: none;
}

/* ==========================================================================
   5. FOOTER
   ========================================================================== */
footer {
  width: 100%;
  background-color: var(--header-footer-bg);
  color: var(--text-main);
  padding: 30px 40px;
  border-top: 1px solid rgba(43, 51, 31, 0.15);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.footer-content {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-bottom-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  font-size: 0.95rem;
  font-weight: 600;
  padding-top: 15px;
}

.footer-links {
  justify-self: start;
  display: flex;
  gap: 20px;
}

.footer-copyright {
  justify-self: center;
  text-align: center;
}

.footer-rights {
  justify-self: end;
}

.footer-bottom-row a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-bottom-row a:hover {
  opacity: 1;
}

/* ==========================================================================
   6. UI COMPONENTS (Back-to-Top Button & Tooltips)
   ========================================================================== */
#backToTopBtn {
  position: fixed;
  bottom: calc(20px + 1.5cm);
  right: 30px;
  z-index: 99;
  background-color: rgba(44, 51, 37, 0.7);
  color: var(--bg-main);
  border: 1.5px solid rgba(181, 190, 138, 0.4);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

#backToTopBtn.visible {
  opacity: 0.35;
  visibility: visible;
}

#backToTopBtn:hover {
  opacity: 1;
  background-color: var(--bg-main);
  color: var(--card-dark);
  transform: translateY(-3px);
  border-color: var(--bg-main);
}

.note-card {
  overflow: visible; 
  z-index: 10;
}

.info-icon {
  position: relative;
  cursor: pointer;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--ink-live);
  color: var(--ink-live);
  background: transparent;
  font-size: 0.85rem;
  font-weight: bold;
  font-family: serif;
  font-style: italic;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  padding: 0;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  z-index: 1000;
}

.info-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 140%;
  left: 0;
  right: auto;
  z-index: 1001;
  width: 260px;
  max-width: calc(100vw - 60px);
  background-color: var(--parchment, #efe8d3);
  color: #212918;
  text-align: left;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1.5px solid var(--ink-live);
  font-size: 0.8rem;
  font-weight: normal;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.info-icon.active .info-tooltip {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

@media (hover: hover) {
  .info-icon:hover {
    transform: scale(1.1);
    background-color: var(--ink-live);
    color: var(--white);
  }

  .info-icon:hover .info-tooltip {
    visibility: visible;
    opacity: 1;
  }
}

@media screen and (max-width: 921px) {
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ==========================================================================
   7. RESPONSIVE MEDIA QUERIES (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 768px) {
  header {
    padding: 20px;
  }

  .hamburger {
    display: flex;
  }

  .header-spacer {
    display: none !important;
  }

  .nav-links {
    display: flex;
    position: absolute;
    top: 75px;
    left: 0;
    width: 100%;
    background-color: var(--parchment);
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    box-shadow: 0 14px 28px rgba(43, 51, 31, 0.28);
    z-index: 99;
    transition: max-height 0.35s ease-in-out, opacity 0.3s ease-in-out, padding 0.35s ease-in-out;
  }

  .nav-links.active {
    max-height: 560px;
    opacity: 1;
    visibility: visible;
    padding: 6px 0;
    border-bottom: 1px solid var(--parchment-edge);
  }

  .nav-links a {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    margin: 0;
    width: auto;
    text-align: left;
    padding: 15px 28px;
    background-color: transparent;
    border-radius: 0;
    border-bottom: 1px solid var(--rule-line);
    min-width: 0;
  }

  .nav-links a:last-of-type {
    border-bottom: none;
  }

  .nav-links a:active {
    background-color: rgba(43, 51, 31, 0.06);
  }

  .nav-links a.active-tab::after {
    content: none;
  }

  .nav-links a.active-tab {
    color: var(--text-main);
    font-weight: 700;
    background-color: rgba(138, 59, 43, 0.08);
  }

  .nav-links a.active-tab::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    background-color: var(--ink-live);
  }

  .nav-item {
    display: flex;
    align-items: center;
	flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--rule-line);
  }

  .nav-item:last-child {
    border-bottom: none;
  }

  .nav-item.active-tab {
    background-color: rgba(138, 59, 43, 0.08);
  }

  .nav-item.active-tab::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    background-color: var(--ink-live);
  }

  .nav-item .nav-link-main {
    display: block;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 15px 0;
    border-bottom: none;
    flex: 1;
	white-space: nowrap;
  }

  .nav-item .nav-link-main.active-tab {
    background: none;
  }

  .nav-item .nav-link-main.active-tab::before {
    content: none;
  }

  .nav-dropdown-toggle {
    font-size: 0.95rem;
    padding: 10px;
	margin-left: 0;
    order: -1;
  }

  .nav-dropdown {
    position: static;
    left: auto;
    display: block;
    width: 100%;
    background: none;
    border: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    margin-top: 0;
    transition: max-height 0.3s ease;
  }

  .nav-item.dropdown-open .nav-dropdown {
    max-height: 240px;
  }

  .nav-dropdown a {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 500;
    width: auto;
    text-align: left;
    font-size: 0.85rem;
    opacity: 0.85;
    padding: 12px 28px 12px 50px;
    margin: 0;
    background: none;
    border-radius: 0;
    border-bottom: 1px solid var(--rule-line);
  }

  .nav-dropdown a:last-child {
    border-bottom: none;
  }

  .footer-bottom-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .footer-links {
    justify-self: auto;
    justify-content: center;
  }

  .footer-rights {
    justify-self: auto;
  }
}