:root{
  --bg-map: url('/modules/custom/project/assets/map.png');
  --bg-product: url('/modules/custom/project/assets/by_product.jpg');
}

/* top image */

#top-image {
  width: 100%;
  height: auto;
}

/* body{ margin:0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; } */
.wrap{
  background: #ececed;
  margin: 0 65px;
  padding: 20px;
  display:grid;
  grid-template-columns: 50% 50%;
  gap: 20px;
  align-items:start;
  min-height: 600px!important;
}

.title{
  margin: 0 0 8px;
  font-size: 35px;
}

.muted{
  color:#6b7280;
  font-size: 12px;
}

table{
  width:100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  border-bottom: 2px solid #9c9a9d;
  text-align: right;
  padding: 8px 6px;
}

td{
  padding: 8px 6px;
  border-bottom: 1px solid #9c9a9d;
  text-align: right;
}

th:first-child, td:first-child{
  text-align:left;
}

tfoot td{
  font-weight: 700;
  border-bottom: 2px solid #9c9a9d;
}

.btns{
  display:flex; gap:8px; flex-wrap:wrap; align-items:center;
}

.btn{
  border: 1px solid #ccc;
  background:#fff;
  padding:6px 10px;
  cursor:pointer;
  font-size: 13px;
  color: #000;
  font-family: Inter;
}

.btn.active{
  background:#034492;
  color:#fff;
  border-color: #004392;
}

.chart-card{
  display:grid;
  max-height: 600px;
  justify-content: center;
  justify-items: center;
  gap:30px;
}

.center{
  text-align:center;
}

.section-divider {
  color: gray;
  border-style: inset;
  border-width: 1px;
}

/* add margin */

.project-tabs {
  margin-bottom: 65px;
}

.chart-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  justify-content: center;
  gap: 8px 30px;
  margin: 12px auto 0;
  font-size: 14px;
  padding: 0;
  list-style: none;
  max-width: 900px;
}

.chart-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}


.chart-legend li span {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
}


/* map */
/* ===== MAP ===== */

  /* ===== MAP ===== */
  .map-wrap{
    padding: 65px;
    border-radius:16px; color:#fff; position:relative; overflow:hidden;
  }
  .map-canvas{
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;   /*better results Image Ratio */
    overflow: hidden;
  }
  .map-img{
    position:absolute; inset:0; width:100%; height:100%;
    object-fit: contain; display:block; pointer-events:none;
    z-index: 1;
  }

  /* HEADER map */
  .map-head.overlay{
    position:absolute; left:0; right:0; top:0; z-index:4;
    display:flex; justify-content:space-between; align-items:flex-end; gap:16px;
    padding: 12px 12px 28px; margin-top: 15px;
    width: min-content;
  }
  .map-head.overlay h3{ margin:0; font-size:clamp(18px,2.6vw,28px) }
  .muted{ opacity:.9; font-size:12px }

  /* Pins */
  .pin{ position:absolute; transform:translate(-50%,-50%); z-index:3; min-width:120px; max-width:180px; text-shadow:0 2px 6px rgba(0,0,0,.5) }
  .pin .country{ font-weight:800 }
  .pin .count{ font-weight:700; display:inline-block; border-bottom:2px solid rgba(255,255,255,.9) }
  .pin .amount{ font-size:12px; margin-top:2px; opacity:.95 }
  @media (max-width:768px){ .pin{ min-width:90px; max-width:140px; font-size:12px } .pin .amount{ font-size:11px }   #flex-menu{
    gap: 5px!important;
  }
  .wrap .table-wrap{
    overflow-x: auto;
    width:100%;
  }.chart-legend{
    width:100%!important;
    text-align: left;
  }.chart-card{
    max-height: 100%;
    justify-items: center;
  }.panel .title{
    font-size:25px;
  }
}

/* links on countries */

.map-links {
  text-decoration: none;
  color: #fff;
}

/* KPIs right-down */
.kpi-overlay{
  position:absolute; 
  left:12px; 
  bottom:12px; 
  z-index:4;
  max-width:260px; 
  color:#fff; 
}

.kpi{ margin-bottom:14px; }

.kpi-label{ 
  font-size:16px; 
  opacity:.95;
  font-family: "Inter", sans-serif; 
  color:#fff; 
  font-weight: 700;  

}
.kpi-value{ font-weight:800; font-size:clamp(24px,4vw,42px); line-height:1; margin-top:4px; color:#0D3082; }
.kpi-sep { 
  height:3px; 
  width:100%; 
  background:#fff; 
  margin:10px 0; 
}

@media (max-width:768px){
  .kpi-overlay{ left:8px; top:64px; bottom:auto; max-width:200px; } /* κάτω από το header */
  .kpi-value{ font-size:clamp(20px,5vw,28px); }
}

.footnote{ margin-top:10px; opacity:.85; font-size:12px }

@media (max-width: 768px){
.pin{ display: none !important; }
}

/* Mobile-only tweaks για τα KPIs */
@media (max-width: 768px){
  /*  pins are hidden  */
  .kpi-overlay{
    position: absolute;
    top: 137px;               /* below header into canvas */
    left: 8px;
    right: 8px;
    bottom: auto;
    max-width: none;         /* full width card */
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.9);  /* card for reading */
    box-shadow: 0 6px 16px rgba(0,0,0,.18);
    color: #0D3082;          /* brand color text */
    text-shadow: none;
    display: none;
  }

  .kpi{
    margin: 0 0 10px 0;
  }

  /* labels smaller + 2 lines max */
  .kpi-label{
    font-size: 12px !important;
    line-height: 1.25;
    font-weight: 700;
    color: #0D3082 !important;
    opacity: .95;
    display: -webkit-box;
    -webkit-line-clamp: 2;   /* κόψε στα 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .kpi-value{
    font-size: clamp(18px, 7vw, 26px) !important;
    line-height: 1.05;
    margin-top: 4px;
    color: #0D3082 !important;
  }

  .kpi-sep{
    height: 2px;
    margin: 8px 0;
    background: #0D3082 !important;
  }

  /* litte bit spacing last */
  .kpi:last-child{ margin-bottom: 0; }
}
/* By Sector */

.bubble-wrap {
  margin: 65px;
  background-color: #0f1f67;
  padding: 12px;
  aspect-ratio: 16 / 9;
}

.bubble-head h3 {
  color: white;
}

#sector-bubbleCanvas > div {
  align-content: center;
}

#sector-bubbleCanvas > div > div:first-child {
  color: #0f1f67;
  text-shadow: none;
  font-family: "Source Serif 4";
}

#sector-bubbleCanvas > div > div:nth-child(2) {
  color: black;
  text-shadow: none;
}

/* Cumulative Portfolio by Sector */

.shell > .card {
  background: #ececed;
  margin: 0 65px;
  padding: 20px;
}

.grid {
  display: grid;
  grid-template-columns: 50% 50%;
  gap: 20px;
}

.grid > .card {
  display: grid;
  justify-content: center;
  max-height: 600px;
}

.btns,
.bubble-head > .hstack {
  margin: 10px 0;
}

/* map button styling */

#map-stats .btns {
  flex-direction: column;
}

#map-stats .btn {
    width: 200px;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 16px solid #fff;
    color: #fff;
    padding: 8px 0;
    font-family: Inter;
    font-size: 16px;
    text-transform: uppercase;
}

#map-stats .btn.active {
    color: #004392;
    border-color: #004392;
}

.bubble-head > .hstack {
  position: relative;
  z-index: 999;
  display: flex;
  flex-direction: column;
  width: 200px;
  gap: 8px;
  text-align: left;
  margin-top: 25px;
}

.bubble-head > .hstack .btn {
  width: 200px;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 16px solid #fff;
  color: #fff;
  padding: 8px 0;
  font-family: Inter;
  font-size: 16px;
  text-transform: uppercase;
}

.bubble-head > .hstack .btn.active {
  border-color: #009ddf;
  color: #009ddf;
}

/* tabs */

#map-stats,
.bubble-wrap {
  height: auto;
}

.project-labels{
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
  position:absolute;
  bottom: 20px;
  right: 0;
  z-index: 9999;
}

.project-tabs {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.project-tab{
  display: none;
}

.project-tab.active{
  min-width: 100%;
  display: flex;
  flex-direction: column;
}

.project-labels button{
  font-size: 16px;
  font-family: "Inter";
  background: transparent;
  color: #fff;
  border:unset;
  border-bottom: 16px solid #fff;
  text-transform: uppercase;
  padding-right: 100px;
  padding-bottom: 8px;
  font-weight: bold;
}

#map-stats .project-labels button.active {
  border-color: #004392;
  color: #004392;
}

.bubble-wrap .project-labels button.active,
.portfolio-section .project-labels button.active {
  border-color: #009ddf;
  color: #009ddf;
}

.bubble-wrap{
  position: relative;
}

/* by product */

/* .hero-wrap {
  position: relative;
  margin: 65px;
  background: var(--bg-product) center/cover no-repeat;
  
  height: 1035px!important;
} */

.portfolio-section li {
    list-style-type: none;
    font-family: 'Source Serif 4';
    line-height: 1;
}

.portfolio-section { 
  position: relative; 
  display: flex; 
  align-items: center;
  justify-content: center; 
  background: url("/modules/custom/project/assets/by_product.jpg") no-repeat center center; 
  background-size: cover; 
  aspect-ratio: 16 / 9;
  margin: 65px;
}

#products-section {
  margin: 0 65px;
  background-color: #ececed;
  padding: 20px;
}

#product-grid{
  display:grid;
  grid-template-columns: 50% 50%;
  gap:20px;
}

#product-grid .card {
  max-height: 500px;
  display: grid;
  justify-content: center;
}

.hero-wrap {
  padding: 150px;
}

/* mobile layout */

@media (max-width: 768px) {

  #carousel-slides {
    margin: 30px !important;
  }

  #product-grid,
  .wrap,
  .grid {
    grid-template-columns: 100%;
  }

  .wrap,
  .shell > .card,
  #products-section {
    margin: 0 30px;
  }

  .map-wrap,
  .bubble-wrap,
  .hero-wrap {
    padding: 0px;
    margin:0px!important;
  }

  .project-labels {
    width: 100%;
    gap: 8px;
  }

  .project-labels button {
    padding-right: 0;
  }

  /* #map-stats, .bubble-wrap, .hero-wrap {
    height: 500px;
  } */

  #sector-bubbleCanvas {
    zoom: 0.33;
    aspect-ratio: 1 / 1 !important;
  }

  /* cross countries */

  #cross-countries {
    flex-direction: column;
    margin: 30px 30px 33px 30px !important;
  }
}

/* carousel */

/* #carousel-widget{
  height:500px;
} */

#carousel-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
}

#carousel-slides {
  display: flex;
  gap: 16px;
  margin: 65px;
}

.carousel-slide {
  flex: 0 0 auto;
  box-sizing: border-box;
}

#carousel-slides img {
  width: 100%;
  height: 430px;
  object-fit: cover;

  pointer-events: none; /* για drag */
  user-drag: none;
  -webkit-user-drag: none;
}

/* --- Image box + hover read-more --- */
.image-box {
  position: relative;
}

#read-more {
  line-height: 1;
  position: absolute;
  bottom: 12px;
  right: 20px;
  color: white;
  font-size: 40px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.carousel-slide:hover #read-more,
#grid article:hover #read-more {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.slide-inner > a {
  display: flex;
  flex-direction: column;
}

.slide-inner h4 {
  padding-top: 8px;
  color: #003366;
  font-weight: bold;
}

.slide-inner p {
  font-size: 12px;
  color: #666;
  font-weight: bold;
}

.slide-inner .meta {
  margin-top: auto;
}

.slide-inner .meta,
.slide-inner .meta .country,
.slide-inner .meta .price {
  font-weight: bold;
  font-size: 12px;
}

.slide-inner .meta .country {
  font-family: Inter;
}

.carousel{
  position: relative;
  margin-top: 20px;
}

.carousel-btn.next{
position: absolute;
    right: clamp(8px, 1.4vw, 14px);
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    border: 0;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
    z-index: 20;
}

/* GRID */

.clamp-4{display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}

.thumb{
  position:relative;
  width:100%;
  /* aspect-ratio:4/3;  */
  height: 500px;
  background: linear-gradient(130deg, #009462 40%, #002D73 100%);
}

.thumb-badge{
  position:absolute; left:12px; bottom:12px;
  background: rgba(255,255,255,.9); padding:4px 8px;
  font-size:12px; font-weight:600;
}

.content-box {
  min-height: 80px;
}

#prevPage,
#nextPage {
  border: 0;
  font-family: "Material Symbols Outlined";
  border-radius: 50%;
  padding: 10px;
  width: 33px;
  height: 33px;
  background-color: transparent;
  color: #004392;
  border: solid 2px #004392;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#prevPage:hover:not(:disabled),
#nextPage:hover:not(:disabled) {
  background-color: #004392;
  color: #fff;
}

#prevPage:disabled,
#nextPage:disabled {
  opacity: 50%;
}

.country-bubble {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* thumbnail titles */

#thumb-title-wrap {
  position: absolute;
  height: 90%;
  padding: 12px;
  display: flex;
  align-items: flex-end;
}

#thumb-title {
  min-height: 100px;
  font-family: Inter;
  color: white;
  font-size: 30px;
  line-height: 1.2;
}

#thumb-image {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

/* inbetween text */

#cross-countries {
  display: flex;
  margin: 65px 65px 33px 65px;
  padding-bottom: 32px;
  border-bottom: 3px solid #6F7072;
  gap: 20px;
}

#cross-countries .half {
  flex: 1 1 50%;
}

#cross-countries h2 {
  font-size: 35px;
  color: #333;
  line-height: 1;
}

#cross-countries p {
  color: #333;
  font-size: 20px;
  text-align: justify;
}

/* search bar */

.relative {
  position: relative;
}

.search-icon {
  font-family: "Material Symbols Outlined";
  position: absolute;
  right: 6px;
  top: 8px;
}

/* filter menu */

#flex-menu {
  display: flex;
  gap: 30px;
}


.layout-wrapper {
  width: 100%;
  padding: 0 30px 30px;
  margin: 0;
}
@media (min-width: 1024px) {
  .layout-wrapper {
    padding: 0 65px 65px;
  }
}

/* Header flex */
.layout-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 768px) {
  .layout-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
    flex-wrap: wrap;
}
@media (min-width: 768px) {
  .header-left {
    width: 50%;
    flex-wrap: nowrap;
  }
}

/* Search bar */
.search-bar {
  position: relative;
  width: 100%;
}
.search-input {
  width: 100%;
  max-width: 320px;
  border: none;
  border-bottom: 2px solid #6F7072;
  border-radius: 0;
  background: #fff;
  padding: 8px 12px;
  font-size: 14px;
}
.search-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #3b82f6; /* blue focus ring */
}
.search-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

/* Filter menu */
.filter-menu {
  display: flex;
  gap: 8px;
}
.filter-select {
  border: none;
  background: #fff;
  font-size: 14px;
  padding: 6px 8px;
  width: 90px;
}

/* Count */
.results-count {
  font-size: 14px;
  color: #4b5563; /* gray-600 */
  white-space: nowrap;
}

/* Grid */
.projects-grid {
  margin-top: 33px;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 640px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Pagination */
.pagination {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

  #cross-countries .half h2{
    font-size:22px;
  }

  #cross-countries p{
    font-size:14px;
  }

  #flex-menu{
    gap:5px!important;
  }

  /* Mobile: keep only .project-labels and the .wrap (table+chart) */
  @media (max-width: 960px) {
    .project-labels button.active {
      border-color: #004392;
      color: #004392;
    }

    .project-labels button{
        border-color: #009ddf;
        color: #009ddf;
        font-size:12px;
    }

    .mobile-only{
      position: static;
    }

    .wrap{
      margin: 0px;
    }

    .project-tabs{
      padding: 20px;
    }

    .project-labels{
        position:static;
        background: #ececed;
        padding: 20px;
        justify-content: space-around;
    }
    .wrap, .shell > .card, #products-section{
      margin:0!important;
    }

    .project-tab > :not(.wrap):not(.shell) {
      display: none !important;
    }

    .project-tab > .shell > :not(.wrap):not(.resall) {
      display: none !important;
    }

    .project-tab > .shell > .resall > :not(.wrap) {
      display: none !important;
    }

    .project-tab .bubble-wrap {
      display: none;
    }
  }
