/* =====================================================================
   Inforlandia Digital Library — style.css
   Palette & type scale taken from the inforlandia.com global CSS
   (Elementor theme globals) and the official logo.
   ===================================================================== */

:root {
  /* Brand palette (inforlandia.com global colors) */
  --il-blue: #6EC1E4;        /* brand light blue  */
  --il-blue-deep: #1779A6;   /* accessible blue for text/links */
  --il-blue-deep-2: #115E80; /* hover */
  --il-blue-tint: #EDF5F9;   /* light blue surface */
  --il-green: #61CE70;       /* brand green (decorative) */
  --il-green-deep: #2F7D45;  /* accessible green for text */
  --il-green-tint: #EDF7F0;
  --il-red: #D71921;         /* logo red */
  --il-red-tint: #FBE9EA;

  /* Neutrals */
  --il-ink: #2E3338;         /* headings */
  --il-body: #54595F;        /* body text (site default) */
  --il-muted: #6E6E6E;       /* muted text (AA on white) */
  --il-line: #DCE4EA;
  --il-line-soft: #EDF2F6;
  --il-bg: #FFFFFF;
  --il-bg-soft: #F5F8FA;
  --il-header-bg: #222426;    /* inforlandia.com header bar */
  --il-header-red: #D71921;   /* header hover (site value) */

  /* Typography (site fonts: Roboto + Roboto Slab; Nunito is the
     inforlandia.com header menu font) */
  --font-sans: "Roboto", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-slab: "Roboto Slab", "Georgia", serif;
  --font-nav: "Nunito", "Roboto", "Segoe UI", Arial, sans-serif;

  /* Layout */
  --container: 1180px;
  --radius: 10px;
  --radius-sm: 6px;
  --header-h: 84px;
  --header-h-scrolled: 60px;
  --shadow-1: 0 1px 3px rgba(30, 41, 59, 0.08), 0 1px 2px rgba(30, 41, 59, 0.06);
  --shadow-2: 0 10px 30px rgba(30, 41, 59, 0.12);
  --focus-ring: 0 0 0 3px rgba(110, 193, 228, 0.45);
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
}

/* ------------------------------ Reset ------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--il-body);
  background: var(--il-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-slab);
  color: var(--il-ink);
  line-height: 1.25;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

a { color: var(--il-blue-deep); text-decoration: none; }
a:hover { color: var(--il-blue-deep-2); text-decoration: underline; }

img { max-width: 100%; display: block; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
}

svg { display: block; }

/* --------------------------- Utilities ----------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1000;
  padding: 10px 18px;
  background: var(--il-ink);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--il-blue-deep);
  outline-offset: 2px;
}

.icon { width: 20px; height: 20px; }

/* ============================== HEADER ============================== */
/* Mirrors the inforlandia.com header (see example3.png): a dark
   #222426 bar in two right-aligned rows —
   row 1: social icons, search and PT (right-aligned)
   row 2: logo on the left, main menu on the right
   Both rows sit in the same 1340px container, so they share the same
   right edge. Sticky; on scroll both rows change together under one
   .scrolled state: row 1 collapses to 0 height while the main row
   compresses to 60px, so the header height always matches its visible
   content (no empty gap). */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--il-header-bg);
}

.header-top,
.header-main {
  max-width: 1340px; /* inforlandia.com container width */
}

/* Top row — social, search and PT (right-aligned), vertically
   centred like example5.png. Collapses by animating its own height
   to 0 (border-box, so max-height: 0 also removes its padding) so the
   header never reserves space for hidden content. */
.header-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 7px;
  padding-bottom: 7px;
  max-height: 60px;
  overflow: hidden;
  transition: max-height 0.3s var(--ease), opacity 0.3s var(--ease);
}

/* Main row — logo left, menu right (flush with row 1's right edge) */
.header-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
  transition: min-height 0.3s var(--ease);
}
.site-header.scrolled .header-top { max-height: 0; opacity: 0; }
.site-header.scrolled .header-main { min-height: var(--header-h-scrolled); }

/* Logo — the original inforlandia.com logo (red "in" mark + white
   "forlandia" wordmark) as one transparent PNG, so the "in" box and
   the wordmark line up exactly like the site (see example4.png). */
.brand {
  display: inline-block;
  flex-shrink: 0;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  display: block;
  height: 40px;
  width: auto;
}

/* Social icons — same size as the search icon and the EN link so the
   whole top row is evenly and vertically centred (see example5.png).
   White → #e80404 on hover (site values). */
.social-list {
  display: flex;
  align-items: center;
  gap: 16px;
}
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: color 0.2s var(--ease);
}
.social-link svg { width: 18px; height: 18px; fill: currentColor; }
.social-link:hover {
  color: #e80404;
  text-decoration: none;
}

/* Search toggle — 18px white icon, same visual size as the social
   icons, on a transparent hit area (site values) */
.search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  transition: color 0.2s var(--ease);
}
.search-toggle:hover { color: #e80404; }
.search-toggle .icon { width: 18px; height: 18px; }

/* Language link (site switcher values: 600 weight, white → red) */
.lang-link {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff;
  /* Right padding matches the menu item right padding (21px) so the
     visible PT/EN text ends at the same x as the last menu item
     ("Suporte") — row 1's rightmost text lines up with row 2, like
     on inforlandia.com where the switcher and the menu share the
     same right column. */
  padding: 0 21px 0 14px;
  transition: color 0.2s var(--ease);
}
.lang-link:hover { color: var(--il-header-red); text-decoration: none; }

/* Main navigation (desktop) */
.main-nav { display: block; }

.nav-toggle { display: none; }

.main-menu { display: flex; align-items: center; gap: 4px; }
.main-menu a {
  display: inline-block;
  padding: 23px 21px; /* inforlandia.com nav item padding */
  font-family: var(--font-nav); /* Nunito, as on inforlandia.com */
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  transition: color 0.2s var(--ease);
}
.main-menu a:hover {
  color: var(--il-header-red);
  text-decoration: none;
}

/* The menu is right-aligned (flush with the container's right edge) at
   every viewport, so row 2 shares the same right boundary as row 1. */

/* Mobile menu toggle (hidden on desktop) */
.nav-toggle-box { display: none; }
.nav-toggle-label { display: none; }

/* ========================== SEARCH OVERLAY ========================= */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 22, 24, 0.97);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
  animation: overlay-in 0.25s var(--ease);
}
.search-overlay[hidden] { display: none; }

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.search-overlay-inner {
  width: 100%;
  max-width: 640px;
  padding: 0 24px;
  text-align: center;
}

.search-overlay-form {
  position: relative;
  display: flex;
  align-items: center;
}

.search-overlay-form input {
  width: 100%;
  padding: 14px 56px 14px 8px;
  font-family: inherit;
  font-size: 1.4rem;
  color: #fff;
  background: transparent;
  border: none;
  border-bottom: 3px solid rgba(255, 255, 255, 0.5);
  border-radius: 0;
}
.search-overlay-form input::placeholder { color: rgba(255, 255, 255, 0.55); }
.search-overlay-form input:focus { outline: none; border-bottom-color: var(--il-red); }

.search-overlay-close {
  position: absolute;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
}
.search-overlay-close:hover { color: #e80404; }

.search-overlay-note {
  margin-top: 18px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}


/* ============================ BREADCRUMBS =========================== */
.breadcrumbs {
  background: var(--il-bg-soft);
  border-bottom: 1px solid var(--il-line-soft);
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  font-size: 13px;
  color: var(--il-muted);
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumbs li + li::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--il-line);
}
.breadcrumbs a { color: var(--il-muted); font-weight: 500; }
.breadcrumbs a:hover { color: var(--il-blue-deep); }
.breadcrumbs li[aria-current="page"] { color: var(--il-ink); font-weight: 600; }

/* =============================== HERO ============================== */
.library-hero {
  position: relative;
  padding: 64px 0 56px;
  background:
    radial-gradient(1200px 300px at 85% -40%, rgba(110, 193, 228, 0.18), transparent 60%),
    radial-gradient(900px 260px at 8% -30%, rgba(97, 206, 112, 0.12), transparent 60%),
    linear-gradient(180deg, #FBFDFE 0%, var(--il-bg-soft) 100%);
  overflow: hidden;
}
.library-hero .container { max-width: 900px; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--il-blue-deep);
}
.hero-eyebrow::before {
  content: "";
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--il-blue), var(--il-green));
}

.hero-title {
  font-size: clamp(2.1rem, 4.5vw, 3.1rem);
  font-weight: 700;
  color: var(--il-ink);
  margin-bottom: 0.4em;
}

.hero-intro {
  max-width: 640px;
  font-size: 1.15rem;
  color: var(--il-body);
  margin-bottom: 0.8em;
}

.hero-supporting {
  max-width: 640px;
  font-size: 0.95rem;
  color: var(--il-muted);
  margin-bottom: 0;
}

.hero-divider {
  margin-top: 28px;
  width: 72px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--il-blue), var(--il-green));
}

/* =========================== LIBRARY AREA ========================== */
.library { padding: 48px 0 72px; }

.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 420px;
}
.search-box-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--il-muted);
  pointer-events: none;
}
.library-search {
  width: 100%;
  padding: 12px 44px 12px 42px;
  font-family: inherit;
  font-size: 15px;
  color: var(--il-ink);
  background: #fff;
  border: 1px solid var(--il-line);
  border-radius: 999px;
  box-shadow: var(--shadow-1);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.library-search::placeholder { color: var(--il-muted); }
.library-search:focus {
  outline: none;
  border-color: var(--il-blue-deep);
  box-shadow: var(--focus-ring);
}

.search-clear {
  position: absolute;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--il-muted);
}
.search-clear:hover { color: var(--il-ink); background: var(--il-bg-soft); }
.search-clear .icon { width: 16px; height: 16px; }

.library-count {
  margin: 0;
  font-size: 14px;
  color: var(--il-muted);
  white-space: nowrap;
}
.library-count strong { color: var(--il-ink); font-weight: 600; }


/* ============================= ACCORDION =========================== */
.accordion { display: block; }
.accordion.searching .acc-item { animation: none; }

.acc-item {
  background: #fff;
  border: 1px solid var(--il-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  margin-bottom: 14px;
  overflow: hidden;
  scroll-margin-top: 132px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.acc-item:hover { border-color: #C4D6E2; }
.acc-item.open {
  border-color: #B9D3E2;
  box-shadow: var(--shadow-2);
}
.acc-item.filtered-out { display: none; }

.acc-heading { margin: 0; }

.acc-trigger {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 20px;
  text-align: left;
  background: transparent;
  transition: background 0.2s var(--ease);
}
.acc-trigger:hover { background: var(--il-bg-soft); }
.acc-item.open .acc-trigger { background: #F7FBFD; }

.acc-title {
  flex: 1;
  font-family: var(--font-slab);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--il-ink);
  transition: color 0.2s var(--ease);
}
.acc-item.open .acc-title { color: var(--il-blue-deep); }

.acc-count {
  flex: 0 0 auto;
  min-width: 30px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--il-bg-soft);
  color: var(--il-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.acc-item.open .acc-count { background: var(--il-blue-tint); color: var(--il-blue-deep); }

.acc-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--il-line);
  border-radius: 50%;
  color: var(--il-muted);
  transition: transform 0.3s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.acc-icon svg { width: 14px; height: 14px; }
.acc-item.open .acc-icon {
  transform: rotate(45deg);
  border-color: var(--il-blue-deep);
  color: var(--il-blue-deep);
}

/* Smooth expand/collapse */
.acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease);
}
.acc-item.open .acc-panel { grid-template-rows: 1fr; }

.acc-panel-inner {
  overflow: hidden;
  min-height: 0;
  visibility: hidden;
  transition: visibility 0s 0.35s;
}
.acc-item.open .acc-panel-inner {
  visibility: visible;
  transition-delay: 0s;
}

/* Document rows */
.doc-list {
  border-top: 1px solid var(--il-line-soft);
  margin: 0;
}

.doc-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  transition: background 0.15s var(--ease);
}
.doc-row + .doc-row { border-top: 1px solid var(--il-line-soft); }
.doc-row:hover { background: #FAFCFD; }

.doc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 9px;
  background: var(--il-red-tint);
  color: var(--il-red);
}
.doc-icon svg { width: 30px; height: 30px; }

.doc-body { min-width: 0; }

.doc-title {
  margin: 0 0 4px;
  font-family: var(--font-sans);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--il-ink);
  line-height: 1.4;
}

.doc-desc {
  margin: 0 0 8px;
  font-size: 13.5px;
  color: var(--il-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doc-meta { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-year { background: var(--il-green-tint); color: var(--il-green-deep); }
.badge-type { background: var(--il-blue-tint); color: var(--il-blue-deep); }
.badge-external { background: var(--il-bg-soft); color: var(--il-muted); }

/* Open link button (blue) */
.doc-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.doc-action svg { width: 16px; height: 16px; flex: 0 0 auto; }
.doc-action:active { transform: translateY(1px); }

.doc-action-link {
  background: #fff;
  color: var(--il-blue-deep);
  border: 1.5px solid var(--il-blue-deep);
}
.doc-action-link:hover {
  background: var(--il-blue-tint);
  border-color: var(--il-blue-deep-2);
  color: var(--il-blue-deep-2);
  text-decoration: none;
}

/* Link not set yet in library-data.js — visible but inactive */
.doc-action-empty {
  opacity: 0.55;
  cursor: default;
}
.doc-action-empty:hover {
  background: #fff;
  border-color: var(--il-blue-deep);
  color: var(--il-blue-deep);
}

/* ------------------------ Empty / no results ----------------------- */
.no-results,
.library-empty {
  margin-top: 10px;
  padding: 56px 28px;
  text-align: center;
  background: #fff;
  border: 1.5px dashed var(--il-line);
  border-radius: var(--radius);
}
.no-results[hidden], .library-empty[hidden] { display: none; }

.no-results-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 18px;
  color: var(--il-blue);
}
.no-results-title { font-size: 1.35rem; margin-bottom: 0.4em; }
.no-results-text {
  max-width: 440px;
  margin: 0 auto 22px;
  color: var(--il-muted);
  font-size: 15px;
}
.no-results-text code {
  background: var(--il-bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-outline {
  background: #fff;
  color: var(--il-blue-deep);
  border: 1.5px solid var(--il-blue-deep);
}
.btn-outline:hover { background: var(--il-blue-tint); text-decoration: none; }


/* ============================== FOOTER ============================== */
/* (removed — the page intentionally has no footer, matching the
   current request; the site header styling above is the only
   inforlandia.com chrome on this page.) */


/* ============================ RESPONSIVE =========================== */

/* Hamburger menu below 1280px (the inline menu needs ~1130px to fit) */
@media (max-width: 1279px) {
  .main-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--il-header-bg);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
    padding: 8px 0;
  }
  .site-header.nav-open .main-menu { display: flex; }
  .main-menu a {
    display: block;
    padding: 13px 24px;
    color: #fff;
  }
  .main-menu a:hover { color: #e80404; }
  .main-menu li + li a { border-top: 1px solid rgba(255, 255, 255, 0.08); }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-sm);
    background: transparent;
  }
  .nav-toggle-box { display: flex; flex-direction: column; gap: 4px; }
  .nav-toggle-line {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: #fff;
    transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
  }
  .site-header.nav-open .nav-toggle-line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .site-header.nav-open .nav-toggle-line:nth-child(2) { opacity: 0; }
  .site-header.nav-open .nav-toggle-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

@media (max-width: 767px) {
  .social-list { display: none; }
  .header-top { gap: 4px; }

  .library-hero { padding: 44px 0 40px; }
  .hero-intro { font-size: 1.05rem; }
  .library { padding: 32px 0 56px; }

  .library-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { flex-basis: auto; }
  .library-count { text-align: left; }

  .acc-trigger { padding: 16px; gap: 10px; }
  .acc-title { font-size: 1.05rem; }
  .acc-count { display: none; }

  .doc-row {
    grid-template-columns: 46px minmax(0, 1fr);
    grid-template-areas:
      "icon body"
      "icon action";
    align-items: start;
    row-gap: 12px;
  }
  .doc-row .doc-icon { grid-area: icon; align-self: start; }
  .doc-row .doc-body { grid-area: body; }
  .doc-row .doc-action-wrap { grid-area: action; display: flex; }
  .doc-row .doc-action { width: 100%; justify-content: center; }
}

@media (max-width: 420px) {
  .brand-logo { height: 38px; }
}

/* ========================= REDUCED MOTION ========================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .acc-panel { transition: none; }
  .acc-panel-inner { transition: none; }
}

