/* Custom Block Styles for wp_blocks.py */

.aff-block {
    margin: 2.75rem 0;
    border: var(--border-width) solid var(--dark);
    border-radius: var(--radius);
    background: var(--white);
    overflow: hidden;
}

.aff-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.35rem;
    border-bottom: var(--border-width) solid var(--dark);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
    background: var(--surface-alt);
}

.aff-body {
    padding: 1.35rem 1.5rem 1.5rem;
}

.aff-icon {
    flex: 0 0 auto;
}

.aff-point {
    border-left-width: 12px;
    border-left-color: var(--primary);
}

.aff-point .aff-head {
    background: var(--white);
}

.aff-point .aff-body {
    font-weight: 600;
    font-size: 1.02rem;
}

.aff-info {
    background: repeating-linear-gradient(
        -45deg,
        #ffffff 0,
        #ffffff 14px,
        #f3f3f3 14px,
        #f3f3f3 28px
    );
}

.aff-info .aff-head {
    background: var(--dark);
    color: var(--white);
}

.aff-info .aff-body {
    background: rgba(255, 255, 255, 0.92);
}

.aff-warn {
    border-color: var(--dark);
    background: #fff8ef;
}

.aff-warn .aff-head {
    background: var(--primary);
    color: var(--dark);
}

.aff-warn .aff-body {
    position: relative;
    padding-left: 2.25rem;
}

.aff-warn .aff-body::before {
    content: "!";
    position: absolute;
    left: 1rem;
    top: 1.25rem;
    width: 1rem;
    height: 1rem;
    font-weight: 900;
}

.aff-step {
    position: relative;
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr);
    gap: 1.2rem;
    align-items: flex-start;
    margin: 2.2rem 0;
}

.aff-step::before {
    content: "";
    position: absolute;
    left: 1.72rem;
    top: 2.45rem;
    bottom: -2.2rem;
    width: 1px;
    background: rgba(0, 0, 0, 0.18);
}

.aff-step + .aff-step {
    margin-top: -0.2rem;
}

.aff-step:last-child {
    margin-bottom: 0;
}

.aff-step:last-child::before {
    display: none;
}

.aff-step-marker {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    padding-top: 0.1rem;
}

.aff-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border: 2px solid var(--dark);
    border-radius: 999px;
    background: var(--primary);
    color: var(--dark);
    font-weight: 900;
    font-size: 1rem;
    line-height: 1;
    box-shadow: 0 0 0 5px var(--bg);
}

.aff-step-content {
    position: relative;
    min-width: 0;
    padding: 0.15rem 0 1.4rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.aff-step:last-child .aff-step-content {
    padding-bottom: 0;
    border-bottom: 0;
}

.aff-step-kicker {
    margin: 0 0 0.35rem;
    min-width: 0;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.aff-step-title {
    margin: 0 0 0.65rem;
    font-family: inherit;
    font-weight: 900;
    font-size: 1.35rem;
    line-height: 1.2;
}

.aff-step .aff-body {
    padding: 0;
    border: 0;
    background: transparent;
}

.aff-checklist {
    background: #fff;
    border: var(--border-width) solid var(--dark);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 4px 4px 0 #000;
}

.aff-checklist .aff-head {
    background: var(--primary);
    border-bottom: var(--border-width) solid var(--dark);
    padding: 11px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aff-checklist .aff-head::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #000;
    opacity: 0.25;
    box-shadow: 14px 0 0 rgba(0, 0, 0, 0.25), 28px 0 0 rgba(0, 0, 0, 0.25);
}

.aff-checklist .aff-head span {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #000;
    margin-left: 20px;
}

.aff-checklist .aff-body {
    padding: 6px 10px 10px;
}

.aff-checklist-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aff-check-item {
    border-radius: 8px;
    overflow: hidden;
    border: 1.5px solid #e8e8e8;
}

.aff-check-toggle {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
    font: inherit;
    color: inherit;
}

.aff-check-mark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #000;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    position: relative;
    transition: background 0.18s, border-color 0.18s;
}

.aff-check-text {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.7;
    color: #111;
    transition: color 0.18s;
}

.aff-check-toggle[aria-pressed="true"] .aff-check-mark {
    background: var(--primary);
    border-color: #000;
}

.aff-check-toggle[aria-pressed="true"] .aff-check-mark::after {
    content: '';
    display: block;
    width: 11px;
    height: 11px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpolyline points='2,6 5,9 10,3' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.aff-check-toggle[aria-pressed="true"] .aff-check-text {
    color: #aaa;
    text-decoration: line-through;
    text-decoration-color: #bbb;
}

.aff-check-item:has([aria-pressed="true"]) {
    border-color: var(--primary);
    background: #FFFEF0;
}

.aff-data .aff-head {
    background: var(--surface-alt);
}

.aff-data-table {
    display: grid;
    gap: 0.7rem;
}

.aff-data-row {
    display: grid;
    grid-template-columns: minmax(120px, 180px) 1fr;
    border: 2px solid var(--dark);
    background: var(--white);
}

.aff-data-label,
.aff-data-value {
    padding: 0.85rem 1rem;
}

.aff-data-label {
    font-weight: 800;
    border-right: 2px solid var(--dark);
    background: #f5f5f5;
}

.aff-cta {
    border-width: 5px;
    box-shadow: var(--shadow-sm);
    background: var(--primary);
}

.aff-cta .aff-head {
    background: var(--dark);
    color: var(--primary);
}

.aff-cta .aff-body {
    padding: 1.5rem;
    font-size: 1.02rem;
    font-weight: 700;
}

.aff-cta .btn {
    background: var(--dark);
    color: var(--white);
    border-color: var(--dark);
}

.aff-cta .btn:hover {
    background: var(--white);
    color: var(--dark);
}

.aff-cta .cta-note {
    color: rgba(0, 0, 0, 0.78);
}

.aff-experience {
    border-left-width: 8px;
    border-left-color: rgba(0, 0, 0, 0.16);
    background: #fcfcfc;
}

.aff-experience .aff-head {
    background: var(--white);
    color: var(--dark);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.aff-experience .aff-body {
    line-height: 1.75;
    color: rgba(0, 0, 0, 0.84);
}

.aff-meritdemerit {
    background: #fff;
    border: 2.5px solid #000;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 4px 4px 0 #000;
}

.aff-meritdemerit > .aff-head {
    background: #F5D000;
    border-bottom: 2.5px solid #000;
    padding: 11px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aff-meritdemerit > .aff-head::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #000;
    opacity: 0.25;
    box-shadow: 14px 0 0 rgba(0,0,0,0.25), 28px 0 0 rgba(0,0,0,0.25);
}

.aff-meritdemerit > .aff-head span {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #000;
    margin-left: 20px;
}

.aff-meritdemerit .aff-body {
    padding: 12px;
}

.aff-meritdemerit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.aff-merit-panel,
.aff-demerit-panel {
  border-radius: 10px;
  border: 1.5px solid #e8e8e8;
  overflow: hidden;
}

.aff-meritdemerit-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px 14px;
  border-bottom: 1px solid #ebebeb;
  background: #fafafa;
}

.aff-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aff-merit-title .aff-icon-wrap {
  background: #F5D000;
  border: 2px solid #000;
}

.aff-demerit-title .aff-icon-wrap {
  background: #111;
  border: 2px solid #000;
}

.aff-merit-title .aff-icon {
  color: #000;
}

.aff-demerit-title .aff-icon {
  color: #F5D000;
}

.aff-meritdemerit-title span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #666;
}

.aff-meritdemerit-list {
  list-style: none;
  margin: 0;
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
}

.aff-merit-item,
.aff-demerit-item {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.65;
  color: #111;
  padding: 8px 0 8px 14px;
  position: relative;
}

.aff-merit-item:not(:last-child),
.aff-demerit-item:not(:last-child) {
  border-bottom: 1px solid #f2f2f2;
}

.aff-merit-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #F5D000;
  border: 1.5px solid #000;
}

.aff-demerit-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #111;
}

.aff-meritdemerit .aff-body > p:empty {
  display: none;
}

@keyframes thumb-up {
  0% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
  60% { transform: translateY(-1px); }
  100% { transform: translateY(0); }
}

@keyframes thumb-down {
  0% { transform: translateY(0); }
  30% { transform: translateY(4px); }
  60% { transform: translateY(1px); }
  100% { transform: translateY(0); }
}

@keyframes pulse-ring-good {
  0% { r: 21; opacity: 0.5; }
  100% { r: 30; opacity: 0; }
}

@keyframes pulse-ring-bad {
  0% { r: 21; opacity: 0.3; }
  100% { r: 30; opacity: 0; }
}

.thumb-up-icon {
  animation: thumb-up 1.8s ease-in-out infinite;
}

.thumb-down-icon {
  animation: thumb-down 1.8s ease-in-out infinite;
}

.pulse-good {
  animation: pulse-ring-good 1.8s ease-out infinite;
  fill: none;
  stroke: #000;
  stroke-width: 1.5;
}

.pulse-bad {
  animation: pulse-ring-bad 1.8s ease-out infinite;
  fill: none;
  stroke: #F5D000;
  stroke-width: 1.5;
}

.aff-faq {
    border-width: 3px;
}

.aff-faq .aff-head {
    background: var(--white);
    border-bottom-width: 2px;
}

.aff-faq .aff-body {
    padding: 0;
}

.aff-faq-item {
    border-top: 1px solid rgba(0, 0, 0, 0.14);
    background: var(--white);
}

.aff-faq-item:first-child {
    border-top: 0;
}

.aff-faq-question {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    list-style: none;
    padding: 1.1rem 1.25rem 0.95rem;
    font-weight: 800;
    line-height: 1.55;
    background: #fbfbfb;
}

.aff-faq-question::-webkit-details-marker {
    display: none;
}

.aff-faq-question::before {
    content: "Q";
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border: 2px solid var(--dark);
    border-radius: 999px;
    background: var(--primary);
    color: var(--dark);
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
}

.aff-faq-question::after {
    content: "";
    margin-left: auto;
    width: 0.6rem;
    height: 0.6rem;
    border-right: 2px solid rgba(0, 0, 0, 0.6);
    border-bottom: 2px solid rgba(0, 0, 0, 0.6);
    transform: rotate(45deg) translateY(-1px);
    flex: 0 0 auto;
}

.aff-faq-item[open] .aff-faq-question::after {
    transform: rotate(225deg) translateY(-1px);
}

.aff-faq-answer {
    position: relative;
    padding: 0.2rem 1.25rem 1.2rem 4rem;
    background: var(--white);
    color: rgba(0, 0, 0, 0.84);
}

.aff-faq-answer::before {
    content: "A";
    position: absolute;
    left: 1.25rem;
    top: 0.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    background: var(--dark);
    color: var(--white);
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
}

.aff-faq-answer > *:last-child {
    margin-bottom: 0;
}

.aff-quiz {
    background: #fffdf4;
    color: var(--text);
    border-width: 4px;
}

.aff-quiz-head {
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 900;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    color: var(--dark);
    background: var(--primary);
    border-bottom: 3px solid var(--dark);
}

.aff-quiz-question {
    padding: 1.4rem 1.5rem 1rem;
    font-size: 1.08rem;
    line-height: 1.45;
    font-weight: 800;
}

.aff-quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
    padding: 0 1.5rem 1.5rem;
}

.aff-option {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 0.9rem;
    border: 2px solid var(--dark);
    border-radius: var(--radius);
    background: var(--white);
    font-weight: 700;
    font: inherit;
    color: inherit;
    cursor: pointer;
    font-size: 0.92rem;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.aff-option:hover {
    transform: translateY(-1px);
}

.aff-opt-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    background: var(--primary);
    color: var(--dark);
    font-weight: 900;
}

.aff-option.is-active {
    border-color: rgba(0, 0, 0, 0.62);
}

.aff-option.is-correct {
    background: #fff3b0;
    box-shadow: 0 0 0 3px rgba(255, 208, 0, 0.2);
}

.aff-option.is-incorrect {
    background: #f8f2ee;
}

.aff-quiz-details {
    border-top: 3px solid var(--dark);
}

.aff-quiz-summary {
    cursor: pointer;
    padding: 1rem 1.25rem;
    font-weight: 800;
    background: #f3f3f3;
    text-align: center;
}

.aff-quiz-answer-box {
    padding: 1.35rem 1.5rem 1.5rem;
    background: var(--white);
}

.aff-quiz.is-correct .aff-quiz-answer-box {
    animation: aff-quiz-pop 0.42s ease;
}

.aff-quiz-answer-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
    font-weight: 900;
    color: var(--dark);
}

@keyframes aff-quiz-pop {
    0% {
        transform: translateY(4px);
        background: #fff7d7;
    }
    100% {
        transform: translateY(0);
        background: var(--white);
    }
}

@media (max-width: 768px) {
    .aff-block {
        margin: 2.25rem 0;
    }

    .aff-body,
    .aff-step-content,
    .aff-cta .aff-body,
    .aff-quiz-question,
    .aff-quiz-answer-box {
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }

    .aff-quiz-options {
        grid-template-columns: 1fr;
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }

    .aff-step-content {
        padding-left: 0;
    }

    .aff-step {
        grid-template-columns: 2.9rem minmax(0, 1fr);
        gap: 1rem;
    }

    .aff-step::before {
        left: 1.4rem;
        top: 2.25rem;
        bottom: -1.9rem;
    }

    .aff-data-row {
        grid-template-columns: 1fr;
    }

    .aff-data-label {
        border-right: 0;
        border-bottom: 2px solid var(--dark);
    }

    .aff-meritdemerit-grid {
        grid-template-columns: 1fr;
    }
}
