#timeliness > .section-body {
  min-height: 350px;

  .slick-track {
    display: flex !important;
    margin: 0 !important;
  }
}

.category-posts-wrapper {
  margin: 0 2rem;
  transition: opacity 0.15s ease;
}

/* timeliness.js fades the posts out while it switches category */
.category-posts-wrapper.is-switching {
  opacity: 0;
}

/* Home page Ενημέρωση, before slick starts: same layout as the slider (3 / 2 / 1 per row, timeliness.js),
   so the posts don't show stacked for a moment. Only #timeliness: category pages use this file too, without a slider */
#timeliness .category-posts-wrapper:not(.slick-initialized) {
  display: flex;
  overflow: hidden;
}

#timeliness .category-posts-wrapper:not(.slick-initialized) > .category-post {
  flex: 0 0 33.3333%;
  max-width: 33.3333%;
}

@media screen and (max-width: 1499.98px) {
  #timeliness .category-posts-wrapper:not(.slick-initialized) > .category-post {
    flex-basis: 50%;
    max-width: 50%;
  }
}

@media screen and (max-width: 767.98px) {
  #timeliness .category-posts-wrapper:not(.slick-initialized) {
    flex-direction: column;
  }

  #timeliness .category-posts-wrapper:not(.slick-initialized) > .category-post {
    flex-basis: auto;
    max-width: 100%;
  }

  #timeliness .category-posts-wrapper:not(.slick-initialized) > .category-post:nth-child(n + 4) {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .category-posts-wrapper {
    transition: none;
  }
}
.category-selector-wrapper {
  min-width: fit-content;
  position: relative;
}

.category-selector {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-selector li {
  padding: 10px 1rem;
}

.category-btn {
  max-width: 100%;
  width: 100%;
  border: none;
  background: none;
  font-weight: 500;
  border-bottom: 2px solid #375895;
  padding: 10px;
  transition: all 1s ease-in-out;
}

.category-btn > i {
  opacity: 0;
}

.category-btn.active > i {
  opacity: 1;
}

.category-btn:hover:not(.active) > i {
  animation: slide-in 0.4s ease-in 0.1s 1 normal forwards;
}

.timeliness-body {
  max-width: 80%;
  align-items: flex-start;
  justify-content: center;
}

@keyframes slide-in {
  0% {
    transform: translateX(-40px);
    opacity: 0;
  }

  10% {
    transform: translateX(-35px);
    opacity: 0.1;
  }

  20% {
    transform: translateX(-30px);
    opacity: 0.3;
  }

  30% {
    transform: translateX(-20px);
    opacity: 0.5;
  }

  50% {
    transform: translateX(-15px);
    opacity: 0.6;
  }

  60% {
    transform: translateX(-10px);
    opacity: 0.7;
  }

  80% {
    transform: translateX(-8px);
    opacity: 0.8;
  }

  90% {
    transform: translateX(-5px);
    opacity: 0.9;
  }

  100% {
    transform: translateX(0px);
    opacity: 1;
  }
}

.category-post {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.post-wrapper {
  width: 260px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0px 2px 4px #00000029;
  margin: 0px 2px 4px 0px;
  overflow: hidden;
  min-height: 370px;
}

.post-wrapper:hover {
  opacity: 0.75;
}

.post-wrapper-inner {
  box-shadow: 0px 2px 4px #00000029;
  border-radius: 10px;
  max-width: 260px;
  overflow: hidden;
}

.category-post-title {
  max-width: 100%;
  overflow: hidden;
  color: #3b3b3a;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-post-content-wrapper {
  max-width: 100%;
  width: 100%;
}

.post-thumbnail img {
  height: 160px;
  object-fit: scale-down;
  background: #F1F1F1;
  width: 100%;
  object-fit: cover;
}

.post-not-found-text {
  width: 280px !important;
}
.category-post-content {
  color: #7c7c7c;
}
.custom-slider-btn {
  font-size: 30px;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 100%;
  transition: all 0.2s ease-in;
  transform: translateX(-50%);
}

.custom-slider-btn:hover:not(.slick-disabled) {
  color: #fff !important;
}

.custom-slider-btn.slick-disabled {
  opacity: 0.25;
}

.slick-dots li button:before {
  color: #fff !important;
}

#loading {
  width: 100px;
}

@media screen and (min-width: 992px) {
  .category-selector {
    max-height: 477px;
    overflow: auto;
  }

  .category-selector-wrapper {
    padding: 0px 60px 0px 0;
  }

  #timeliness-slider-prev {
    left: -15px;
  }

  #timeliness-slider-next {
    left: calc(100% - -15px);
  }

  .main-btn-wrapper {
    padding: 50px 0px 50px 50px !important;
  }
}

@media screen and (min-width: 991px) and (max-width: 1199px) {
  .dropdown-btn {
    display: none;
  }
}

@media screen and (max-width: 991px) {
  #timeliness-slider-prev {
    left: -10px;
  }

  #timeliness-slider-next {
    left: calc(100% - -10px);
  }

  .posts-wrapper,
  .category-selector-wrapper {
    width: 90%;
    margin: 0 auto;
  }

  .dropdown-btn {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: left;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    padding: 10px;
    cursor: pointer;
    border: 0;
    border-bottom: 2px solid #3e3a32;
    background-color: #fff;
    color: #931913;
    font-weight: 500;
    font-size: 19px;
  }

  .category-selector {
    flex-direction: column;
  }

  i.fa-solid.fa-chevron-down {
    color: #931913;
    opacity: 0.7;
  }

  .dropdown-btn {
    position: relative;
    max-height: 500px;
    overflow: auto;
  }

  .category-selector {
    position: absolute;
    top: 51px;
    left: 0px;
    right: 0;
    z-index: 9;
    background: #fff;
    box-shadow: 0px 2px 4px #0000004f;
  }
}

@media screen and (max-width: 768px) {
  #timeliness-slider-next {
    left: calc(100% - -5px);
  }

  #timeliness-slider-prev {
    left: -5px;
  }

  .custom-slider-btn {
    font-size: 20px;
    width: 40px;
    height: 40px;
  }
  .category-post {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  /* Category / Ενότητες cards only (on the home page this file also loads next to other sections) */
  .category-posts-wrapper .text-row-2 {
    min-height: 75px !important;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}

/* =====================================================================
   Home page «Ενημέρωση» (Figma "Ενημέρωση" + "Category Item" + "News Card")
   Everything below is scoped to #timeliness: the rules above also style the category pages.
   ===================================================================== */

#timeliness {
  background: var(--sf-surface);
}

#timeliness .timeliness-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sf-gap-xl);
}

#timeliness .sf-section-title {
  width: 100%;
}

/* Categories on the left (260–320px), carousel next to them; stacked below 992px */
#timeliness .timeliness-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--sf-gap-xl);
  width: 100%;
  max-width: none;
}

#timeliness .category-selector-wrapper {
  flex: 0 1 320px;
  min-width: 260px;
  max-width: 320px;
  width: auto;
  margin: 0;
  padding: 0;
}

#timeliness .posts-wrapper {
  display: flex;
  flex: 999 1 600px;
  flex-direction: column;
  align-items: center;
  gap: var(--sf-gap-xl);
  min-width: 0;
  width: auto;
  margin: 0;
}

@media (max-width: 991.98px) {
  #timeliness .category-selector-wrapper {
    flex-basis: 100%;
    max-width: none;
    min-width: 0;
  }

  #timeliness .posts-wrapper {
    flex-basis: 100%;
  }
}

/* ----- Category list (always visible: the design has no dropdown) ----- */
#timeliness .category-selector {
  position: static;
  display: block !important;
  max-height: none;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

#timeliness .category-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 16px;
  color: var(--sf-brand-dark);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--sf-border);
  font-size: var(--sf-fs-md);
  font-weight: 500;
  line-height: var(--sf-lh-body);
  text-align: left;
  transition: background-color var(--sf-transition), color var(--sf-transition), border-color var(--sf-transition), box-shadow var(--sf-transition);
}

#timeliness .is-child .category-btn {
  padding-left: 32px;
  font-size: var(--sf-fs-sm);
}

#timeliness .category-btn > i {
  flex-shrink: 0;
  color: var(--sf-brand-dark);
  font-size: 14px;
  opacity: 0;
  animation: none;
}

/* Hover (Figma State=Hover): light blue, the grey line under it stays */
#timeliness .category-btn:hover {
  color: var(--sf-brand-ink);
  background: var(--sf-brand-light);
}

/* Selected category: light blue, 4px dark blue bar on the left and a dark blue line under it.
   The bar is an inset shadow, so the text doesn't move. */
#timeliness .category-btn.active {
  color: var(--sf-brand-ink);
  background: var(--sf-brand-light);
  border-bottom-color: var(--sf-brand-dark);
  box-shadow: inset 4px 0 0 var(--sf-brand-dark);
}

#timeliness .category-btn.active > i {
  opacity: 1;
  color: var(--sf-brand-dark);
}

/* Keyboard focus (Figma State=Active): the same in text/on-tint-accent */
#timeliness .category-btn:focus-visible {
  color: var(--sf-brand-ink);
  background: var(--sf-brand-light);
  border-bottom-color: var(--sf-on-tint-accent);
  box-shadow: inset 4px 0 0 var(--sf-on-tint-accent);
  outline: none;
}

#timeliness .category-btn:hover > i,
#timeliness .category-btn:focus-visible > i {
  opacity: 1;
  color: var(--sf-on-tint-accent);
}

/* ----- Carousel: arrow, cards, arrow ----- */
#timeliness .timeliness-carousel {
  display: flex;
  align-items: center;
  gap: var(--sf-gap-md);
  width: 100%;
}

#timeliness .category-posts-wrapper {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

#timeliness .slick-list {
  /* room for the card shadows */
  padding: 4px 0 12px;
}

#timeliness .slick-track {
  display: flex !important;
  margin: 0 !important;
}

#timeliness .slick-slide {
  height: auto;
  margin: 0;
}

/* Same height cards in a row; not when slick stacks several rows in a slide (phones) */
#timeliness .slick-slide > div:only-child {
  height: 100%;
}

#timeliness .category-post {
  display: flex !important;
  align-items: stretch;
  height: 100%;
  padding: 0 calc(var(--sf-gap-lg) / 2);
}

/* ----- News card ----- */
#timeliness .news-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: var(--sf-text);
  background: var(--sf-surface);
  /* Transparent until hover, so the card doesn't move when the frame appears */
  border: 1px solid transparent;
  border-radius: var(--sf-radius);
  box-shadow: var(--sf-shadow-card);
  text-decoration: none;
  opacity: 1;
  transition: box-shadow var(--sf-transition), border-color var(--sf-transition);
}

#timeliness .news-card .post-thumbnail {
  flex-shrink: 0;
  height: 200px;
  background: var(--sf-surface-alt);
}

#timeliness .news-card .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--sf-surface-alt);
}

#timeliness .news-card .category-post-content-wrapper {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--sf-gap-xs);
  padding: 20px 20px 24px;
}

#timeliness .news-card-title {
  min-height: calc(2em * 1.3) !important;
  margin: 0;
  color: var(--sf-text);
  font-size: var(--sf-fs-h3);
  font-weight: 700;
  line-height: var(--sf-lh-card);
  transition: color var(--sf-transition);
}

#timeliness .news-card-date {
  color: var(--sf-accent-dark);
  font-size: var(--sf-fs-sm);
  line-height: var(--sf-lh-small);
}

#timeliness .news-card-excerpt {
  min-height: 0;
  margin: 0;
  color: var(--sf-text-muted);
  font-size: var(--sf-fs-md);
  line-height: var(--sf-lh-body);
}

/* Hover: 1px border-primary frame all around the card, deeper shadow, blue title */
#timeliness .news-card:hover {
  opacity: 1;
  border-color: var(--border-primary, #83abf4);
  box-shadow: var(--sf-shadow-card-hover);
}

#timeliness .news-card:hover .news-card-title {
  color: var(--sf-brand-dark);
}

#timeliness .news-card:focus-visible {
  outline: var(--sf-focus-ring);
  outline-offset: -3px;
}

/* "Δείτε περισσότερα" under the carousel, centred */
#timeliness .timeliness-btn {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0 !important;
}

/* ----- Phones: three cards stacked (slick rows), arrows under them ----- */
@media (max-width: 767.98px) {
  #timeliness .timeliness-carousel {
    flex-wrap: wrap;
    justify-content: center;
  }

  #timeliness .category-posts-wrapper {
    flex-basis: 100%;
    order: -1;
  }

  #timeliness .category-post {
    padding: 0 0 var(--sf-gap-md);
  }

  #timeliness .news-card .post-thumbnail {
    height: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #timeliness .category-btn,
  #timeliness .news-card,
  #timeliness .news-card-title {
    transition: none;
  }
}
