/* Semarak Engineering Journal — site stylesheet.
   Reuses OJS class names and the original green theme
   (linear-gradient #55b754 -> #221f1b) from the sample styleSheet.css,
   while providing a working, responsive, non-broken layout. */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
    color: #222;
    line-height: 1.55;
    background-image: linear-gradient(#eaeaea, #d0d0d0);
    background-attachment: fixed;
}

a { color: #1c7a3e; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif; color: #14401f; line-height: 1.25; }
h1 { font-size: 2rem; margin: 0.4em 0; }
h2 { font-size: 1.5rem; margin: 0.5em 0; }
h3 { font-size: 1.15rem; }
img { max-width: 100%; height: auto; }

/* Skip links (visually hidden until focus) */
.cmp_skip_to_content { position: absolute; left: -9999px; }
.cmp_skip_to_content a:focus { position: fixed; left: 8px; top: 8px; background: #096938; color: #fff; padding: 8px 12px; z-index: 100; }
.pkp_screen_reader { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

/* ----- Structure ----- */
.pkp_structure_page { display: flex; flex-direction: column; min-height: 100vh; }

.pkp_structure_head { position: relative; }
.pkp_head_wrapper {
    color: #fff;
    max-width: 1160px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    line-height: 0;
}
/* Banner as an <img>: the whole image is always shown, never cropped. */
.pkp_head_banner { display: block; }
.pkp_head_banner img { display: block; width: 100%; height: auto; }

/* Register / Login pinned to top-right corner */
.pkp_navigation_user_wrapper { position: absolute; top: 16px; right: 20px; z-index: 3; line-height: normal; }
.pkp_navigation_user { justify-content: flex-end; gap: 8px; }
#navigationUser > li > a,
.pkp_navigation_user > li > a {
    color: #fff;
    background-color: #232526;
    padding: 8px 16px;
    border: 3px solid #ffffff;
    border-radius: 4px;
    font-size: 0.8rem;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    text-transform: none;
}
#navigationUser > li > a:hover,
.pkp_navigation_user > li > a:hover { background-color: #096938; text-decoration: none; }

.pkp_site_nav_toggle {
    display: none;
    background: #451e53;
    border: 2px solid #ffffff;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 3;
}

/* Nav bar directly below the banner image */
.pkp_site_nav_menu {
    background-image: linear-gradient(to right, #55b754, #221f1b);
    position: relative;
    z-index: 2;
    line-height: normal;
}
.pkp_navigation_primary_row { }
.pkp_navigation_primary_wrapper {
    max-width: 1160px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-left: 10px;
}

ul.pkp_nav_list { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; flex-wrap: wrap; }
ul.pkp_nav_list > li { position: relative; }
ul.pkp_nav_list > li > a {
    display: block;
    padding: 12px 15px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid transparent;
}
#navigationPrimary > li > a:hover,
#navigationPrimary > li > a:focus { border-color: #2d9f57; background: #096938; color: #fff; }

/* Dropdown submenus (green) */
ul.pkp_nav_list > li > ul {
    position: absolute;
    top: 100%;
    left: 0;
    background: #065f31;
    min-width: 250px;
    list-style: none;
    padding: 4px 0;
    margin: 0;
    box-shadow: 0 6px 18px rgba(0,0,0,0.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 50;
}
ul.pkp_nav_list > li:hover > ul,
ul.pkp_nav_list > li:focus-within > ul,
ul.pkp_nav_list > li.open > ul { opacity: 1; visibility: visible; transform: translateY(0); }
ul.pkp_nav_list > li > ul li a {
    display: block; padding: 9px 18px; color: #fff !important; font-weight: 500; font-size: 0.82rem; text-transform: uppercase;
}
ul.pkp_nav_list > li > ul li a:hover { background: #3e7a41; text-decoration: none; }

.pkp_navigation_search_wrapper a { color: #f7e952; padding: 12px 14px; display: inline-block; font-weight: 600; }
.pkp_navigation_search_wrapper a:hover { color: #f0ecc6; text-decoration: none; }

/* ----- Main + sidebar layout ----- */
.pkp_structure_content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    max-width: 1160px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px;
    background: #fff;
    align-items: start;
}
.pkp_structure_content.no_sidebar { grid-template-columns: 1fr; }
.pkp_structure_content.no_sidebar .pkp_structure_main { padding-right: 0; }
.pkp_structure_main {
    padding: 8px 20px 28px 0;
    min-width: 0;
}
.pkp_structure_sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}
.pkp_block {
    font-size: 0.9rem;
    padding-bottom: 14px;
    border-bottom: 1px solid #e6eaf2;
}
.pkp_block .title { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 0; color: #14401f; border-bottom: 2px solid #f7e952; padding-bottom: 6px; }
.pkp_block ul { padding-left: 18px; margin: 6px 0; }
.pkp_block .content { word-wrap: break-word; }
.pkp_block .content img { margin: 6px 0; height: auto; }
.indexing-images img { display: inline-block; margin: 4px 6px 4px 0; max-width: 100%; }

/* ----- Footer ----- */
.pkp_structure_footer_wrapper {
    width: 100%;
    color: #fff;
    background-image: linear-gradient(to right, #55b754, #221f1b);
    border-bottom: 20px solid #d4badd;
}
.pkp_structure_footer { max-width: 1160px; margin: 0 auto; }
.pkp_footer_content { text-align: center; padding: 30px 20px; }
.pkp_footer_content a { color: #f7e952; }
.pkp_brand_footer { display: none; }

/* ----- Home & issues ----- */
.homepage_about, .cmp_announcements, .current_issue, .additional_content {
    padding-bottom: 20px;
    border-bottom: 1px solid #e6eaf2;
    margin-bottom: 20px;
}
.additional_content { border-bottom: none; }
.current_issue_title { font-size: 1.15rem; color: #14401f; margin-bottom: 12px; font-weight: 600; }
.published .label { font-weight: 600; margin-right: 6px; }
.read_more { display: inline-block; margin-top: 8px; font-weight: 600; color: #1c7a3e; }

.cmp_article_list { list-style: none; padding: 0; margin: 0; }
.obj_article_summary {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px dashed #e0e6ee;
    align-items: start;
}
.obj_article_summary:last-child { border-bottom: none; }
.obj_article_summary .cover img { width: 100px; height: auto; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.obj_article_summary .title { margin: 0 0 6px 0; font-size: 1.05rem; }
.obj_article_summary .authors { color: #4c5a72; font-size: 0.9rem; margin-bottom: 4px; }
.obj_article_summary .pages { color: #6c7a92; font-size: 0.85rem; }
.galleys_links { list-style: none; padding: 0; margin-top: 6px; display: flex; gap: 6px; }
.obj_galley_link {
    display: inline-block;
    padding: 3px 10px;
    background: #e63946;
    color: #fff;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
}
.obj_galley_link:hover { text-decoration: none; background: #b7202b; }

/* Announcements / notices */
.obj_announcement_summary { padding: 12px 0; border-bottom: 1px dashed #e0e6ee; }
.obj_announcement_summary:last-child { border-bottom: none; }
.obj_announcement_summary h3 { margin: 0 0 6px 0; }
.obj_announcement_summary .date { font-size: 0.85rem; color: #6c7a92; margin-bottom: 6px; }
.obj_announcement_summary .summary p { margin: 4px 0; }

/* Archive list */
.issues_archive { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: 16px; }
.obj_issue_summary { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 12px; border: 1px solid #e6eaf2; border-radius: 6px; background: #fbfcfe; }
.obj_issue_summary a.cover img { width: 140px; }
.obj_issue_summary .series { color: #6c7a92; font-size: 0.9rem; }
.obj_issue_summary h2 { margin: 0 0 6px 0; font-size: 1.1rem; }

/* Article view */
.obj_article_details .main_entry { max-width: 100%; }
.obj_article_details .row { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
.obj_article_details .entry_details { background: #f2faf3; padding: 14px 18px; border-radius: 6px; }
.obj_article_details .item { margin-bottom: 14px; }
.obj_article_details .label { font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.85rem; color: #14401f; }
.item.authors ul { list-style: none; padding: 0; margin: 0; }
.item.authors li { margin-bottom: 8px; }
.item.authors .name { font-weight: 600; }
.item.authors .affiliation { color: #6c7a92; font-size: 0.9rem; display: block; }
.item.keywords .value span:not(:last-child)::after { content: ", "; }
.item.cover_image img { border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.15); margin-bottom: 12px; }

/* Breadcrumbs */
.cmp_breadcrumbs ol { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.85rem; color: #6c7a92; }
.cmp_breadcrumbs li { display: flex; gap: 6px; align-items: center; }
.cmp_breadcrumbs .separator { color: #bcc6d6; }

/* ----- Forms ----- */
.cmp_form fieldset { border: 1px solid #e6eaf2; border-radius: 6px; padding: 16px; margin-bottom: 16px; }
.cmp_form legend { padding: 0 6px; font-weight: 600; color: #14401f; }
.cmp_form .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.cmp_form .fields > div { display: flex; flex-direction: column; }
.cmp_form label { font-weight: 500; margin-bottom: 4px; display: block; }
.cmp_form label .required { color: #b7202b; }
em.error { color: #b7202b; font-size: 0.85rem; display: block; margin-top: 3px; }
.cmp_form input[type="text"], .cmp_form input[type="email"], .cmp_form input[type="password"],
.cmp_form input[type="date"], .cmp_form input[type="number"], .cmp_form input[type="file"],
.cmp_form select, .cmp_form textarea, input[type="text"], input[type="email"],
input[type="password"], input[type="date"], input[type="number"], input[type="search"], select, textarea {
    padding: 8px 10px;
    border: 1px solid #cbd3e0;
    border-radius: 4px;
    font: inherit;
    background: #fff;
    width: 100%;
}
.cmp_form textarea, textarea { min-height: 100px; resize: vertical; }
.cmp_form .buttons { display: flex; gap: 10px; margin-top: 8px; align-items: center; }
.cmp_form button.submit, button.submit, .btn-primary {
    background: #096938;
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cmp_form button.submit:hover, button.submit:hover, .btn-primary:hover { background: #075027; }
.btn-danger { background: #b7202b; color: #fff; border: none; padding: 6px 14px; border-radius: 4px; cursor: pointer; }
.btn-danger:hover { background: #8a1820; }
.btn-secondary { display: inline-block; padding: 6px 14px; background: #e6eaf2; color: #14401f; border-radius: 4px; border: none; cursor: pointer; }
.btn-secondary:hover { background: #d6dde8; text-decoration: none; }

/* Flashes */
.flash-container { margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 8px; border-left: 4px solid; }
.flash-success { background: #eaf6ec; border-color: #2b8a3e; color: #1e5c2b; }
.flash-error   { background: #fbeaea; border-color: #b7202b; color: #7a1620; }
.flash-warning { background: #fef4e0; border-color: #b78e00; color: #7d6100; }
.flash-info    { background: #eaf3fb; border-color: #157cbf; color: #0d4a75; }

/* Contact page */
.address, .contact { margin-bottom: 16px; }
.contact h3 { margin-bottom: 4px; color: #14401f; }

/* Tables (admin) */
table.data-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
table.data-table th, table.data-table td { padding: 8px 10px; border-bottom: 1px solid #e6eaf2; text-align: left; font-size: 0.92rem; vertical-align: top; }
table.data-table th { background: #f2faf3; color: #14401f; }
table.data-table tr:hover { background: #fbfcfe; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.badge-admin { background: #b7202b; color: #fff; }
.badge-editor { background: #096938; color: #fff; }
.badge-author { background: #2b8a3e; color: #fff; }
.badge-verified { background: #2b8a3e; color: #fff; }
.badge-unverified { background: #b78e00; color: #fff; }

/* Search results */
.search_input .query { max-width: 480px; }
.search_results { list-style: none; padding: 0; margin: 0; }
.search_results li { padding: 14px 0; border-bottom: 1px dashed #e0e6ee; }
.cmp_notification { padding: 12px 16px; background: #f2faf3; border-radius: 4px; margin: 12px 0; }
.cmp_notification.notice { background: #fef4e0; }

/* Admin dashboard */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 20px 0; }
.dashboard-card { background: #fff; border-radius: 6px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border-left: 4px solid #55b754; }
.dashboard-card .count { font-size: 1.8rem; font-weight: 700; color: #14401f; }
.dashboard-card .label { font-size: 0.85rem; text-transform: uppercase; color: #6c7a92; }

.admin-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.admin-toolbar input[type="search"], .admin-toolbar input[type="text"] { max-width: 300px; }
.actions { display: flex; gap: 6px; align-items: center; }
.actions form { display: inline; }

/* Authors editor (article form) */
.authors-editor .author-row { display: grid; grid-template-columns: 1.5fr 2fr 1.5fr auto; gap: 8px; margin-bottom: 6px; align-items: center; }
.authors-editor .author-row input { width: 100%; }
.authors-editor .remove-author { background: transparent; border: none; color: #b7202b; cursor: pointer; font-size: 1.2rem; }

/* Responsive */
@media (max-width: 991px) {
    .pkp_structure_content { grid-template-columns: 1fr; }
    .obj_article_details .row { grid-template-columns: 1fr; }
    .cmp_form .fields { grid-template-columns: 1fr; }

    /* Banner keeps its native aspect ratio (padding-top set on desktop rule) */
    .pkp_site_nav_toggle { display: inline-block; position: absolute; top: 8px; left: 8px; margin: 0; }
    .pkp_navigation_user_wrapper { position: static; padding: 8px; text-align: right; }
    .pkp_navigation_user > li > a { background-color: #232526; }
    .pkp_site_nav_menu { position: static; background: #461f54 !important; }
    ul.pkp_nav_list { display: none; flex-direction: column; width: 100%; }
    ul.pkp_nav_list.open { display: flex; }
    .pkp_navigation_search_wrapper { width: 100%; }
    ul.pkp_nav_list > li > ul { position: static; box-shadow: none; opacity: 1; visibility: visible; transform: none; background: rgba(0,0,0,0.15); }
    .pkp_navigation_primary_wrapper { flex-direction: column; align-items: stretch; }
}
@media (max-width: 600px) {
    .obj_article_summary { grid-template-columns: 80px 1fr; }
    .obj_article_summary .cover img { width: 80px; }
    .obj_issue_summary { grid-template-columns: 1fr; }
    .authors-editor .author-row { grid-template-columns: 1fr; }
}
