/* =====================================================================
   Hero (Figma "Hero" + "Hero Search Card" + "Quick Access")
   The photo / slider / video fills the section as a background; the glass card is in the normal
   flow, so the hero is as tall as the design (fluid min-height) and grows with the card on phones.
   ===================================================================== */

#hero {
  height: fit-content;
}

#hero .media-container {
  display: flex;
  justify-content: center;
  align-items: center;
  /* 666 at 1920, 544 at 768 */
  min-height: clamp(540px, 10.6vw + 463px, 680px);
  /* Below the transparent header: 176 / 152 / 128 at the top, 96 / 72 / 48 at the bottom */
  padding: calc(var(--sf-header-h) + var(--sf-section-py)) var(--sf-gutter) var(--sf-section-py);
  overflow: hidden;
}

/* Darker at the top (header readability) and a light tint everywhere (card readability) */
#hero .media-container::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--sf-overlay-hero);
  pointer-events: none;
}

#hero .hero-image,
#hero .hero-video,
#hero .image-slider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
}

#hero .hero-image,
#hero .hero-video {
  object-fit: cover;
  border-radius: 0;
}

.hero-video-controls {
  display: none !important;
}

/* The slides' z-indexes (crossfade) stay inside the slider, so they never cover the glass card */
.image-slider {
  z-index: 0;
  isolation: isolate;
}

/* Hero slider crossfade: the slides are stacked */
#hero .hero-slide {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

#hero .hero-slide.prev {
  opacity: 1;
  z-index: 1;
  transition: none;
}

#hero .hero-slide.active {
  opacity: 1;
  z-index: 2;
}

/* ----- Glass card: title, subtitle, Απλή / AI search, gov.gr CTA ----- */
.hero-text-and-search {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 708px;
  gap: 14px;
  /* 34×38 / 28 / 20 */
  padding: clamp(20px, 1.2vw + 18.8px, 34px) clamp(20px, 1.6vw + 16px, 38px);
  background: rgba(29, 29, 29, 0.28);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--sf-on-dark);
  border-radius: var(--sf-radius-lg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  transition: opacity 0.45s ease;
}

/* The script in section-hero.php adds .is-loading and removes it once the search widget has rendered.
   Without the script the card is simply visible. */
.hero-text-and-search.is-loading {
  opacity: 0;
}

.hero-welcome-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin: 0;
}

.hero-welcome-title {
  display: block;
  font-size: var(--sf-fs-hero);
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.hero-welcome-subtitle {
  display: block;
  font-size: var(--sf-fs-md);
  font-weight: 400;
  line-height: 1.4;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

/* Search widget (Απλή / AI toggle + search bar, from the Search AI plugin) */
#hero .search-block-wrapper {
  max-width: 492px;
}

/* ----- gov.gr CTA (Figma "Gov CTA") ----- */
/* One row on every width: logo, label (wraps on itself), arrow */
.hero-govgr-btn {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 6px 12px;
  width: 100%;
  max-width: 492px;
  padding: 12px 18px;
  color: var(--sf-on-dark);
  background-color: var(--sf-navy);
  border: 1px solid var(--sf-on-dark);
  border-radius: var(--sf-radius-pill);
  box-shadow: 0 4px 11px rgba(0, 0, 0, 0.25);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color var(--sf-transition), box-shadow var(--sf-transition);
}

.hero-govgr-btn:hover {
  color: var(--sf-on-dark);
  background-color: var(--sf-navy-hover);
  box-shadow: 0 6px 17px rgba(0, 0, 0, 0.35);
}

/* Focus: the white border grows into a 3px ring right on the edge (an offset showed the dark photo between
   the border and the ring, which read as a black border) */
.hero-govgr-btn:focus-visible {
  color: var(--sf-on-dark);
  background-color: var(--sf-navy-hover);
  outline: 3px solid var(--sf-on-dark);
  outline-offset: 0;
}

.hero-govgr-btn img {
  flex-shrink: 0;
  width: auto;
  height: 16px;
}

.hero-govgr-label {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

.hero-govgr-arrow {
  flex-shrink: 0;
  transition: transform var(--sf-transition);
}

.hero-govgr-btn:hover .hero-govgr-arrow {
  transform: translateX(4px);
}

/* ----- Links repeater (optional, set in the hero settings) ----- */
.hero-links-txt {
  display: flex;
  flex-direction: column;
  align-content: flex-start;
  flex-wrap: wrap;
  align-items: flex-end;
}

.hero-links-txt p:nth-child(1) {
  font-size: 12px;
  color: var(--sf-text);
  text-align: end;
  font-weight: 600;
}

.hero-links-txt p:nth-child(2) {
  font-size: 10px;
  color: var(--sf-text-muted);
  text-align: end;
  max-width: 150px;
  width: 125px;
}

.hero-links {
  position: absolute;
  top: 16rem;
  z-index: 6;
  display: flex;
  flex-direction: row;
  background-color: var(--sf-surface);
  text-align: center;
  align-content: center;
  padding: 4px;
  border-radius: 0 30px 30px 0;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  max-width: 200px;
  width: 100px;
  height: 51px;
  transition: all ease 0.5s;
  box-shadow: var(--sf-shadow-control);
}

.hero-links:hover {
  cursor: pointer;
  width: 200px;
}

.hero-links p {
  display: none;
}

.hero-links:hover p {
  display: block;
  margin-bottom: 0;
}

.hero-links img {
  max-width: 45px;
  max-height: 45px;
  border-radius: 140px;
}

.hero-links.no-click {
  cursor: default;
}

@media (max-width: 574px) {
  .hero-links {
    width: 55px;
    z-index: 999;
  }
}

/* ----- Quick access: white bar on the right edge, opens on hover / keyboard focus to show the labels ----- */
.quick-access {
  position: absolute;
  /* 232 at 1920, 104 at 768 (right below the header) */
  top: clamp(104px, 11.1vw + 19px, 232px);
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 68px;
  padding: 12px 10px;
  background-color: var(--sf-surface);
  border-radius: var(--sf-radius) 0 0 var(--sf-radius);
  box-shadow: -2px 4px 16px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transition: width 0.3s ease;
}

.quick-access:hover,
.quick-access:focus-within {
  width: 280px;
}

.quick-access a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border-radius: var(--sf-radius-sm);
  text-decoration: none;
}

/* Keyboard focus inside the white bar: the ring hugs the row instead of floating 2px away */
.quick-access a:focus-visible {
  outline: var(--sf-focus-ring);
  outline-offset: 0;
  background-color: var(--sf-brand-light);
}

.quick-access a img {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.quick-access a p {
  margin: 0;
  padding: 0;
  color: var(--sf-brand-dark);
  font-size: var(--sf-fs-md);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.25s ease, transform 0.3s ease, color var(--sf-transition);
}

.quick-access:hover a p,
.quick-access:focus-within a p {
  opacity: 1;
  transform: translateX(0);
}

.quick-access a:hover p {
  color: var(--sf-accent-dark);
}

/* ----- Quick access on phones: "Services" tab on the right edge + bottom sheet ----- */
.quick-access-toggle,
.quick-access-sheet {
  display: none;
}

@media (max-width: 767.98px) {
  /* the side bar needs hover, so on touch screens it is replaced by the tab */
  .quick-access {
    display: none;
  }

  /* leave room for the tab, so it doesn't cover the search field */
  #hero:has(.quick-access-toggle) .media-container {
    padding-right: calc(var(--sf-gutter) + 28px);
  }

  .quick-access-toggle {
    position: absolute;
    top: 50%;
    right: 0;
    z-index: 10;
    display: block;
    padding: 14px 7px;
    background-color: var(--sf-surface);
    color: var(--sf-brand-dark);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    border: 0;
    border-radius: var(--sf-radius) 0 0 var(--sf-radius);
    box-shadow: -2px 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%);
  }

  .quick-access-toggle:focus-visible {
    outline: var(--sf-focus-ring);
    outline-offset: 2px;
  }

  .quick-access-sheet {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: block;
  }

  .quick-access-sheet[hidden] {
    display: none;
  }

  .quick-access-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .quick-access-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    padding: 10px 0 calc(16px + env(safe-area-inset-bottom));
    background: var(--sf-surface);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }

  .quick-access-sheet.is-open .quick-access-sheet-backdrop {
    opacity: 1;
  }

  .quick-access-sheet.is-open .quick-access-sheet-panel {
    transform: translateY(0);
  }

  .quick-access-sheet-handle {
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto 12px;
    background: var(--sf-border);
    border-radius: 2px;
  }

  .quick-access-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 20px 12px;
    border-bottom: 1px solid var(--sf-border);
  }

  .quick-access-sheet-header h2 {
    margin: 0;
    color: var(--sf-text);
    font-size: var(--sf-fs-sm);
    font-weight: 600;
    letter-spacing: var(--sf-ls-label);
    text-transform: uppercase;
  }

  .quick-access-sheet-close {
    padding: 4px 0;
    background: none;
    border: 0;
    color: var(--sf-brand-dark);
    font-size: var(--sf-fs-sm);
    font-weight: 700;
  }

  .quick-access-sheet-links {
    overflow-y: auto;
  }

  .quick-access-sheet-links a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    color: var(--sf-brand-dark);
    text-decoration: none;
    border-bottom: 1px solid var(--sf-surface-alt);
  }

  .quick-access-sheet-links a:active {
    background: var(--sf-surface-alt);
  }

  .quick-access-sheet-links img {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    object-fit: contain;
  }

  .quick-access-sheet-links p {
    margin: 0;
    font-size: var(--sf-fs-md);
    font-weight: 500;
  }

  body.quick-access-sheet-open {
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-text-and-search,
  #hero .hero-slide,
  .quick-access,
  .quick-access a p,
  .hero-govgr-arrow,
  .quick-access-sheet-backdrop,
  .quick-access-sheet-panel {
    transition: none;
  }
}
