/* Shared design tokens, typography and reusable heritage components. */
@font-face {
    font-family: 'UTM-Mabella';
    src: url('../fonts/UTM-Mabella.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: 'SVN-Gilroy';
    src: url('../fonts/SVN-Gilroy Regular.otf') format('opentype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'SVN-Gilroy';
    src: url('../fonts/SVN-Gilroy SemiBold.otf') format('opentype');
    font-weight: 600;
    font-display: swap;
}

:root {
    --heritage-red: #7a1c1c;
    --heritage-red-dark: #5a1313;
    --heritage-gold: #d4af37;
    --heritage-cream: #f9f6f0;
    --heritage-dark: #1c1917;
    --font-display: 'UTM-Mabella', 'Playfair Display', serif;
    --font-body: 'Gilroy', 'SVN-Gilroy', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

#artifacts-swiper .swiper-slide { height: auto; }

#artifacts-swiper-pagination {
    bottom: 0 !important;
}

#artifacts-swiper-pagination .swiper-pagination-bullet {
    background: var(--heritage-gold);
    opacity: 0.4;
}

#artifacts-swiper-pagination .swiper-pagination-bullet-active { opacity: 1; }

#o-dien-swiper .swiper-slide,
#ha-mo-heritage-swiper .swiper-slide { height: auto; }

#o-dien-pagination,
#ha-mo-heritage-pagination { bottom: 0 !important; }

#o-dien-pagination .swiper-pagination-bullet,
#ha-mo-heritage-pagination .swiper-pagination-bullet {
    background: var(--heritage-gold);
    opacity: 0.4;
}

#o-dien-pagination .swiper-pagination-bullet-active,
#ha-mo-heritage-pagination .swiper-pagination-bullet-active { opacity: 1; }

/* Reusable image-only Swiper panel. */
.c-image-swiper {
    overflow: hidden;
    border-radius: 0.875rem;
    padding-bottom: 2rem;
}

.c-image-swiper .swiper-slide img {
    display: block;
    width: 100%;
    height: clamp(17rem, 34vw, 24rem);
    object-fit: cover;
    border-radius: 0.875rem;
    transform: scale(1.055);
}

.c-image-swiper .swiper-slide {
    overflow: hidden;
    border-radius: 0.875rem;
}

.c-image-swiper .swiper-pagination { bottom: 0 !important; }

.c-image-swiper .swiper-pagination-bullet {
    background: var(--heritage-red);
    opacity: 0.35;
}

.c-image-swiper .swiper-pagination-bullet-active { opacity: 1; }

/* Primary-source cards presented as bound historical books. */
.c-source-books {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
}

.c-source-book {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 25rem;
    overflow: hidden;
    padding: 2rem 1.75rem 1.75rem 2.35rem;
    border: 1px solid rgb(212 175 55 / 0.65);
    border-radius: 0.3rem 1rem 1rem 0.3rem;
    box-shadow: 0.7rem 0.85rem 1.6rem rgb(28 25 23 / 0.22), inset -0.35rem 0 0 rgb(255 255 255 / 0.08);
    color: var(--heritage-cream);
    transition: transform 250ms ease, box-shadow 250ms ease;
}

.c-source-book::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 0.9rem;
    border-right: 1px solid rgb(255 255 255 / 0.22);
    background: rgb(0 0 0 / 0.2);
    box-shadow: 0.2rem 0 0 rgb(255 255 255 / 0.08);
}

.c-source-book::after {
    content: "";
    position: absolute;
    top: 0.8rem;
    right: 0.45rem;
    bottom: 0.8rem;
    width: 0.15rem;
    background: rgb(255 255 255 / 0.22);
}

.c-source-book:hover {
    transform: translateY(-0.45rem) rotate(-0.35deg);
    box-shadow: 0.9rem 1.2rem 2rem rgb(28 25 23 / 0.3), inset -0.35rem 0 0 rgb(255 255 255 / 0.08);
}

.c-source-book--red { background: linear-gradient(135deg, #8e2924, #521314); }
.c-source-book--gold { background: linear-gradient(135deg, #8f691e, #523b10); }
.c-source-book--dark { background: linear-gradient(135deg, #40342b, #1d1916); }

.c-source-book .text-heritage-red { color: var(--heritage-gold-light, #ebd58b) !important; }
.c-source-book .text-heritage-red-dark { color: var(--heritage-gold-light, #ebd58b) !important; }
.c-source-book .text-gray-700 { color: rgb(249 246 240 / 0.9) !important; }
.c-source-book blockquote {
    color: var(--heritage-cream) !important;
    font-family: var(--font-body) !important;
    font-size: clamp(1rem, 0.92rem + 0.25vw, 1.125rem) !important;
    font-style: normal !important;
    font-weight: 500;
    line-height: 1.7 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

@media (min-width: 768px) {
    .c-source-books { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .c-source-book { min-height: 31rem; }
}

/* Photo-only document cards. */
.sr-card:has(> .c-document-photo) {
    min-height: clamp(20rem, 32vw, 28rem);
    padding: 0 !important;
    overflow: hidden;
}

.sr-card:has(> .c-document-photo) > :not(.c-document-photo) { display: none; }

.c-document-photo {
    display: block;
    width: 100%;
    height: 100%;
    min-height: inherit;
    object-fit: cover;
    transition: transform 500ms ease;
}

.sr-card:has(> .c-document-photo):hover .c-document-photo { transform: scale(1.04); }

/* Display font is intentionally reserved for uppercase headings and labels. */
.font-playfair,
h1.font-playfair,
h2.font-playfair,
h3.font-playfair,
h4.font-playfair,
h5.font-playfair,
h6.font-playfair {
    font-family: var(--font-display) !important;
    text-transform: uppercase !important;
}

.font-gilroy {
    font-family: var(--font-body) !important;
}

/* Reusable section shell with a decorative background watermark. */
.c-heritage-section {
    position: relative;
    overflow: hidden;
}

.c-heritage-section__ornament {
    position: absolute;
    inset: 0;
    width: 88%;
    max-width: 72rem;
    height: auto;
    margin: auto;
    opacity: 0.055;
    pointer-events: none;
    user-select: none;
}

.c-heritage-section__content {
    position: relative;
    z-index: 1;
}

/* Reusable image location cards. */
.c-location-card {
    overflow: hidden;
    border: 1px solid rgb(212 175 55 / 0.7);
    background: var(--heritage-red-dark);
    color: #fff;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.c-location-card:hover {
    transform: translateY(-0.5rem);
    box-shadow: 0 25px 30px -12px rgb(0 0 0 / 0.25);
}

.c-location-card__image-wrap { overflow: hidden; }

.c-location-card__image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    transition: transform 700ms ease;
}

.c-location-card:hover .c-location-card__image { transform: scale(1.05); }

.c-location-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.75rem 1.5rem;
}

.c-location-card__location {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    color: var(--heritage-cream);
    font-size: 0.8125rem;
    font-weight: 600;
}

.c-location-card__location i,
.c-location-card__action { color: var(--heritage-gold); }

.c-location-card__title-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.c-location-card__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

/* Reusable, caption-free photo strip. */
.c-photo-marquee {
    position: relative;
    overflow: hidden;
    padding: 0.25rem 0;
    border-radius: 1.5rem;
}

.c-photo-marquee::before,
.c-photo-marquee::after {
    content: "";
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    width: 2.5rem;
    pointer-events: none;
}

.c-photo-marquee::before {
    left: 0;
    border-left: 0.25rem solid var(--heritage-red-dark);
    background: linear-gradient(90deg, rgb(255 255 255 / 0.95), transparent);
}

.c-photo-marquee::after {
    right: 0;
    border-right: 0.25rem solid var(--heritage-red-dark);
    background: linear-gradient(270deg, rgb(255 255 255 / 0.95), transparent);
}

.c-photo-marquee__track {
    display: flex;
    width: max-content;
    gap: 1rem;
    animation: c-photo-marquee-scroll 32s linear infinite;
}

.c-photo-marquee:hover .c-photo-marquee__track { animation-play-state: paused; }

.c-photo-marquee__image {
    display: block;
    width: clamp(14rem, 22vw, 18rem);
    height: clamp(17rem, 30vw, 24rem);
    border: 1px solid rgb(212 175 55 / 0.45);
    border-radius: 0.75rem;
    object-fit: cover;
}

@keyframes c-photo-marquee-scroll {
    to { transform: translateX(calc(-50% - 0.5rem)); }
}

@media (prefers-reduced-motion: reduce) {
    .c-photo-marquee { overflow-x: auto; }
    .c-photo-marquee__track { animation: none; }
}

/* Heritage tourist map */
.c-heritage-tour-map {
    width: 100%;
    height: clamp(28rem, 58vw, 40rem);
    border-radius: 0.75rem;
    background: var(--heritage-cream);
    z-index: 0;
}

.c-heritage-map-pin {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    background: var(--heritage-red);
    color: #fff;
    box-shadow: 0 5px 18px rgb(45 20 15 / 0.35);
    font: 800 0.95rem/1 var(--font-body);
    transform: rotate(-45deg);
}

.c-heritage-map-pin > span { transform: rotate(45deg); }

.leaflet-tooltip.c-heritage-map-label {
    border: 1px solid rgb(212 175 55 / 0.7);
    border-radius: 999px;
    background: rgb(255 253 248 / 0.96);
    color: var(--heritage-red-dark);
    box-shadow: 0 4px 14px rgb(45 20 15 / 0.16);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
}

.leaflet-popup.c-heritage-map-popup .leaflet-popup-content-wrapper {
    overflow: hidden;
    border: 1px solid rgb(212 175 55 / 0.55);
    border-radius: 0.9rem;
    padding: 0;
}

.leaflet-popup.c-heritage-map-popup .leaflet-popup-content {
    width: min(17rem, 72vw) !important;
    margin: 0;
}

.c-heritage-map-card img {
    display: block;
    width: 100%;
    height: 7rem;
    object-fit: cover;
}

.c-heritage-map-card__body { padding: 0.85rem 1rem 1rem; }

.c-heritage-map-card__step {
    color: var(--heritage-gold);
    font: 600 0.68rem/1.3 var(--font-body);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.c-heritage-map-card h3 {
    margin: 0.25rem 0 0.4rem;
    color: var(--heritage-red-dark);
    font: 600 1.15rem/1.25 var(--font-body);
}

.c-heritage-map-card p {
    margin: 0 0 0.65rem;
    color: #4b5563;
    font: 600 0.78rem/1.55 var(--font-body);
}

.c-heritage-map-card a {
    color: var(--heritage-red);
    font: 600 0.75rem/1.4 var(--font-body);
    text-decoration: none;
}

.c-heritage-map-card a:hover { text-decoration: underline; }

@media (max-width: 639px) {
    .c-heritage-tour-map { height: 32rem; }
    .leaflet-tooltip.c-heritage-map-label { display: none; }
}
