/* File: assets/css/widgets.css */

/* Original ACF Card - Grid Layout */
.acf-cards-grid {
    display: grid;
    gap: 20px;
    margin: 0;
    padding: 0;
}

/* ACF Card V2 - Vertical Layout */
.acf-cards-v2-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.acf-cards-columns-1 {
    grid-template-columns: repeat(1, 1fr);
}

.acf-cards-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.acf-cards-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.acf-cards-columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive breakpoints */
@media (max-width: 1024px) {
    .acf-cards-columns-4,
    .acf-cards-columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .acf-cards-grid,
    .acf-cards-v2-grid {
        gap: 15px;
    }
    
    .acf-card-content,
    .acf-card-v2-content {
        padding: 15px;
    }
    
    .acf-card-title,
    .acf-card-v2-title {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .acf-card-v2-image {
        width: 250px;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .acf-cards-columns-4,
    .acf-cards-columns-3,
    .acf-cards-columns-2 {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .acf-cards-grid,
    .acf-cards-v2-grid {
        gap: 12px;
    }
    
    .acf-card-content,
    .acf-card-v2-content {
        padding: 15px;
    }
    
    .acf-card-title,
    .acf-card-v2-title {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .acf-card-excerpt,
    .acf-card-v2-excerpt {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .acf-card-field,
    .acf-card-v2-field {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .acf-card-button,
    .acf-card-v2-button {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .acf-card-fields,
    .acf-card-v2-fields {
        margin: 12px 0;
        padding: 12px;
    }
    
    .acf-card-has-background {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .acf-card-content,
    .acf-card-v2-content {
        padding: 12px;
    }
    
    .acf-card-title,
    .acf-card-v2-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .acf-card-excerpt,
    .acf-card-v2-excerpt {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .acf-card-field,
    .acf-card-v2-field {
        font-size: 12px;
        padding: 8px 10px;
        margin: 6px 0;
    }
    
    .acf-card-button,
    .acf-card-v2-button {
        padding: 8px 14px;
        font-size: 13px;
        width: 100%;
        text-align: center;
    }
    
    .acf-card-fields,
    .acf-card-v2-fields {
        gap: 8px;
        margin: 10px 0;
        padding: 10px;
    }
    
    .acf-field-label {
        font-size: 11px;
    }
    
    .acf-field-value {
        font-size: 13px;
    }
    
    .acf-card-has-background {
        min-height: 250px;
    }
    
    .acf-card-button-v1 {
        top: 8px !important;
        right: 8px !important;
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
}

.acf-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* Full-card clickable overlay */
.acf-card-link {
    position: absolute;
    inset: 0;
    z-index: 2; /* above background and below interactive elements with higher z-index */
    display: block;
    text-decoration: none;
    background: transparent;
    cursor: pointer;
}

/* Make sure v2 cards also accept the overlay link */
.acf-card-v2 .acf-card-link {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    text-decoration: none;
    background: transparent;
    cursor: pointer;
}

/* Ensure inner links and buttons remain clickable on top of overlay */
.acf-card a, .acf-card .acf-card-button, .acf-card-button-v1 {
    position: relative;
    z-index: 3;
}

.acf-card-content, .acf-card-image {
    position: relative;
    z-index: 1;
}

.acf-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Background image variant */
.acf-card-has-background {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    min-height: 400px;
}

.acf-card-has-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
    border-radius: inherit;
}

.acf-card-has-background .acf-card-content {
    position: relative;
    z-index: 1;
    color: #ffffff;
}

.acf-card-has-background .acf-card-title,
.acf-card-has-background .acf-card-title a {
    color: #ffffff;
}

.acf-card-has-background .acf-card-excerpt {
    color: rgba(255, 255, 255, 0.9);
}


.acf-card-has-background .acf-card-field {
    color: rgba(255, 255, 255, 0.95);
}

.acf-card-has-background .acf-card-field strong {
    color: #ffffff;
}

.acf-card-image {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding-top: 66.67%; /* 3:2 aspect ratio */
}

.acf-card-image a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.acf-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.acf-card:hover .acf-card-image img {
    transform: scale(1.05);
}

.acf-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.acf-card-title {
    margin: 0 0 15px 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
}

.acf-card-title a {
    color: inherit;
    text-decoration: none !important;
    transition: color 0.3s ease;
}

.acf-card-title a:hover {
    color: #0073aa;
}

.acf-card-excerpt {
    margin: 0 0 15px 0;
    line-height: 1.6;
    color: #666666;
    flex-grow: 1;
}

.acf-card-fields {
    margin: 15px 0;
    padding: 0;
    background: transparent;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.acf-card-field {
    margin: 10px 0;
    padding: 12px 15px;
    font-size: 14px;
    line-height: 1.5;
    background: #f9f9f9;
    border-left: 3px solid #0073aa;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.acf-card-field:hover {
    background: #f0f0f0;
    border-left-color: #005177;
    transform: translateX(3px);
}

/* Inline layout for fields (label left, value right) */
.acf-card-field-inline {
    display: flex;
    align-items: center;
    gap: 15px;
}

.acf-card-field-inline .acf-field-label {
    width: 30%;
    min-width: 80px;
    margin-bottom: 0;
}

.acf-card-field-inline .acf-field-value {
    flex: 1 1 auto;
}

/* Field label styling */
.acf-field-label {
    display: block;
    color: #0073aa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

/* Field value styling */
.acf-field-value {
    color: #333333;
    font-size: 14px;
    line-height: 1.6;
}

/* Ensure images inserted via ACF fields are responsive */
.acf-field-value img,
.acf-card-v2-field img,
.acf-card-field img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-top: 6px;
}

/* Legacy support for old strong tags (if any remain) */
.acf-card-field strong {
    display: block;
    color: #0073aa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.acf-card-button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
    margin-top: auto;
}

.acf-card-button:hover {
    background: #005177;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.acf-card-button-v1 {
    display: inline-block !important;
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    padding: 10px 20px !important;
    background: #0073aa !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
    text-align: center !important;
    margin-top: auto !important;
}

.acf-card-button-v1:hover {
    background: #005177;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

/* Loading state */
.acf-cards-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}


/* ===== ACF Card V2 - Vertical Layout Styles ===== */

.acf-card-v2 {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: row;
    width: 100%;
}

.acf-card-v2:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.acf-card-v2-image {
    width: 300px;
    min-width: 300px;
    overflow: hidden;
    position: relative;
}

.acf-card-v2-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.acf-card-v2-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.acf-card-v2:hover .acf-card-v2-image img {
    transform: scale(1.05);
}

.acf-card-v2-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.acf-card-v2-title {
    margin: 0 0 15px 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
}

.acf-card-v2-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.acf-card-v2-title a:hover {
    color: #0073aa;
}

.acf-card-v2-excerpt {
    margin: 0 0 15px 0;
    line-height: 1.6;
    color: #666666;
    flex-grow: 1;
}

.acf-card-v2-fields {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.acf-card-v2-field {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.5;
}

.acf-card-v2-field strong {
    color: #333333;
    font-weight: 600;
}

.acf-card-v2-button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
    margin-top: auto;
    align-self: flex-start;
}

.acf-card-v2-button:hover {
    background: #005177;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

/* Responsive for V2 */
@media (max-width: 768px) {
    .acf-card-v2 {
        flex-direction: column;
    }
    
    .acf-card-v2-image {
        width: 100%;
        min-width: 100%;
        padding-top: 56.25%; /* 16:9 aspect ratio for mobile */
        position: relative;
    }
    
    .acf-card-v2-image a {
        position: absolute;
        top: 0;
        left: 0;
    }
}

@media (max-width: 480px) {
    .acf-card-v2-image {
        padding-top: 66.67%; /* 3:2 aspect ratio for very small screens */
    }
    
    .acf-card-v2:hover {
        transform: translateX(3px);
    }
}

/* ============================================
   Cheapest Flight Widget Styles
   ============================================ */

.flight-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.flight-card-link {
    text-decoration: none !important;
    color: inherit;
    display: block;
    cursor: pointer;
}

.flight-card-link .country-name {
    text-decoration: none !important;
}

.flight-card-link .price {
    text-decoration: none !important;
}

.flight-card-link .subtitle {
    text-decoration: none !important;
}

.flight-card-link:hover {
    text-decoration: none !important;
    color: inherit;
}

.flight-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 20px;
    border: 2px solid #e0b3ff;
    padding: 30px 25px;
    border-radius: 12px;
    background: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.flight-card-link:hover .flight-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.flag-icon {
    font-size: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.flag-icon svg {
    max-width: 100%;
    height: auto;
}

.flag-icon i {
    line-height: 1;
}

.flight-content {
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.country-name {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 700;
    color: #1a73e8;
    line-height: 1.2;
}

.subtitle {
    margin: 0;
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

.price {
    margin: 0;
    font-weight: 700;
    font-size: 20px;
    padding: 0;
    white-space: nowrap;
}

/* Responsive Styles for Flight Cards */
@media (max-width: 768px) {
    .flight-card {
        gap: 15px;
        padding: 20px 15px;
    }
    
    .flag-icon {
        font-size: 60px;
    }
    
    .country-name {
        font-size: 14px;
    }
    
    .price {
        font-size: 18px;
    }
    
    .subtitle {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .flight-card {
        grid-template-columns: auto 1fr;
        gap: 12px;
        padding: 15px 12px;
    }
    
    .flag-icon {
        font-size: 50px;
    }
    
    .flight-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .country-name {
        font-size: 13px;
    }
    
    .price {
        font-size: 16px;
    }
    
    .subtitle {
        font-size: 10px;
    }
}