/*
Theme Name: RTWF
Description: Тема архива rtwf.ru — вёрстка сайта Всероссийской федерации перетягивания каната (РФПК, 2017–2022). Основные стили — архивный /css/default.css на родном пути; здесь только дополнения: доступность, свои блоки (галерея, видео, архив ВФПК), карточки во всплывающем окне, правки для телефона.
Version: 0.1.0
Text Domain: rtwf
*/

:root {
	--rtwf-navy: #1d3565;
	--rtwf-blue: #0069b4;
	--rtwf-link: #3271ae;
	--rtwf-red: #dc371d;
	--rtwf-grey: #707173;
	--rtwf-muted: #a2a3a4;
	--rtwf-paper: #ffffff;
	--rtwf-bg: #e1e2e3;
	--rtwf-shadow: 0 10px 10px rgba(0, 0, 0, .25), 0 5px 5px rgba(0, 0, 0, .22);
}

body { background-color: var(--rtwf-bg); }

/* доступность: видимый фокус, скрытые заголовки */
a:focus-visible, button:focus-visible { outline: 3px solid var(--rtwf-red); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: absolute; left: 10px; top: 10px; z-index: 1000; width: auto; height: auto; clip: auto; padding: 8px 12px; background: #fff; color: var(--rtwf-navy); }

/* содержимое записей: длинные слова и таблицы не распирают страницу */
#content div.news, #intro, #two_one div.two { overflow-wrap: break-word; }
#content div.news h1, #intro h1, .title { overflow-wrap: break-word; hyphens: auto; }
#content div.news table { max-width: 100%; width: auto; border-collapse: collapse; margin: 0 20px 20px; }
#content div.news td, #content div.news th { word-break: break-word; hyphens: auto; padding: 4px 6px; border: 1px solid #d9dadb; font-size: 14px; }

/* собственные блоки внутри #content: архивное правило «#content div» даёт им тень и float — снимаем */
#content div.news div.lead, #content div.news div.vfpk-sub, #content div.news div.rtwf-video,
#content div.news div.rtwf-album, #content div.news div.rtwf-meta { float: none; box-shadow: none; margin: 0; background: transparent; }
#content div.news div.lead { margin: 0 0 10px; }
#content div.news div.lead p:first-child { font-weight: 500; }
#content div.news p.subtitle { font-weight: 500; color: var(--rtwf-navy); margin-top: 10px; }
#content div.news div.vfpk-sub { padding-left: 20px; }
#content div.news img.vfpk-img { float: left; width: 180px; margin: 0 20px 10px 20px; }
#content div.news img[align="left"] { float: left; width: auto; max-width: 40%; margin: 0 20px 10px 20px; }
#content div.news img[align="right"] { float: right; width: auto; max-width: 40%; margin: 0 20px 10px 20px; }
#content pre span.archive { background: #888888; }
#content pre { white-space: normal; height: auto; min-height: 24px; }
#content pre span { margin-bottom: 2px; }
#content div.news .rtwf-clear { clear: both; height: 1px; }

/* фотоальбом (вместо show_album + jquery.tools, которых нет в архиве) */
#content div.news div.rtwf-album { clear: both; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 0 20px 20px; }
#content div.news div.rtwf-album a { border: 0; display: block; }
#content div.news div.rtwf-album img { width: 100%; height: 130px; object-fit: cover; margin: 0; display: block; }

/* видео YouTube: iframe загружается только по нажатию */
#content div.news div.rtwf-video { margin: 0 20px 20px; aspect-ratio: 16 / 9; max-width: 740px; background: #0f1b33; display: flex; align-items: center; justify-content: center; }
#content div.news div.rtwf-video button { font: 500 15px/1.2 Roboto, Arial, sans-serif; color: #fff; background: var(--rtwf-red); border: 0; padding: 12px 20px; cursor: pointer; }
#content div.news div.rtwf-video iframe { width: 100%; height: 100%; border: 0; }
#content div.news div.rtwf-video--off { aspect-ratio: auto; justify-content: flex-start; padding: 12px 16px; background: #eef1f6; color: #4a5568; font: 400 14px/1.4 Roboto, Arial, sans-serif; }

/* боковые блоки — общей правой колонкой, даже когда материал короче сайдбара */
#content div.rtwf-aside { float: right; margin: 0; padding: 0; box-shadow: none; background: transparent; width: 400px; }
#content div.rtwf-aside div.side { float: none; }
@media (min-width: 980px) and (max-width: 1200px) { #content div.rtwf-aside { width: 340px; } }
@media (min-width: 768px) and (max-width: 980px) { #content div.rtwf-aside { width: 256px; } }
@media (max-width: 767px) {
	#content div.rtwf-aside { float: none; width: 100%; }
	/* в архивном CSS у боковых блоков на телефоне height:160px — блоки наезжали друг на друга */
	#content div.side { height: auto; padding-bottom: 10px; }
	/* архивный CSS: картинке «Главной темы» width:100% + margin-right:30px — вылет вбок на 30 px */
	#fullimg img, #fullimg img.right { margin-right: 0; }
	/* в текстах из архива инлайн text-align:justify и text-indent из Word: на узком экране —
	   дыры между словами и съеденная отступом строка; на телефоне выравниваем влево */
	#content div.news p[style], #content div.news div[style] { text-align: left !important; text-indent: 0 !important; }
	#content div.news [style*="font-family"] { font-family: inherit !important; }
	/* архивные 10–11 px в боковых блоках и подвале на телефоне не читаются */
	#content div.side, #content div.side a, #content div.side p, #content div.side span, #footer, #footer a, #footer p { font-size: 14px !important; line-height: 1.45; }
	p.date, ul.news li, div.news li, div.news span, .title p span, #site span { font-size: 13px !important; }}

/* сайдбар: навигация архива ВФПК */
#content div.side ul.vfpk-nav { list-style: none; margin: 15px 20px 15px 20px; padding: 0; }
#content div.side ul.vfpk-nav li { margin: 0 0 8px; }
#content div.side ul.vfpk-nav li.sub { padding-left: 14px; }

/* карточка соревнования / организации (страница и всплывающее окно календаря) */
#intro h2.global, #intro h2.local, #intro h2.member, #intro h2.branch, #intro h2.soon { display: inline-block; margin: 0 50px 10px; padding: 4px 12px; font-size: 13px; line-height: 16px; font-weight: 500; text-transform: uppercase; color: #fff; background: var(--rtwf-link); }
#intro h2.global, #intro h2.member { background: var(--rtwf-red); }
#intro h2.soon { background: #888; }
#intro .rtwf-center { text-align: center; }
#intro p.rtwf-note, p.rtwf-note { color: var(--rtwf-grey); font-style: italic; }
html.in-frame body { background: #fff !important; }
html.in-frame #top, html.in-frame #footer, html.in-frame .rtwf-partners, html.in-frame #rtwf-crumb-title, html.in-frame .skip-link { display: none !important; }
html.in-frame #intro { box-shadow: none; margin: 0 auto; width: auto; }

.title a { color: inherit; }

/* шапка на главной: заголовок — h1 с той же типографикой, что и <p> в архиве */
#title h1 { margin: 0; padding: 0; font: inherit; }

/* партнёры: подписи для img без ссылок */
#sixth div.partner img { max-width: 160px; max-height: 50px; margin-top: 5px; }

@media (min-width: 1200px) {
	#title h1.site { margin: 23px 0 0 210px; font-size: 32px; font-weight: 300; line-height: 30px; color: var(--rtwf-navy); }
}
@media (min-width: 980px) and (max-width: 1200px) {
	#title h1.site { margin: 23px 0 0 210px; font-size: 32px; font-weight: 300; line-height: 30px; color: var(--rtwf-navy); }
}
@media (min-width: 768px) and (max-width: 980px) {
	#title h1.site { margin: 23px 0 0 130px; font-size: 32px; font-weight: 300; line-height: 30px; color: var(--rtwf-navy); }
}
@media (max-width: 767px) {
	#title h1.site { margin: 23px 0 0 110px; font-size: 16px; font-weight: 500; line-height: 16px; color: var(--rtwf-navy); max-width: 150px; }
	#title h1.site span { display: none; }
	#content div.news img.vfpk-img, #content div.news img[align] { float: none; display: block; width: auto; max-width: calc(100% - 40px); margin: 0 20px 10px; }
	#content div.news table { display: block; overflow-x: auto; margin: 0 10px 20px; }
	#intro h2.global, #intro h2.local, #intro h2.member, #intro h2.branch { margin: 0 20px 10px; }
	#content div.news div.rtwf-album { grid-template-columns: repeat(2, 1fr); }
	#content iframe { max-width: 100%; }
	img { max-width: 100%; height: auto; }
	body { overflow-x: hidden; }
}

/* переключатель языка RU / EN (английская версия /en/, 20.10.2026) */
#lang { float: right; margin: 14px 12px 0 0; font-family: Roboto, Arial, sans-serif; font-size: 13px; font-weight: 500; line-height: 20px; }
#lang a { display: inline-block; padding: 4px 7px; color: var(--rtwf-navy); text-decoration: none; border: 1px solid transparent; }
#lang a:hover { color: var(--rtwf-blue); border-bottom-color: var(--rtwf-blue); }
#lang a.sel { color: var(--rtwf-red); border-color: var(--rtwf-red); border-radius: 3px; }
@media (max-width: 767px) {
	#lang { margin: 12px 6px 0 0; width: 34px; font-size: 12px; line-height: 16px; text-align: center; }
	#lang a { display: block; padding: 3px 0; margin-bottom: 4px; }
}
