/* ===== Theme tokens ===== */
:root{
  /* Info brand */
  --info:        #17a2b8;
  --info-focus:  #138496;
  --info-rgb:    23,162,184;

  /* Golds */
  --gold:        #d4af37;         /* muted gold */
  --gold-true:   #ffd700;         /* bright gold */
  --gold-true-rgb: 255,215,0;

  /* Holiday reds (used as-is below; keep as tokens if you like) */
  --red-1: #d21414;
  --red-2: #a50f0f;
}

/* Heading underline */
.h-underline{
  position: relative;
  padding-bottom: .3em;
  margin: 0 0 .8em;
  line-height: 1.2;
}
.h-underline::after{
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: .12em;
  background: var(--info);
  border-radius: 2px;
}

/* Base borders on most fields */
form input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]),
form select,
form textarea,
form .custom-file-label{
  border-color: var(--info);
}

/* Focus state (merged) */
form input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]):focus,
form select:focus,
form textarea:focus,
form .custom-file-input:focus ~ .custom-file-label{
  border-color: var(--info-focus);
  box-shadow: 0 0 0 .2rem rgba(var(--info-rgb), .25);
  outline: 0;
}

/* Extra-small capsule preview button */
.btn-pill-red{
  display: inline-block;
  padding: 3px 7px;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  color: #fff !important;
  background: linear-gradient(var(--red-1), var(--red-2));
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 9999px;
  text-decoration: none;
  letter-spacing: .15px;
  box-shadow: 0 4px 10px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.16);
  margin-left: 4px;
}

/* Modal header */
.modal-header{
  background: linear-gradient(180deg, rgba(111,8,4,1) 0%, rgba(191,41,33,1) 100%);
  border: 1px solid #000;
  box-shadow: 2px 2px 10px rgba(0,0,0,.7);
  color: gold;
  border-bottom: 4px solid gold;
  transition: background-color 300ms linear;
}

/* Holiday Select (native arrow with solid red background) */
.select-holiday{
  display: inline-block;
  width: auto; min-width: 0; max-width: 100%;
  font-size: 14px; line-height: 1.2;
  padding: 6px 28px 6px 10px; /* room for native arrow */
  border: 2px solid var(--gold); border-radius: 8px;
  color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.25);
  cursor: pointer;
  appearance: auto; /* allow native arrow */
  background-color: var(--red-2);
} 

/* STF links */
a.stf-link{ color: var(--gold) !important; text-decoration: none; }
a.stf-link:hover,
a.stf-link:focus{ color: #fff !important; text-decoration: underline; }

/* Glow link (hover trimmed) */
a.glow-link{
  color: var(--gold-true);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, text-shadow .15s;
}
a.glow-link:hover{
  font-weight: bold;
  text-shadow:
    0 0 10px rgba(var(--gold-true-rgb), 1),
    0 0 24px rgba(var(--gold-true-rgb), 1),
    0 0 48px rgba(var(--gold-true-rgb), 1),
    0 0 80px rgba(var(--gold-true-rgb), 1);
}

/* Small gold text (nowrap) */
.stf-text{ color: #a28d32; white-space: nowrap; }

/* Drop cap */
.intro.dropcap::first-letter{
  float: left;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 4.6em;
  line-height: .82;
  margin: -0.01em .14em 0 0;
  padding-top: 0;
  color: #97231b;
}
.dropcap-block{
  max-width: 60ch;
  margin: 0 auto 1.25rem;
}

/* parchment-myChildEdit card */
.parchment-myChildEdit{
  position: relative;
  background: #F8F1DF;
  border-radius: 16px;
  padding: 28px;
  box-shadow:
    0 10px 24px rgba(0,0,0,.08),
    0 2px 6px rgba(0,0,0,.06);
  overflow: hidden;
}
.parchment-myChildEdit::before{
  content: "";
  position: absolute; inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .04;
  background-image:
    url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='64' height='64'>\
<filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/></filter>\
<rect width='100%' height='100%' filter='url(#n)' opacity='.5'/></svg>");
  background-size: 240px 240px;
  mix-blend-mode: multiply;
}
.parchment-myChildEdit::after{
  content: "";
  position: absolute; inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(255,255,255,.35), rgba(255,255,255,0) 38%),
    linear-gradient(to top, rgba(0,0,0,.06), rgba(0,0,0,0) 42%);
}
.parchment-myChildEdit > *{ position: relative; z-index: 1; }

/* Responsive tweaks */
@media (max-width: 680px){
  .parchment-myChildEdit{
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(0,0,0,.07);
  }
}
@media (max-width: 480px){
  .parchment-myChildEdit{ padding: 16px; }
  .parchment-myChildEdit::before{ opacity: .03; }
}

/* Optional dark mode */
@media (prefers-color-scheme: dark){
  .parchment-myChildEdit{
    background: #1f2a32;
    box-shadow: 0 10px 24px rgba(0,0,0,.4);
  }
  .parchment-myChildEdit::after{
    background:
      linear-gradient(to bottom, rgba(255,255,255,.06), rgba(255,255,255,0) 38%),
      linear-gradient(to top, rgba(0,0,0,.25), rgba(255,255,255,0) 42%);
  }
}

/* Custom highlight */
.custom-highlight { background-color: yellow; color: red; }

/* Show/Hide text swap */
.toggle-chev-ChildEdit .when-expanded { display: none; }
.toggle-chev-ChildEdit[aria-expanded="true"] .when-expanded { display: inline; }
.toggle-chev-ChildEdit[aria-expanded="true"] .when-collapsed { display: none; }

/* Chevron before the link */
.toggle-chev-ChildEdit::before{
  content: "\25B6";            /* right triangle U+25B6 */
  display: inline-block;
  margin-right: .5rem;
  transition: transform .2s ease;
}
.toggle-chev-ChildEdit[aria-expanded="true"]::before{
  content: "\25BC";            /* down triangle U+25BC */
}

/* Link styling */
.toggle-chev-ChildEdit{
  color: #d60000;              /* dark red */
  text-decoration: none;
}
.toggle-chev-ChildEdit:hover{
  color: #8b0000;              /* hover gold (optional) */
  text-decoration: none;
}
.SP {
  color: #d60000;        /* dark red (matches ChildEdit link) */
  text-decoration: none; /* no underline */
}

.SP:hover {
  color: #8b0000;        
  text-decoration: none; /* still no underline */
}

.remaining {
  font-size: 1.1rem;
  color: red;
  font-family: 'arial Condensed', sans-serif;
  font-style: italic;
}
.code-copy{
  background:#f8f9fa; border:1px solid #dee2e6; border-radius:.25rem;
  padding:.25rem .5rem; overflow-x:auto;  /* enable sideways scroll on small screens */
}
.code-copy__inline{
  white-space:nowrap; display:inline-flex; align-items:center;
}
.code-copy a{ text-decoration:none; }
.code-copy a:hover{ text-decoration:underline; }
.code-copy__btn{margin-left:4px; padding:.2rem .4rem; line-height:1;  /* tight, neat */}

/* === TTT image preview (upload preview) === */
.image-preview-wrap {
  position: relative;
  display: inline-block; /* or block if you prefer full-width */
}

/* "Loading..." overlay */
.preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 4px;
}

/* While loading, show overlay and dim image */
.image-preview-wrap.loading .preview-loading {
  display: flex !important;
}

.image-preview-wrap.loading img {
  opacity: 0.2;
}

/* Red "Preview" badge */
.preview-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(220, 53, 69, 0.95); /* Bootstrap-ish red */
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  pointer-events: none; /* don't block clicks */
}

/* X button to clear preview */
.preview-clear {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  padding: 0;
}

/* Hide badge when image is hidden via d-none */
.image-preview-wrap img.d-none + .preview-badge {
  display: none;
}

/* Hide X when image is hidden via d-none */
.image-preview-wrap img.d-none ~ .preview-clear {
  display: none;
}

/* === TTT current image overlay (for saved image) === */
.image-current-wrap {
  position: relative;
  display: inline-block;
}

.image-current-wrap .current-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(40, 167, 69, 0.95); /* Bootstrap-ish success green */
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  pointer-events: none;
}
.update-image-btn.d-none {
  display: none !important;
}
