/* 
Bootstrap breakpoints 
---------------------
Extra small	<576px
Small	sm	≥576px
Medium	md	≥768px
Large	lg	≥992px
Extra large	xl	≥1200px
Extra extra large	xxl	≥1400px
*/

:root {

	--body-bg: 240, 240, 240;           /* Фон всего окна */
	--content-bg: 255, 255, 255;        /* Фон зоны контента */
	--font-color: 70, 70, 70;           /* Шрифт  */
	--font-color-inv: 255, 255, 255;    /* Шрифт (инверсия) */
	--links: 100, 140, 30;              /* Цвет ссылок */

	--color1: 130, 170, 60;       /* 1 Цвет (основной) */
	--color1-ui: 110, 150, 40;    /* 1 Цвет (линии, :hover...) */
	--color2: 250, 220, 120;      /* 2 Цвет (акцедентный) */
	--color2-ui: 255, 195, 45;    /* 2 Цвет (элементы UI) */
	
	/* Bootstrap override */
	--bs-body-font-size: 1.15rem;
	--bs-body-line-height: 1.5rem;
	--bs-form-control-bg: rgb(var(--content-bg));	
	--primary: rgb(var(--color1));
	--secondary: rgb(var(--color2));
	--bs-label-font-weight: 400;
}

:active, :focus, .btn { outline: 0 !important; box-shadow: 0 0 0 0 !important}

h1, .h1, h2, .h2, h3, .h3 {font-weight:400}
h1, .h1 {font-size:2rem; line-height:2rem; color:rgb(var(--color1)) }
h2, .h2 {font-size:1.5rem; line-height:1.5rem; color:rgb(var(--color1-ui)) }
h3, .h3 {font-size:1.25rem; line-height:1.25rem; }

a { color:rgb(var(--links)); text-underline-offset: 4px }
a:hover { color:rgb(var(--font-color)) }
a.no-link { opacity:.5 }

b {font-weight:500;}
.small {line-height:1rem}

.col-12 p:last-child { margin-bottom:0}


body { background-color:rgb(var(--body-bg)) }
.container {background-color:rgb(var(--content-bg));}
    @media (min-width: 1200px) {
        .container {max-width:1200px;}
    }

header { border-radius: .5rem .5rem 0 0; display:flex; flex-direction: row; justify-content:space-between; align-items: center;}
header .logo { flex:0 0 auto; text-align:left}
header .logo-text { font-size:2.25rem; font-weight:700; letter-spacing:-.02em; color:var(--font-color); white-space:nowrap }
header .logo-accent { color:rgb(var(--color1)); margin-left:.25rem }
header .logo a { text-decoration:none }
header .logo a:hover .logo-text { color:var(--font-color) }

.logo-side .logo-text { font-size:1.75rem; font-weight:700; letter-spacing:-.02em; color:var(--font-color); white-space:nowrap }
.logo-side .logo-accent { color:rgb(var(--color1)); margin-left:.25rem }
.logo-side a { text-decoration:none }
.logo-side a:hover .logo-text { color:var(--font-color) }

header .title { font-size:1.25rem; margin-bottom:0.5rem; margin-left:2rem; margin-right:auto; padding:0;
	max-width:26rem; text-align:left; line-height:1.05}
header .social {flex-basis:25%}
header .social a {margin:0 .35rem}

    @media (max-width: 768px) {
        header {border-radius:0; padding:.5rem 0; flex-direction: column; justify-content:center;}
		header div {text-align:center}
		header .title {order:-1; font-size:1.1rem; line-height:1.25rem}
    }
	@media (max-width: 992px) {
	    header {flex-wrap: wrap}
        header .title {order:-1; flex-basis:100%; font-size: 1.1rem; text-align:center;}
    }

footer { border-radius: 0 0 .5rem .5rem}
    footer.container { background-color:rgb(var(--color1)); color:rgb(var(--font-color-inv)); text-align:center;}
    footer.container a { color:var(--base-main);}
    @media (max-width: 768px) {
        footer {border-radius:0}
    }

	
.img-top {background-color:rgba(var(--color2-ui), .5); overflow:hidden; width:100% }
.img-top img {aspect-ratio:3}
    @media (max-width: 576px) { .img-top img {aspect-ratio:.75} }

.frame { border: 2px dashed rgb(var(--color1-ui)); padding:.75rem 1rem; border-radius: .5rem }
.note { padding:.75rem 1rem; border-radius: .5rem; background-color:rgba(var(--color2), .25) }

.invalid { font-size:.9rem; line-height:1rem; color: #c00 } /* Ошибки в формах */

.breadcrumbs { background-color:rgb(var(--content-bg)) }
.breadcrumb { margin:0; padding:.5rem 1.5rem; background-color:rgba(var(--color1), .1)}
	@media (max-width: 992px) { .breadcrumb {padding:.5rem 1rem;} }
.breadcrumb a {text-decoration:none }
.breadcrumb li {opacity:.75 }
.breadcrumbs .separ {width:16px; height:16px; position:relative; margin:0 .5rem;}
.breadcrumbs i, .breadcrumbs i::after {position:absolute; width:9px; height:2px; background: rgba(var(--color1), .75); content: ""}
.breadcrumbs i {transform: rotate(45deg); top:8px; left:5px}
.breadcrumbs i::after {transform: rotate(-90deg); left:5px; top:4px;}

/* Theme switcher (светлая/тёмная тема BS6: data-bs-theme) */
.theme-switcher {position:fixed; top:0.625rem; right:0.625rem; width:1.5rem; height:1.5rem; z-index:1500;
	cursor:pointer; color:rgb(var(--font-color)); opacity:.65; transition:opacity .2s}
.theme-switcher:hover {opacity:1}
/* контраст: полый круг, закрашена нужная половина */
.theme-switcher i {position:absolute; top:0.25rem; left:0.25rem; width:1rem; height:1rem; border-radius:50%;
	display:block; border:2px solid currentcolor;
	background:linear-gradient(90deg, transparent 50%, currentcolor 50%)}
/* в тёмной теме закрашена противоположная половина */
.theme-switcher.theme-dark i {background:linear-gradient(270deg, transparent 50%, currentcolor 50%)}
/* «Авто»: буква A, левая половина тёмная, правая светлая */
.theme-switcher.theme-auto i {border:0; background:none; border-radius:0;
	font:700 .9375rem/1rem system-ui, sans-serif; text-align:center}
.theme-switcher.theme-auto i::before,
.theme-switcher.theme-auto i::after {content:"A"; position:absolute; inset:0}
.theme-switcher.theme-auto i::before {color:rgb(var(--font-color))}
.theme-switcher.theme-auto i::after {color:rgb(var(--font-color-inv)); clip-path:inset(0 0 0 50%)}

/* Тёмная тема BS6 (data-bs-theme="dark"): перекрытие переменных сборки.
   Инлайновый :root с палитрой стоит в <head> ДО common.css —
   поэтому атрибутный селектор ниже гарантированно побеждает. */
[data-bs-theme="dark"] {
	--body-bg: 24, 26, 27;
	--content-bg: 33, 37, 41;
	--font-color: 222, 226, 230;
	--links: 158, 200, 80;
	--color1: 110, 145, 50;
	--color1-ui: 95, 128, 44;
	--color2: 250, 220, 120;
	--color2-ui: 255, 195, 45;
}

/* Xcomm3x (отзывы): пакетный CSS жёстко задаёт светлые фоны —
   в тёмной теме перекрываем полупрозрачным белым (25% и меньше) */
[data-bs-theme="dark"] .xcomm3x-comment {background:rgba(255,255,255,.06); border-left-color:rgba(255,255,255,.18)}
[data-bs-theme="dark"] .xcomm3x-btn {background:rgba(255,255,255,.25); color:rgb(var(--font-color)); border-color:rgba(255,255,255,.35)}
[data-bs-theme="dark"] .xcomm3x-btn:hover {background:rgba(255,255,255,.35)}
[data-bs-theme="dark"] .xcomm3x-btn-primary {background:rgb(var(--color1)); border-color:rgb(var(--color1)); color:rgb(var(--font-color-inv))}
[data-bs-theme="dark"] .xcomm3x-btn-primary:hover {background:rgb(var(--color1-ui)); border-color:rgb(var(--color1-ui))}
[data-bs-theme="dark"] .xcomm3x-input, [data-bs-theme="dark"] .xcomm3x-textarea {background:rgba(255,255,255,.25); color:rgb(var(--font-color)); border-color:rgba(255,255,255,.35)}
[data-bs-theme="dark"] .xcomm3x-input::placeholder, [data-bs-theme="dark"] .xcomm3x-textarea::placeholder {color:rgba(255,255,255,.55)}
[data-bs-theme="dark"] .xcomm3x-date, [data-bs-theme="dark"] .xcomm3x-no-comments, [data-bs-theme="dark"] .xcomm3x-deleted {color:rgba(255,255,255,.55)}
[data-bs-theme="dark"] .xcomm3x-rating, [data-bs-theme="dark"] .xcomm3x-vote-btn {color:rgba(255,255,255,.7)}
[data-bs-theme="dark"] .xcomm3x-vote-btn.xcomm3x-voted {color:rgb(var(--links))}
[data-bs-theme="dark"] .xcomm3x-reply-form {background:rgba(255,255,255,.08)}
[data-bs-theme="dark"] .xcomm3x-pending-notice {background:rgba(var(--color2-ui),.25); border-color:rgba(var(--color2-ui),.5)}
[data-bs-theme="dark"] .xcomm3x-success-notice {background:rgba(var(--color1),.25); border-color:rgba(var(--color1),.5)}
[data-bs-theme="dark"] .xcomm3x-form-title {color:rgb(var(--font-color))}

/* Карта (OpenStreetMap) в карточке объекта */
.castle-map {position:relative; width:100%; aspect-ratio:4/3; border:0; border-radius:.5rem; display:block}
.castle-map-link {font-size:.85rem; opacity:.75}

/* Видео (YouTube): обложка со ссылкой в новом окне */
.youtube-card {position:relative; display:block; border-radius:.5rem; overflow:hidden; text-decoration:none}
.youtube-card img {width:100%; aspect-ratio:16/9; object-fit:cover; display:block}
.youtube-card::after {content:""; position:absolute; inset:0;
	background:linear-gradient(rgba(0,0,0,.15), rgba(0,0,0,.35)); transition:background .2s}
.youtube-card:hover::after {background:linear-gradient(rgba(0,0,0,.05), rgba(0,0,0,.25))}
.youtube-card .youtube-play {position:absolute; z-index:1; top:50%; left:50%; width:3rem; height:2.1rem;
	transform:translate(-50%,-50%); background:rgba(255,0,0,.85); border-radius:.5rem; transition:background .2s}
.youtube-card .youtube-play::before {content:""; position:absolute; top:50%; left:55%; transform:translate(-50%,-50%);
	border-left:.8rem solid #fff; border-top:.5rem solid transparent; border-bottom:.5rem solid transparent}
.youtube-card:hover .youtube-play {background:#f00}

/* Полноэкранная галерея замка (Swiper) */
.cg-overlay {position:fixed; inset:0; z-index:3000; background:rgba(0,0,0,.92);
	display:none; flex-direction:column; padding:1rem}
.cg-overlay.show {display:flex}
.cg-top {flex:1; min-height:0; position:relative}
.cg-top .swiper {width:100%; height:100%}
.cg-top .swiper-slide {height:100%; display:flex; align-items:center; justify-content:center}
.cg-slide img {max-width:100%; max-height:100%; object-fit:contain}
.cg-caption {position:absolute; bottom:0; left:0; right:0; text-align:center;
	color:#fff; font-size:.9rem; padding:.5rem 1rem; background:rgba(0,0,0,.5); z-index:10}
.cg-thumbs {flex:none; width:100%; min-width:0; height:5rem; margin-top:.75rem; opacity:.6; transition:opacity .2s}
.cg-thumbs:hover {opacity:1}
.cg-thumbs .swiper-slide {height:100%; opacity:.45; cursor:pointer; overflow:hidden;
	border-radius:.25rem}
.cg-thumbs .swiper-slide img {width:100%; height:100%; object-fit:cover}
.cg-thumbs .swiper-slide-thumb-active {opacity:1; outline:2px solid rgb(var(--color2-ui)); outline-offset:-2px}
.cg-close {position:absolute; top:.75rem; right:1rem; z-index:20; width:2.5rem; height:2.5rem;
	border:0; border-radius:50%; background:rgba(255,255,255,.15); color:#fff; font-size:1.5rem;
	line-height:1; cursor:pointer}
.cg-close:hover {background:rgba(255,255,255,.3)}
.cg-overlay .swiper-button-prev, .cg-overlay .swiper-button-next {color:#fff; opacity:.5; transition:opacity .2s}
.cg-overlay .swiper-button-prev:hover, .cg-overlay .swiper-button-next:hover {opacity:1}
.cg-overlay .swiper-pagination-fraction, .cg-overlay .swiper-pagination-bullets {color:#fff}

/* Главная: галерея популярных замков (Swiper) */
.main-gallery {position:relative; overflow:hidden}
.main-gallery .swiper-slide a {position:relative; display:block; text-decoration:none;
	overflow:hidden; border-radius:0}
.main-gallery .swiper-slide img {width:100%; aspect-ratio:4/3; object-fit:cover; display:block}
.main-gallery .swiper-slide .mg-caption {position:absolute; left:0; right:0; bottom:0;
	padding:1.5rem .75rem .5rem; color:#fff; font-size:1rem; line-height:1.2; text-align:center;
	background:linear-gradient(transparent, rgba(0,0,0,.75))}
.main-gallery .swiper-pagination-bullet-active {background:rgb(var(--color2-ui))}
