/**
 * Palace Properties - Base Stylesheet
 *
 * Shared BEM-namespaced CSS loaded for ALL templates.
 * Custom properties are overridable via the WordPress Customizer.
 *
 * @package Integrate_Palace_Properties
 * @since   1.0.0
 */

/* ==========================================================================
   Custom Properties
   ========================================================================== */

:root {
    --ipp-color-primary: #1a1a2e;
    --ipp-color-accent: #e94560;
    --ipp-color-bg: #ffffff;
    --ipp-color-surface: #f8f9fa;
    --ipp-color-text: #2d3436;
    --ipp-color-text-light: #636e72;
    --ipp-color-border: #e9ecef;
    --ipp-color-success: #00b894;
    --ipp-radius: 12px;
    --ipp-radius-sm: 6px;
    --ipp-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --ipp-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --ipp-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --ipp-font-heading: inherit;
    --ipp-font-body: inherit;
    --ipp-container-width: 1280px;
}

/* ==========================================================================
   Reset / Base — Scope all styles under .ipp-archive-page / .ipp-single-page
   to avoid conflicts with any theme (including block themes).
   ========================================================================== */

.ipp-archive-page,
.ipp-single-page {
    font-family: var(--ipp-font-body), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ipp-color-text);
    background: var(--ipp-color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding: 2rem 0;
}

.ipp-archive-page *,
.ipp-archive-page *::before,
.ipp-archive-page *::after,
.ipp-single-page *,
.ipp-single-page *::before,
.ipp-single-page *::after,
.ipp-container *,
.ipp-container *::before,
.ipp-container *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.ipp-archive-page a { color: var(--ipp-color-primary); text-decoration: none; }
.ipp-archive-page a:hover { color: var(--ipp-color-accent); }
.ipp-single-page a { color: var(--ipp-color-primary); text-decoration: none; }
.ipp-single-page a:hover { color: var(--ipp-color-accent); }
.ipp-archive-page img,
.ipp-single-page img { max-width: 100%; height: auto; display: block; }
.ipp-archive-page h1,
.ipp-archive-page h2,
.ipp-archive-page h3,
.ipp-single-page h1,
.ipp-single-page h2,
.ipp-single-page h3 { font-family: var(--ipp-font-heading), inherit; line-height: 1.3; color: var(--ipp-color-primary); }
.ipp-archive-page p,
.ipp-single-page p { margin: 0; }

/* ==========================================================================
   Container
   ========================================================================== */

.ipp-container {
    width: 100%;
    max-width: var(--ipp-container-width);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

@media (min-width: 768px) {
    .ipp-container {
        padding-inline: 2rem;
    }
}

/* ==========================================================================
   Archive Layout Helpers
   ========================================================================== */

.ipp-archive-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 0 0.25rem;
}

.ipp-archive-count {
    font-size: 0.95rem;
    color: var(--ipp-color-text-light);
}

.ipp-archive-count strong {
    color: var(--ipp-color-primary);
}

.ipp-archive-view-toggle {
    display: flex;
    gap: 0.5rem;
}

.ipp-archive-view-toggle .ipp-btn {
    padding: 0.4rem;
    background: var(--ipp-color-surface);
    border: 1px solid var(--ipp-color-border);
}

.ipp-archive-view-toggle .ipp-btn.active {
    background: var(--ipp-color-primary);
    color: #fff;
    border-color: var(--ipp-color-primary);
}

.ipp-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.ipp-no-results h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.ipp-no-results p {
    color: var(--ipp-color-text-light);
}

.ipp-pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    padding-bottom: 2rem;
}

.ipp-pagination .ipp-btn svg {
    margin-left: 0.5rem;
}

/* ==========================================================================
   Archive Grid
   ========================================================================== */

.ipp-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .ipp-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .ipp-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.ipp-grid--2-cols {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .ipp-grid--2-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ipp-grid--4-cols {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .ipp-grid--4-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .ipp-grid--4-cols {
        grid-template-columns: repeat(4, 1fr);
    }
}

.ipp-grid--list {
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* ==========================================================================
   Property Card
   ========================================================================== */

.ipp-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--ipp-color-bg);
    border-radius: var(--ipp-radius);
    box-shadow: var(--ipp-shadow);
    overflow: hidden;
    transition: var(--ipp-transition);
    border: 1px solid var(--ipp-color-border);
}

.ipp-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ipp-shadow-hover);
}

.ipp-card:focus-within {
    outline: 2px solid var(--ipp-color-accent);
    outline-offset: 2px;
}

/* Card Image */
.ipp-card__image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--ipp-color-surface);
}

.ipp-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.ipp-card:hover .ipp-card__image img {
    transform: scale(1.05);
}

.ipp-card__image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.4) 0%,
        transparent 50%
    );
    pointer-events: none;
}

/* Card Badge */
.ipp-card__badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    color: #fff;
    background: var(--ipp-color-accent);
    border-radius: var(--ipp-radius-sm);
    line-height: 1.5;
}

/* Card Price */
.ipp-card__price {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--ipp-font-heading);
    color: #fff;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: var(--ipp-radius-sm);
    line-height: 1.4;
}

/* Card Body */
.ipp-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    gap: 0.5rem;
}

.ipp-card__title {
    margin: 0;
    font-family: var(--ipp-font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ipp-color-primary);
}

.ipp-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ipp-card__title a:hover {
    color: var(--ipp-color-accent);
}

.ipp-card__address {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.875rem;
    color: var(--ipp-color-text-light);
    line-height: 1.5;
}

.ipp-card__address::before {
    content: "";
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    margin-top: 0.2em;
    background: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* Card Meta */
.ipp-card__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 0.75rem;
    margin-top: auto;
    border-top: 1px solid var(--ipp-color-border);
}

.ipp-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ipp-color-text-light);
}

.ipp-card__meta-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--ipp-color-text-light);
}

/* Card Footer */
.ipp-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--ipp-color-border);
    font-size: 0.8rem;
    color: var(--ipp-color-text-light);
}

/* Card List View Modifier */
.ipp-card--list {
    flex-direction: row;
}

.ipp-card--list .ipp-card__image {
    width: 280px;
    min-width: 280px;
    aspect-ratio: auto;
}

.ipp-card--list .ipp-card__body {
    padding: 1.25rem 1.5rem;
}

@media (max-width: 639px) {
    .ipp-card--list {
        flex-direction: column;
    }

    .ipp-card--list .ipp-card__image {
        width: 100%;
        min-width: 100%;
        aspect-ratio: 4 / 3;
    }
}

/* ==========================================================================
   Single Property
   ========================================================================== */

.ipp-single {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-block: 2rem;
}

@media (min-width: 1024px) {
    .ipp-single {
        grid-template-columns: 1fr 360px;
        gap: 2.5rem;
    }
}

.ipp-single__hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--ipp-radius);
    overflow: hidden;
    background: var(--ipp-color-surface);
    cursor: pointer;
}

.ipp-single__hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ipp-single__hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.35) 0%,
        transparent 40%
    );
    pointer-events: none;
}

.ipp-single__gallery {
    grid-column: 1 / -1;
}

.ipp-single__content {
    min-width: 0;
}

.ipp-single__sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ipp-single__section {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--ipp-color-border);
}

.ipp-single__section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ipp-single__section-title {
    margin: 0 0 1rem;
    font-family: var(--ipp-font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ipp-color-primary);
    line-height: 1.3;
}

.ipp-single__detail-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0.65rem 0;
    border-bottom: 1px dashed var(--ipp-color-border);
    font-size: 0.95rem;
    line-height: 1.5;
}

.ipp-single__detail-row:last-child {
    border-bottom: none;
}

.ipp-single__detail-label {
    font-weight: 600;
    color: var(--ipp-color-text);
    flex-shrink: 0;
    margin-right: 1rem;
}

.ipp-single__detail-value {
    color: var(--ipp-color-text-light);
    text-align: right;
}

/* ==========================================================================
   Gallery / Slider
   ========================================================================== */

.ipp-gallery {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ipp-gallery__main {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--ipp-radius);
    overflow: hidden;
    background: var(--ipp-color-surface);
    cursor: pointer;
}

.ipp-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.ipp-gallery__thumbs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.25rem;
}

.ipp-gallery__thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: var(--ipp-radius-sm);
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    transition: var(--ipp-transition);
    scroll-snap-align: start;
}

.ipp-gallery__thumb:hover,
.ipp-gallery__thumb--active {
    opacity: 1;
}

.ipp-gallery__thumb--active {
    border-color: var(--ipp-color-accent);
}

.ipp-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ipp-gallery__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--ipp-color-primary);
    cursor: pointer;
    transition: var(--ipp-transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ipp-gallery__nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ipp-gallery__nav--prev {
    left: 0.75rem;
}

.ipp-gallery__nav--next {
    right: 0.75rem;
}

.ipp-gallery__nav svg {
    width: 18px;
    height: 18px;
}

.ipp-gallery__count {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    z-index: 3;
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: var(--ipp-radius-sm);
    letter-spacing: 0.03em;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.ipp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ipp-lightbox--open {
    opacity: 1;
    visibility: visible;
}

.ipp-lightbox__image {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--ipp-radius-sm);
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
}

.ipp-lightbox__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 1.5rem;
    line-height: 1;
}

.ipp-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ipp-lightbox .ipp-gallery__nav {
    position: absolute;
    top: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.ipp-lightbox .ipp-gallery__nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ipp-lightbox .ipp-gallery__count {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
}

/* ==========================================================================
   Agent Card
   ========================================================================== */

.ipp-agent {
    background: var(--ipp-color-bg);
    border: 1px solid var(--ipp-color-border);
    border-radius: var(--ipp-radius);
    padding: 1.5rem;
    box-shadow: var(--ipp-shadow);
}

.ipp-agent__name {
    margin: 0 0 0.15rem;
    font-family: var(--ipp-font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ipp-color-primary);
}

.ipp-agent__role {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: var(--ipp-color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.ipp-agent__contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.ipp-agent__contact a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--ipp-color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.ipp-agent__contact a:hover {
    color: var(--ipp-color-accent);
}

.ipp-agent__contact a svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--ipp-color-text-light);
}

.ipp-agent__action {
    width: 100%;
}

/* ==========================================================================
   Search / Filter Bar
   ========================================================================== */

.ipp-search {
    background: var(--ipp-color-bg);
    border: 1px solid var(--ipp-color-border);
    border-radius: var(--ipp-radius);
    box-shadow: var(--ipp-shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.ipp-search__form {
    display: flex;
    flex-direction: column;
}

.ipp-search__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    align-items: flex-end;
}

.ipp-search__row:first-child {
    background: var(--ipp-color-surface);
    border-bottom: 1px solid var(--ipp-color-border);
    padding: 1.25rem;
}

.ipp-search__group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.ipp-search__group--text {
    flex: 2 1 220px;
}

.ipp-search__group--price {
    flex: 1.5 1 180px;
}

.ipp-search__group--select {
    flex: 1 1 120px;
}

.ipp-search__group--actions {
    flex: 0 0 auto;
}

.ipp-search__group label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ipp-color-text-light);
}

.ipp-search__price-pair {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ipp-search__price-pair .ipp-search__input {
    flex: 1;
    min-width: 0;
}

.ipp-search__separator {
    color: var(--ipp-color-text-light);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ipp-search__input,
.ipp-search__select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
    font-family: var(--ipp-font-body), sans-serif;
    color: var(--ipp-color-text);
    background: #fff;
    border: 1px solid var(--ipp-color-border);
    border-radius: var(--ipp-radius-sm);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.4;
}

.ipp-search__input::placeholder {
    color: #adb5bd;
}

.ipp-search__input:focus,
.ipp-search__select:focus {
    border-color: var(--ipp-color-accent);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
    background: #fff;
}

.ipp-search__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23636e72' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-color: #fff;
    padding-right: 2.25rem;
    cursor: pointer;
}

.ipp-search__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ipp-btn--search {
    white-space: nowrap;
    padding: 0.6rem 1.25rem;
}

.ipp-search__clear {
    font-size: 0.825rem;
    color: var(--ipp-color-text-light);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.ipp-search__clear:hover {
    color: var(--ipp-color-accent);
}

/* Search responsive */
@media (max-width: 767px) {
    .ipp-search__row {
        flex-direction: column;
        gap: 0.6rem;
    }
    .ipp-search__group {
        flex-basis: 100% !important;
    }
    .ipp-search__group--actions {
        flex-basis: 100% !important;
    }
    .ipp-search__actions {
        width: 100%;
    }
    .ipp-btn--search {
        flex: 1;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .ipp-search__group--text { flex: 1 1 100%; }
    .ipp-search__group--price { flex: 1 1 40%; }
    .ipp-search__group--select { flex: 1 1 22%; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.ipp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    font-family: var(--ipp-font-body);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--ipp-radius-sm);
    cursor: pointer;
    transition: var(--ipp-transition);
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

.ipp-btn:focus-visible {
    outline: 2px solid var(--ipp-color-accent);
    outline-offset: 2px;
}

.ipp-btn--primary {
    color: #fff;
    background: var(--ipp-color-accent);
    border-color: var(--ipp-color-accent);
}

.ipp-btn--primary:hover {
    background: color-mix(in srgb, var(--ipp-color-accent) 85%, #000);
    border-color: color-mix(in srgb, var(--ipp-color-accent) 85%, #000);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(233, 69, 96, 0.35);
}

.ipp-btn--outline {
    color: var(--ipp-color-text);
    background: transparent;
    border-color: var(--ipp-color-border);
}

.ipp-btn--outline:hover {
    color: var(--ipp-color-accent);
    border-color: var(--ipp-color-accent);
    background: rgba(233, 69, 96, 0.04);
}

.ipp-btn--sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
}

.ipp-btn--lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.ipp-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.5;
    border-radius: var(--ipp-radius-sm);
    color: var(--ipp-color-text-light);
    background: var(--ipp-color-surface);
    border: 1px solid var(--ipp-color-border);
}

.ipp-badge--active {
    color: #fff;
    background: var(--ipp-color-success);
    border-color: var(--ipp-color-success);
}

.ipp-badge--inactive {
    color: var(--ipp-color-text-light);
    background: var(--ipp-color-surface);
    border-color: var(--ipp-color-border);
}

.ipp-badge--featured {
    color: #fff;
    background: var(--ipp-color-accent);
    border-color: var(--ipp-color-accent);
}

/* ==========================================================================
   Map
   ========================================================================== */

.ipp-map {
    aspect-ratio: 16 / 9;
    width: 100%;
    border-radius: var(--ipp-radius);
    overflow: hidden;
    border: 1px solid var(--ipp-color-border);
    background: var(--ipp-color-surface);
}

.ipp-map iframe {
    width: 100%;
    height: 100%;
    border: none;
}

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

.ipp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ipp-skeleton {
    position: relative;
    overflow: hidden;
    background: var(--ipp-color-surface);
    border-radius: var(--ipp-radius-sm);
}

.ipp-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 100%
    );
    animation: ipp-skeleton-shimmer 1.8s ease-in-out infinite;
}

@keyframes ipp-skeleton-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ==========================================================================
   Responsive fine-tuning
   ========================================================================== */

@media (max-width: 639px) {
    .ipp-single {
        padding-block: 1rem;
        gap: 1.25rem;
    }

    .ipp-single__section-title {
        font-size: 1.1rem;
    }

    .ipp-gallery__thumb {
        width: 64px;
        height: 48px;
    }

    .ipp-search {
        flex-direction: column;
        gap: 0.5rem;
    }

    .ipp-search__group {
        flex-basis: 100%;
    }
}

@media (min-width: 768px) {
    .ipp-gallery__thumb {
        width: 96px;
        height: 72px;
    }
}

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

@media print {
    .ipp-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .ipp-lightbox,
    .ipp-gallery__nav,
    .ipp-search {
        display: none !important;
    }
}
