/* ================================================================
   MicaySeoul Elementor Widgets — shared styles
   ================================================================ */

/* ── Animated Headline ──────────────────────────────────────────── */

/* Custom properties với giá trị mặc định — bị override bởi Elementor inline style
   trên .elementor-widget-container khi user chỉnh trong editor */
.ms-animated-headline {
    display: block; /* block để text-align từ Advanced Elementor hoạt động */
    margin: 0;
}

.ms-ah-plain-text {
    display: inline;
}

.ms-ah-dynamic-wrapper {
    display: inline-block;
    position: relative;
    white-space: nowrap;
}

.ms-ah-dynamic-text {
    display: inline;
}

.ms-ah-svg {
    position: absolute;
    /* --ms-ah-gap được set bởi Elementor selector trên {{WRAPPER}};
       mặc định 4px nếu chưa được set */
    bottom: calc(-1 * var(--ms-ah-gap, 4px));
    left: 0;
    width: 100%;
    height: auto;
    overflow: visible;
    pointer-events: none;
}

.ms-ah-svg path {
    fill: none;
    stroke: var(--ms-ah-stroke, #e63946);
    stroke-width: var(--ms-ah-stroke-w, 4px);
    stroke-linecap: round;
    stroke-linejoin: round;
    /* initial hidden state — JS sẽ set strokeDasharray/Offset và transition */
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
}

/* ── Simple Post Cards ──────────────────────────────────────────── */

.ms-spc-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ms-spc-gap, 24px);
}

.ms-spc-card {
    width: calc((100% - 2 * var(--ms-spc-gap, 24px)) / 3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ms-spc-thumb-link {
    display: block;
}

.ms-spc-thumb-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 default — overridden by Elementor */
    overflow: hidden;
}

.ms-spc-thumb-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms-spc-no-thumb {
    position: absolute;
    inset: 0;
    background-color: #e5e7eb;
}

.ms-spc-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    padding: 16px;
}

.ms-spc-date {
    font-size: 0.8em;
    opacity: 0.6;
}

.ms-spc-title {
    display: block;
    font-weight: 600;
    text-decoration: none;
    color: inherit;
}

.ms-spc-title:hover {
    text-decoration: underline;
}

.ms-spc-excerpt {
    margin: 0;
    font-size: 0.9em;
    flex: 1;
}

.ms-spc-pagination {
    margin-top: 32px;
}

.ms-spc-pagination .page-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ms-spc-pagination .page-numbers li {
    margin: 0;
    padding: 0;
}

.ms-spc-pagination .page-numbers a,
.ms-spc-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid currentColor;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.875em;
    opacity: 0.7;
    transition: opacity 200ms ease, background-color 200ms ease;
}

.ms-spc-pagination .page-numbers a:hover {
    opacity: 1;
}

.ms-spc-pagination .page-numbers .current {
    opacity: 1;
    font-weight: 700;
}

.ms-spc-btn {
    display: inline-block;
    align-self: flex-start;
    margin-top: 4px;
    padding: 8px 16px;
    text-decoration: none;
    font-size: 0.875em;
    border-radius: 4px;
    transition: background-color 200ms ease, color 200ms ease;
}

/* ── Taxonomy Flex Buttons ──────────────────────────────────────── */

.ms-taxbtn-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.ms-taxbtn {
    display: inline-block;
    padding: 8px 20px;
    background-color: transparent;
    color: inherit;
    border: 1px solid currentColor;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 250ms ease, color 250ms ease, border-color 250ms ease, transform 250ms ease;
}

.ms-taxbtn:hover {
    text-decoration: none;
    transform: scale(1.05);
}

.ms-taxbtn-count {
    font-size: 0.85em;
    opacity: 0.75;
}

/* ── Image Marquee Scroll ───────────────────────────────────────── */

.ms-marquee-wrapper {
    display: flex;
    gap: 12px;
    overflow: hidden;
    height: 600px; /* default — overridden per breakpoint by Elementor */
}

.ms-marquee-col {
    width: 240px; /* default — overridden by Elementor control */
    flex-shrink: 0;
    overflow: hidden;
    height: 100%; /* fill wrapper height so overflow:hidden clips correctly */
}

.ms-marquee-track {
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.ms-marquee-item {
    flex-shrink: 0;
    padding-bottom: 12px; /* default gap — overridden by Elementor gap control */
}

.ms-marquee-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px; /* default — overridden by Elementor control */
}

/* Animations — speed via CSS custom property --ms-speed set by Elementor selectors */
@keyframes ms-scroll-up {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

@keyframes ms-scroll-down {
    0% {
        transform: translateY(-50%);
    }
    100% {
        transform: translateY(0);
    }
}

.ms-marquee-col[data-dir="up"] .ms-marquee-track {
    animation: ms-scroll-up var(--ms-speed, 20s) linear infinite;
}

.ms-marquee-col[data-dir="down"] .ms-marquee-track {
    animation: ms-scroll-down var(--ms-speed, 20s) linear infinite;
}

/* Pause on hover — marquee */
.ms-pause-on-hover:hover .ms-marquee-col[data-dir="up"] .ms-marquee-track,
.ms-pause-on-hover:hover .ms-marquee-col[data-dir="down"] .ms-marquee-track {
    animation-play-state: paused;
}

/* ── Taxonomy Grid ──────────────────────────────────────────────── */

@keyframes ms-wiggle {
    0%   { transform: scale(1)    rotate(0deg); }
    15%  { transform: scale(1.06) rotate(-3deg); }
    30%  { transform: scale(1.06) rotate(3deg); }
    50%  { transform: scale(1.03) rotate(-2deg); }
    65%  { transform: scale(1.03) rotate(1.5deg); }
    80%  { transform: scale(1.01) rotate(-0.5deg); }
    100% { transform: scale(1)    rotate(0deg); }
}

.ms-tax-grid-item.ms-anim-visible {
    animation: ms-wiggle 0.7s ease both;
}

.ms-tax-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.ms-tax-grid-item {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ms-tax-grid-thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1; /* overridden by image_ratio control */
    background: #eee;
    box-shadow: rgba(255, 241, 183, 0.71) 0px 0px 20px 0px;
    border-style: solid;
    border-width: 2px;
    border-color: rgb(255, 247, 191);
    border-radius: 20px;
    transform-origin: top center;
    transition: transform 0.35s ease; /* smooth return khi bỏ hover */
}

@keyframes ms-thumb-zoom-in {
    from { transform: scale(1); }
    to   { transform: scale(1.1); }
}

@keyframes ms-thumb-shake {
    0%, 100% { transform: scale(1.1) translateY(0); }
    50%       { transform: scale(1.1) translateY(-5px); }
}

.ms-tax-grid-item:hover .ms-tax-grid-thumb {
    z-index: 2;
    transition: none;
    animation:
        ms-thumb-zoom-in 0.25s ease forwards,
        ms-thumb-shake 0.25s ease-in-out 0.25s 3 forwards;
}

.ms-tax-grid-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    border-radius: 18px;
}

.ms-tax-grid-item:hover .ms-tax-grid-thumb img {
    transform: scale(1.05);
}

.ms-tax-grid-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.25); /* overridden by overlay_color control */
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

/* overlay color value applied via Elementor selector; opacity toggled here on hover */
.ms-tax-grid-item:hover .ms-tax-grid-overlay {
    opacity: 1;
}

.ms-tax-grid-no-image {
    width: 100%;
    height: 100%;
    background: #ddd;
}

.ms-tax-grid-name {
    position: relative;
    z-index: 3;
    padding-top: 10px;
    text-align: center;
    font-family: "Times New Roman", sans-serif;
    font-size: 22px;
    font-weight: 100;
    text-transform: uppercase;
    text-shadow: rgba(0, 0, 0, 0.3) 0px 0px 10px;
    color: rgb(0, 0, 0);
    background-color: transparent;
    background-image: linear-gradient(167deg, rgb(240, 198, 135) 0%, rgb(255, 255, 255) 100%);
    border-radius: 10px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* ── Post Directory ─────────────────────────────────────────────── */

/* Loading overlay */
.ms-post-directory {
    position: relative;
}

.ms-post-directory.ms-pd--loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    z-index: 10;
}

/* Tabs */
.ms-pd-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.ms-pd-tab {
    padding: 8px 20px;
    border: 1px solid currentColor;
    background: transparent;
    cursor: pointer;
    font-size: inherit;
    transition: background 0.2s, color 0.2s;
}

.ms-pd-tab.ms-pd-tab--active,
.ms-pd-tab:hover {
    background: currentColor;
}

.ms-pd-tab.ms-pd-tab--active span,
.ms-pd-tab.ms-pd-tab--active {
    color: #fff;
}

/* Search bar */
.ms-pd-search {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
}

.ms-pd-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ccc;
    font-size: inherit;
    outline: none;
}

.ms-pd-search-input:focus {
    border-color: #888;
}

.ms-pd-search-btn {
    padding: 10px 20px;
    border: none;
    background: #333;
    color: #fff;
    cursor: pointer;
    font-size: inherit;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.ms-pd-search-btn:hover {
    opacity: 0.85;
}

/* Grid */
.ms-pd-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* overridden by Elementor */
    gap: 24px;
}

/* Card */
.ms-pd-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ms-pd-card-thumb-link {
    display: block;
}

.ms-pd-card-thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3; /* overridden by Elementor */
    background: #eee;
}

.ms-pd-card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.ms-pd-card:hover .ms-pd-card-thumb img {
    transform: scale(1.04);
}

.ms-pd-card-no-thumb {
    width: 100%;
    height: 100%;
    background: #ddd;
}

/* Badges */
.ms-pd-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    border-radius: 3px;
}

.ms-pd-badge--hq {
    background: #c8282f;
}

.ms-pd-badge--closed {
    background: #888;
}

/* Card body */
.ms-pd-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px;
}

.ms-pd-card-code {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.ms-pd-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.3;
}

.ms-pd-card-title a {
    text-decoration: none;
    color: inherit;
}

.ms-pd-card-title a:hover {
    text-decoration: underline;
}

.ms-pd-card-position {
    font-size: 13px;
    color: #555;
    margin: 0 0 6px;
}

.ms-pd-card-address {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px;
    flex: 1;
}

.ms-pd-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.ms-pd-btn {
    display: inline-block;
    padding: 7px 16px;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid currentColor;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.ms-pd-btn--detail {
    background: #333;
    color: #fff;
    border-color: #333;
}

.ms-pd-btn--detail:hover {
    opacity: 0.85;
}

.ms-pd-btn--maps {
    background: transparent;
    color: #333;
}

.ms-pd-btn--maps:hover {
    background: #333;
    color: #fff;
}

/* No results */
.ms-pd-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    color: #888;
}

/* Pagination */
.ms-pd-pagination-wrap {
    margin-top: 32px;
}

.ms-pd-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ms-pd-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s, border-color 0.2s;
}

.ms-pd-page-btn:hover,
.ms-pd-page-btn.ms-pd-page-btn--active {
    background: #333;
    border-color: #333;
    color: #fff;
}

/* ── Application Form ───────────────────────────────────────── */

.ms-app-form-wrap {
    max-width: 100%;
}

.ms-app-section {
    margin-bottom: 36px;
}

.ms-app-section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

/* 2-column responsive grid */
.ms-app-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 24px;
}

@media (max-width: 600px) {
    .ms-app-fields-grid {
        grid-template-columns: 1fr;
    }
}

.ms-app-field--full {
    grid-column: 1 / -1;
}

/* Field */
.ms-app-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ms-app-field > label {
    font-size: 14px;
    font-weight: 600;
}

.ms-app-required-mark {
    color: #c0392b;
    margin-left: 2px;
}

/* Inputs */
.ms-app-form input[type="text"],
.ms-app-form input[type="tel"],
.ms-app-form input[type="email"],
.ms-app-form select,
.ms-app-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: inherit;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.ms-app-form input:focus,
.ms-app-form select:focus,
.ms-app-form textarea:focus {
    border-color: #888;
}

/* Ngày sinh — 3 select ngang hàng */
.ms-app-dob-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 8px;
}

/* Số điện thoại + mã vùng */
.ms-app-phone-row {
    display: flex;
    align-items: stretch;
}

.ms-app-phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-right: none;
    font-size: 14px;
    white-space: nowrap;
}

.ms-app-phone-row input[type="tel"] {
    flex: 1;
    border-radius: 0;
}

/* Thông báo tuổi */
.ms-app-age-error {
    font-size: 13px;
    color: #c0392b;
    margin: 0;
    font-weight: 600;
}

/* Branch search */
.ms-app-branch-search {
    position: relative;
}

.ms-app-branch-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.ms-app-branch-input:focus {
    border-color: #888;
}

.ms-app-branch-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}

.ms-app-branch-suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
    transition: background 0.15s;
}

.ms-app-branch-suggestion-item:hover {
    background: #f5f5f5;
}

.ms-app-branch-no-results {
    padding: 12px;
    font-size: 13px;
    color: #888;
}

.ms-app-branch-selected {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f7f0;
    border: 1px solid #a8d5a2;
    padding: 8px 12px;
    font-size: 13px;
    flex-wrap: wrap;
}

.ms-app-branch-name {
    font-weight: 600;
}

.ms-app-branch-addr {
    color: #666;
}

.ms-app-branch-clear {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #888;
    padding: 0 4px;
    line-height: 1;
}

.ms-app-branch-clear:hover {
    color: #333;
}

/* Field hint (ACF instructions) */
.ms-app-field-hint {
    margin: 4px 0 0;
    font-size: 12px;
    color: #999;
}

/* Checkbox group */
.ms-app-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}

.ms-app-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
}

.ms-app-checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

/* Radio group */
.ms-app-radio-group {
    display: flex;
    gap: 20px;
    padding: 4px 0;
}

.ms-app-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
}

.ms-app-radio-label input[type="radio"] {
    cursor: pointer;
}

/* File upload */
.ms-app-file-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.ms-app-file-input {
    display: none;
}

.ms-app-file-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #333;
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.ms-app-file-btn:hover {
    opacity: 0.85;
}

.ms-app-file-name {
    font-size: 13px;
    color: #666;
}

.ms-app-file-hint {
    margin: 4px 0 0;
    font-size: 12px;
    color: #999;
}

/* reCAPTCHA */
.ms-app-recaptcha {
    margin-bottom: 16px;
}

/* Submit */
.ms-app-submit-wrap {
    margin-top: 8px;
}

.ms-app-form-error {
    font-size: 13px;
    color: #c0392b;
    margin: 0 0 12px;
    padding: 10px 14px;
    background: #fdf0ef;
    border-left: 3px solid #c0392b;
}

.ms-app-submit-btn {
    display: inline-block;
    padding: 14px 40px;
    background: #c8282f;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
    font-family: inherit;
}

.ms-app-submit-btn:hover:not(:disabled) {
    opacity: 0.88;
}

.ms-app-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading state */
.ms-app-form-wrap.ms-app--loading {
    position: relative;
    pointer-events: none;
}

.ms-app-form-wrap.ms-app--loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.65);
    border-radius: inherit;
    z-index: 10;
}

.ms-app-btn--loading {
    position: relative;
    padding-right: 40px !important;
}

.ms-app-btn--loading::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ms-spin 0.7s linear infinite;
}

@keyframes ms-spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Success */
.ms-app-success {
    padding: 48px 32px;
    text-align: center;
}

.ms-app-success-icon {
    font-size: 56px;
    color: #27ae60;
    line-height: 1;
    margin-bottom: 20px;
}

.ms-app-success p {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

/* ── Search Results ─────────────────────────────────────────── */

.ms-search-results {
    width: 100%;
}

/* Tiêu đề */
.ms-sr-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 20px;
    line-height: 1.3;
}

.ms-sr-keyword {
    font-style: italic;
}

/* Form tìm kiếm lại */
.ms-sr-form {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    max-width: 560px;
}

.ms-sr-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-right: none;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    appearance: none;
    background: #fff;
    color: inherit;
    transition: border-color 0.2s;
}

.ms-sr-input:focus {
    border-color: #888;
}

.ms-sr-btn {
    padding: 12px 24px;
    border: none;
    background: #333;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.ms-sr-btn:hover {
    opacity: 0.85;
}

/* Số kết quả */
.ms-sr-count {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px;
}

/* Grid */
.ms-sr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* overridden by Elementor columns control */
    gap: 24px;
}

/* Card */
.ms-sr-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ms-sr-card:hover {
    transform: translateY(-3px);
}

.ms-sr-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9; /* overridden by Elementor control */
    overflow: hidden;
    background: #eee;
    flex-shrink: 0;
}

.ms-sr-card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.ms-sr-card:hover .ms-sr-card-thumb img {
    transform: scale(1.04);
}

.ms-sr-card-no-thumb {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
}

/* Badge */
.ms-sr-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    border-radius: 2px;
    text-transform: uppercase;
}

/* Card body */
.ms-sr-card-body {
    padding: 14px 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ms-sr-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ms-sr-card-sub {
    font-size: 13px;
    color: #666;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* No results */
.ms-sr-no-results {
    padding: 48px 0;
    text-align: center;
    color: #888;
    font-size: 16px;
}

/* Pagination */
.ms-sr-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 40px;
}

.ms-sr-page-item {
    display: contents;
}

.ms-sr-pagination a,
.ms-sr-pagination span.current,
.ms-sr-pagination span.dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #ccc;
    font-size: 14px;
    text-decoration: none;
    color: #333;
    background: #fff;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.ms-sr-pagination a:hover {
    background: #333;
    border-color: #333;
    color: #fff;
}

.ms-sr-pagination span.current {
    background: #333;
    border-color: #333;
    color: #fff;
    cursor: default;
}

.ms-sr-pagination span.dots {
    border-color: transparent;
    background: transparent;
    cursor: default;
}

/* ── Archive fallback template ──────────────────────────────── */

.ms-archive-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.ms-archive-header {
    text-align: center;
    margin-bottom: 40px;
}

.ms-archive-title {
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
}

/* ── Post Grid ──────────────────────────────────────────────── */

.ms-pg-card.ms-anim-visible {
    animation: ms-wiggle 0.7s ease both;
}

.ms-pg-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px; /* overridden by gap control */
}

.ms-pg-card {
    flex: 0 0 calc((100% - 3 * 24px) / 4); /* overridden by Elementor columns control */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border-radius: 20px;
    box-shadow: rgba(255, 241, 183, 0.71) 0px 0px 20px 0px;
    border-style: solid;
    border-width: 2px;
    border-color: rgb(255, 247, 191);
}

.ms-pg-thumb-link {
    display: block;
    width: 100%;
}

@keyframes ms-pg-rise {
    from { transform: translateY(0) scale(1); }
    to   { transform: translateY(-14px) scale(1.18); }
}

@keyframes ms-pg-wobble {
    0%   { transform: translateY(-14px) scale(1.18) rotate(0deg); }
    20%  { transform: translateY(-14px) scale(1.18) rotate(-3deg); }
    40%  { transform: translateY(-14px) scale(1.18) rotate(3deg); }
    60%  { transform: translateY(-14px) scale(1.18) rotate(-2deg); }
    80%  { transform: translateY(-14px) scale(1.18) rotate(1deg); }
    100% { transform: translateY(-14px) scale(1.18) rotate(0deg); }
}

.ms-pg-thumb {
    position: relative;
    width: 100%;
}

.ms-pg-thumb--circle  { border-radius: 50%; }
.ms-pg-thumb--rounded { border-radius: 12px; }
.ms-pg-thumb--square  { border-radius: 0; }

.ms-pg-thumb img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.ms-pg-card:hover .ms-pg-thumb img {
    transition: none;
    animation:
        ms-pg-rise 0.2s ease forwards,
        ms-pg-wobble 0.4s ease-in-out 0.2s 2 forwards;
}


.ms-pg-no-thumb {
    width: 100%;
    height: 100%;
    background: #ddd;
}

.ms-pg-title {
    display: block;
    padding: 8px 18px;
    text-decoration: none;
    text-align: center;
    font-family: "Times New Roman", sans-serif;
    font-size: 18px;
    font-weight: 100;
    text-transform: uppercase;
    text-shadow: rgba(0, 0, 0, 0.3) 0px 0px 10px;
    color: rgb(0, 0, 0);
    background-color: transparent;
    background-image: linear-gradient(167deg, rgb(240, 198, 135) 0%, rgb(255, 255, 255) 100%);
    border-radius: 10px;
    transition: opacity 0.2s;
}

.ms-pg-title:hover {
    opacity: 0.88;
}

.ms-pg-no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: #888;
    padding: 40px 0;
}

/* Pagination */
.ms-pg-pagination {
    margin-top: 32px;
}

.ms-pg-pagination ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ms-pg-pagination ul li a,
.ms-pg-pagination ul li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #ccc;
    font-size: 14px;
    text-decoration: none;
    color: #333;
    background: #fff;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.ms-pg-pagination ul li a:hover,
.ms-pg-pagination ul li span.current {
    background: #333;
    border-color: #333;
    color: #fff;
}

.ms-pg-pagination ul li span.dots {
    border-color: transparent;
    background: transparent;
    cursor: default;
}
