/* Default/base styles - style.css
    Lightweight reset + sensible defaults for typical HTML elements
*/

/* Box sizing + reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root{
  /* color system */
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #0f1724;
  --muted: #545963;
  --primary: #ba0a33; /* warmer primary (reddish) */
  --accent: #7c3aed;

  --radius: 6px;
  --gap: 1rem;
  --max-width: 1100px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 6px 24px rgba(11,15,23,0.08);
}

/* Base page */
html, body {
  height: 100%;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
    background-image: url("../images/bg.jpg");
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}

/* Container utility */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(0.75rem, 2vw, 1.25rem);
  padding-right: clamp(0.75rem, 2vw, 1.25rem);
}

/* Headings */
h1,h2,h3,h4,h5,h6 {
  margin: 0 0 0.5rem 0;
  font-weight: 600;
  line-height: 1.2;
  color: inherit;
}

h1 { font-size: clamp(1.5rem, 3.6vw, 2.25rem); }
h2 { font-size: clamp(1.25rem, 3.0vw, 1.75rem); }
h3 { font-size: clamp(1.125rem, 2.4vw, 1.25rem); }
h4 { font-size: 1rem; }
h5 { font-size: 0.9rem; }
h6 { font-size: 0.8rem; }

/* Paragraphs & text blocks */
p {
  margin: 0 0 1rem 0;
  color: var(--text);
}

/* Lists */
ul, ol {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}


/* Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover,
a:focus {
  text-decoration: underline;
  outline: none;
}

/* Images & media */
img, svg, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Form elements */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

input, textarea, select {
  border: 1px solid #bbb;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: #fff;
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(3,102,214,0.9);
  box-shadow: 0 0 0 3px rgba(3,102,214,0.08);
}

/* Checkbox & radio - slightly larger, with accent color and improved focus */
input[type="checkbox"],
input[type="radio"] {
  /* scale up native controls for consistent sizing across browsers */
  transform: scale(1.25);
  -webkit-transform: scale(1.25);
  transform-origin: center;
  -webkit-transform-origin: center;
  accent-color: var(--primary);
  margin-right: 0.5rem;
  vertical-align: middle;
  cursor: pointer;
}

input[type="radio"] {
  border-radius: 50%;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(217,72,15,0.12); /* subtle focus ring using primary */
}

@media (max-width: 768px) {
  input[type="checkbox"],
  input[type="radio"] {
    transform: scale(1.15);
    -webkit-transform: scale(1.15);
  }
}

/* Buttons */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button:active {
  transform: translateY(1px);
}

/* Secondary button variant */
.button-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(3,102,214,0.12);
}

/* HR */
hr {
  border: none;
  height: 1px;
  background: rgba(15,23,42,0.06);
  margin: 1rem 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(15,23,42,0.06);
}

thead th {
  background: transparent;
  font-weight: 600;
}

/* Code & pre */
code, kbd, samp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
  font-size: 0.875em;
  background: rgba(15,23,42,0.04);
  padding: 0.125rem 0.25rem;
  border-radius: 4px;
}

pre {
  background: rgba(0,0,0,0.04);
  padding: 0.75rem;
  border-radius: 8px;
  overflow: auto;
  font-size: 0.9rem;
}

/* Accessibility helpers */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Utility spacing */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }

/* Small default card */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

/* Make sure images inside links keep their inline behavior */
a img {
  display: inline-block;
}

/* Print-friendly tweaks */
@media print {
  a::after { content: " (" attr(href) ")"; font-size: 90%; }
  nav, .no-print { display: none !important; }
}

/** 
--------------------------------------------------------------------------------
Components styling 
--------------------------------------------------------------------------------
**/

/* Layout Components */
.main-wrapper {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  grid-template-areas: 
    "header"
    "menu" 
    "content"
    "footer";
}

.site-header {
  grid-area: header;
  position: relative;
  height: 120px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-logo__image {
  width: 100px;
  height: 100px;
  background: url("../images/logo.png") no-repeat center;
  background-size: contain;
}

.site-logo__text {
  font-size: clamp(1.25rem, 4vw, 1.625rem);
  color: var(--muted);
  line-height: 1.3;
  font-weight: 500;
}

.user-panel {
  position: absolute;
  top: 10px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

/* Menu Navigation */
.menu-bg {
  grid-area: menu;
  height: 30px;
  background: var(--muted);
  position: relative;
  z-index: 1000;
}

.main-nav {
  width: 100%;
  margin: 0 auto;
  height: 100%;
  background: var(--muted);
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.main-nav li {
  position: relative;
  white-space: nowrap;
}

/* Ensure parent items have no accidental gaps and submenu slightly overlaps as extra protection
   against fractional pixel gaps across browsers */
.main-nav > ul > li {
  margin-bottom: 0;
}

.main-nav ul ul {
  margin-top: -2px; /* tiny overlap fallback */
}

.main-nav a,
.main-nav span {
  display: block;
  padding: 0 1rem;
  line-height: 30px;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.main-nav li:hover > a,
.main-nav li:hover > span {
  background: rgba(255, 255, 255, 0.1);
}

.main-nav ul ul {
  /* Use visibility + opacity instead of display to avoid a mouse-gap between parent and submenu.
     While hidden the submenu is non-interactive via pointer-events:none so it doesn't interfere.
  */
  position: absolute;
  top: calc(100% - 2px); /* slight overlap to avoid tiny gaps on hover */
  background: #666666;
  border: 1px solid var(--muted);
  padding: 0.5rem;
  flex-direction: column;
  min-width: 180px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.25rem 0; /* give vertical spacing for items */
}

.main-nav ul ul ul {
  top: 0;
  left: 100%;
}

.main-nav li:hover > ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.main-nav .home-icon {
  height: 30px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.main-nav .home-icon img {
  padding: 7px 0 0 2px;
}

/* Main Content Area */
.main-content {
  grid-area: content;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  min-height: 500px;
  overflow-x: hidden;
}

/* Two-column layout */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 768px) {
  .content-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.main-column {
  min-height: 300px;
}

.sidebar {
  padding-top: 50px;
  min-height: 300px;
}

.sidebar a {
  color: var(--muted);
}

.sidebar .section-title {
  border-bottom: 2px solid var(--muted);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

/* Footer */
.site-footer {
  grid-area: footer;
  background: var(--muted);
  color: #bbbbbb;
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-content {
  max-width: 990px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.footer-content h3 {
  color: #ffffff;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: #bbbbbb;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #ffffff;
}

.social {
  list-style: none;
  padding: 0.75rem 0 0;
  display: flex;
  gap: 0.75rem;
}


.site-footer {
  background: linear-gradient(180deg,#111827 0%, #0b1216 100%);
  color: #cbd5e1;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  padding: 2rem 1.25rem;
}

.site-footer h3 {
  color: #ffffff;
  margin-bottom: 0.75rem;
}

/* Footer links in the 'Πληροφορίες' section: white and no bullets */
.site-footer .footerul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer .footerul li {
  margin: 0 0 0.5rem 0;
}
.site-footer .footerul li a {
  color: #ffffff;
  text-decoration: none;
}
.site-footer .footerul li a:hover {
  color: var(--primary);
}

.footer-pages a, .footererga a {
  color: #cbd5e1;
  text-decoration: none;
}

.footer-pages a:hover, .footererga a:hover { color: var(--primary); }

.copyright {
  background: #060708;
  text-align: center;
  padding: 1rem;
  color: #94a3b8;
  font-size: 0.875rem;
}

/* Content Components */

/* News List */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  position: relative;
}

.news-item:first-child {
  border-top: none;
}

.news-item.unpublished {
  opacity: 0.6;
}

.news-item__date {
  flex-shrink: 0;
  width: 85px;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.875rem;
}

.news-item__content {
  flex: 1;
  min-width: 0;
}

.news-item__title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.news-item__title .ergo-name {
  font-weight: 400;
  color: var(--primary);
  font-size: 0.875rem;
}

.news-item.unpublished .news-item__title .ergo-name {
  color: #ff9892;
}

.news-item__description {
  color: var(--muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.news-item__more a {
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Sidebar News */
.sidebar .news-list .news-item {
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0;
}

.sidebar .news-item__content {
  width: 100%;
}

/* Ergo Projects */
.ergo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1rem 0;
}

.ergo-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.ergo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.ergo-card.unpublished {
  opacity: 0.6;
}

.ergo-card__header {
  background: #d1d1d1;
  padding: 0.5rem 1rem;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9375rem;
  position: relative;
}

.ergo-card.unpublished .ergo-card__header {
  color: #999999;
}

.ergo-card__content {
  padding: 1rem;
}

.ergo-card__logo {
  text-align: center;
  margin-bottom: 1rem;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ergo-card__logo img {
  max-width: 120px;
  max-height: 70px;
  object-fit: contain;
}

.ergo-card__description {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.ergo-card__more a {
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Gallery Components */
.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  aspect-ratio: 4/5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.gallery-item__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  padding: 1rem;
  transform: translateY(100%);
  transition: transform 0.2s ease;
}

.gallery-item:hover .gallery-item__overlay {
  transform: translateY(0);
}

.gallery-item__title a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.gallery-item__tools {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gallery-item:hover .gallery-item__tools {
  opacity: 1;
}

.gallery-item__tools a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 50%;
  text-decoration: none;
  font-size: 0.75rem;
}

.gallery-item__main-indicator {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  width: 10px;
  height: 10px;
  background: #00ff00;
  border-radius: 50%;
}

/* Page Gallery (thumbnails) */
.page-gallery {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-gallery li {
  width: 70px;
  height: 70px;
  padding: 5px;
  background: #f5f5f5;
  border: 1px solid #cccccc;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-gallery img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
}

/* Large Gallery Thumbnails */
.gallery-thumbnails {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.gallery-thumbnails li {
  background: #f5f5f5;
  border: 1px solid #cccccc;
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
}

.gallery-thumbnails img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
}

/* Form Components */

/* Enhanced form layout */
.form {
  width: 100%;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group--horizontal {
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.form-group--horizontal label {
  flex-shrink: 0;
  width: 220px;
  margin-bottom: 0;
}

.form-group label {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.25rem;
}

/* Enhanced inputs building on base styles */
input.normal,
textarea.normal,
select.normal {
  width: 250px;
}

textarea.normal {
  height: 100px;
  resize: vertical;
  font-family: inherit;
}

input.error,
textarea.error,
select.error {
  border-color: #dc2626;
  background-color: #fef2f2;
  color: #dc2626;
}

.error-message {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Enhanced buttons building on base styles */
.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: none;
  color: white;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-inverse {
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
  color: white;
  border: none;
}

.btn-inverse:hover {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

/* Reusable button utility class
   Use on <button>, <a>, or <input type="button"> to get consistent styling
*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem; /* 15px */
  line-height: 1;
  border-radius: var(--radius);
  border: none;
  background: var(--primary);
  color: #fff !important;
  cursor: pointer;
  text-decoration: none; /* for anchors */
  transition: transform 0.08s ease, box-shadow 0.12s ease, opacity 0.12s ease, background-color 0.12s ease;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(217,72,15,0.12);
}

.btn[disabled],
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Small button variant similar to Bootstrap's btn-sm */
.btn-mini,
.btn--sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem; /* 13px */
  border-radius: calc(var(--radius) - 2px);
}

/* Allow semantic variants to be combined with .btn */
.btn.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
}

.btn.btn-inverse {
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
  color: #fff;
}

.form-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.form-buttons--left {
  justify-content: flex-start;
}

/* File upload styling */
input[type="file"] {
  width: 250px;
  padding: 0.5rem;
  border: 2px dashed #d1d5db;
  border-radius: var(--radius);
  background: #f9fafb;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

input[type="file"]:hover {
  border-color: var(--primary);
  background: #f3f4f6;
}

/* Image preview components */
.form-thumbnail {
  display: block;
  width: 260px;
  height: 180px;
  margin: 0.75rem 0 0 224px;
  border: 1px solid #cccccc;
  border-radius: var(--radius);
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.form-thumbnail img {
  max-width: 230px;
  max-height: 160px;
  object-fit: contain;
}

.thumbnail {
  display: block;
  width: 230px;
  height: 150px;
  border: 1px solid #cccccc;
  border-radius: var(--radius);
  background: #f9fafb;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.thumbnail img {
  max-width: 200px;
  max-height: 130px;
  object-fit: contain;
}

/* Login form */
.login-form {
  width: 370px;
  margin: 5rem auto 0;
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.login-form .form-group {
  margin-bottom: 1.5rem;
}

.login-form label {
  display: inline-block;
  width: 180px;
  line-height: 1.5;
}

.login-form .form-buttons {
  margin-left: 185px;
  margin-top: 1rem;
  justify-content: flex-start;
  border-top: none;
  padding-top: 0;
}

/* Utility Components */

/* Toolbox component */
.toolbox {
  position: absolute;
  right: 5px;
  top: 7px;
  width: 12px;
  height: 13px;
  background: url('../images/tools.png') no-repeat;
  cursor: pointer;
  z-index: 1000;
}

.toolbox:hover .toolbox__menu {
  display: block;
}

.toolbox__menu {
  position: absolute;
  top: 100%;
  right: -2px;
  background: #f5f5f5;
  border: 1px solid #999999;
  padding: 0.5rem;
  display: none;
  list-style: none;
  margin: 0;
  min-width: 120px;
  box-shadow: var(--shadow-md);
}

.toolbox__menu li {
  display: block;
  margin: 0;
}

.toolbox__menu a {
  display: block;
  padding: 0.25rem 0.5rem;
  color: #333333;
  text-decoration: none;
  font-size: 0.625rem;
  font-weight: 600;
  border-radius: calc(var(--radius) - 1px);
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.toolbox__menu a:hover {
  background: #cccccc;
}

/* Page content */
.page-content {
  position: relative;
  line-height: 1.6;
}

.page-content__text {
  padding-top: 0.75rem;
}

.page-content__text h1,
.page-content__text h2,
.page-content__text h3,
.page-content__text h4 {
  margin: 1.5rem 0 0.75rem 0;
}

.page-content__text h1:first-child,
.page-content__text h2:first-child,
.page-content__text h3:first-child,
.page-content__text h4:first-child {
  margin-top: 0;
}

/* Page list management */
.page-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-list__item {
  position: relative;
  background: #eeeeee;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 65px;
}

.page-list__status {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
}

.page-list__info {
  flex: 1;
  min-width: 0;
}

.page-list__title {
  color: #444444;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.page-list__meta {
  color: #777777;
  font-size: 0.75rem;
  display: flex;
  gap: 1rem;
}

.page-list__url {
  color: #5684d7;
}

.page-list__actions {
  flex-shrink: 0;
  display: flex;
  gap: 0.5rem;
}

.page-list__button {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cccccc;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  transition: all 0.15s ease;
}

.page-list__button:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Filters */
.filters {
  background: #eeeeee;
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  margin: 1rem 0 2.5rem;
}

.filters__title {
  color: #999999;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dddddd;
}

.filters .form-group {
  margin-bottom: 1rem;
}

/* Tabs */
.tabs {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  border-bottom: 1px solid #dddddd;
}

.tabs__tab {
  background: none;
  color: var(--muted);
  padding: 0.75rem 1rem;
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tabs__tab:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.02);
}

.tabs__tab.current {
  background: #dddddd;
  color: var(--text);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
  background: #dddddd;
  padding: 1.5rem;
  border-radius: 0 0 var(--radius) var(--radius);
}

.tab-content.current {
  display: block;
}

/* Tables */
.table-border {
  border-spacing: 0;
  border-collapse: collapse;
}

.table-border th,
.table-border td {
  border: 1px solid #555555;
  padding: 0.5rem 0.75rem;
}

.table-center {
  margin: 0 auto;
}

/* Form title header */
.form-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  margin-bottom: 2rem;
}

.form-title h1 {
  margin: 0;
}

/* Editor wrapper */
.editor {
  padding: 0.5rem 0 1.5rem;
}

/* Special logo layouts */
.ergo-logo {
  position: relative;
  left: 20px;
  top: 30px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.ergo-logo img {
  max-width: 300px;
  max-height: 60px;
  object-fit: contain;
}

.ergo-logo__text {
  font-size: clamp(1.25rem, 4vw, 1.625rem);
  color: var(--muted);
  line-height: 1;
  font-weight: 500;
}

/* Responsive utilities */
@media (max-width: 1024px) {
  .main-wrapper {
    max-width: 100%;
  }
  
  .main-content,
  .main-nav {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 768px) {
  .site-header {
    height: auto;
    min-height: 80px;
    padding: 1rem;
  }
  
  .site-logo {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .site-logo__image {
    width: 60px;
    height: 60px;
  }
  
  .user-panel {
    position: static;
    margin-top: 1rem;
  }
  
  .main-nav ul {
    flex-direction: column;
    height: auto;
  }
  
  .main-nav ul ul {
    /* Mobile: make submenus participate in flow and always visible */
    position: static;
    display: block;
    background: #555555;
    margin-left: 1rem;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
  }
  
  .ergo-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .form-group--horizontal {
    flex-direction: column;
    align-items: stretch;
  }
  
  .form-group--horizontal label {
    width: auto;
  }
  
  .form-thumbnail {
    margin-left: 0;
  }
  
  .login-form {
    width: 90%;
    max-width: 370px;
  }
}

/* Backwards compatibility: map old main.css IDs/classes to new styles
   This keeps existing PHP templates working while you migrate markup.
*/

/* Page wrapper -> modern main-wrapper */
#main {
  margin: 0 auto;
  width: 100%;
  max-width: 1100px;
  background: rgba(255,255,255,0.95);
  box-shadow: var(--shadow-sm);
}

#header, .site-header, .ergologo {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  position: relative;
  justify-content: space-between;
}

/* old logo blocks */
#logo { width: 100px; height: 100px; background: url('../images/logo.png') no-repeat center/contain; }
#logotext { font-size: 1.25rem; color: var(--muted); margin-left: 1rem; }

/* menu container */
#menubg { background: var(--muted); position: relative; z-index: 9999; }
/* inner container padding to keep menu and content aligned */
/* uses same clamp as root container for consistent gutters */
/* legacy menu container */
#menu, .main-nav { margin: 0 auto; padding-left: clamp(0.75rem, 2vw, 1.25rem); padding-right: clamp(0.75rem, 2vw, 1.25rem); position: relative; z-index: 10000; }

/* Legacy menu dropdown mappings (desktop horizontal, hover dropdown) */
#menu ul, .main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

/* By default every li was positioned, which anchors submenus to each li.
   For a full-width first-level dropdown we want the submenu to anchor to the
   nav container instead. Make only nested li elements positioned, while
   top-level li stay static so their submenus use the #menu/.main-nav as
   containing block. */
#menu > ul > li, .main-nav > ul > li { position: static; }
.main-nav li { position: relative; }

#menu ul li a, #menu ul li span, .main-nav a, .main-nav span {
  display: block;
  padding: 5px 20px;
  line-height: 30px;
  color: #fff;
  text-decoration: none;
}

#menu ul li:hover > a, #menu ul li:hover > span, .main-nav li:hover > a, .main-nav li:hover > span {
  background: rgba(255,255,255,0.06);
}

/* Dropdown panel (legacy selectors) - mirror modern behavior to avoid hover gaps */
#menu ul li ul, .main-nav ul ul {
  position: absolute;
  top: calc(100% - 2px);
  background: #666666;
  border: 1px solid #555555;
  padding: 0.5rem;
  min-width: 180px;
  box-shadow: var(--shadow-md);
  z-index: 2000;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.25rem 0;
}

/* Make first-level dropdown span the full width of the menu bar (covering all items) */
#menu > ul > li > ul,
.main-nav > ul > li > ul {
  min-width: 180px;     /* ensure it is at least as wide as the menu bar */
  width: auto;
  max-width: none;
  z-index: 3000;       /* ensure it overlays the top-level items */
}

#menu ul li ul li, .main-nav ul ul li { display: block; }

#menu ul li ul li a, .main-nav ul ul li a {
  padding: 8px 12px;
  color: #fff;
  display: block;
  line-height: 1.4;
}

/* Nested dropdown (second-level) */
#menu ul li ul li ul, .main-nav ul ul ul { position: absolute; top: 0; left: 100%; }

/* Show submenu on hover/focus (desktop) */
#menu li:hover > ul, .main-nav li:hover > ul,
#menu li:focus-within > ul, .main-nav li:focus-within > ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Responsive menu behavior */
.main-nav {
  position: relative;
}
.main-nav .menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.125rem;
  padding: 6px 10px;
}

/* mobile: stack items and make toggle visible */
@media (max-width: 900px) {
  /* Full-bleed (edge-to-edge) menu background on mobile */
  #menubg {
    width: 100%;
    position: relative;
  }

  /* Make the nav itself full-width with no side gutters */
  #menu, .main-nav {
    width: 100vw;
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
  }

  #menu ul, .main-nav ul {
    display: none;
    flex-direction: column;
    background: rgba(51,51,51,0.95);
    width: 100%;
    margin: 0;
    padding: 0.5rem 0;
  }
  .main-nav .menu-toggle { display: inline-block; padding: 0 20px; font-size: 30px; }
  /* Use higher specificity to beat the ID-based hide rule */
  #menu.open > ul, .main-nav.open > ul { display: flex; }
  /* ensure the full-width dropdown rule doesn't break mobile stacked list */
  #menu > ul > li > ul, .main-nav > ul > li > ul { left: auto; right: auto; min-width: 0; width: 100%; }
  /* submenus in mobile flow */
  #menu ul li ul, .main-nav ul ul {
    position: static;
    box-shadow: none;
    border: none;
    /* remove inner indent so the menu feels full-width */
    padding-left: 0;
    margin-left: 0; /* override earlier 768px rule */
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
  }
  /* Make each item and its link/span fill 100% width on mobile */
  #menu ul li, .main-nav ul li { width: 100%; }
  #menu ul li > a, #menu ul li > span,
  .main-nav ul li > a, .main-nav ul li > span { display: block; width: 100%; }
  #menu ul li.open > ul, .main-nav ul li.open > ul { display: flex; }
  #menu ul li a, .main-nav a { padding: 12px 16px; }
  /* center text and any icons for mobile menu items */
  #menu ul, .main-nav ul { text-align: center; }
  #menu ul li, .main-nav ul li { justify-content: center; }
  #menu ul li > a, .main-nav ul li > a,
  #menu ul li > span, .main-nav ul li > span {
    text-align: center;
    display: block; /* ensure text-align applies */
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* Desktop z-index and dropdown alignment fixes */
#menu ul li ul, .main-nav ul ul { z-index: 2500; }
#menu { z-index: 2000; }

/* content area mapping */
#content, .main-content { padding: 1rem 2rem  3rem; margin: 0 auto; }

/* columns */
.leftcolumn, .main { float: none; display: block; }
.leftcolumn, .main-column { width: auto; }
.rightcolumn, .sidebar { width: 300px; }
.layout, .content-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  grid-template-areas: "main sidebar";
  gap: 2rem;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

/* assign logical grid areas so HTML order doesn't dictate visual placement */
.main, .main-column { grid-area: main; }
.sidebar, .rightcolumn { grid-area: sidebar; }

@media (max-width: 900px) {
  /* On smaller screens place sidebar on top and main below */
  .layout, .content-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "sidebar" "main";
    padding: 1rem;
  }
  .rightcolumn, .sidebar { width: 100%; }
}

/* listerga -> ergo-grid */
.listerga {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

.listerga .item {
  /* Two columns on desktop: each item takes roughly 50% minus half the gap */
  flex: 1 1 calc(50% - 0.75rem);
  display: block;
}

@media (max-width: 768px) {
  .listerga .item {
    flex: 1 1 100%;
  }
}

/* ergo card mapping */
.ergo, .ergo-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; position: relative; }
.ergo .title, .ergo-card__header { padding: 0.5rem 0.75rem; background: #eeeeee; color: var(--primary); font-weight: 600; border-bottom: 4px #ddd solid;}
.ergo .logo {
  width: 100%;
  height: 90px;
  margin: 10px 0;
  display: flex;
  align-items: flex-start; /* align contents at top */
  justify-content: flex-start; /* align image to left */
  overflow: hidden;
}

.ergo .logo img {
  width: auto;
  height: 100%;
  max-width: 200px;
  object-fit: contain;
  object-position: left top; /* put the image at left-top inside the box */
  display: block;
}

.ergo-card__logo { padding: 0.75rem; display:flex; align-items:center; justify-content:center; }
.ergo-card__logo img { max-width:120px; max-height:70px; object-fit:contain; }
.ergo .description, .ergo-card__description { padding: 0.75rem; color: var(--muted); }

/* newslist mapping */
.newslist { list-style: none; margin: 0; padding: 0; }
.newslist .item { display:flex; gap: 1rem; padding: 0.75rem 0; border-top: 1px solid rgba(15,23,42,0.06); }
.newslist .item .date { width: 85px; font-weight:700; color: #777777; }
.newslist .item .text { flex:1; position: relative; }

/* Underline announcement links on the homepage only */
body.home .sidebar.news .newslist a {
  text-decoration: underline;
}

/* Make the ergo name in announcements the same primary color as the 'Περισσότερα' links */
body.home .sidebar.news .newslist .ergoname {
  color: var(--primary);
  margin-top: 0.25rem;
}

.toolbox ul { 
    display: none; 
    position: absolute; 
    top: 100%; 
    right: -2px; 
    background: #f5f5f5; 
    border: 1px solid #999; 
    padding: 0.5rem; 
    list-style: none; 
}
.toolbox:hover ul { display: block; } 

.toolbox ul li { display: block; margin: 0; }
.toolbox ul li a { 
    display: block; 
    padding: 0.25rem 0.5rem; 
    color: #333; 
    text-decoration: none; 
    white-space: nowrap;    
}
.toolbox ul li a:hover { background: #ccc; }    

/* footer mappings */
#footer, .site-footer { background: var(--muted); color: #eee; padding: 30px 0 0 0; }
#footercontent, .footer-content { max-width: 990px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; padding: 1rem; }
#copyright, .copyright { background: #444444; text-align:center; padding: 20px 10px 60px 10px; color: #bbb; font-size: 0.875rem; }


.ergologo img {
    position: relative;
    max-width: 300px;
    max-height: 60px;
    float: left;
    padding-right: 20px;
}


/** 
--------------------------------------------------------------------------------
news list 
--------------------------------------------------------------------------------
**/

.newslist .record{
    list-style: none;
    margin: 0;
    padding: 20px 0;
    border-top: 1px solid #bbb;
    display: flex;
    position: relative;
}

.newslist .record .date {
    display: inline-block;
    width: 100px;
    font-weight: bold;
    color:  var(--primary);
    flex-shrink: 0;
}

.newslist .record .title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.newslist .record .title .ergoname {
    font-weight: normal;
    color:  var(--primary);
}

.newslist .record a {
    color: blue;
    text-decoration: underline;
}

#login form {
    margin: 50px;
}

#login form label { 
    display: inline-block;
    width: 180px;
}

#login form .field {
    padding: 5px;
}

#login form .error {
    color:red;
}

.page {
    position: relative;
}

/**
--------------------------------------------------------------------------------
forms
--------------------------------------------------------------------------------
**/

.form label {
	display:inline-block;
	width:220px;
}

.form .line {
    padding: 5px 0;
}






.pagelist .item {
	margin-top:3px; 
	height:60px;
	padding-top:5px; 
	background-color:#dddddd; 
	position:relative;
}

.pagelist .item .title{
	color:#444444;
	font-size:14px;
	font-weight:bold;
}

.pagelist .item .status{
	position:absolute;
	top:0px;
	padding-top:17px;
	height:40px; 
	width:40px;
	text-align:center;
}

.pagelist .item .info{
	position:absolute;
	top:0px;
	height:40px;
	padding-top:9px;
}


.pagelist .item .menu{
	color:#777777;
	font-size:12px;
}
.pagelist .item .url{
	color:#5684d7
}
.pagelist .item .buttons {
	float:right;
	padding-top:15px;
}
.pagelist .item .button {
	width:30px;
	display:inline-block; 
	text-align:center;
	overflow:hidden;
}


/* ----------------- tabs --------------------------------*/

		ul.tabs{
			margin: 0px;
			padding: 0px;
			list-style: none;
		}
		ul.tabs li{
			background: none;
			color: #222;
			display: inline-block;
			padding: 10px 15px;
			cursor: pointer;
		}

		ul.tabs li.current{
			background: #dddddd;
			color: #222;
		}

		.tab-content{
			display: none;
			background: #dddddd;
			padding: 15px;
		}

		.tab-content.current{
			display: inherit;
		}
/* ----------------- tabs end --------------------------------*/




.thumb {
	position:relative;
	display: block;
	padding:1px;
	width:230px;
	height:150px;
	line-height:150px;
	margin-bottom:10px;
	border: 1px solid #cccccc;
	border-radius: 4px;
	text-align:center;
}

.thumb img {
	position:relative;
	display:inline-block;
	vertical-align: middle;
	max-width:200px;
	max-height:130px;
}

.photos {
	position:relative;
	margin-top:10px;
}

.photos h2 {
	margin-top:20px;
	margin-bottom:20px;
}

.gallery {
	list-style-type: none;
}
.gallery .title { left:0px; right:0px;height:40px; padding-top:3px; position:absolute; background-color:rgba(0,0,0,0.5); display:block; }
.gallery li:hover .title { display:block;}
.gallery .title a {color:#ffffff;}
.gallery li { width:200px; height:250px; float:left;  margin:5px; text-align:center; position:relative;}

.gallery .tools { 
	position:absolute;
	height:40px;
	left:0px; right:0px;top:210px;
	display:none;
}
.gallery .tools a { 
	display:inline-block;
	width:30px;
	height:27px;
	background-color:rgba(0,0,0,0.8);
	line-height:30px;
	padding-top:3px;
	text-align:center;
}

.gallery li:hover .tools { display:block;}

.gallery img { max-width:200px; max-height:250px;}

.gallery li .ismain {
	position:absolute;left:5px;  top:5px; width:10px; height:10px; background-color:#00ff00; 
}

.pagegallery {
	list-style-type: none;
	padding:0px;
	margin:0px;
	margin-top:20px;
	margin-left:-5px;
    display: flex;
}

.pagegallery li { 
	width:70px;
	height:70px;
	margin:5px;
	padding:5px;
	/*box-shadow:2px 2px 6px 0px #bbbbbb;*/
	background-color:#f5f5f5;
	border:1px #cccccc solid;
}

.galleryt {
	list-style-type: none;
	padding:0px;
	margin:0px;
	margin-top:20px;
	margin-left:-5px;
}

.galleryt li { 
	float:left;
	width:200px;
	height:200px;
	margin:10px;
	padding:9px;
	/*box-shadow:2px 2px 6px 0px #bbbbbb;*/
	background-color:#f5f5f5;
	border:1px #cccccc solid;
}

.footer-title {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 30px;
}

.logos-espa {
    position: fixed;
    bottom: 0px;
    left: 0px;
    right: 0px;
    display: flex;
    justify-content: center;
    height: 1px;

}

.logos-espa img {
    height: 50px;
}

.logos-espa-container {
    display: inline-flex;
    border: 1px #bbb solid;
    margin-top: -50px;

}

/* * {
    border: 1px red solid;
} */