/* ============================================
   HOJ Members Plugin — Frontend Styles
   Theme: Purple / Gold / White
   ============================================ */

:root {
    --hoj-purple: #4a1a6b;
    --hoj-purple-dark: #3a1055;
    --hoj-purple-light: #6b3a8a;
    --hoj-gold: #c5a028;
    --hoj-gold-light: #d4b94e;
    --hoj-gold-dark: #a58820;
    --hoj-white: #ffffff;
    --hoj-gray-light: #f5f3f7;
    --hoj-gray: #e0dce4;
    --hoj-text: #2d2d2d;
    --hoj-text-light: #6b6b6b;
    --hoj-success: #28a745;
    --hoj-error: #dc3545;
    --hoj-radius: 10px;
}

/* ============================================
   Modal Overlay & Container
   ============================================ */

.hoj-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hoj-modal-overlay.hoj-modal-visible {
    opacity: 1;
}

.hoj-modal {
    background: var(--hoj-white);
    border-radius: var(--hoj-radius);
    max-width: 520px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.hoj-modal-overlay.hoj-modal-visible .hoj-modal {
    transform: translateY(0);
}

.hoj-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--hoj-text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.hoj-modal-close:hover {
    color: var(--hoj-text);
}

.hoj-modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.hoj-modal-icon {
    font-size: 40px;
    color: var(--hoj-purple);
    margin-bottom: 10px;
}

.hoj-success-icon {
    color: var(--hoj-success);
    font-size: 50px;
    background: #e8f5e9;
    width: 70px;
    height: 70px;
    line-height: 70px;
    border-radius: 50%;
    display: inline-block;
    margin-bottom: 15px;
}

.hoj-modal-header h2 {
    font-size: 24px;
    color: var(--hoj-purple);
    margin: 0 0 8px;
    font-weight: 700;
}

.hoj-modal-header p {
    font-size: 14px;
    color: var(--hoj-text-light);
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   Forms (shared between modal and page)
   ============================================ */

.hoj-form-row {
    display: flex;
    gap: 15px;
}

.hoj-form-row-3 {
    display: flex;
    gap: 15px;
}

.hoj-form-field {
    flex: 1;
    margin-bottom: 16px;
}

.hoj-form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--hoj-text);
    margin-bottom: 5px;
}

.hoj-form-field .required {
    color: var(--hoj-error);
}

.hoj-form-field input[type="text"],
.hoj-form-field input[type="email"],
.hoj-form-field input[type="tel"],
.hoj-form-field input[type="date"],
.hoj-form-field input[type="number"],
.hoj-form-field select,
.hoj-form-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--hoj-gray);
    border-radius: 6px;
    font-size: 15px;
    color: var(--hoj-text);
    background: var(--hoj-white);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.hoj-form-field input:focus,
.hoj-form-field select:focus,
.hoj-form-field textarea:focus {
    border-color: var(--hoj-purple);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 26, 107, 0.1);
}

.hoj-form-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.hoj-form-message.hoj-msg-error {
    background: #fce4ec;
    color: var(--hoj-error);
    border: 1px solid #f8bbd0;
}

.hoj-form-message.hoj-msg-success {
    background: #e8f5e9;
    color: var(--hoj-success);
    border: 1px solid #c8e6c9;
}

/* ============================================
   Buttons
   ============================================ */

.hoj-btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.hoj-btn-primary {
    background: var(--hoj-purple);
    color: var(--hoj-white);
}

.hoj-btn-primary:hover {
    background: var(--hoj-purple-dark);
    color: var(--hoj-white);
    text-decoration: none;
}

.hoj-btn-gold {
    background: var(--hoj-gold);
    color: var(--hoj-white);
}

.hoj-btn-gold:hover {
    background: var(--hoj-gold-dark);
    color: var(--hoj-white);
    text-decoration: none;
}

.hoj-btn-lg {
    padding: 16px 40px;
    font-size: 18px;
}

.hoj-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hoj-btn-link {
    background: none;
    border: none;
    color: var(--hoj-purple);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 5px 0;
    text-decoration: none;
}

.hoj-btn-link:hover {
    color: var(--hoj-purple-dark);
    text-decoration: underline;
}

.hoj-modal-dismiss {
    background: none;
    border: none;
    color: var(--hoj-text-light);
    cursor: pointer;
    font-size: 14px;
    margin-top: 12px;
    display: block;
    width: 100%;
    text-align: center;
}

.hoj-modal-dismiss:hover {
    color: var(--hoj-text);
}

/* ============================================
   Join CTA (inside modal after subscribe)
   ============================================ */

.hoj-join-cta {
    text-align: center;
    margin-top: 20px;
}

.hoj-join-cta-divider {
    position: relative;
    margin: 25px 0 20px;
}

.hoj-join-cta-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--hoj-gray);
}

.hoj-join-cta-divider span {
    background: var(--hoj-white);
    padding: 0 15px;
    position: relative;
    color: var(--hoj-text-light);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hoj-join-cta h3 {
    color: var(--hoj-purple);
    font-size: 20px;
    margin: 0 0 8px;
}

.hoj-join-cta p {
    font-size: 14px;
    color: var(--hoj-text-light);
    margin: 0 0 20px;
    line-height: 1.5;
}

/* ============================================
   Sidebar Banners
   ============================================ */

.hoj-sidebar-banners {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hoj-banner {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: var(--hoj-radius);
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.hoj-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.hoj-banner-icon {
    font-size: 28px;
    margin-right: 14px;
    flex-shrink: 0;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.hoj-banner-text {
    flex: 1;
}

.hoj-banner-title {
    display: block;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
}

.hoj-banner-subtitle {
    display: block;
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

.hoj-banner-arrow {
    font-size: 20px;
    opacity: 0.7;
    transition: transform 0.2s;
}

.hoj-banner:hover .hoj-banner-arrow {
    transform: translateX(3px);
}

/* Support banner — gold */
.hoj-banner-support {
    background: linear-gradient(135deg, var(--hoj-gold) 0%, var(--hoj-gold-dark) 100%);
    color: var(--hoj-white);
}

/* Subscribe banner — purple */
.hoj-banner-subscribe {
    background: linear-gradient(135deg, var(--hoj-purple) 0%, var(--hoj-purple-dark) 100%);
    color: var(--hoj-white);
}

/* Join banner — deep purple with gold accent */
.hoj-banner-join {
    background: linear-gradient(135deg, var(--hoj-purple-dark) 0%, #2a0a3e 100%);
    color: var(--hoj-white);
    border: 2px solid var(--hoj-gold);
}

/* ============================================
   Membership Form Page
   ============================================ */

.hoj-membership-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.hoj-membership-welcome {
    text-align: center;
    padding: 40px 30px;
    background: linear-gradient(135deg, var(--hoj-purple) 0%, var(--hoj-purple-dark) 100%);
    color: var(--hoj-white);
    border-radius: var(--hoj-radius);
    margin-bottom: 30px;
}

.hoj-membership-welcome-icon {
    font-size: 50px;
    margin-bottom: 10px;
    color: var(--hoj-gold);
}

.hoj-membership-welcome h2 {
    font-size: 30px;
    margin: 0 0 12px;
    color: var(--hoj-white);
}

.hoj-membership-welcome p {
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.hoj-membership-form {
    background: var(--hoj-white);
    border-radius: var(--hoj-radius);
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.hoj-form-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--hoj-gray);
}

.hoj-form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.hoj-form-section h3 {
    font-size: 18px;
    color: var(--hoj-purple);
    margin: 0 0 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-number {
    background: var(--hoj-purple);
    color: var(--hoj-white);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.section-desc {
    font-size: 14px;
    color: var(--hoj-text-light);
    margin: 0 0 15px;
}

/* Checkbox grid */
.hoj-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.hoj-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--hoj-text);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--hoj-gray);
    transition: all 0.2s;
}

.hoj-checkbox:hover {
    border-color: var(--hoj-purple-light);
    background: var(--hoj-gray-light);
}

.hoj-checkbox input:checked + .hoj-checkbox,
.hoj-checkbox:has(input:checked) {
    background: var(--hoj-gray-light);
    border-color: var(--hoj-purple);
}

.hoj-checkbox-standalone {
    border: none;
    padding: 0;
    font-size: 15px;
}

/* Child row add button */
.hoj-child-row {
    align-items: flex-end;
}

.hoj-child-row .hoj-remove-child {
    background: none;
    border: none;
    color: var(--hoj-error);
    cursor: pointer;
    font-size: 20px;
    padding: 8px;
    line-height: 1;
}

/* Success state */
.hoj-membership-success {
    text-align: center;
    padding: 60px 30px;
}

.hoj-success-icon-large {
    font-size: 70px;
    color: var(--hoj-success);
    background: #e8f5e9;
    width: 100px;
    height: 100px;
    line-height: 100px;
    border-radius: 50%;
    display: inline-block;
    margin-bottom: 20px;
}

.hoj-membership-success h2 {
    color: var(--hoj-purple);
    font-size: 28px;
    margin: 0 0 15px;
}

.hoj-membership-success p {
    font-size: 16px;
    color: var(--hoj-text-light);
    max-width: 500px;
    margin: 0 auto 25px;
    line-height: 1.6;
}

.hoj-membership-success .hoj-btn {
    width: auto;
    display: inline-block;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 600px) {
    .hoj-modal {
        padding: 25px 20px;
        margin: 10px;
    }

    .hoj-form-row,
    .hoj-form-row-3 {
        flex-direction: column;
        gap: 0;
    }

    .hoj-checkbox-grid {
        grid-template-columns: 1fr;
    }

    .hoj-membership-welcome {
        padding: 25px 20px;
    }

    .hoj-membership-welcome h2 {
        font-size: 24px;
    }

    .hoj-membership-form {
        padding: 20px 15px;
    }

    .hoj-banner {
        padding: 14px 16px;
    }

    .hoj-banner-icon {
        font-size: 22px;
        width: 38px;
        height: 38px;
    }
}
/* Theme override - ensure purple buttons */
.hoj-membership-page [type="submit"].hoj-btn-primary,
.hoj-membership-page button.hoj-btn-primary,
.hoj-modal [type="submit"].hoj-btn-primary,
.hoj-modal button.hoj-btn-primary,
body .hoj-btn.hoj-btn-primary,
body [type="submit"].hoj-btn.hoj-btn-primary {
    background-color: #4A0E78 !important;
    background: #4A0E78 !important;
    border-color: #4A0E78 !important;
    color: #ffffff !important;
}
.hoj-membership-page [type="submit"].hoj-btn-primary:hover,
body .hoj-btn.hoj-btn-primary:hover {
    background-color: #3a0b5e !important;
    background: #3a0b5e !important;
}
/* Fix input text color - override theme purple text */
.hoj-membership-page input[type="text"],
.hoj-membership-page input[type="email"],
.hoj-membership-page input[type="tel"],
.hoj-membership-page input[type="number"],
.hoj-membership-page select,
.hoj-membership-page textarea,
.hoj-modal input[type="text"],
.hoj-modal input[type="email"],
.hoj-form input,
.hoj-form select,
.hoj-form textarea {
    color: #000000 !important;
}
.hoj-form input::placeholder,
.hoj-form textarea::placeholder {
    color: #999999 !important;
}
/* Fix select dropdown text being cut off */
.hoj-form select,
.hoj-membership-page select {
    min-height: 48px !important;
    height: auto !important;
    padding: 10px 12px !important;
    line-height: 1.5 !important;
    font-size: 16px !important;
    overflow: visible !important;
    -webkit-appearance: menulist !important;
    appearance: menulist !important;
}
.hoj-form .hoj-form-field {
    overflow: visible !important;
}

/* ============================================
   HOJ Sidebar Page Layout
   Widens the container on pages with sidebar banners
   so the sidebar extends closer to the page edge.
   ============================================ */

/* Widen Blocksy container on pages that have our sidebar */
body.page-template-default .ct-container[data-sidebar="right"] {
    max-width: 1500px; /* wider than default 1290px */
}

/* Make sidebar banners fill the full sidebar width */
.ct-sidebar .hoj-sidebar-banners {
    width: 100%;
}

/* Responsive: on smaller screens, keep default container width */
@media (max-width: 1500px) {
    body.page-template-default .ct-container[data-sidebar="right"] {
        max-width: calc(100% - 40px); /* small margin on edges */
    }
}

@media (max-width: 999px) {
    body.page-template-default .ct-container[data-sidebar="right"] {
        max-width: 1290px; /* revert to default on tablet */
    }
}


/* ===== Sticky Sidebar Banners (Desktop) ===== */
aside .hoj-sidebar-banners {
    position: sticky;
    top: 80px;
}
.admin-bar aside .hoj-sidebar-banners {
    top: 112px;
}

/* ===== Mobile Banners (Top of Content) ===== */
.hoj-mobile-banners {
    display: none;
}
@media (max-width: 999px) {
    .hoj-mobile-banners {
        display: block;
        margin-bottom: 24px;
    }
    .hoj-mobile-banners .hoj-sidebar-banners {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }
    .hoj-mobile-banners .hoj-banner {
        flex: 1;
        min-width: 200px;
    }
}
@media (max-width: 549px) {
    .hoj-mobile-banners .hoj-sidebar-banners {
        flex-direction: column;
    }
    .hoj-mobile-banners .hoj-banner {
        min-width: unset;
    }
}
