/* Shared beautiful detail pages for region, place, country and institution CPTs */

.entity-detail {
    padding: 2.5rem 0 4rem;
    background: var(--cream);
    font-family: Inter, system-ui, -apple-system, sans-serif;
}

.entity-detail .breadcrumbs {
    margin-bottom: 1.5rem;
    font-size: .9rem;
    color: var(--muted);
}

.entity-detail .breadcrumbs a {
    color: var(--green-2);
    text-decoration: none;
}

.entity-detail .breadcrumbs a:hover {
    color: var(--sepia);
    text-decoration: underline;
}

.entity-detail .breadcrumbs [aria-current="page"] {
    color: var(--ink);
    font-weight: 600;
}

.entity-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 380px);
    gap: 2.5rem;
    align-items: start;
}

.entity-detail-main,
.entity-detail-side {
    min-width: 0;
}

.entity-detail-card,
.entity-widget {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: var(--shadow);
    padding: 2rem;
}

.entity-detail-card {
    margin-bottom: 2rem;
}

.entity-detail-head {
    text-align: center;
    margin-bottom: 1.5rem;
}

.entity-detail-badge {
    display: inline-block;
    background: var(--green);
    color: #fff;
    padding: .35rem .85rem;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: .7rem;
    font-weight: 700;
    margin-bottom: .75rem;
}

.entity-detail-card h1 {
    font-family: "Cormorant Garamond", Georgia, serif;
    color: var(--green);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    margin: 0 0 .5rem;
    line-height: 1.1;
}

.entity-lead {
    font-size: 1.15rem;
    color: var(--muted);
    margin: .5rem 0 1.25rem;
    line-height: 1.5;
}

.entity-stats {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .75rem;
    margin-top: .5rem;
}

.entity-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
    padding: .65rem 1rem;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 0;
    text-align: center;
}

.entity-stat strong {
    display: block;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.6rem;
    color: var(--green);
    line-height: 1;
}

.entity-stat span {
    font-size: .8rem;
    color: var(--muted);
    text-transform: lowercase;
}

.entity-preview {
    margin: 1.5rem 0 2rem;
    border-radius: 0;
    overflow: hidden;
    background: #e6dcc9;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.entity-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.entity-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    color: var(--green);
    opacity: .55;
    padding: 2rem;
    text-align: center;
}

.entity-preview-icon {
    width: 64px;
    height: 64px;
}

.entity-detail-card .lead {
    font-size: 1.15rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.entity-detail-card h2 {
    font-family: "Cormorant Garamond", Georgia, serif;
    color: var(--green);
    font-size: 1.6rem;
    margin-top: 2rem;
    margin-bottom: .75rem;
}

.entity-detail-card p,
.entity-detail-card li {
    line-height: 1.75;
}

.entity-detail-card a {
    color: var(--green-2);
}

.entity-detail-card a:hover {
    color: var(--sepia);
}

.entity-meta-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.entity-meta-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 1rem;
    align-items: baseline;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--line);
}

.entity-meta-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.entity-meta-item dt {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 700;
}

.entity-meta-item dd {
    margin: 0;
    color: var(--ink);
    font-weight: 500;
}

.entity-meta-item a {
    color: var(--green-2);
    text-decoration: none;
}

.entity-meta-item a:hover {
    color: var(--sepia);
    text-decoration: underline;
}

.entity-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 100px;
    align-self: start;
}

.entity-widget h3 {
    margin: 0 0 1.25rem;
    font-family: "Cormorant Garamond", Georgia, serif;
    color: var(--green);
    font-size: 1.35rem;
}

.entity-links-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.entity-links-list a {
    color: var(--green-2);
    text-decoration: none;
    font-size: .95rem;
}

.entity-links-list a:hover {
    color: var(--sepia);
    text-decoration: underline;
}

.entity-cta,
.entity-back-link {
    display: inline-flex;
    justify-content: center;
    padding: .75rem 1.2rem;
    background: var(--green);
    color: #fff;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    transition: background .15s, transform .15s;
    text-align: center;
}

.entity-cta:hover,
.entity-back-link:hover {
    background: var(--green-2);
    transform: translateY(-2px);
    color: #fff;
}

.entity-widget--links {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.entity-more {
    display: inline-block;
    margin-top: .75rem;
    font-weight: 600;
    color: var(--green);
    text-decoration: none;
    font-size: .9rem;
}

.entity-more:hover {
    color: var(--sepia);
    text-decoration: underline;
}

.entity-section {
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .entity-detail-layout {
        grid-template-columns: 1fr;
    }

    .entity-sidebar,
    .region-sidebar {
        position: static;
        order: -1;
    }

    .entity-detail-card,
    .entity-widget {
        padding: 1.5rem;
    }

    .entity-detail-head {
        text-align: left;
    }

    .entity-stat {
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .entity-detail {
        padding: 1.5rem 0 3rem;
    }

    .entity-detail-card h1 {
        font-size: 1.9rem;
    }

    .entity-meta-item {
        grid-template-columns: 1fr;
        gap: .25rem;
    }
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2.5rem 0 1rem;
    width: 100%;
}

.pagination-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .35rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(23, 63, 53, 0.05);
}

.pagination .page-numbers,
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 .65rem;
    border: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: .88rem;
    line-height: 1;
    transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .15s ease;
    cursor: pointer;
    user-select: none;
}

.pagination a.page-numbers:hover,
.pagination .page-numbers:hover,
.pagination a.page-numbers:focus-visible,
.pagination .page-numbers:focus-visible {
    background: var(--cream, #f7f3ec);
    color: var(--green);
    border-color: var(--line);
    transform: translateY(-1px);
    text-decoration: none;
    outline: none;
}

.pagination .current,
.pagination .page-numbers.current {
    background: var(--green);
    color: #ffffff;
    border-color: var(--green);
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(23, 63, 53, 0.22);
    cursor: default;
    transform: none;
}

.pagination .dots,
.pagination .page-numbers.dots {
    min-width: 24px;
    padding: 0 .25rem;
    background: transparent;
    border-color: transparent;
    color: var(--muted);
    font-weight: 700;
    cursor: default;
    transform: none;
}

.pagination .dots:hover,
.pagination .page-numbers.dots:hover {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
    transform: none;
}

.pagination .prev.page-numbers,
.pagination .next.page-numbers {
    padding: 0 .85rem;
    background: rgba(23, 63, 53, 0.04);
    border-color: var(--line);
    font-weight: 600;
    font-size: .84rem;
    gap: .4rem;
    flex-shrink: 0;
}

.pagination .prev.page-numbers:hover,
.pagination .next.page-numbers:hover {
    background: var(--green);
    color: #ffffff;
    border-color: var(--green);
    box-shadow: 0 4px 12px rgba(23, 63, 53, 0.2);
}

.pagination-btn-content {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.pagination-arrow-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    transition: transform .18s ease;
}

.pagination .prev:hover .pagination-arrow-icon {
    transform: translateX(-3px);
}

.pagination .next:hover .pagination-arrow-icon {
    transform: translateX(3px);
}

@media (max-width: 768px) {
    .pagination {
        margin: 1.75rem 0 .5rem;
    }

    .pagination-inner {
        width: auto;
        max-width: 100%;
        flex-wrap: nowrap;
        justify-content: center;
        gap: .25rem;
        padding: .25rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pagination .page-numbers,
    .pagination a,
    .pagination span {
        min-width: 34px;
        height: 34px;
        padding: 0 .45rem;
        font-size: .82rem;
        flex-shrink: 0;
    }

    .pagination .prev.page-numbers,
    .pagination .next.page-numbers {
        min-width: 34px;
        height: 34px;
        padding: 0 .45rem;
        flex-shrink: 0;
    }

    .pagination-text {
        display: none;
    }
}

@media (max-width: 480px) {
    .pagination-inner {
        gap: .18rem;
        padding: .2rem;
    }

    .pagination .page-numbers,
    .pagination a,
    .pagination span {
        min-width: 30px;
        height: 30px;
        padding: 0 .25rem;
        font-size: .78rem;
    }

    .pagination .prev.page-numbers,
    .pagination .next.page-numbers {
        min-width: 30px;
        height: 30px;
        padding: 0 .3rem;
    }

    .pagination .dots,
    .pagination .page-numbers.dots {
        min-width: 18px;
        padding: 0 .1rem;
    }
}

/* Entity detail card grid */
.entity-detail .cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0 1rem;
}

.entity-detail .card {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: var(--shadow);
    padding: 1.25rem;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s;
    height: 100%;
}

.entity-detail .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 42px rgba(23,63,53,.12);
}

.entity-detail .card-thumb {
    display: block;
    margin: -1.25rem -1.25rem .5rem;
    overflow: hidden;
}

.entity-detail .card-thumb img,
.entity-detail .card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform .25s;
}

.entity-detail .card:hover .card-thumb img {
    transform: scale(1.04);
}

.entity-detail .card .meta {
    display: inline-flex;
    align-self: start;
    background: var(--green);
    color: #fff;
    padding: .15rem .6rem;
    border-radius: 0;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .25rem;
    opacity: 0.5;
}

.entity-detail .card h3 {
    margin: 0;
    font-size: 1.15rem;
    font-family: "Cormorant Garamond", Georgia, serif;
    color: var(--green);
    line-height: 1.25;
}

.entity-detail .card h3 a {
    color: var(--ink);
    text-decoration: none;
}

.entity-detail .card h3 a:hover {
    color: var(--sepia);
}

.entity-detail .card p {
    margin: 0;
    font-size: .95rem;
    color: var(--muted);
    line-height: 1.5;
    flex: 1 0 auto;
}

.no-results {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 2.5rem;
    text-align: center;
    color: var(--muted);
}

.country-hero {
    background: var(--green);
    color: #fff;
    border-radius: 0;
    padding: 2.5rem 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.country-hero__eyebrow {
    display: inline-block;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .25rem .65rem;
    border-radius: 0;
    margin-bottom: .75rem;
}

.country-hero__title {
    font-family: "Cormorant Garamond", Georgia, serif;
    color: #fff;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    line-height: 1.1;
    margin: 0 0 .5rem;
}

.country-hero__subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, .85);
    margin: 0 0 1.25rem;
}

.country-hero__stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.country-hero__stat {
    text-align: center;
}

.country-hero__stat strong {
    display: block;
    font-size: 1.8rem;
    color: #fff;
    line-height: 1;
}

.country-hero__stat span {
    font-size: .85rem;
    color: rgba(255, 255, 255, .85);
}

.country-hero__excerpt {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, .9);
    line-height: 1.6;
    max-width: 640px;
    margin: 0 auto;
}

.country-tips {
    margin-bottom: 2rem;
}

@media (max-width: 600px) {
    .country-hero {
        padding: 1.5rem 1rem;
    }

    .country-hero__stats {
        gap: 1.25rem;
    }
}

