/* =========================================================================
   DR Theme — Downloads layer
   Single download page (What's Inside, Free Guide form, related grid) and
   archive blog-card tweaks. Scoped to .dr-* selectors so it stays inert on
   non-download templates.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Archive — download cards (blog "Article card" with a portrait cover)
   ------------------------------------------------------------------------- */
.dr-download-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.dr-download-card .article-image {
  aspect-ratio: 3 / 4;
  background: #0f1115;
}

.dr-download-card .article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dr-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-weight: 600;
  color: var(--primary);
}

.dr-card-link svg { width: 16px; height: 16px; }
.dr-card-link:hover { gap: 10px; }

/* -------------------------------------------------------------------------
   Single — shared
   ------------------------------------------------------------------------- */
.dr-download-single { padding-top: 0; }

.dr-download-single .section-container { padding-block: 56px; }

/* 1. What's Inside --------------------------------------------------------- */
.dr-inside-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 56px;
}

.dr-inside-art {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dr-inside-art img {
  width: 100%;
  max-width: 480px;
  height: auto;
}

.dr-inside-title {
  margin: 0 0 18px;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--primary);
}

.dr-inside-badge {
  display: inline-block;
  margin-bottom: 26px;
  padding: 10px 18px;
  font-weight: 600;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, #ffffff);
  border-radius: var(--radius-md);
}

.dr-inside-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
}

.dr-inside-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.dr-inside-check {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: var(--radius-full);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, #ffffff);
}

.dr-inside-check svg { width: 14px; height: 14px; }

.dr-inside-text {
  color: #4b5563;
  font-size: 1.0625rem;
  line-height: 1.55;
}

.dr-inside-text strong { color: var(--foreground); font-weight: 700; }

/* 2. Free Guide form + cover ---------------------------------------------- */
.dr-form-section { position: relative; }

.dr-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
}

.dr-form-panel { position: relative;
background-image: url(https://www.5centscdn.net/dr/wp-content/uploads/2025/05/Free-Guide-Widget.png);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% auto;
}

.dr-form-card {
  position: relative;
  z-index: 2;
  max-width: 560px;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 70px rgba(17, 17, 17, 0.10);
  background-color: #FFFFFF54;
  background-image: url(https://www.5centscdn.net/dr/wp-content/uploads/2022/06/Frame-5204.png);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  border-style: solid;
  border-width: 2px 2px 2px 2px;
  border-color: #FFF;
  transition: background 0.3s,border 0.3s,border-radius 0.3s,box-shadow 0.3s;
  padding: 32px 32px 12px 32px;
}

.dr-form-title {
  margin: 0 0 26px;
  font-size: clamp(1.6rem, 2.6vw, 2rem);
  font-weight: 800;
  color: var(--foreground);
}

.dr-field { margin-bottom: 18px; }

.dr-field input {
  width: 100%;
  padding: 18px 20px;
  font-size: 1rem;
  color: var(--foreground);
  background: #ffffff;
  border: 1px solid #e1e1e1;
  border-radius: var(--radius-lg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dr-field input::placeholder { color: #9aa0a6; }

/* Autofill detection: Chrome runs this no-op animation on autofilled inputs,
   which fires `animationstart` so the JS can re-validate the button. */
@keyframes drAutofill { from { /* noop */ } to { /* noop */ } }
.dr-field input:-webkit-autofill { animation-name: drAutofill; animation-duration: 0.01s; }

.dr-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

/* Download button — also the form submit. Disabled until both fields valid. */
.dr-download-btn {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius-lg);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
}

.dr-download-btn:disabled { cursor: not-allowed; }

.dr-download-btn-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 0;
}

.dr-download-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  transition: transform 0.15s ease;
}

/* Circular pie progress ring */
.dr-ring { display: block; width: 56px; height: 56px; }

.dr-ring-track { stroke: #d7dbe0; }

.dr-ring-fill {
  stroke: var(--primary);
  /* Empty by default; sweeps clockwise from 12 o'clock as offset -> 0. */
  stroke-dashoffset: 94.25;
  transform: rotate(-90deg);
  transform-origin: center;
  transform-box: fill-box;
  transition: stroke-dashoffset 0.25s ease;
}

.dr-ring-arrow { transition: fill 0.2s ease; }

.dr-download-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.dr-download-size {
  font-size: 1.15rem;
  font-weight: 800;
  color: #c7cdd3;
  transition: color 0.25s ease;
}

.dr-download-format {
  font-size: 0.95rem;
  color: #9aa0a6;
}

/* Enabled (form valid) state — the ring fills solid green. */
.dr-download-btn:not(:disabled) .dr-ring-fill { stroke-dashoffset: 0; }
.dr-download-btn:not(:disabled) .dr-download-size { color: var(--primary); }
.dr-download-btn:not(:disabled):hover .dr-download-icon { transform: translateY(-2px); }

/* Disabled — gray arrow on the gray track. */
.dr-download-btn:disabled .dr-ring-arrow { fill: #f2f4f6; }

.dr-download-btn.is-loading { cursor: progress; }
.dr-download-btn.is-loading .dr-download-icon { transform: none; }
.dr-download-btn.is-loading .dr-ring-arrow { fill: #ffffff; }

.dr-form-status {
  margin: 16px 0 0;
  min-height: 22px;
  font-size: 0.95rem;
  color: #4b5563;
}

.dr-form-status.is-success {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--foreground);
  font-weight: 600;
}

.dr-form-status.is-success::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  background: var(--primary);
  border-radius: var(--radius-full);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.dr-form-status.is-error { color: #c0392b; }

/* Decorative blobs behind the form card */
.dr-blob {
  position: absolute;
  z-index: 1;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

.dr-blob--svg {
  width: 280px;
  height: 330px;
  left: -90px;
  top: -70px;
  opacity: 0.7;
}

.dr-blob--png {
  width: 150px;
  height: 150px;
  right: -30px;
  bottom: -20px;
}

/* Cover panel (ebook) */
.dr-cover-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 520px;
}

.dr-cover-blob {
  position: absolute;
  z-index: 1;
  width: 420px;
  height: 420px;
  right: -40px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle at 35% 30%, #8ed06a 0%, #4fa83d 60%, #3c8a30 100%);
  filter: blur(0.5px);
}

.dr-cover-img {
  position: relative;
  z-index: 2;
  width: 360px;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  /* box-shadow: 0 40px 80px rgba(17, 17, 17, 0.28); */
}

/* 3. Peoples also search for ---------------------------------------------- */
.dr-related-section { background: #eef6e8; }

.dr-related-heading {
  margin: 0 0 36px;
  text-align: center;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--foreground);
}

.dr-related-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 50px;
}

.dr-related-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dr-related-cover {
  display: block;
  /* aspect-ratio: 3 / 4; */
  border-radius: var(--radius-lg);
  /* overflow: hidden; */
  background: #0f1115;
  box-shadow: 0 14px 30px rgba(17, 17, 17, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dr-related-cover {
  overflow: visible;
}
.dr-related-cover img {
  transition: transform 0.3s;
}
.dr-related-card:hover .dr-related-cover img {
  transform: scale(1.1);
}
.dr-related-cover img { width: 100%; height: 100%; object-fit: cover; }

.dr-related-card:hover .dr-related-cover {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(17, 17, 17, 0.18);
}

.dr-related-label {
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.dr-related-title {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--foreground);
}

.dr-related-excerpt {
  font-size: 0.85rem;
  line-height: 1.45;
  color: #5f6368;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .dr-related-grid { grid-template-columns: repeat(3, 1fr); }
  .dr-cover-panel { min-height: 440px; }
  .dr-cover-blob { width: 340px; height: 340px; }
  .dr-cover-img { width: 300px; }
}

@media (max-width: 860px) {
  .dr-inside-grid { grid-template-columns: 1fr; gap: 32px; }
  .dr-inside-art { order: -1; }
  .dr-form-grid { grid-template-columns: 1fr; gap: 40px; }
  .dr-form-card { max-width: none; }
  .dr-cover-panel { order: -1; min-height: 360px; }
}

@media (max-width: 600px) {
  .dr-related-grid { grid-template-columns: repeat(2, 1fr); }
  .dr-form-card { padding: 28px 22px; }
  .dr-download-single .section-container { padding-block: 40px; }
}
