/**
 * Greeting Card Page Styles
 * Warm, inviting design for greeting display
 */

/* ==========================================================================
   Global Overflow Fix
   ========================================================================== */

* {
    box-sizing: border-box;
}

body, html {
    overflow-x: hidden;
    overflow-x: clip; /* clip, unlike hidden, does not turn body into a scroll container */
}

main.nine.columns {
    min-width: 0;
    overflow: hidden;
}

/* ==========================================================================
   Loading States & Transitions
   ========================================================================== */

.loading, .loading a, .loading h1 {
    color: inherit !important;
}

/* ==========================================================================
   Ad Container Styles
   ========================================================================== */

.ad_container {
    direction: ltr;
    margin: 1em 0em;
}

.ad_in_greeting_page {
    width: 320px;
    height: 100px;
}

@media(min-width: 500px) {
    .ad_in_greeting_page {
        width: 468px;
        height: 60px;
    }
}

@media(min-width: 800px) {
    .ad_in_greeting_page {
        width: 728px;
        height: 90px;
    }
    .bannerHolder {
        text-align: right !important;
    }
}

.large_resp_greeting {
    margin: 0 auto;
    width: 300px;
    height: 250px !important;
}

@media(min-width: 340px) {
    .large_resp_greeting {
        margin: 0 auto;
        width: 336px;
        height: 280px !important;
    }
}

@media(min-width: 670px) {
    .large_resp_greeting {
        margin: 0 auto;
        width: 650px;
        height: 250px !important;
    }
}

@media(min-width: 760px) {
    .large_resp_greeting {
        margin: 0 auto;
        width: 728px;
        height: 250px !important;
    }
    .bannerHolder {
        text-align: right !important;
    }
}

@media(min-width: 1300px) {
    .large_resp_greeting {
        margin: 0 auto;
        width: 970px;
        height: 250px !important;
    }
    .bannerHolder {
        text-align: right !important;
    }
}

.small_resp_greeting,
.small_left_resp_greeting {
    margin: 0 auto;
    width: 300px;
    height: 250px !important;
}

@media(min-width: 340px) {
    .small_resp_greeting,
    .small_left_resp_greeting {
        margin: 0 auto;
        width: 336px;
        height: 280px !important;
    }
}

/* ==========================================================================
   Form Elements (Scoped to NOT affect header search)
   ========================================================================== */

.greeting-card-container input,
.search input,
#tag_erea input,
.RelatedGreetings input {
    border: 1px solid #d8d8d8 !important;
    padding: 7px !important;
    font-size: 1em !important;
    border-radius: 0.3em !important;
    width: 78% !important;
    margin-top: 1em !important;
}

.greeting-card-container .submit,
.search .submit {
    background: #4c6a8a !important;
    border: 0px solid #da5946 !important;
    color: #fbf9f9 !important;
    width: 19% !important;
}

/* ==========================================================================
   Greeting Card Container - Warm & Inviting
   ========================================================================== */

.greeting-card-container {
    width: 100%;
    margin: 0 0 24px 0;
    background: #ffffff;
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    border: 1px solid #eae6df;
}

.greeting-card-inner {
    background: #ffffff;
    border-radius: 17px;
    padding: 0;
    overflow: hidden;
}

/* ==========================================================================
   Greeting Card Header
   ========================================================================== */

.greeting-card-header {
    background: transparent;
    color: #2c3e50;
    padding: 0px 10px 0px 0px;
    text-align: right !important;
    border-radius: 17px 17px 0 0;
    position: relative;
    direction: rtl;
}

.greeting-card-header h1 {
    margin: 0 0 16px 0;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.5;
    color: #2c3e50 !important;
    letter-spacing: 0.2px;
    font-family: 'Alef', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: right !important;
    direction: rtl;
}

/* ==========================================================================
   Card Meta (author, category, sent count)
   ========================================================================== */

.greeting-card-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 14px;
    flex-wrap: wrap;
    color: #777;
    direction: rtl;
    text-align: right !important;
}

.greeting-card-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.greeting-card-meta a {
    color: #4c6a8a;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.greeting-card-meta a:hover {
    color: #2c4a68;
    text-decoration: underline;
}

/* Sent count badge */
.sent-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fef7ed;
    color: #b8860b;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #f5e6cc;
}

.sent-count-badge i {
    font-size: 12px;
}

/* ==========================================================================
   Greeting Content Area - Warm & Readable
   ========================================================================== */

#bracha {
    font-family: 'Alef', Arial, sans-serif;
    line-height: 2;
    padding: 32px 30px;
    font-size: 18px;
    color: #3a3a3a;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #fdfcfa 0%, #faf6f0 100%);
    border-right: 4px solid;
    border-image: linear-gradient(to bottom, #c9956b, #8b6f4e) 1;
    position: relative;
}

#bracha::before {
    content: '\201F';
    position: absolute;
    top: 8px;
    right: 28px;
    font-size: 52px;
    color: rgba(201, 149, 107, 0.12);
    font-family: Georgia, serif;
    line-height: 1;
    pointer-events: none;
}

/* Digital text mode styling */
#bracha.digital-text {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    color: #0066cc;
    text-shadow: 0 0 5px rgba(0, 102, 204, 0.3);
}

#bracha p {
    margin-bottom: 1em;
}

#bracha br {
    content: "";
    display: block;
    margin-bottom: 0.5em;
}

/* ==========================================================================
   Primary Actions - send / copy, directly under the greeting text
   ========================================================================== */

.greeting-primary-actions {
    display: flex;
    gap: 12px;
    margin: 18px 0 28px; /* bottom gap keeps the buttons clear of the ad unit below */
}

.primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 12px;
    font-family: 'Alef', Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.primary-action i {
    font-size: 20px;
}

.primary-action-whatsapp {
    background: #0E7C3A; /* WhatsApp-family green dark enough for white text (5.3:1) */
    color: #fff;
    border: 2px solid #0E7C3A;
}

.primary-action-whatsapp:hover,
.primary-action-whatsapp:focus-visible {
    background: #0a6a31;
    border-color: #0a6a31;
}

.primary-action-copy {
    background: #fff;
    color: #2c3e50;
    border: 2px solid #c9b8a3;
}

.primary-action-copy:hover,
.primary-action-copy:focus-visible {
    background: #faf6f0;
    border-color: #8b6f4e;
}

.primary-action-copy.is-copied {
    background: #eaf6ee;
    color: #0E7C3A;
    border-color: #0E7C3A;
}

/* ==========================================================================
   Action Bar - Clean Toolbar Design
   ========================================================================== */

.greeting-action-bar {
    margin: 24px 0 8px;
    padding: 14px 0;
    border-top: 1px solid #eae6df;
    border-bottom: 1px solid #eae6df;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

/* Action buttons group */
.action-buttons {
    display: flex;
    gap: 4px;
    align-items: center;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Alef', Arial, sans-serif;
    color: #666;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.2;
}

.action-btn:hover {
    background: #f5f2ed;
    color: #333;
}

.action-btn:active {
    background: #ebe7e0;
}

.action-btn i {
    font-size: 17px;
    color: #999;
    transition: color 0.2s ease;
}

.action-btn:hover i {
    color: #555;
}

/* Divider between action groups */
.action-divider {
    width: 1px;
    height: 24px;
    background: #e0dbd3;
    margin: 0 4px;
}

/* Navigation buttons group */
.navigation-buttons {
    display: flex;
    gap: 2px;
    align-items: center;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Alef', Arial, sans-serif;
    color: #888;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-btn:hover {
    background: #f5f2ed;
    color: #555;
}

.nav-btn i {
    font-size: 12px;
    color: #bbb;
    transition: color 0.2s ease;
}

.nav-btn:hover i {
    color: #888;
}

/* Share dropdown inside action bar */

/* Share dropdown */
.share-dropdown {
    position: relative;
    display: inline-flex;
}

.share-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: white;
    border: 1px solid #eae6df;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    margin-bottom: 8px;
    z-index: 1000;
    min-width: 170px;
    padding: 6px 0;
    overflow: hidden;
}

.share-menu button {
    display: flex !important;
    align-items: center;
    width: 100%;
    padding: 11px 16px !important;
    border: none !important;
    background: white !important;
    text-align: right;
    cursor: pointer;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #444 !important;
    gap: 10px;
    transition: background 0.15s ease;
    border-radius: 0 !important;
}

.share-menu button:hover {
    background: #f5f2ed !important;
}

.share-menu button:not(:last-child) {
    border-bottom: 1px solid #f2efe9 !important;
}

.share-menu button i {
    font-size: 18px;
    width: 22px;
    text-align: center;
}

/* ==========================================================================
   Tags Section
   ========================================================================== */

.greeting-tags-section {
    padding: 20px 24px;
}

.greeting-tags-section h2 {
    margin: 0 0 14px 0;
    color: #4c6a8a;
    font-size: 1.15em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.greeting-tags-section h2 i {
    color: #b8860b;
    font-size: 0.9em;
}

.greeting-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-pill {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #4c6a8a, #3a5570);
    color: white;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.88em;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.tag-pill:hover {
    background: linear-gradient(135deg, #3a5570, #2c4358);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 106, 138, 0.3);
    color: white;
}

/* ==========================================================================
   Similar / Related Greetings Section
   ========================================================================== */

.similar-greetings-section {
    padding: 20px 24px;
}

.similar-greetings-section h2 {
    color: #4c6a8a;
    margin: 0 0 14px 0;
    font-size: 1.15em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.similar-greetings-section h2 i {
    color: #c9956b;
}

.similar-greetings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.similar-greeting-item {
    display: block;
    padding: 12px 16px;
    background: #fdfcfa;
    border-right: 3px solid #c9956b;
    text-decoration: none;
    color: #444;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.similar-greeting-item:hover {
    background: #f8f4ee;
    border-right-color: #b8860b;
    transform: translateX(-3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    color: #333;
}

.similar-greeting-item strong {
    display: block;
    font-size: 0.95em;
    line-height: 1.5;
}

.similar-greeting-item .similar-author {
    color: #999;
    font-size: 0.82em;
    margin-top: 4px;
    display: block;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */

.toast-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    background: #2c3e50;
    color: white;
    padding: 14px 24px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    font-size: 15px;
    font-family: 'Alef', Arial, sans-serif;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(-12px) translateX(0);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    direction: rtl;
}

.toast-notification.toast-visible {
    opacity: 1;
    transform: translateY(0) translateX(0);
    pointer-events: auto;
}

.toast-notification.toast-success {
    background: linear-gradient(135deg, #2d7a4f, #1e6b3e);
}

.toast-notification.toast-info {
    background: linear-gradient(135deg, #4c6a8a, #3a5570);
}

.toast-notification i {
    font-size: 18px;
}

/* ==========================================================================
   Legacy tag/related styles (backwards compat)
   ========================================================================== */

#tag_erea {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

#tag_erea h4 {
    margin-bottom: 15px;
    color: #29486e;
}

#tag_erea ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#tag_erea li {
    display: inline-block;
}

#tag_erea li a {
    display: inline-block;
    padding: 6px 14px;
    background: #4c6a8a;
    color: white;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

#tag_erea li a:hover {
    background: #3a5269;
    transform: translateY(-2px);
}

/* ==========================================================================
   Related Greetings (legacy)
   ========================================================================== */

.RelatedGreetings {
    margin: 30px 0;
}

.RelatedGreetings h4 {
    margin-bottom: 20px;
    color: #29486e;
    font-size: 18px;
    border-bottom: 2px solid #4c6a8a;
    padding-bottom: 10px;
}

.RelatedGreetingsItem {
    display: block;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.RelatedGreetingsItem:hover {
    background: #e9ecef;
    border-left-color: #4c6a8a;
    transform: translateX(-5px);
}

/* ==========================================================================
   Social Sharing Buttons (legacy - kept for other pages)
   ========================================================================== */

.social-share-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.share-main-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 15px auto;
    padding: 12px 24px;
    background: #4c6a8a;
    color: white;
    border: 2px solid #4c6a8a;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-main-button:hover {
    background: #3a5269;
    border-color: #3a5269;
    transform: translateY(-1px);
}

/* ==========================================================================
   Greeting Card Footer
   ========================================================================== */

.greeting-card-footer {
    background: #f8f9fa;
    padding: 25px 30px 30px 30px;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 17px 17px;
}

.greeting-card-footer > * {
    margin-bottom: 20px;
}

.greeting-card-footer > *:last-child {
    margin-bottom: 0;
}

.category-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ==========================================================================
   Mobile Search Form
   ========================================================================== */

.search {
    margin: 20px 0;
}

.search form {
    display: flex;
    gap: 10px;
}

.search input[type="search"] {
    flex: 1;
    min-width: 0;
}

.search input[type="submit"] {
    width: auto !important;
}

/* ==========================================================================
   Responsive Utilities
   ========================================================================== */

.hideOnUnder768 {
    display: block;
}

@media (max-width: 768px) {
    .hideOnUnder768 {
        display: none !important;
    }
}

.visible-xs {
    display: none;
}

@media (max-width: 767px) {
    .visible-xs {
        display: block !important;
    }
}

.divNavImagesMobile {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.navImage {
    max-width: 60px;
    height: auto;
}

.navImageLast {
    margin-left: auto;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.margin_15_top {
    margin-top: 15px;
}

.margin_2em_top {
    margin-top: 2em;
}

.margin_15_top_bottom {
    margin-top: 15px;
    margin-bottom: 15px;
}

.margin_3em_left {
    margin-left: 3em;
}

.float_dir {
    float: right;
}

/* ==========================================================================
   Mobile Responsive - Greeting Card Page
   ========================================================================== */

@media (max-width: 768px) {
    .greeting-card-container {
        margin: 12px 8px;
        width: calc(100% - 16px);
        border-radius: 10px;
        padding: 16px;
    }

    .greeting-card-header {
        text-align: right !important;
    }

    .greeting-card-header h1 {
        font-size: 24px;
        font-weight: 700;
        word-break: break-word;
        margin-bottom: 12px;
        text-align: right !important;
    }

    .greeting-card-meta {
        gap: 10px;
        font-size: 13px;
        justify-content: flex-start;
        text-align: right !important;
    }

    #bracha {
        padding: 24px 18px;
        font-size: 16px;
        text-align: right !important;
        border-radius: 8px;
    }

    #bracha::before {
        font-size: 40px;
        top: 6px;
        right: 16px;
    }

    .greeting-card-footer {
        padding: 15px;
    }

    /* Mobile action bar */
    .greeting-action-bar {
        padding: 10px 0;
        flex-wrap: wrap;
        gap: 6px;
    }

    .action-buttons {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0;
    }

    /* Mobile: full-width send/copy, side by side */
    .greeting-primary-actions {
        gap: 10px;
        margin: 16px 0 28px;
    }

    .primary-action {
        flex: 1 1 auto;
        padding: 0 12px;
        font-size: 15px;
        white-space: nowrap;
    }

    /* Secondary tools: small label under the icon (icon-only was hard to read) */
    .action-btn {
        flex-direction: column;
        gap: 3px;
        min-width: 64px;
        padding: 8px 10px;
        border-radius: 10px;
        font-size: 12px;
    }

    .action-btn i {
        font-size: 18px;
    }

    .action-divider {
        width: 100%;
        height: 1px;
        margin: 4px 0;
    }

    .nav-btn {
        flex: 1 1 0;
        justify-content: center;
        padding: 8px 6px;
        font-size: 12px;
    }

    .nav-btn i {
        font-size: 11px;
    }

    /* Tags mobile */
    .greeting-tags-section {
        padding: 16px 18px;
    }

    .tag-pill {
        font-size: 0.82em;
        padding: 5px 12px;
    }

    /* Similar greetings mobile */
    .similar-greetings-section {
        padding: 16px 18px;
    }

    /* Toast mobile */
    .toast-notification {
        right: 12px;
        left: 12px;
        top: 12px;
    }

    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .columns {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* Narrow phones (360px class): both labels don't fit on one row, stack them */
@media (max-width: 379px) {
    .greeting-primary-actions {
        flex-direction: column;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .ad_container,
    .greeting-navigation,
    .social-share-buttons,
    #icons_bottom_set,
    .RelatedGreetings,
    #tag_erea,
    .greeting-card-buttons-container,
    .greeting-tags-section,
    .toast-notification {
        display: none !important;
    }

    #bracha {
        box-shadow: none;
        padding: 0;
        background: none;
        border: none;
        border-image: none;
    }

    #bracha::before {
        display: none;
    }

    .greeting-card-container {
        box-shadow: none;
        border: none;
    }
}
