/*
 * FiveMind Joomla Template
 * Visual conversion of the legacy FiveMind / Dragonfly CMS theme.
 * The layout intentionally preserves the compact early-2000s appearance.
 */

:root {
    --fm-green: #70a402;
    --fm-green-soft: #b3d272;
    --fm-green-pale: #d2e399;
    --fm-border: #cccccc;
    --fm-text: #000000;
    --fm-muted: #666666;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.fivemind-site {
    color: var(--fm-text);
    background: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.55;
}
img { border: 0; max-width: 100%; }
a { color: #000; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header — preserved from the old FiveMind theme */
#header {
    position: relative;
    width: 100%;
    min-height: 100px;
    background: #fff;
    overflow: hidden;
}
#header .brand {
    display: inline-block;
    margin: 10px 0 8px 10px;
}
#header .brand img {
    display: block;
    width: 418px;
    height: auto;
}
#offer {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 150px;
    min-height: 84px;
    text-align: right;
}
#offer img.legacy-corner-logo {
    width: 150px;
    height: auto;
}

/* Thin green navigation strip */
#topbar {
    width: 100%;
    min-height: 20px;
    background: var(--fm-green);
    color: #fff;
    font-size: 12px;
    line-height: 20px;
}
.topbar-inner {
    text-align: center;
    min-height: 20px;
}
#topbar a { color: #fff; }
#topbar .mod-menu,
#topbar ul {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
}
#topbar li { margin: 0; padding: 0; }
#topbar li + li::before {
    content: " • ";
    color: #fff;
    padding: 0 3px;
}
#topbar .nav-link,
#topbar li > a {
    display: inline;
    color: #fff;
    padding: 0;
    background: transparent !important;
}

/* Three-column body */
#content { padding: 10px 12px 0; }
.layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    width: 100%;
    align-items: start;
}
body.has-left .layout-grid { grid-template-columns: 180px minmax(0, 1fr); }
body.has-right .layout-grid { grid-template-columns: minmax(0, 1fr) 190px; }
body.has-left.has-right .layout-grid { grid-template-columns: 180px minmax(0, 1fr) 190px; }
.main { min-width: 0; vertical-align: top; }
.mainside {
    vertical-align: top;
    color: var(--fm-muted);
    font-size: 12px;
    padding: 8px 12px 0 8px;
}
#sidebar-right { padding-left: 10px; padding-right: 8px; }
.mainside a { color: var(--fm-muted); }
.mainside a:hover { color: var(--fm-green); text-decoration: none; }

/* Joomla module chrome translated to FiveMind side blocks */
.mainside .moduletable,
.mainside .moduletable-menu,
.mainside > div {
    width: 100%;
    margin: 0 0 12px;
}
.mainside h3,
.mainside .moduletable > h3,
.mainside .card-header {
    margin: 0;
    padding: 3px 0 3px 8px;
    border: 0;
    border-top: 1px solid var(--fm-green);
    background: #fff;
    color: #444;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    position: relative;
}
.mainside h3::before,
.mainside .moduletable > h3::before {
    content: "::";
    position: absolute;
    left: 0;
    color: var(--fm-green);
}
.mainside .mod-menu,
.mainside ul {
    list-style: none;
    margin: 3px 0 0;
    padding: 0 0 0 12px;
}
.mainside li { margin: 0; padding: 0; line-height: 1.45; }
.mainside li > a,
.mainside .nav-link { padding: 0; display: inline; background: none; }
.mainside li li > a::before { content: "- "; }

/* Joomla messages styled like the old red maintenance notice */
joomla-alert,
.alert,
#system-message-container .alert {
    display: block;
    margin: 0 0 8px;
    padding: 8px 12px;
    border: 1px solid #ff4c4c;
    border-radius: 0;
    background: #fff;
    color: #ff0000;
    text-align: center;
    font-family: "Times New Roman", Times, serif;
    font-size: 16px;
    font-weight: bold;
}
#system-message-container .alert-heading { font-size: 16px; }

/* Main component */
.component-shell { width: 100%; padding: 8px 10px 0; }
.component-shell > *:first-child { margin-top: 0; }

/* Green section bars: category/page titles and content-top module titles */
.page-header h1,
.blog > h1,
.category-list > h1,
.contact-category > h1,
#content-top .moduletable > h3,
#content-top .moduletable > h2,
.fm-section-title {
    width: 100%;
    margin: 0;
    padding: 5px 10px;
    border-radius: 4px 4px 0 0;
    background: var(--fm-green);
    color: #fff;
    text-align: center;
    font-family: "Trebuchet MS", Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.15;
}

/* Article/news presentation */
.blog-items,
.blog .items-leading,
.blog .items-row { margin: 0; }
.blog-item,
.item-page,
.newsflash-item,
.cell_wrapper {
    padding: 8px 9px 11px;
    border: 1px solid var(--fm-border);
    border-top: 0;
    background: #fff;
}
.blog-item + .blog-item { border-top: 0; }
.item-page { border-top: 1px solid var(--fm-border); }
.blog-item .page-header,
.item-page .page-header,
.article-info,
.article-info-term { margin: 0; }
.blog-item .page-header h2,
.item-page .page-header h1,
.item-page .page-header h2,
.cell_header {
    margin: 0 0 2px;
    padding: 0;
    background: transparent;
    color: #000;
    text-align: left;
    font-family: "Trebuchet MS", Arial, sans-serif;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.3;
}
.blog-item .page-header h2 a,
.item-page .page-header h2 a { color: #000; }
.article-info,
.article-info dd,
.article-info dt,
.createdby,
.published,
.modified,
.category-name,
.hits {
    color: #777;
    font-size: 9px;
}
.article-info { margin-bottom: 8px; }
.article-info dd { margin: 0 8px 0 0; display: inline; }
.article-info dt { display: none; }
.item-page p,
.blog-item p,
.cell_content {
    font-size: 14px;
    line-height: 1.5;
}
.readmore { margin: 6px 0 0; }
.readmore a { color: #000; }

/* Generic forms/tables */
table { border-collapse: collapse; }
.table { --bs-table-bg: transparent; font-size: 11px; }
.table > :not(caption) > * > * { padding: 4px 6px; border-color: #ccc; }
input, select, textarea, button { font: inherit; }
input[type="text"], input[type="password"], input[type="email"], select, textarea {
    border: 1px solid #aaa;
    border-radius: 0;
    background: #fff;
}
.btn,
button,
input[type="submit"] {
    border: 1px solid #999;
    border-radius: 2px;
    background: #eee;
    color: #000;
    padding: 2px 7px;
    font-size: 10px;
}
.btn:hover, button:hover, input[type="submit"]:hover { background: #ddd; }

/* Old green footer strip */
#mainfoot {
    height: 20px;
    margin: 0;
    border-radius: 0 0 4px 4px;
    background: var(--fm-green);
}
#footer {
    position: relative;
    min-height: 76px;
    margin: 10px 12px 0;
    font-size: 10px;
    text-align: center;
}
#powered {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 63px;
    height: 63px;
}
#powered img { width: 63px; height: 63px; }

/* Hide modern Joomla decorations that fight the legacy look */
.icon-calendar,
.btn-group.float-end,
.float-end .dropdown-toggle { }


/* V3 polish: make Joomla modules feel closer to the original Dragonfly blocks */
.mainside .mod-login,
.mainside .login,
.mainside form {
    font-size: 12px;
}
.mainside input[type="text"],
.mainside input[type="password"],
.mainside input[type="email"] {
    width: 100%;
    max-width: 165px;
    min-height: 22px;
    padding: 2px 4px;
    border: 1px solid #b8b8b8;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    font-size: 12px;
}
.mainside .btn,
.mainside button,
.mainside input[type="submit"] {
    padding: 2px 8px;
    border: 1px solid #999;
    border-radius: 1px;
    background: linear-gradient(#f6f6f6, #e3e3e3);
    color: #222;
    font-size: 11px;
    line-height: 1.25;
}
.mainside .btn:hover,
.mainside button:hover,
.mainside input[type="submit"]:hover {
    background: #dedede;
}
.mainside label {
    font-size: 11px;
}
.mainside .form-check {
    margin: 4px 0;
}
.mainside .form-check-input {
    margin-top: 0.15em;
}
#topbar .mod-menu > li > a,
#topbar .mod-menu > li > span,
#topbar > .topbar-inner > a {
    font-weight: 600;
}
.main {
    border-left: 1px solid #d8d8d8;
    border-right: 1px solid #d8d8d8;
}
.mainside h3,
.mainside .moduletable > h3,
.mainside .card-header {
    border-top-color: #83b52a;
}

/* Mobile fallback: retain the look while preventing overflow */
@media (max-width: 760px) {
    #header { min-height: 78px; }
    #header .brand { margin-left: 6px; }
    #header .brand img { width: min(330px, 72vw); }
    #offer { min-width: 90px; top: 6px; right: 5px; }
    #offer img.legacy-corner-logo { width: 95px; }
    #content { padding: 7px; }
    .layout-grid,
    body.has-left .layout-grid,
    body.has-right .layout-grid,
    body.has-left.has-right .layout-grid { grid-template-columns: 1fr; }
    .mainside { width: 100%; padding: 4px 0 8px; }
    #sidebar-left { order: 2; }
    #main { order: 1; }
    #sidebar-right { order: 3; }
    .mainside .moduletable { max-width: none; }
}
