/* Real Krabi – site templates (plugin, includes/class-rktp-site.php).
   Tour page frame without Elementor, legal pages, blog posts, 404 and the image lightbox.
   Colours / fonts come from pages.css (--rkp-*) and tour-design.css (--rkx-*). */

/* ============================================================== tour page frame */
.rkx-tpl { display: block; width: 100%; background: var(--rkx-cream, #faf8f5); }
.rkx-tpl-hero, .rkx-tpl-related, .rkx-main, .rkx-aside { display: flex; flex-direction: column; box-sizing: border-box; }
.rkx-tpl-body { box-sizing: border-box; width: 100%; }
.rkx-block { width: 100%; min-width: 0; }
.rkx-main > .rkx-block:last-child .rkx-sec { border-bottom: 0; }
.rkx-aside .rkx-block .amelia-v2-booking { background: transparent !important; box-shadow: none !important; border: none !important; }

/* ============================================================== shared (legal, post, 404) */
.rks .rks-hero { min-height: 0; padding: 150px 0 140px; }
.rks .rks-hero .rkp-h1 { margin-bottom: 0 !important; }
.rks-sec { padding: 0 0 96px; background: var(--rkp-cream); }
.rks-doc {
	position: relative; z-index: 2;
	max-width: 820px; margin: -84px auto 0; padding: 56px 64px;
	background: #fff; border: 1px solid var(--rkp-line); border-radius: var(--rkp-radius-lg);
	box-shadow: var(--rkp-shadow);
	font-family: var(--rkp-sans); font-size: 16px; line-height: 1.75; color: var(--rkp-ink);
}
.rks-doc > :first-child { margin-top: 0 !important; }
.rks-doc h2, .rks-doc h3, .rks-doc h4 { font-family: var(--rkp-serif) !important; color: var(--rkp-navy) !important; line-height: 1.25 !important; font-weight: 700 !important; }
.rks-doc h2 { font-size: 24px !important; margin: 44px 0 12px !important; }
.rks-doc h3 { font-size: 20px !important; margin: 32px 0 10px !important; }
.rks-doc h4 { font-size: 17px !important; margin: 24px 0 8px !important; }
.rks-doc p { margin: 0 0 16px; }
.rks-doc ul, .rks-doc ol { margin: 0 0 20px; padding-left: 22px; }
.rks-doc li { margin: 6px 0; }
.rks-doc li::marker { color: var(--rkp-gold); }
.rks-doc a { color: #9a7128; text-decoration: underline; text-underline-offset: 3px; }
.rks-doc a:hover { color: var(--rkp-navy); }
.rks-doc hr { border: 0; border-top: 1px solid var(--rkp-line); margin: 36px 0; }
.rks-doc img { max-width: 100%; height: auto; border-radius: 16px; }
.rks-doc figure { margin: 28px 0; }
.rks-doc figcaption { font-size: 14px; color: var(--rkp-muted); margin-top: 8px; }
.rks-doc blockquote { margin: 28px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--rkp-gold); font-family: var(--rkp-serif); font-size: 20px; line-height: 1.5; color: var(--rkp-navy); }
.rks-doc table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 15px; }
.rks-doc th, .rks-doc td { border: 1px solid var(--rkp-line); padding: 10px 12px; text-align: left; vertical-align: top; }
.rks-doc th { background: var(--rkp-cream); }
.rks-doc-foot { margin: 40px 0 0 !important; padding-top: 24px; border-top: 1px solid var(--rkp-line); font-size: 15px; color: var(--rkp-muted); }

/* legal */
.rks-legal-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; }
.rks-legal-nav a {
	display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, .28); color: rgba(255, 255, 255, .85) !important;
	font-size: 14px; font-weight: 500; text-decoration: none !important; transition: border-color .2s, background .2s, color .2s;
}
.rks-legal-nav a:hover { border-color: var(--rkp-gold); color: #fff !important; }
.rks-legal-nav a[aria-current="page"] { background: var(--rkp-gold); border-color: var(--rkp-gold); color: var(--rkp-navy) !important; }

/* post */
.rks-meta { display: flex; justify-content: center; gap: 10px; margin: 18px 0 0 !important; color: rgba(255, 255, 255, .78); font-size: 15px; }
.rks-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rkp-line); font-size: 14px; color: var(--rkp-muted); }
.rks-share span { margin-right: 4px; font-weight: 600; color: var(--rkp-navy); }
.rks-doc .rks-share a { display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--rkp-line); color: var(--rkp-navy); text-decoration: none; font-weight: 500; }
.rks-doc .rks-share a:hover { border-color: var(--rkp-gold); background: var(--rkp-gold-soft); }
.rks-more .rkp-h2 { margin-bottom: 28px !important; }
.rks-more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.rks-post-card { display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--rkp-line); border-radius: var(--rkp-radius); box-shadow: var(--rkp-shadow); color: var(--rkp-ink) !important; text-decoration: none !important; transition: transform .25s, box-shadow .25s; }
.rks-post-card:hover { transform: translateY(-3px); box-shadow: var(--rkp-shadow-lg); }
.rks-post-card-img { display: block; aspect-ratio: 16 / 10; background: var(--rkp-sand); overflow: hidden; }
.rks-post-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rks-post-card-body { display: flex; flex-direction: column; gap: 6px; padding: 20px 22px 24px; }
.rks-post-card-body time { font-size: 13px; color: var(--rkp-muted); }
.rks-post-card-body strong { font-family: var(--rkp-serif); font-size: 19px; line-height: 1.3; color: var(--rkp-navy); }

/* 404 */
.rks-404 .rks-hero { min-height: 72vh; padding: 140px 0 110px; }
.rks-404-links { margin-top: 24px !important; color: rgba(255, 255, 255, .78); font-size: 15px; }
.rks-404-links a { color: var(--rkp-gold-2) !important; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 900px) {
	.rks-more-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
	.rks .rks-hero { padding: 110px 0 104px; }
	.rks-doc { margin-top: -64px; padding: 32px 22px; border-radius: 22px; font-size: 15.5px; }
	.rks-doc h2 { font-size: 21px !important; margin-top: 34px !important; }
	.rks-sec { padding-bottom: 64px; }
	.rks-more-grid { grid-template-columns: 1fr; }
	.rks-legal-nav a { font-size: 13px; padding: 7px 13px; }
}

/* ============================================================== lightbox (assets/site/rk-lightbox.js) */
html.rk-lb-open { overflow: hidden; }
.rk-lb { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 56px 80px; background: rgba(7, 18, 27, .95); }
.rk-lb[hidden] { display: none; }
.rk-lb-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 100%; max-height: 100%; }
.rk-lb-fig img { display: block; width: auto; height: auto; max-width: min(1400px, 100%); max-height: calc(100vh - 150px); border-radius: 12px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); }
.rk-lb-count { color: rgba(255, 255, 255, .7); font: 500 13px/1 var(--rkx-sans, system-ui, sans-serif); letter-spacing: .08em; }
.rk-lb > button {
	position: absolute; display: flex; align-items: center; justify-content: center;
	width: 48px !important; height: 48px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important;
	border-radius: 50% !important; border: 1px solid rgba(255, 255, 255, .28) !important;
	background: rgba(255, 255, 255, .06) !important; color: #fff !important;
	font: 400 30px/1 system-ui, sans-serif !important; cursor: pointer; box-shadow: none !important; transition: background .2s, border-color .2s;
}
.rk-lb > button:hover, .rk-lb > button:focus-visible { background: rgba(214, 168, 79, .22) !important; border-color: #d6a84f !important; outline: none; }
.rk-lb-close { top: 16px; right: 16px; }
.rk-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.rk-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.rk-lb.is-single .rk-lb-prev, .rk-lb.is-single .rk-lb-next { display: none; }
@media (max-width: 767px) {
	.rk-lb { padding: 64px 12px 88px; }
	.rk-lb-prev, .rk-lb-next { top: auto; bottom: 20px; transform: none; }
	.rk-lb-prev { left: calc(50% - 60px); }
	.rk-lb-next { right: calc(50% - 60px); }
}

/* ============================================================== hero images on wide screens (pages.css .rkp-hero)
   - height grows with the screen width so wide screens show more of the photo instead of a thin strip
   - from 1600px the hero becomes an inset rounded card (max 1560px) so photos are never stretched past their size
   - per page focal point: style="--rkp-hero-img:url(...);--rkp-hero-pos:center 30%" */
.rkp .rkp-hero { background-position: var(--rkp-hero-pos, center); }
@media (min-width: 1280px) {
	.rkp .rkp-hero.rkp-hero:not(.rkh-home-hero) { min-height: clamp(600px, 40vw, 760px); }
	.rkp .rkp-hero.rkp-hero--short:not(.rkh-home-hero) { min-height: clamp(460px, 30vw, 600px); }
}
@media (min-width: 1600px) {
	.rkp .rkp-hero.rkp-hero:not(.rkh-home-hero) { width: auto; max-width: 1560px; margin: 24px auto 0; border-radius: 28px; box-shadow: var(--rkp-shadow-lg); }
}
