/**
 * Copyright (c) Enalean, 2025-Present. All Rights Reserved.
 *
 * This file is a part of Tuleap.
 *
 * Tuleap is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
 */

.artidoc-add-new-section-container {
    opacity: 0;

    &:hover,
    &:focus-within {
        opacity: 1;
    }
}

.artidoc-section-with-add-button {
    &:hover,
    &:focus-within {
        // the previous button
        > .artidoc-add-new-section-container {
            opacity: 1;
        }

        // the next button
        + .artidoc-section-with-add-button > .artidoc-add-new-section-container {
            opacity: 1;
        }
    }
}

// the last button
.artidoc-sections-list:has(> .artidoc-section-with-add-button:last-child:hover),
.artidoc-sections-list:has(> .artidoc-section-with-add-button:last-child:focus-within) {
    + .artidoc-add-new-section-container {
        opacity: 1;
    }
}
