/* =========================================================
   NERCO - Ν. Χλύκας & Συνεργάτες Α.Ε.Μ.
   Stylesheet - responsive, accessible, mobile-first
   ========================================================= */

:root {
  --color-primary: #1b4332;
  --color-primary-dark: #10281d;
  --color-primary-light: #2d6a4f;
  --color-accent: #a9762f;
  --color-accent-dark: #7d5820;
  --color-bg: #f7f7f3;
  --color-bg-alt: #eef1ec;
  --color-surface: #ffffff;
  --color-text: #1f2421;
  --color-text-muted: #4c5750;
  --color-border: #d8ddd4;
  --focus-ring: 3px solid #ffb703;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(16, 40, 29, 0.12);
  --shadow-md: 0 6px 20px rgba(16, 40, 29, 0.14);
  --max-width: 1180px;
  --font-base: "Segoe UI", "Noto Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 1rem;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary-light);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-accent-dark);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  color: var(--color-primary-dark);
  line-height: 1.25;
  font-weight: 700;
}

h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); margin-top: 2rem; }
h3 { font-size: 1.2rem; }

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary-dark);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: 0 0 6px 0;
}

.skip-link:focus {
  left: 0;
}

/* =========================
   Header / Nav
   ========================= */
.site-header {
  background: var(--color-primary-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #ffffff;
}

.brand:hover { color: var(--color-bg-alt); }

.brand-mark {
  height: 72px;
  width: auto;
  max-width: 320px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1.15rem;
  letter-spacing: 0.5px;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}

.main-nav {
  display: flex;
}

.main-nav > ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  align-items: center;
}

.main-nav a,
.main-nav button.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.7rem 0.85rem;
  color: var(--color-primary-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.96rem;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
}

.main-nav a[aria-current="page"] {
  color: var(--color-primary-light);
  text-decoration: underline;
}

.main-nav a:hover,
.main-nav button.nav-link:hover {
  background: var(--color-bg-alt);
  color: var(--color-primary);
}

/* Top-level items sit directly on the dark header bar, so they need light
   text; the dropdown/mobile panels below stay white with dark text. */
@media (min-width: 901px) {
  .main-nav > ul > li > a,
  .main-nav > ul > li > button.nav-link {
    color: #ffffff;
  }

  .main-nav > ul > li > a[aria-current="page"] {
    color: var(--color-accent);
    text-decoration: underline;
  }

  .main-nav > ul > li > a:hover,
  .main-nav > ul > li > button.nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }
}

.has-submenu {
  position: relative;
}

.submenu {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 280px;
  display: none;
  z-index: 50;
}

.has-submenu.open .submenu {
  display: block;
}

.submenu a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.92rem;
  white-space: normal;
}

.submenu a:hover {
  background: var(--color-bg-alt);
}

/* =========================
   Hero / Slider
   ========================= */
.hero {
  position: relative;
  background: var(--color-primary-dark);
  color: #fff;
  overflow: hidden;
}

.slider {
  position: relative;
  height: clamp(220px, 36.46vw, 700px);
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease;
  display: flex;
  align-items: flex-end;
}

.slide.active {
  opacity: 1;
  visibility: visible;
}

.slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(16,40,29,0.92) 0%, rgba(16,40,29,0.35) 60%, rgba(16,40,29,0.15) 100%);
  z-index: 1;
}

.slide > .container {
  width: 100%;
}

.slide-caption {
  position: relative;
  z-index: 2;
  padding: 2rem 0 2.5rem;
  max-width: 720px;
}

.slide-caption h2 {
  color: #fff;
  margin: 0 0 0.5rem;
}

.slide-caption p {
  margin: 0 0 1rem;
  color: #e7ede8;
}

.slider-controls {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  pointer-events: none;
}

.slider-controls button {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.6);
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.1rem;
  pointer-events: auto;
}

.slider-controls button:hover {
  background: rgba(255,255,255,0.3);
}

.slider-dots {
  display: none;
}

/* =========================
   Buttons
   ========================= */
.btn {
  display: inline-block;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn:hover {
  background: var(--color-primary-light);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary-dark);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

/* =========================
   Sections & cards
   ========================= */
main {
  display: block;
}

section {
  padding-block: 2.5rem;
}

.section-title {
  text-align: center;
  margin-bottom: 0.4rem;
}

.section-lead {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 2rem;
  color: var(--color-text-muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: var(--color-bg-alt);
}

.card-body {
  padding: 1.1rem 1.2rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.card-body h3 {
  margin: 0;
  font-size: 1.05rem;
}

.card-body h3 a {
  text-decoration: none;
  color: var(--color-primary-dark);
}

.card-body h3 a:hover {
  text-decoration: underline;
}

.card-body p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.94rem;
  flex: 1;
}

.card-link {
  font-weight: 600;
  font-size: 0.9rem;
}

/* =========================
   Page header / breadcrumb
   ========================= */
.page-hero {
  background: var(--color-primary-dark);
  color: #fff;
  padding: 2.2rem 0;
}

.page-hero h1 {
  color: #fff;
  margin: 0.2rem 0 0;
}

.breadcrumb {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  color: #cfe0d5;
}

.breadcrumb a {
  color: #d9ead9;
}

.breadcrumb li:not(:last-child)::after {
  content: "›";
  margin-left: 0.35rem;
  color: #9fc3ac;
}

/* =========================
   Layout with sidebar
   ========================= */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  align-items: start;
  padding-block: 2.5rem;
}

@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.side-nav {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  position: sticky;
  top: 90px;
}

.side-nav h2 {
  font-size: 1rem;
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
}

.side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.side-nav a {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.93rem;
}

.side-nav a:hover {
  background: var(--color-bg-alt);
}

.side-nav a[aria-current="page"] {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

.content article > * + * {
  margin-top: 1rem;
}

.content figure {
  margin: 1.5rem 0;
}

.content figcaption {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
}

/* Accordion (native details/summary) */
.accordion-item {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  background: var(--color-surface);
  overflow: hidden;
}

.accordion-item > summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--color-bg-alt);
}

.accordion-item > summary::-webkit-details-marker {
  display: none;
}

.accordion-item > summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 400;
  flex-shrink: 0;
}

.accordion-item[open] > summary::after {
  content: "−";
}

.accordion-item .accordion-body {
  padding: 1rem 1.1rem;
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-list li {
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--color-border);
  font-size: 0.95rem;
}

.project-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.project-group-title {
  margin-top: 1.4rem;
  color: var(--color-accent-dark);
  font-size: 1.02rem;
}

/* Info / notice boxes */
.notice {
  background: var(--color-bg-alt);
  border-left: 4px solid var(--color-accent);
  padding: 1rem 1.2rem;
  border-radius: 6px;
}

.under-construction {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

/* =========================
   Tables
   ========================= */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

caption {
  text-align: left;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--color-border);
  font-size: 0.93rem;
}

th {
  background: var(--color-bg-alt);
}

/* =========================
   Contact page
   ========================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 800px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-info-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-info-list li {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.contact-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.map-frame {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/10;
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

form.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font: inherit;
  background: var(--color-surface);
}

.form-row .hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.required::after {
  content: " *";
  color: #b3261e;
}

/* =========================
   News feed (homepage, dark list style)
   ========================= */
.news-feed-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}

.news-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.news-feed-item {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.news-feed-item:last-child {
  border-bottom: none;
}

.news-feed-date {
  background: var(--color-primary);
  color: #fff;
  width: 96px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.1rem 0.5rem;
  text-align: center;
}

.news-feed-date .day {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.news-feed-date .month {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-top: 0.3rem;
  text-transform: uppercase;
}

.news-feed-date .year {
  margin-top: 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
}

.news-feed-body {
  background: #16211c;
  color: #fff;
  flex: 1;
  padding: 1.1rem 1.4rem;
  min-width: 0;
}

.news-feed-body h3 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
  line-height: 1.35;
}

.news-feed-body h3 a {
  color: #fff;
  text-decoration: none;
}

.news-feed-body h3 a:hover,
.news-feed-body h3 a:focus-visible {
  text-decoration: underline;
}

.news-feed-body p {
  margin: 0;
  color: #b7c4bc;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

@media (max-width: 560px) {
  .news-feed-date {
    width: 76px;
    padding: 0.9rem 0.4rem;
  }
  .news-feed-date .day { font-size: 1.4rem; }
  .news-feed-date .year { font-size: 0.6rem; padding: 0.1rem 0.45rem; }
  .news-feed-body { padding: 1rem 1.1rem; }
}

/* =========================
   News list
   ========================= */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.news-item {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1.5rem;
}

.news-date {
  display: inline-block;
  background: var(--color-bg-alt);
  color: var(--color-primary);
  border-radius: 999px;
  padding: 0.15rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.news-item h3 {
  margin: 0 0 0.4rem;
}

.news-item h3 a {
  text-decoration: none;
  color: var(--color-primary-dark);
}

.news-item h3 a:hover {
  text-decoration: underline;
}

/* =========================
   Footer
   ========================= */
.site-footer {
  background: var(--color-primary-dark);
  color: #d9e2dc;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  padding-block: 2.5rem;
}

.footer-grid h2 {
  color: #fff;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.9rem;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-grid a {
  color: #cfe0d5;
  text-decoration: none;
  font-size: 0.92rem;
}

.footer-grid a:hover {
  text-decoration: underline;
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 1.1rem 0;
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  color: #a9bdb2;
}

.footer-bottom a {
  color: #cfe0d5;
}

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 400;
}

.back-to-top.visible {
  display: block;
}

/* =========================
   Utility
   ========================= */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }

/* =========================
   Mobile nav
   ========================= */
@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(340px, 88vw);
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    padding: 1.25rem;
    overflow-y: auto;
  }

  .main-nav.open {
    transform: translateX(0);
  }

  .main-nav > ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
  }

  .main-nav a,
  .main-nav button.nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 0.85rem 0.7rem;
  }

  .submenu {
    position: static;
    box-shadow: none;
    border: none;
    display: none;
    min-width: 0;
    padding-left: 0.75rem;
  }

  .has-submenu.open .submenu {
    display: block;
  }

  .nav-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(16,40,29,0.45);
    z-index: 490;
  }

  .nav-scrim.visible {
    display: block;
  }
}

@media (min-width: 901px) {
  .nav-scrim { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
