/* Shared page + modal shell utilities */

.page-shell,
.modal-shell {
  max-width: 1200px;
  width: 100%;
  padding: 3rem 3rem 2rem;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  font-size: 1.35em;
  line-height: 1.6;
}

@media (max-width: 767px) {
  .page-shell,
  .modal-shell {
    padding: 2.5rem 1.5rem 1.5rem;
  }
}

.modal-shell--narrow {
  max-width: 920px;
}

.overlay-shell {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
  padding: 3rem 2rem;
  overflow-y: auto;
}

.overlay-shell.is-open {
  display: flex;
}

@media (max-width: 767px) {
  .overlay-shell {
    padding: 1rem;
  }
}

/* Standard close button */
.btn-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s;
  z-index: 1001;
  padding: 0;
}

.btn-close:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .btn-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
}

/* Hero header (icon + title + subtitle) */
.hero-header {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.5rem);
  margin-bottom: clamp(1rem, 3vw, 1.8rem);
}

.hero-header__icon {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-header__icon svg,
.hero-header__icon img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}

.hero-header__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  align-items: flex-start;
  text-align: left;
}

.hero-title {
  margin: 0;
  color: var(--primary);
}

.hero-subtitle {
  margin: 0.25em 0 0;
  color: var(--accent);
  line-height: 1.35;
  font-size: clamp(1.15em, 1.5vw, 1.5em);
}

.hero-subtitle:empty {
  display: none;
}

.hero-header.hero-header--tight .hero-header__text {
  gap: 0.15em;
}

.hero-header.hero-header--tight .hero-subtitle {
  margin-top: 0.15em;
  line-height: 1.25;
}

.hero-header.hero-header--centered {
  justify-content: center;
}

.hero-header.hero-header--centered .hero-header__text {
  align-items: center;
  text-align: center;
}

@media (max-width: 768px) {
  .hero-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-header__icon {
    width: 48px;
    height: 48px;
  }

  .hero-header__text {
    width: 100%;
    align-items: center;
    text-align: center;
  }

  .hero-header.hero-header--left-mobile {
    align-items: flex-start;
    text-align: left;
  }

  .hero-header.hero-header--left-mobile .hero-header__text {
    align-items: flex-start;
    text-align: left;
  }

  .hero-header.hero-header--centered .hero-header__text {
    align-items: center;
    text-align: center;
  }
}

.modal-shell.modal-shell--tight {
  padding: 1.5rem 1.5rem 1rem;
}
