:root {
    --vinho: #8d1728;
    --vinho-escuro: #6f0f1d;
    --vinho-claro: #b83a49;
    --azul: #1524b7;
    --azul-escuro: #101a82;
    --dourado: #d5a83f;
    --creme: #fff8ec;
    --fundo: #f6f7f9;
    --texto: #20242a;
    --muted: #667085;
    --borda: #e5e7eb;
    --branco: #fff;
    --sombra: 0 16px 42px rgba(31, 41, 55, .08);
    --radius: 16px;
    --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "Open Sans", Arial, Helvetica, sans-serif;
    color: var(--texto);
    background: #fff;
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
svg { width: 1em; height: 1em; fill: currentColor; }
.repo-container { width: min(var(--container), calc(100% - 40px)); margin: 0 auto; }
.narrow-container { max-width: 760px; }

/* Header */
.site-header { background: var(--branco); position: relative; z-index: 50; box-shadow: 0 1px 0 rgba(16,24,40,.08); }
.header-top { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 14px; min-width: 0; }
.brand img { width: 66px; height: 66px; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; justify-content: center; line-height: 1.1; min-width: 0; }
.university-name { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; font-family: "Open Sans", Arial, Helvetica, sans-serif; }
.university-word { color: #b73743; font-size: 21px; font-weight: 400; letter-spacing: -.025em; }
.wutiva-word { color: #1739a8; font-size: 21px; font-weight: 700; letter-spacing: -.025em; }
.repository-name { color: #b73743; font-size: 13px; font-weight: 500; margin-top: 5px; letter-spacing: .005em; text-transform: none; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.institution-link { font-size: 14px; color: #4b5563; font-weight: 600; }
.institution-link:hover { color: var(--vinho); }
.login-button { display: inline-flex; align-items: center; gap: 8px; background: var(--vinho); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; transition: .2s ease; }
.login-button:hover { background: var(--vinho-escuro); transform: translateY(-1px); }
.login-button svg { font-size: 18px; }
.menu-button { display: none; background: transparent; border: 0; padding: 8px; cursor: pointer; }
.menu-button span { display: block; width: 24px; height: 2px; background: var(--vinho); margin: 4px 0; }
.menu-button em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.main-nav {
    background: var(--branco);
    color: #30343a;
    border-top: 1px solid #f1f2f4;
    border-bottom: 1px solid #eceef1;
}
.nav-inner {
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-height: 54px;
    gap: 2px;
}
.nav-inner a {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 600;
    color: #34383f;
    white-space: nowrap;
    transition: color .18s ease;
}
.nav-inner a::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: -1px;
    height: 2px;
    background: var(--vinho);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .2s ease;
}
.nav-inner a:hover,
.nav-inner a.active {
    color: var(--vinho);
}
.nav-inner a:hover::after,
.nav-inner a.active::after {
    transform: scaleX(1);
}

/* Hero */
.hero-section { position: relative; min-height: 500px; display: flex; align-items: center; overflow: hidden; color: #fff; }
.hero-image { position: absolute; inset: 0; background: url('../img/campus-unitiva.jpg') center 51% / cover no-repeat; transform: scale(1.01); }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(45,8,15,.89) 0%, rgba(72,11,22,.73) 44%, rgba(7,17,52,.28) 100%); }
.hero-content { position: relative; z-index: 2; padding: 78px 0 82px; }
.hero-kicker, .eyebrow { display: inline-block; color: var(--vinho); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; }
.hero-kicker { color: #ffd881; margin-bottom: 10px; }
.hero-content h1 { max-width: 780px; margin: 0; font-family: "Open Sans", Arial, Helvetica, sans-serif; font-weight: 700; font-size: clamp(37px, 5vw, 62px); line-height: 1.05; letter-spacing: -.045em; text-shadow: 0 2px 22px rgba(0,0,0,.22); }
.hero-content > p { max-width: 720px; font-size: 19px; margin: 20px 0 29px; color: rgba(255,255,255,.91); }
.hero-search { max-width: 900px; min-height: 67px; background: #fff; border-radius: 12px; padding: 7px 7px 7px 20px; display: flex; align-items: center; box-shadow: 0 18px 45px rgba(0,0,0,.2); }
.hero-search svg { color: #7b8492; font-size: 25px; flex: 0 0 auto; }
.hero-search input { min-width: 0; flex: 1; height: 52px; border: 0; outline: 0; padding: 0 16px; color: #2f3742; font-size: 16px; }
.hero-search button { height: 52px; border: 0; border-radius: 9px; padding: 0 27px; background: var(--vinho); color: #fff; font-weight: 800; cursor: pointer; }
.hero-search button:hover { background: var(--vinho-escuro); }
.hero-links { display: flex; gap: 22px; margin-top: 20px; font-size: 14px; font-weight: 700; }
.hero-links a { border-bottom: 1px solid rgba(255,255,255,.55); }
.hero-links a:hover { color: #ffd881; border-color: #ffd881; }

/* Sections */
.section-block { padding: 76px 0; }
.soft-bg { background: var(--fundo); }
.section-heading { margin-bottom: 34px; }
.section-heading.centered { text-align: center; max-width: 760px; margin-left: auto; margin-right: auto; }
.section-heading h2 { margin: 7px 0 8px; font-size: clamp(29px, 3vw, 39px); line-height: 1.16; letter-spacing: -.035em; }
.section-heading p { color: var(--muted); margin: 0; font-size: 15px; }
.split-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.split-heading > div { max-width: 760px; }
.text-link { white-space: nowrap; color: var(--vinho); font-weight: 800; font-size: 14px; }
.text-link span { margin-left: 5px; }

/* Explore */
.explore-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.explore-card { border: 1px solid var(--borda); border-radius: var(--radius); padding: 25px 22px; min-height: 190px; background: #fff; display: flex; flex-direction: column; transition: .22s ease; }
.explore-card:hover { transform: translateY(-4px); box-shadow: var(--sombra); border-color: rgba(141,23,40,.28); }
.icon-wrap { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: #f9edef; color: var(--vinho); margin-bottom: 20px; }
.icon-wrap svg { font-size: 25px; }
.explore-card strong { font-size: 16px; margin-bottom: 7px; }
.explore-card > span:last-child { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Communities */
.community-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.community-card { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--borda); border-radius: var(--radius); padding: 28px; min-height: 270px; display: flex; flex-direction: column; }
.community-topline { position: absolute; height: 4px; top: 0; left: 0; right: 0; background: linear-gradient(90deg, var(--vinho), var(--azul)); }
.community-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: var(--azul); background: #eef0ff; margin-bottom: 18px; }
.community-icon svg { font-size: 24px; }
.community-card h3 { margin: 0 0 9px; font-size: 19px; }
.community-card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.community-meta { border-top: 1px solid var(--borda); padding-top: 17px; margin-top: 22px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.community-meta a { color: var(--vinho); font-weight: 800; }

/* Publications */
.publication-list { border-top: 1px solid var(--borda); }
.publication-item { display: grid; grid-template-columns: 145px 1fr 42px; gap: 28px; align-items: start; padding: 27px 0; border-bottom: 1px solid var(--borda); }
.publication-type, .result-badge, .record-type { color: var(--vinho); background: #f9edef; border-radius: 999px; padding: 6px 11px; width: fit-content; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.publication-body h3 { margin: -3px 0 5px; font-size: 20px; line-height: 1.35; }
.publication-body h3 a:hover, .search-result-card h3 a:hover { color: var(--vinho); }
.authors, .result-authors { color: var(--azul-escuro); font-weight: 700; margin: 0 0 7px; font-size: 14px; }
.abstract { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.publication-meta, .result-meta { display: flex; flex-wrap: wrap; gap: 9px 15px; color: #687180; font-size: 12px; }
.publication-meta span + span::before { content: "•"; margin-right: 15px; color: #a3a9b3; }
.publication-arrow { width: 38px; height: 38px; border: 1px solid var(--borda); border-radius: 50%; display: grid; place-items: center; color: var(--vinho); font-size: 20px; }
.publication-arrow:hover { background: var(--vinho); color: #fff; border-color: var(--vinho); }

/* Statistics */
.stats-section { background: linear-gradient(100deg, var(--vinho-escuro), var(--vinho) 62%, #9f2033); color: #fff; }
.stats-grid { min-height: 178px; display: grid; grid-template-columns: repeat(6, 1fr); align-items: center; }
.stat-item { text-align: center; padding: 20px 14px; position: relative; }
.stat-item + .stat-item::before { content: ""; position: absolute; left: 0; top: 28%; bottom: 28%; width: 1px; background: rgba(255,255,255,.2); }
.stat-item strong { display: block; font-size: 33px; line-height: 1; margin-bottom: 10px; }
.stat-item span { font-size: 12px; color: rgba(255,255,255,.82); text-transform: uppercase; letter-spacing: .04em; }

/* Institution */
.institution-grid { display: grid; grid-template-columns: 1.45fr .55fr; gap: 70px; align-items: center; }
.institution-copy h2 { font-size: clamp(31px, 3.2vw, 44px); margin: 8px 0 18px; line-height: 1.13; letter-spacing: -.04em; }
.institution-copy p { color: var(--muted); max-width: 760px; }
.institution-mark { display: grid; place-items: center; border-left: 1px solid var(--borda); min-height: 280px; }
.institution-mark img { width: min(260px, 90%); height: auto; }
.primary-button, .secondary-button { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 0 20px; border-radius: 8px; font-size: 14px; font-weight: 800; }
.primary-button { background: var(--vinho); color: #fff; margin-top: 12px; }
.primary-button:hover { background: var(--vinho-escuro); }
.secondary-button { background: #fff; color: var(--vinho); border: 1px solid #d9bec3; }

/* Page hero */
.page-hero { background: linear-gradient(100deg, var(--vinho-escuro), var(--vinho)); color: #fff; }
.compact-hero { padding: 52px 0 57px; }
.page-hero .eyebrow.light { color: #ffd881; }
.page-hero h1 { font-size: clamp(33px, 4vw, 48px); line-height: 1.1; margin: 8px 0 10px; letter-spacing: -.04em; }
.page-hero p { max-width: 760px; margin: 0; color: rgba(255,255,255,.86); }
.inner-search { max-width: 810px; display: flex; margin-top: 25px; padding: 5px; background: #fff; border-radius: 9px; }
.inner-search input { flex: 1; min-width: 0; height: 48px; border: 0; outline: 0; padding: 0 14px; }
.inner-search button { border: 0; border-radius: 7px; background: var(--azul); color: #fff; font-weight: 800; padding: 0 22px; cursor: pointer; }
.breadcrumb { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; color: rgba(255,255,255,.8); margin-bottom: 16px; }
.breadcrumb a:hover { color: #fff; text-decoration: underline; }

/* Search */
.search-layout { display: grid; grid-template-columns: 280px 1fr; gap: 42px; align-items: start; }
.filters-panel { position: sticky; top: 20px; border: 1px solid var(--borda); border-radius: 14px; overflow: hidden; background: #fff; }
.filters-title { display: flex; justify-content: space-between; align-items: center; padding: 17px 18px; border-bottom: 1px solid var(--borda); background: #fafafa; }
.filters-title strong { font-size: 14px; }
.filters-title a { color: var(--vinho); font-size: 12px; font-weight: 700; }
.filters-form { padding: 18px; }
.filters-form label { display: block; font-size: 12px; font-weight: 800; margin-bottom: 16px; color: #404652; }
.filters-form select, .filters-form input { width: 100%; border: 1px solid #d7dbe1; border-radius: 7px; min-height: 41px; margin-top: 6px; padding: 7px 9px; background: #fff; color: #303640; }
.filter-button { width: 100%; border: 0; min-height: 43px; border-radius: 7px; background: var(--vinho); color: #fff; font-weight: 800; cursor: pointer; }
.results-head { display: flex; align-items: end; justify-content: space-between; gap: 22px; border-bottom: 1px solid var(--borda); padding-bottom: 17px; margin-bottom: 2px; }
.results-head h2 { margin: 5px 0 0; font-size: 25px; }
.sort-form label { font-size: 12px; font-weight: 700; color: var(--muted); }
.sort-form select { display: block; margin-top: 5px; border: 1px solid #d7dbe1; border-radius: 7px; min-height: 38px; padding: 0 9px; background: #fff; }
.search-result-card { padding: 27px 0; border-bottom: 1px solid var(--borda); }
.search-result-card h3 { margin: 10px 0 5px; font-size: 21px; line-height: 1.35; }
.search-result-card > p { color: var(--muted); font-size: 14px; margin: 10px 0; }
.result-meta span { background: #f7f7f8; border-radius: 6px; padding: 5px 8px; }
.keywords { margin-top: 10px; font-size: 12px; color: var(--muted); }
.result-link { display: inline-block; margin-top: 13px; color: var(--vinho); font-weight: 800; font-size: 13px; }
.notice-box { border: 1px solid #ecd8a9; background: #fff9e8; color: #6d5320; padding: 14px 16px; border-radius: 8px; margin: 16px 0; font-size: 13px; }
.pagination-wrap { display: flex; justify-content: space-between; align-items: center; padding-top: 26px; font-size: 13px; }
.pagination-wrap a { color: var(--vinho); font-weight: 800; }
.page-disabled { color: #a0a7b1; }

/* Directory */
.community-directory { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.directory-card { border: 1px solid var(--borda); border-radius: var(--radius); padding: 25px; display: grid; grid-template-columns: 54px 1fr; gap: 17px; background: #fff; }
.directory-card.is-child { margin-left: 26px; background: #fbfbfc; }
.directory-icon { width: 50px; height: 50px; border-radius: 13px; background: #f9edef; color: var(--vinho); display: grid; place-items: center; }
.directory-icon svg { font-size: 25px; }
.directory-content h2 { margin: 3px 0 6px; font-size: 19px; }
.directory-content p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.parent-name { font-size: 11px; color: var(--azul); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.directory-count { font-size: 12px; font-weight: 700; color: var(--vinho); }
.collection-layout { display: grid; grid-template-columns: 280px 1fr; gap: 42px; align-items: start; }
.collection-info { border: 1px solid var(--borda); border-radius: 14px; padding: 22px; }
.collection-info h2 { font-size: 20px; margin: 6px 0 20px; }
.collection-info dl, .metadata-card dl { margin: 0; }
.collection-info dt, .metadata-card dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; margin-top: 14px; }
.collection-info dd, .metadata-card dd { margin: 3px 0 0; font-size: 13px; }

/* Record */
.record-header { background: #f8f2f3; border-bottom: 1px solid #eadfe1; padding: 45px 0 47px; }
.record-header .breadcrumb { color: #7d6570; }
.record-header .breadcrumb a:hover { color: var(--vinho); }
.record-header h1 { max-width: 930px; margin: 13px 0 8px; font-size: clamp(31px, 4vw, 45px); line-height: 1.13; letter-spacing: -.04em; }
.record-authors { margin: 0; color: var(--azul-escuro); font-size: 16px; font-weight: 700; }
.record-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
.record-section { padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--borda); }
.record-section h2 { font-size: 20px; margin: 0 0 14px; }
.record-section p { color: #4d5560; white-space: pre-line; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list a { background: #f4f5f7; border: 1px solid #e3e5e8; border-radius: 999px; padding: 6px 10px; font-size: 12px; color: #48505b; }
.file-list { display: grid; gap: 10px; }
.file-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--borda); border-radius: 10px; padding: 13px 15px; }
.file-icon { width: 44px; height: 44px; border-radius: 8px; background: #f9edef; color: var(--vinho); display: grid; place-items: center; font-size: 10px; font-weight: 900; }
.file-copy { display: flex; flex-direction: column; min-width: 0; }
.file-copy strong { font-size: 13px; overflow-wrap: anywhere; }
.file-copy span { color: var(--muted); font-size: 11px; }
.file-row > a { color: var(--vinho); font-size: 12px; font-weight: 800; }
.metadata-card { border: 1px solid var(--borda); border-radius: 14px; padding: 22px; }
.metadata-card h2 { font-size: 18px; margin: 0 0 12px; }
.metadata-card a { color: var(--vinho); font-weight: 700; }
.metric-card { display: grid; grid-template-columns: 1fr 1fr; margin-top: 16px; border-radius: 14px; overflow: hidden; background: var(--vinho); color: #fff; }
.metric-card div { padding: 18px 12px; text-align: center; }
.metric-card div + div { border-left: 1px solid rgba(255,255,255,.18); }
.metric-card strong { display: block; font-size: 23px; }
.metric-card span { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }

/* Empty and login */
.empty-state { border: 1px dashed #ccd1d8; background: #fbfbfc; border-radius: 14px; padding: 34px; text-align: center; color: var(--muted); }
.empty-state.wide { grid-column: 1 / -1; }
.empty-state strong { display: block; color: #3e4651; font-size: 16px; margin: 8px 0 5px; }
.empty-state p { margin: 0; font-size: 13px; }
.empty-icon { width: 45px; height: 45px; border-radius: 50%; background: #f9edef; color: var(--vinho); display: grid; place-items: center; margin: auto; font-weight: 900; }
.login-placeholder { text-align: center; border: 1px solid var(--borda); border-radius: 18px; padding: 48px; box-shadow: var(--sombra); }
.login-placeholder img { width: 110px; }
.login-placeholder h2 { font-size: 27px; margin: 16px 0 7px; }
.login-placeholder p { color: var(--muted); max-width: 600px; margin: 0 auto 22px; }
.placeholder-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* Footer */
.site-footer { background: #7f1021; color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.35fr .65fr .8fr; gap: 60px; padding-top: 55px; padding-bottom: 48px; }
.footer-brand img { width: 78px; height: 78px; object-fit: contain; float: left; margin-right: 16px; }
.footer-brand > div { padding-top: 9px; display: flex; flex-direction: column; }
.footer-brand strong { font-size: 18px; }
.footer-brand span { font-size: 12px; color: #ffd881; text-transform: uppercase; font-weight: 800; letter-spacing: .04em; }
.footer-brand p { clear: both; padding-top: 19px; max-width: 470px; color: rgba(255,255,255,.78); font-size: 13px; }
.footer-column { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: rgba(255,255,255,.8); }
.footer-column h3 { color: #fff; font-size: 14px; margin: 0 0 7px; }
.footer-column a:hover { color: #ffd881; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.13); }
.footer-bottom .repo-container { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: rgba(255,255,255,.64); font-size: 11px; }


/* Ligações adicionais visíveis apenas no menu móvel */
.nav-inner .mobile-nav-divider,
.nav-inner .mobile-nav-extra { display: none; }

@media (max-width: 980px) {
    .explore-grid { grid-template-columns: repeat(2, 1fr); }
    .community-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(3, 1fr); padding: 15px 0; }
    .stat-item:nth-child(4)::before { display: none; }
    .institution-grid { grid-template-columns: 1fr; gap: 25px; }
    .institution-mark { border-left: 0; border-top: 1px solid var(--borda); padding-top: 30px; min-height: 220px; }
    .search-layout, .collection-layout { grid-template-columns: 1fr; }
    .filters-panel { position: static; }
    .record-layout { grid-template-columns: 1fr; }
    .record-sidebar { order: -1; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .repo-container { width: min(100% - 28px, var(--container)); }
    .header-top { min-height: 78px; }
    .brand img { width: 53px; height: 53px; }
    .university-name { gap: 5px; }
    .university-word, .wutiva-word { font-size: 16px; }
    .repository-name { font-size: 10px; margin-top: 4px; }
    .institution-link, .login-button { display: none; }
    .menu-button { display: block; }
    .main-nav { display: none; }
    .main-nav.is-open { display: block; }
    .nav-inner { flex-direction: column; align-items: stretch; padding: 7px 0; gap: 0; }
    .nav-inner a { min-height: 43px; padding: 0 15px; }
    .nav-inner a::after { left: 15px; right: auto; bottom: 4px; width: 34px; transform-origin: left; }
    .nav-inner a:hover, .nav-inner a.active { color: var(--vinho); }
    .mobile-nav-divider { display: block; height: 1px; background: var(--borda); margin: 6px 15px; }
    .nav-inner .mobile-nav-extra { display: flex; color: var(--vinho); font-weight: 600; }
    .nav-inner .mobile-nav-extra::after { display: none; }
    .nav-inner .mobile-login-link { font-weight: 700; }
    .hero-section { min-height: 540px; }
    .hero-content { padding: 58px 0; }
    .hero-content h1 { font-size: 38px; }
    .hero-content > p { font-size: 16px; }
    .hero-search { align-items: stretch; flex-wrap: wrap; padding: 8px; }
    .hero-search svg { display: none; }
    .hero-search input { flex-basis: 100%; padding: 0 8px; }
    .hero-search button { width: 100%; }
    .hero-links { flex-direction: column; gap: 8px; align-items: flex-start; }
    .section-block { padding: 56px 0; }
    .split-heading { align-items: start; flex-direction: column; gap: 14px; }
    .explore-grid, .community-grid, .community-directory { grid-template-columns: 1fr; }
    .directory-card.is-child { margin-left: 0; }
    .publication-item { grid-template-columns: 1fr; gap: 12px; }
    .publication-arrow { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-item:nth-child(odd)::before { display: none; }
    .stat-item:nth-child(4)::before { display: block; }
    .results-head { align-items: stretch; flex-direction: column; }
    .sort-form select { width: 100%; }
    .file-row { grid-template-columns: 45px 1fr; }
    .file-row > a { grid-column: 2; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .footer-brand { grid-column: auto; }
    .footer-bottom .repo-container { flex-direction: column; justify-content: center; text-align: center; padding: 12px 0; }
}

@media (max-width: 430px) {
    .brand-copy strong { font-size: 15px; }
    .brand-copy span { font-size: 9px; }
    .hero-content h1 { font-size: 33px; }
    .explore-card { min-height: 165px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-item strong { font-size: 28px; }
}

/* ============================================================
   Navegação pública expansível
   ============================================================ */
.browse-section {
    background: #f4f5f7;
    padding-top: 38px;
    padding-bottom: 38px;
}

.browse-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.browse-panel {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(21, 31, 43, .07);
    overflow: hidden;
}

.browse-panel summary {
    min-height: 48px;
    padding: 0 12px 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    list-style: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: #1e2630;
    user-select: none;
}

.browse-panel summary::-webkit-details-marker { display: none; }

.browse-toggle {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 50%;
    background: var(--institucional, #9b1c2d);
    position: relative;
}

.browse-toggle::before,
.browse-toggle::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
    border-radius: 1px;
}

.browse-toggle::before { width: 10px; height: 2px; }
.browse-toggle::after { width: 2px; height: 10px; transition: opacity .18s ease; }
.browse-panel[open] .browse-toggle::after { opacity: 0; }

.browse-content {
    border-top: 1px solid #edf0f2;
    background: #fff;
}

.browse-row {
    min-height: 37px;
    padding: 8px 12px 8px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: #4b5562;
    font-size: 13px;
    border-bottom: 1px solid #edf0f2;
    transition: background-color .16s ease, color .16s ease;
}

.browse-row:last-child { border-bottom: 0; }

.browse-row:hover {
    background: #faf6f7;
    color: var(--institucional, #9b1c2d);
}

.browse-row > span {
    min-width: 0;
    line-height: 1.35;
}

.browse-row strong {
    min-width: 25px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    background: #f1f3f5;
    color: #415064;
    font-size: 12px;
    font-weight: 700;
}

.browse-empty {
    padding: 13px 15px;
    color: #7b8490;
    font-size: 12px;
}

@media (max-width: 900px) {
    .browse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .browse-section { padding-top: 24px; padding-bottom: 24px; }
    .browse-grid { grid-template-columns: 1fr; gap: 12px; }
    .browse-panel summary { min-height: 46px; }
}


/* Ajustes da Home: Publicações Recentes */
.recent-section .recent-title {
    margin-top: 0;
    font-size: clamp(25px, 2.3vw, 32px);
}

/* Página própria de Estatísticas */
.statistics-page { padding: 58px 0 76px; background: #f7f8fa; }
.statistics-page .stats-grid {
    min-height: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.statistics-page .stat-item {
    background: #fff;
    border: 1px solid var(--borda);
    border-radius: 10px;
    padding: 30px 22px;
    text-align: left;
}
.statistics-page .stat-item + .stat-item::before { display: none; }
.statistics-page .stat-item strong {
    color: var(--vinho);
    font-size: 34px;
    margin-bottom: 8px;
}
.statistics-page .stat-item span {
    color: #555f6c;
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
}
@media (max-width: 760px) {
    .statistics-page .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
    .statistics-page .stats-grid { grid-template-columns: 1fr; }
}


/* ============================================================
   Ajustes finais das páginas internas
   ============================================================ */
.compact-hero { padding: 42px 0 46px; }
.page-hero h1 {
    font-size: clamp(30px, 3.5vw, 42px);
    margin: 5px 0 7px;
    line-height: 1.12;
}
.page-hero p {
    max-width: 680px;
    font-size: 14px;
    line-height: 1.55;
}
.breadcrumb {
    margin-bottom: 10px;
    font-size: 11px;
}
.section-heading h2 { font-size: clamp(27px, 2.8vw, 36px); }
.section-heading p { font-size: 14px; }
.results-head h2 { font-size: 23px; }
.record-header { padding: 40px 0 42px; }
.record-header h1 { font-size: clamp(29px, 3.5vw, 41px); }
.record-authors { font-size: 15px; }
.record-section h2 { font-size: 19px; }
.collection-info h2 { font-size: 19px; }
.recent-section .recent-title { font-size: clamp(24px, 2.2vw, 30px); }

/* Página de Ajuda */
.help-page { background: #fff; }
.help-layout { max-width: 920px; }
.help-intro { margin-bottom: 24px; }
.help-intro h2 { margin: 0 0 7px; font-size: 23px; line-height: 1.25; }
.help-intro p { margin: 0; color: var(--muted); font-size: 14px; }
.help-list { border-top: 1px solid var(--borda); }
.help-list details { border-bottom: 1px solid var(--borda); }
.help-list summary {
    position: relative;
    list-style: none;
    cursor: pointer;
    padding: 18px 38px 18px 0;
    font-size: 15px;
    font-weight: 700;
    color: #303640;
}
.help-list summary::-webkit-details-marker { display: none; }
.help-list summary::after {
    content: '+';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--vinho);
    font-size: 20px;
    font-weight: 600;
}
.help-list details[open] summary::after { content: '−'; }
.help-list details p {
    margin: -3px 0 18px;
    max-width: 800px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

@media (max-width: 760px) {
    .compact-hero { padding: 34px 0 38px; }
    .page-hero h1 { font-size: 29px; }
    .page-hero p { font-size: 13px; }
    .record-header { padding: 34px 0 36px; }
}

/* ============================================================
   Página de acesso
   ============================================================ */
.login-page {
    background: var(--fundo);
    padding-top: 58px;
    padding-bottom: 64px;
}

.login-card {
    width: min(100%, 520px);
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--borda);
    border-radius: 14px;
    box-shadow: 0 12px 34px rgba(31, 41, 55, .07);
    overflow: hidden;
}

.login-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 26px 28px 22px;
    border-bottom: 1px solid #eef0f3;
}

.login-card-header img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    flex: 0 0 auto;
}

.login-card-header h2 {
    margin: 0 0 4px;
    font-size: 20px;
    line-height: 1.25;
    color: #2f343b;
}

.login-card-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.login-form {
    padding: 26px 28px 28px;
}

.login-field {
    margin-bottom: 19px;
}

.login-field label {
    display: block;
    margin-bottom: 7px;
    color: #3b414a;
    font-size: 13px;
    font-weight: 700;
}

.login-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.login-label-row label {
    margin-bottom: 7px;
}

.forgot-password {
    margin-bottom: 7px;
    color: var(--vinho);
    font-size: 12px;
    font-weight: 700;
}

.forgot-password:hover {
    text-decoration: underline;
}

.login-field input {
    width: 100%;
    height: 46px;
    border: 1px solid #d7dbe1;
    border-radius: 8px;
    background: #fff;
    padding: 0 13px;
    outline: none;
    color: #2f343b;
    font-size: 14px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.login-field input::placeholder {
    color: #9aa1ac;
}

.login-field input:focus {
    border-color: rgba(141, 23, 40, .65);
    box-shadow: 0 0 0 3px rgba(141, 23, 40, .08);
}

.login-submit {
    width: 100%;
    min-height: 47px;
    border: 0;
    border-radius: 8px;
    background: var(--vinho);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: background .18s ease;
}

.login-submit:hover {
    background: var(--vinho-escuro);
}

.login-card-footer {
    padding: 14px 28px 16px;
    border-top: 1px solid #eef0f3;
    background: #fafafa;
    text-align: center;
    color: #747d89;
    font-size: 11px;
}

@media (max-width: 600px) {
    .login-page {
        padding-top: 38px;
        padding-bottom: 44px;
    }

    .login-card-header {
        padding: 22px 20px 19px;
    }

    .login-card-header img {
        width: 50px;
        height: 50px;
    }

    .login-card-header h2 {
        font-size: 18px;
    }

    .login-form {
        padding: 22px 20px 24px;
    }

    .login-label-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0;
    }

    .forgot-password {
        order: 2;
        margin-top: -2px;
    }

    .login-card-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Mensagem de autenticação */
.login-alert {
    margin: 0 0 18px;
    padding: 10px 12px;
    border: 1px solid #f0c5ca;
    border-radius: 7px;
    background: #fff1f3;
    color: #8d1728;
    font-size: 12px;
    line-height: 1.5;
}

/* Estatísticas detalhadas */
.stats-detail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-top:24px}
.stats-popular-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:18px}
.stats-detail-card{background:#fff;border:1px solid #e3e6ea;border-radius:10px;padding:18px 20px;box-shadow:0 4px 14px rgba(25,35,45,.03)}
.stats-detail-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:12px;border-bottom:1px solid #edf0f2}.stats-detail-head h2{margin:0;font-size:14px;color:#303942}.stats-detail-head span{font-size:9px;color:#7d8791}
.stats-ranking{display:flex;flex-direction:column}.stats-ranking-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:10px 0;border-bottom:1px solid #edf0f2}.stats-ranking-row:last-child{border-bottom:0}.stats-ranking-row span{min-width:0;font-size:11px;color:#505a65}.stats-ranking-row strong{font-size:12px;color:var(--vinho)}
.stats-publication-list{display:flex;flex-direction:column}.stats-publication-list a{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:11px 0;border-bottom:1px solid #edf0f2;text-decoration:none}.stats-publication-list a:last-child{border-bottom:0}.stats-publication-list a:hover span{color:var(--vinho)}.stats-publication-list span{font-size:10px;line-height:1.45;color:#48525d;transition:.15s}.stats-publication-list strong{flex:0 0 auto;font-size:11px;color:var(--vinho)}.stats-empty{margin:0;padding:15px 0;font-size:10px;color:#7b8490}
@media(max-width:920px){.stats-detail-grid{grid-template-columns:1fr 1fr}.stats-detail-grid .stats-detail-card:last-child{grid-column:1/-1}}
@media(max-width:700px){.stats-detail-grid,.stats-popular-grid{grid-template-columns:1fr}.stats-detail-grid .stats-detail-card:last-child{grid-column:auto}.stats-detail-card{padding:15px}.stats-detail-head h2{font-size:13px}}
