/* ================================================
   Community List Page – community-list.css
   ================================================ */

/* Same look as /show-communities (communities.css): cream line-pattern
   background, dark text breadcrumb/title, dark "glass" boxes with the switcher
   look (--sw-* in stylesUGCnew.css) - transparent rows with white bold text,
   light veil on hover, open category = darker block + shadow. The accordion
   structure of the list is kept. */

/* ---- Page background (as communities.css) ---- */
#page_content {
    background: #fdf5ec url('../../image/home/new-icreate-imgs/communities_bgr.jpg') center top / cover no-repeat;
    background-image: image-set(url('../../image/home/new-icreate-imgs/communities_bgr.webp') type("image/webp"), url('../../image/home/new-icreate-imgs/communities_bgr.jpg') type("image/jpeg"));
}
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
    #page_content { background-attachment: fixed; }
}

#inner_content,
#inner_content.wrap {
    width: 100% !important;
    max-width: none !important;
    display: block !important;
    background-color: transparent !important;
    /* side inset of the breadcrumb, the page head and the content: --page-inset (stylesUGCnew.css) */
    padding: 0 var(--page-inset);
    box-sizing: border-box;
}

.wrap { background-color: transparent; }

/* ---- Page wrapper ---- */
.community-list-page {
    padding: 0 0 clamp(60px, 5vw, 90px);
}

/* ---- Header row (layout: .page-head in stylesUGCnew.css) ---- */
.communities-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Breadcrumb (layout/location-bar.jsp): dark on the cream background */
p.locationBar {
    margin-left: 0;
    margin-right: 0;
}

.locationBar,
.locationBar a {
    color: #3b3633 !important;
    text-shadow: none !important;
}

.locationBar a {
    text-decoration: none;
    /* underline as an inset shadow: a border made the breadcrumb row 1px taller than on the other pages */
    box-shadow: inset 0 -1px 0 transparent;
    transition: box-shadow 0.2s;
}

.locationBar a:hover {
    box-shadow: inset 0 -1px 0 currentColor;
}

.communities-title {
    font-weight: 700;
    color: #3b3633;
}

/* ---- List wrapper ---- */
.wrapperBox {
    width: 100%;
    padding: 0;
    margin-top: 0;
    background-color: transparent;
    border-radius: 0;
    text-align: left;
    font-size: inherit;
    color: inherit;
    box-sizing: border-box;
}

.wrapperBox > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 1.5vw, 20px);
}

/* ---- Category (L0): glass box ---- */
.communityLink {
    list-style-type: none !important;
    margin: 0;
    padding: 6px;
    background: var(--sw-glass-bg);
    border: var(--sw-glass-border);
    border-radius: 14px;
    box-shadow: var(--sw-glass-shadow);
    color: #fff;
}

/* Category row: like .cm-switch-link */
.communityLink > strong {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 8px 10px 8px 14px;
    border-radius: 8px;
    font-size: clamp(16px, 1.3vw, 19px);
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    transition: background 0.15s;
}

.communityLink > strong:hover {
    background: var(--sw-hover-bg);
}

/* Open category = selected row */
.communityLink:not(.collapsed) > strong:has(.cl-toggle) {
    background: var(--sw-selected-bg);
    box-shadow: var(--sw-selected-shadow);
}

.communityLink > strong a {
    color: #fff !important;
    text-decoration: none;
}

.communityLink > strong a:hover {
    text-decoration: underline;
}

.communityStrength {
    font-size: 0.85em;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
}

/* ---- Open / close button ---- */
.cl-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: #fff;
    font-size: 0.85em;
    line-height: 1;
    border-radius: 6px;
    transition: background 0.15s, transform 0.25s;
}

.cl-toggle:hover { background: var(--sw-hover-bg); }

.communityLink.collapsed > strong .cl-toggle {
    transform: rotate(-90deg);
}

@media (prefers-reduced-motion: reduce) {
    .cl-toggle { transition: none; }
}

/* ---- Collapsed state ---- */
.communityLink.collapsed > ul {
    display: none;
}

/* ---- Collections (L1) inside an open category ---- */
.communityLink > ul {
    list-style: none;
    margin: 0;
    padding: 6px 4px 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* one level deeper: indented under its parent row */
.communityLink .communityLink > ul {
    background: rgba(0, 0, 0, 0.2);
    border-radius: inherit;
    padding-left: 24px;
}

.communityLink > ul:empty,
.communityLink > ul:not(:has(li)) {
    display: none;
}

.communityLink > br {
    display: none;
}

.collectionListItem {
    font-size: clamp(14px, 1vw, 15px);
    font-weight: 700;
    padding: 0;
    color: #fff;
}

.collectionListItem a {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 8px;
    color: #fff !important;
    text-decoration: none;
    transition: background 0.15s;
}

.collectionListItem a:hover {
    background: var(--sw-hover-bg);
    text-decoration: underline;
}

/* ---- Sub-categories (recursive) ---- */
.communityLink .communityLink {
    margin: 2px 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.communityLink .communityLink > a {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: clamp(14px, 1.1vw, 16px);
    font-weight: 700;
    color: #fff !important;
    text-decoration: none;
}

/* sub-category row: same switcher row, a size smaller */
.communityLink .communityLink > strong {
    min-height: 40px;
    padding: 6px 8px 6px 24px;
    font-size: clamp(14px, 1.1vw, 16px);
}

.collectionListItem a {
    max-width: 100%;
    box-sizing: border-box;
}

.communityLink .communityLink > a:hover {
    background: var(--sw-hover-bg);
    text-decoration: underline;
}

/* school year never split over two lines (wrapped by community-list.jsp) */
.cl-year {
    white-space: nowrap;
}

/* ---- Admin edit links ---- */
.edit {
    font-size: 0.8em;
    font-weight: 400;
}

/* ---- Admin panel (miscTableNoColor, signed-in admins only) ----
   Same glass box as the category rows, full width of the list (was a beige
   900px box). Text left, "Εργαλεία διαχείρισης" right; on narrow screens the
   tools go under the text. */
.community-list-page table.miscTableNoColor {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0 0 clamp(16px, 2vw, 24px) !important;   /* inline margin-left:20px */
    padding: clamp(14px, 1.6vw, 22px) clamp(16px, 2vw, 28px);
    box-sizing: border-box;
    background: var(--sw-glass-bg);
    border: var(--sw-glass-border);
    border-radius: 14px;
    box-shadow: var(--sw-glass-shadow);
    color: #fff;
    text-align: left;
}

.community-list-page table.miscTableNoColor > tbody,
.community-list-page table.miscTableNoColor > tbody > tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    width: 100%;
}

.community-list-page table.miscTableNoColor > tbody > tr > td {
    display: block;
    padding: 0;
    vertical-align: top;
    background: transparent;
}

.community-list-page table.miscTableNoColor > tbody > tr > td:first-child {
    flex: 1 1 320px;
    min-width: 0;
}

.community-list-page table.miscTableNoColor h3 {
    margin: 0 0 6px;
    color: #fff;
    font-size: clamp(18px, 1.6vw, 22px);
    font-weight: 700;
}

.community-list-page table.miscTableNoColor > tbody > tr > td p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(14px, 1vw, 16px);
}

/* Nested "Εργαλεία διαχείρισης" box: no box of its own, just its title + actions */
.community-list-page table.miscTableNoColor table.miscTable,
.community-list-page table.miscTableNoColor table.miscTable table {
    width: auto;
    background: transparent;
    border: 0;
    border-collapse: collapse;
}

.community-list-page table.miscTableNoColor .evenRowEvenCol,
.community-list-page table.miscTableNoColor td.standard,
.community-list-page table.miscTableNoColor th.standard {
    background: transparent;
    border: 0;
}

.community-list-page table.miscTableNoColor th.standard {
    padding: 0 0 8px;
    height: auto;
    color: #fff;
    font-size: clamp(14px, 1vw, 15px);
    font-weight: 700;
    text-align: left;
}

.community-list-page table.miscTableNoColor td.standard {
    padding: 4px 0;
    text-align: left;
    font-size: clamp(14px, 1vw, 15px);
}

/* Create button: switcher look, as the other single buttons */
.community-list-page table.miscTableNoColor input[type="submit"] {
    min-height: 44px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: clamp(14px, 1.1vw, 15px);
    font-weight: 700;
    color: #fff;
    background: var(--sw-selected-bg);
    border: var(--sw-glass-border);
    border-radius: 8px;
    box-shadow: var(--sw-selected-shadow);
    cursor: pointer;
    transition: background 0.15s;
}

.community-list-page table.miscTableNoColor input[type="submit"]:hover {
    background: var(--sw-hover-bg);
}

.community-list-page table.miscTableNoColor a {
    color: #fff;
    text-decoration: underline;
}

.community-list-page table.miscTableNoColor a:hover {
    text-decoration-thickness: 2px;
}

/* ---- "(επεξεργασία)" next to each name (signed-in admins) ----
   It is a second link inside the row; with space-between it floated somewhere
   between the name and the arrow depending on the name's length. Now it sits
   right after the name and the arrow is pushed to the far right. */
.communityLink > strong {
    justify-content: flex-start;
}

.communityLink > strong .cl-toggle {
    margin-left: auto;
}

.communityLink > strong > a + a,
.collectionListItem > a + a {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: underline !important;
    transition: background 0.15s;
}

.communityLink > strong > a + a:hover,
.collectionListItem > a + a:hover {
    background: var(--sw-hover-bg);
}
