/* ============================================================
   CUSTOM CSS  —  only things Tailwind can't express
   (keyframes, pseudo-elements, complex gradients, theme vars)
   ============================================================ */

/* ── Google Fonts already loaded via <link> in HTML ── */

/* ── Keyframe animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(7px); }
}

.animate-fade-up       { animation: fadeInUp .7s ease forwards; }
.animate-fade-up.d1    { animation-delay: .1s; }
.animate-fade-up.d2    { animation-delay: .2s; }
.animate-fade-up.d3    { animation-delay: .3s; }
.animate-fade-up.d4    { animation-delay: .4s; }
.animate-fade-in       { animation: fadeIn 1s ease forwards; }
.animate-bounce-slow   { animation: bounce 2s ease-in-out infinite; }

/* ── Scroll-reveal (JS adds .will-animate then .visible) ── */
.reveal { transition: opacity .6s ease, transform .6s ease; }
.reveal.will-animate   { opacity: 0; transform: translateY(22px); }
.reveal.visible        { opacity: 1; transform: translateY(0); }

/* ── Gradient text (hero headline accent) ── */
.gradient-text {
  background: linear-gradient(135deg,#b8872a,#f0c45a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Hero dot-pattern overlay ── */
.hero-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='40' cy='40' r='8'/%3E%3Ccircle cx='0' cy='0' r='8'/%3E%3Ccircle cx='80' cy='0' r='8'/%3E%3Ccircle cx='0' cy='80' r='8'/%3E%3Ccircle cx='80' cy='80' r='8'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

/* ── Star rating ── */
.stars::before {
  content: '★★★★★';
  color: #d4a843;
  font-size: 1rem;
  letter-spacing: 2px;
}

/* ── Gradient divider ── */
.divider-accent {
  width: 64px;
  height: 3px;
  background: linear-gradient(135deg,#b8872a,#f0c45a);
  border-radius: 9999px;
}

/* ── Card side accents (straight lines, clipped to card bounds) ── */
.card-accent-left,
.card-accent-right {
  position: relative;
  overflow: hidden;
}
.card-accent-left::before,
.card-accent-right::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  background: var(--color-accent);
}
.card-accent-left::before {
  left: 0;
}
.card-accent-right::before {
  right: 0;
}
.card-accent-left.card-accent-left--primary::before,
.card-accent-right.card-accent-right--primary::before {
  background: var(--color-primary);
}

/* ── Card top accent (straight line, clipped to card bounds) ── */
.card-accent-top {
  position: relative;
  overflow: hidden;
}
.card-accent-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: var(--color-accent);
}
.card-accent-top.card-accent-top--primary::before {
  background: var(--color-primary);
}

/* ── Card bottom accent (straight line, clipped to card bounds) ── */
.card-accent-bottom {
  position: relative;
  overflow: hidden;
}
.card-accent-bottom::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: var(--color-accent);
}
.card-accent-bottom.card-accent-bottom--primary::before {
  background: var(--color-primary);
}


/* ── Hamburger open state ── */
.nav-open .bar1 { transform: rotate(45deg) translate(5px,5px); }
.nav-open .bar2 { opacity: 0; }
.nav-open .bar3 { transform: rotate(-45deg) translate(5px,-5px); }

/* ── Navbar scroll state (JS adds .scrolled) ── */
.navbar-scrolled {
  background: rgba(255,255,255,.97) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.navbar-scrolled .nav-link   { color: #4b5563 !important; }
.navbar-scrolled .nav-link:hover,
.navbar-scrolled .nav-link.active { color: #1a3a5c !important; background: #eef2f7 !important; }
.navbar-scrolled .logo-text  { color: #1a3a5c !important; }
.navbar-scrolled .hamburger-bar { background: #1a3a5c !important; }


/* ── Page hero section ── */
.page-hero {
  background: linear-gradient(135deg,#0f2237 0%,#1a3a5c 60%,#2a5298 100%);
  padding: 7rem 0 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
}

/* ── FAQ accordion max-height transition ── */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease;
}
.faq-open .faq-answer { max-height: 300px; }
.faq-open .faq-chevron { transform: rotate(180deg); }
.faq-chevron { transition: transform .25s ease; }

/* ── Form focus ring ── */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #2a5298 !important;
  box-shadow: 0 0 0 3px rgba(42,82,152,.12) !important;
}

/* ── Admin toast notifications ── */
.admin-toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  max-width: min(24rem, calc(100vw - 3rem));
  pointer-events: none;
}

.admin-toast {
  pointer-events: auto;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border: 1px solid transparent;
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 0.25s ease, transform 0.25s ease;
  cursor: pointer;
}

.admin-toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.admin-toast-hiding {
  opacity: 0;
  transform: translateY(0.5rem);
}

.admin-toast-success {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.package-doc-section {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  border: 1px solid #f3f4f6;
  padding: 2rem;
}

/* ── TinyMCE editor (admin) ── */
.tox-tinymce {
  border-radius: 0.75rem !important;
  border-color: #e5e7eb !important;
  overflow: hidden;
}

.tox .tox-edit-area__iframe {
  background: #fff;
  display: block;
  width: 100%;
}

/* ── Rich text content (public package pages + TinyMCE editor) ── */
.package-rich-content {
  font-size: 0.875rem;
  line-height: 1.625;
  color: #4b5563;
  box-sizing: border-box;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

body.package-rich-content,
.mce-content-body.package-rich-content {
  margin: 0;
  padding: 2rem 0;
  overflow-x: hidden;
}

div.package-rich-content {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.mce-content-body {
  padding: 0 !important;
  overflow-x: hidden !important;
}

.package-document {
  max-width: var(--package-document-width, 72rem);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.package-rich-content h1,
.package-rich-content h2,
.package-rich-content h3,
.package-rich-content h4 {
  font-family: "Playfair Display", Georgia, serif;
  color: #1a3a5c;
  font-weight: 700;
  margin: 1.25rem 0 0.75rem;
  line-height: 1.25;
}

.package-rich-content h1:first-child,
.package-rich-content h2:first-child,
.package-rich-content h3:first-child,
.package-rich-content h4:first-child {
  margin-top: 0;
}

.package-rich-content h1 { font-size: 1.75rem; }
.package-rich-content h2 { font-size: 1.375rem; }
.package-rich-content h3 { font-size: 1.125rem; }
.package-rich-content h4 { font-size: 1rem; }

.package-rich-content p {
  margin: 0 0 0.75rem;
}

.package-rich-content p:last-child {
  margin-bottom: 0;
}

.package-rich-content ul,
.package-rich-content ol {
  margin: 0 0 0.75rem 1.25rem;
  padding: 0;
}

.package-rich-content li {
  margin-bottom: 0.35rem;
}

.package-rich-content a {
  color: #2a5298;
  text-decoration: underline;
}

.package-rich-content strong,
.package-rich-content b {
  font-weight: 600;
  color: #1a3a5c;
}

.package-rich-content em,
.package-rich-content i {
  font-style: italic;
}

.package-rich-content u {
  text-decoration: underline;
}

.package-rich-content s,
.package-rich-content strike,
.package-rich-content del {
  text-decoration: line-through;
}

.package-rich-content sub,
.package-rich-content sup {
  font-size: 0.75em;
}

.package-rich-content blockquote {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid #d4a843;
  background: #f8f7f4;
  color: #4b5563;
}

.package-rich-content hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 1.25rem 0;
}

.package-rich-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 0.75rem 0;
  display: inline-block;
}

.package-rich-content p[style*="text-align: center"] img,
.package-rich-content p[style*="text-align:center"] img,
.package-rich-content div[style*="text-align: center"] img,
.package-rich-content div[style*="text-align:center"] img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.package-rich-content table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
}

.package-rich-content pre,
.package-rich-content iframe,
.package-rich-content video {
  max-width: 100%;
}

.package-rich-content th,
.package-rich-content td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  vertical-align: top;
}

.package-rich-content th {
  background: #f8f7f4;
  font-weight: 600;
  color: #1a3a5c;
}

.package-rich-content th:not([align]):not([style*="text-align"]),
.package-rich-content td:not([align]):not([style*="text-align"]) {
  text-align: left;
}
