/* ============================================================
   How To Use — frontend section CSS (v1.5.15+).
   Replaces the inline wp_add_inline_style payload that lived
   in includes/frontend/how-to-use.php since v1.4.0.

   Markup is shape-agnostic: a single .htu-section gets layout /
   number-style / aspect modifier classes from PHP, e.g.

     <section class="htu-section
                     htu-layout-image-left
                     htu-numstyle-circle
                     htu-aspect-3-4">

   All variants share the same base structure; only modifier
   classes differ. Mobile always stacks (image on top, content
   below) regardless of layout choice — desktop-only flexibility.
   ============================================================ */

/* ============================================================
   CARD SHELL
   ============================================================ */
.htu-section {
    background: #fff;
    border-radius: 20px;
    padding: 28px 40px;
    margin: 32px auto;
    width: 80%;
    box-shadow: 0 2px 24px rgba(31, 31, 31, 0.06);
}

.htu-inner {
    display: flex;
    align-items: center;
    gap: 48px;
}

/* ============================================================
   LAYOUT MODIFIERS — desktop only.
   ============================================================ */
.htu-layout-image-left  .htu-inner { flex-direction: row; }
.htu-layout-image-right .htu-inner { flex-direction: row-reverse; }
.htu-layout-image-top   .htu-inner { flex-direction: column; gap: 32px; }
.htu-layout-image-top   .htu-images,
.htu-layout-image-top   .htu-content { width: 100%; }
.htu-layout-image-top   .htu-images { max-width: 720px; margin: 0 auto; }

/* ============================================================
   IMAGES — desktop side-by-side, mobile vertical stack.
   ============================================================ */
.htu-images {
    display: flex;
    gap: 14px;
    flex: 0 0 auto;
    width: 48%;
}

.htu-img-wrap {
    flex: 1;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    margin: 0;
}

.htu-aspect-1-1 .htu-img-wrap { aspect-ratio: 1 / 1; }
.htu-aspect-4-3 .htu-img-wrap { aspect-ratio: 4 / 3; }

.htu-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.htu-img-wrap:hover .htu-img {
    transform: scale(1.03);
}

/* ============================================================
   CONTENT — title + steps.
   ============================================================ */
.htu-content {
    flex: 1;
    min-width: 0;
}

.htu-title {
    font-family: 'Geologica', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #1f1f1f;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 24px 0;
    text-align: left;
}

.htu-layout-image-top .htu-title { text-align: center; }

.htu-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    counter-reset: htu-step;
}

.htu-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    text-align: left;
}

.htu-step-text {
    font-family: 'Geologica', sans-serif;
    font-size: 14.5px;
    line-height: 1.6;
    color: #555;
    margin: 0;
    padding-top: 5px;
}

/* ============================================================
   STEP NUMBER STYLES
   ============================================================ */

/* Circle (default) — 32px burgundy filled circle, white bold number. */
.htu-numstyle-circle .htu-step-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #851625;
    color: #fff;
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    font-size: 14.5px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0;
}

/* Pill — "Step N" burgundy pill stacked above the text, matches Routine. */
.htu-numstyle-pill .htu-step {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.htu-numstyle-pill .htu-step-badge {
    background: #851625;
    color: #fff;
    font-family: 'Geologica', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 4px 14px;
    border-radius: 30px;
    display: inline-block;
    line-height: 1.4;
}
.htu-numstyle-pill .htu-step-badge::before { content: 'Step '; }
.htu-numstyle-pill .htu-step-text { padding-top: 0; }

/* Simple — large outline number, decorative. */
.htu-numstyle-simple .htu-step-badge {
    font-family: 'Geologica', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #851625;
    line-height: 1;
    flex-shrink: 0;
    min-width: 28px;
    padding-top: 2px;
}
.htu-numstyle-simple .htu-step-badge::after { content: '.'; }

/* ============================================================
   RESPONSIVE — tablet + mobile.
   On mobile every layout variant stacks (image on top) for
   readability; only desktop / large tablet respects the
   admin-selected direction.
   ============================================================ */

@media (max-width: 1024px) and (min-width: 769px) {
    .htu-section { padding: 24px 32px; }
    .htu-inner   { gap: 36px; }
    .htu-title   { font-size: 28px; margin-bottom: 20px; }
    .htu-images  { width: 44%; }
}

@media (max-width: 768px) {
    .htu-section { padding: 32px 20px; margin: 24px 12px; width: auto; border-radius: 16px; }
    .htu-inner,
    .htu-layout-image-left  .htu-inner,
    .htu-layout-image-right .htu-inner,
    .htu-layout-image-top   .htu-inner {
        flex-direction: column;
        gap: 24px;
    }
    .htu-images  {
        width: 100%;
        flex-direction: column;
        gap: 12px;
        max-width: 360px;
        margin: 0 auto;
    }
    .htu-img-wrap { aspect-ratio: 1 / 1; }
    .htu-title   { font-size: 22px; text-align: center; margin-bottom: 16px; }
    .htu-steps   { gap: 18px; }
    .htu-step-text { font-size: 14px; line-height: 1.55; }
    .htu-numstyle-circle .htu-step-badge { width: 28px; height: 28px; font-size: 13.5px; }
}
