/* ==========================================================================
   Darsely — Shared Layout (Header + Footer)
   Full-width, light-only design. Loaded after style.css on every page.
   ========================================================================== */

:root {
  --ds-ink: #1a0f26;
  --ds-text: #3b3550;
  --ds-muted: #6b6880;
  --ds-line: rgba(50, 30, 72, 0.09);
  --ds-surface: #ffffff;
  --ds-bg: #f6f8fb;
  --ds-primary: #321e48;
  --ds-primary-2: #43637e;
  --ds-accent: #65dcd5;
  --ds-accent-soft: #e6fbf8;
  --ds-accent-ink: #0e7c76;
  --ds-radius: 16px;
  --ds-header-h: 76px;
  --ds-gutter: clamp(16px, 4vw, 64px);
  --ds-shadow-sm: 0 2px 8px rgba(26, 15, 38, 0.05);
  --ds-shadow-md: 0 12px 32px rgba(26, 15, 38, 0.08);
  --ds-shadow-lg: 0 24px 60px rgba(26, 15, 38, 0.14);
}

/* ─── Header ─────────────────────────────────────────────────────────────── */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 9999;
  width: 100%;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--ds-line);
  font-family: "Cairo", sans-serif;
  transition: box-shadow 0.25s ease, background 0.25s ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 30px rgba(26, 15, 38, 0.07);
}

.site-header__inner {
  height: var(--ds-header-h);
  padding-inline: var(--ds-gutter);
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-left: 32px;
  border-left: 1px solid var(--ds-line);
  text-decoration: none !important;
}

.site-brand img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

/* Links sit next to the logo; actions are pushed to the far side */
.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 100%;
}

.site-nav a {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  color: var(--ds-muted);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none !important;
  transition: color 0.2s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--ds-primary);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.site-nav a:hover {
  color: var(--ds-ink);
}

.site-nav a.is-active {
  color: var(--ds-ink);
  font-weight: 700;
}

.site-nav a.is-active::after {
  transform: scaleX(1);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-inline-start: auto;
}

.site-header__actions #nav-links-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Buttons */
.hdr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border-radius: 12px;
  font-family: "Cairo", sans-serif;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  text-decoration: none !important;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.hdr-btn--text {
  color: var(--ds-ink);
  background: transparent;
  padding: 0 14px;
}

.hdr-btn--text:hover {
  color: var(--ds-primary);
  background: var(--ds-bg);
}

.hdr-btn--ghost {
  color: var(--ds-primary);
  border-color: var(--ds-line);
  background: #fff;
}

.hdr-btn--ghost:hover {
  color: var(--ds-primary);
  border-color: rgba(50, 30, 72, 0.25);
}

.hdr-btn--primary {
  color: #fff;
  background: var(--ds-primary);
}

.hdr-btn--primary:hover {
  color: #fff;
  background: #47306a;
}

/* Logged-in user chip */
.hdr-user {
  position: relative;
}

.hdr-user__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 3px 6px 3px 14px;
  border-radius: 999px;
  border: 1px solid var(--ds-line);
  background: #fff;
  cursor: pointer;
  font-family: "Cairo", sans-serif;
  color: var(--ds-ink);
}

.hdr-user__btn:hover,
.hdr-user.is-open .hdr-user__btn {
  border-color: rgba(50, 30, 72, 0.25);
  box-shadow: var(--ds-shadow-sm);
}

.hdr-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--ds-primary), var(--ds-primary-2));
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
}

.hdr-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hdr-user__name {
  font-weight: 700;
  font-size: 14px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hdr-user__chev {
  font-size: 11px;
  color: var(--ds-muted);
  transition: transform 0.2s ease;
}

.hdr-user.is-open .hdr-user__chev {
  transform: rotate(180deg);
}

.hdr-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 260px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--ds-line);
  border-radius: 18px;
  box-shadow: var(--ds-shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.hdr-user.is-open .hdr-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hdr-menu__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--ds-line);
}

.hdr-menu__head strong {
  display: block;
  font-size: 15px;
  color: var(--ds-ink);
  line-height: 1.3;
}

.hdr-menu__head small {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--ds-accent-soft);
  color: var(--ds-accent-ink);
  font-weight: 700;
  font-size: 12px;
}

.hdr-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ds-text);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none !important;
}

.hdr-menu a :is(i, svg) {
  width: 18px;
  text-align: center;
  color: var(--ds-primary-2);
}

.hdr-menu a:hover {
  background: var(--ds-bg);
  color: var(--ds-primary);
}

.hdr-menu a.is-danger {
  color: #c0262d;
  margin-top: 4px;
  border-top: 1px solid var(--ds-line);
  border-radius: 0 0 12px 12px;
}

.hdr-menu a.is-danger :is(i, svg) {
  color: #c0262d;
}

.hdr-menu a.is-danger:hover {
  background: #fff1f1;
}

/* Burger */
.site-burger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--ds-line);
  background: #fff;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.site-burger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--ds-primary);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.site-header.is-open .site-burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header.is-open .site-burger span:nth-child(2) {
  opacity: 0;
}

.site-header.is-open .site-burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hdr-user__btn:focus,
.site-burger:focus {
  outline: none;
}

.hdr-user__btn:focus-visible,
.site-burger:focus-visible,
.hdr-btn:focus-visible,
.site-nav a:focus-visible {
  outline: 3px solid var(--ds-accent);
  outline-offset: 2px;
}

/* Mobile panel */
.site-mobile-panel {
  display: none;
}

/* Scroll progress */
.site-progress {
  position: absolute;
  bottom: -1px;
  right: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(270deg, var(--ds-primary-2), var(--ds-accent));
  pointer-events: none;
  transition: none;
}

@media (max-width: 991px) {
  .site-nav {
    display: none;
  }

  .site-burger {
    display: flex;
  }

  .site-header__actions {
    margin-inline-start: auto;
  }

  .site-header__actions .hdr-btn--text {
    display: none;
  }

  .site-brand {
    padding-left: 0;
    border-left: 0;
  }

  .hdr-user__name {
    display: none;
  }

  .site-mobile-panel {
    display: block;
    max-height: 0;
    overflow: hidden;
    padding-inline: var(--ds-gutter);
    background: #fff;
    transition: max-height 0.3s ease, padding 0.3s ease;
  }

  .site-header.is-open .site-mobile-panel {
    max-height: 80vh;
    padding-block: 8px 20px;
    border-top: 1px solid var(--ds-line);
  }

  .site-mobile-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--ds-line);
    color: var(--ds-ink);
    font-weight: 700;
    font-size: 16px;
    text-decoration: none !important;
  }

  .site-mobile-nav a :is(i, svg) {
    width: 20px;
    color: var(--ds-primary-2);
  }

  .site-mobile-nav a.is-active {
    color: var(--ds-accent-ink);
  }

  .site-mobile-auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
  }

  .site-mobile-auth:empty {
    display: none;
  }
}

@media (max-width: 575px) {
  :root {
    --ds-header-h: 66px;
  }

  .site-brand img {
    height: 38px;
  }

  .site-header__actions .hdr-btn--primary {
    height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }

  .site-header__actions .hdr-btn--primary :is(i, svg) {
    display: none;
  }
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */

.site-footer {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #1a0f26;
  color: rgba(255, 255, 255, 0.72);
  font-family: "Cairo", sans-serif;
  text-align: right;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 90% 0%, rgba(101, 220, 213, 0.14), transparent 70%),
    radial-gradient(500px 300px at 0% 100%, rgba(67, 99, 126, 0.35), transparent 70%);
  pointer-events: none;
}

.site-footer__main {
  position: relative;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.3fr;
  gap: 48px;
  padding: 72px var(--ds-gutter) 48px;
}

.site-footer__brand img {
  height: 56px;
  width: auto;
  margin-bottom: 18px;
}

.site-footer__brand p {
  max-width: 340px;
  font-size: 15px;
  line-height: 1.9;
  margin-bottom: 22px;
}

.site-footer__social {
  display: flex;
  gap: 10px;
}

.site-footer__social a {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 17px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none !important;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.site-footer__social a:hover {
  background: var(--ds-accent);
  color: var(--ds-ink);
  transform: translateY(-2px);
}

.site-footer h4 {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 18px;
}

.site-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.site-footer__links a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  text-decoration: none !important;
  transition: color 0.2s ease, padding 0.2s ease;
}

.site-footer__links a:hover {
  color: var(--ds-accent);
  padding-right: 4px;
}

.site-footer__contact li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-footer__contact :is(i, svg) {
  width: 18px;
  color: var(--ds-accent);
}

.site-footer__app {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 10px 18px;
  border-radius: 14px;
  background: #fff;
  color: var(--ds-ink) !important;
  text-decoration: none !important;
  transition: transform 0.2s ease;
}

.site-footer__app:hover {
  transform: translateY(-2px);
}

.site-footer__app :is(i, svg) {
  font-size: 24px;
  color: #34a853;
}

.site-footer__app small {
  display: block;
  font-size: 11px;
  color: var(--ds-muted);
  line-height: 1.2;
}

.site-footer__app strong {
  display: block;
  font-size: 15px;
  line-height: 1.3;
}

.site-footer__bottom {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px var(--ds-gutter);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

.site-footer__bottom p {
  margin: 0;
}

.site-footer__bottom a {
  color: var(--ds-accent);
  font-weight: 700;
  text-decoration: none !important;
}

.site-footer__bottom a:hover {
  color: #fff;
}

@media (max-width: 991px) {
  .site-footer__main {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    padding-top: 56px;
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 575px) {
  .site-footer__main {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .site-footer__bottom {
    flex-direction: column;
    text-align: center;
  }
}
