/*
Theme Name: Ogniwo Blocks
Theme URI: https://smogniwo.pl/
Author: Jakub Jaworowicz
Author URI: https://jaworowi.cz
Description: Motyw blokowy (Full Site Editing) odwzorowujący układ serwisu Spółdzielni Mieszkaniowej "Ogniwo" w Łodzi: arkusz 1000 px, banner 200 px, trzy kolumny (menu 230 px / treść / dane adresowe 230 px) oraz gradientowa stopka.
Version: 1.4.0
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ogniwo
Tags: full-site-editing, block-templates, three-columns, custom-colors
*/

/* =========================================================
   1. Strona i arkusz (odpowiednik .art-sheet)
   ========================================================= */

body {
	background-color: #e5e5e5;
	background-image: url( assets/images/page_t.jpg );
	background-repeat: repeat;
	background-position: top center;
	color: #696969;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	line-height: 150%;
}

.wp-site-blocks {
	box-sizing: border-box;
	width: 1000px;
	max-width: 100%;
	margin: 20px auto;
	background-color: #f7f7f7;
	border: 1px solid #d7d7d7;
	border-radius: 2px;
	box-shadow: 0 0 4px rgba( 0, 0, 0, 0.08 );
}

.wp-site-blocks > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* =========================================================
   2. Nagłówek (odpowiednik .art-header / .art-header-jpeg)
   ========================================================= */

.ogniwo-header {
	position: relative;
	width: 998px;
	max-width: 100%;
	height: 200px;
	margin: 0 auto;
	overflow: hidden;
	background-image: url( assets/images/header.jpg );
	background-repeat: no-repeat;
	background-position: center center;
}

.ogniwo-header a {
	display: block;
	width: 100%;
	height: 100%;
}

/* Tytuł witryny dla czytników ekranu; wizualnie zastępuje go banner. */
.ogniwo-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	white-space: nowrap;
	border: 0;
}

/* =========================================================
   3. Układ kolumn (odpowiednik .art-content-layout)
   ========================================================= */

.ogniwo-layout.wp-block-columns {
	width: 998px;
	max-width: 100%;
	margin: 0 auto;
	gap: 0;
	align-items: stretch;
}

.ogniwo-layout > .wp-block-column {
	min-width: 0;
}

.ogniwo-sidebar.wp-block-column {
	flex-basis: 230px;
	flex-grow: 0;
	flex-shrink: 0;
}

.ogniwo-main.wp-block-column {
	flex-basis: auto;
	flex-grow: 1;
}

/* =========================================================
   4. Blok boczny (odpowiednik .art-block + .art-blockheader)
   ========================================================= */

.ogniwo-block,
.is-style-ogniwo-block {
	margin: 10px;
	padding: 11px;
	background-color: #ededed;
	background-image: url( assets/images/block_c.png );
	background-repeat: repeat;
	border: 1px solid #dcdcdc;
	border-radius: 6px;
}

.ogniwo-block > *,
.is-style-ogniwo-block > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

.ogniwo-blockheader,
.ogniwo-block > h2,
.ogniwo-block > h3,
.is-style-ogniwo-block > h2,
.is-style-ogniwo-block > h3 {
	height: 25px;
	margin: 0 0 6px;
	padding: 0 13px;
	overflow: hidden;
	color: #f5f5f5;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 13px;
	font-weight: bold;
	line-height: 25px;
	white-space: nowrap;
	text-align: left;
	background-color: #99151b;
	background-image: url( assets/images/blockheader.png );
	background-repeat: repeat-x;
	background-position: left top;
	border-radius: 3px;
}

.ogniwo-blockbody {
	padding: 4px 0 0;
	color: #000;
}

.ogniwo-blockbody p {
	margin: 6px 0;
	font-size: 12px;
	line-height: 18px;
	text-align: center;
}

/* =========================================================
   5. Menu pionowe (odpowiednik ul.menu w module Joomla)
   ========================================================= */

/*
 * Belka "Menu witryny" jest jednocześnie przełącznikiem (blok Szczegóły).
 * Na desktopie wygląda i zachowuje się jak zwykły nagłówek bloku,
 * poniżej 782 px dostaje hamburgera i zwija listę.
 */
.ogniwo-menu-toggle {
	margin: 0;
}

.ogniwo-menu-toggle > summary {
	position: relative;
	height: 25px;
	margin: 0 0 6px;
	padding: 0 13px;
	overflow: hidden;
	color: #f5f5f5;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 13px;
	font-weight: bold;
	line-height: 25px;
	white-space: nowrap;
	text-align: left;
	background-color: #99151b;
	background-image: url( assets/images/blockheader.png );
	background-repeat: repeat-x;
	background-position: left top;
	border-radius: 3px;
	list-style: none;
	cursor: pointer;
}

.ogniwo-menu-toggle > summary::marker {
	content: "";
}

.ogniwo-menu-toggle > summary::-webkit-details-marker {
	display: none;
}

.ogniwo-menu-toggle > summary::after {
	position: absolute;
	top: 0;
	right: 11px;
	font-size: 15px;
	line-height: 25px;
}

.ogniwo-menu ul,
.ogniwo-menu .wp-block-navigation__container,
.ogniwo-menu.wp-block-page-list {
	display: block;
	margin: 0;
	padding: 0;
	list-style: none;
	gap: 0;
}

.ogniwo-menu li,
.ogniwo-menu .wp-block-navigation-item,
.ogniwo-menu .wp-block-pages-list__item {
	display: list-item;
	margin: 0;
	padding: 0;
	line-height: 24px;
	border-bottom: 1px solid #ececec;
}

.ogniwo-menu li:last-child,
.ogniwo-menu .wp-block-navigation-item:last-child {
	border-bottom: none;
}

.ogniwo-menu a,
.ogniwo-menu a:link,
.ogniwo-menu a:visited {
	display: block;
	padding: 0 2px;
	color: #99151b;
	font-size: 12px;
	font-weight: normal;
	line-height: 24px;
	text-decoration: none;

}

.ogniwo-menu a:hover,
.ogniwo-menu .current-menu-item > a {
	color: #696969;
	text-decoration: underline;
}

/* Podmenu rozwijane w pionie, bez nakładki */
.ogniwo-menu .wp-block-navigation__submenu-container {
	position: static;
	width: auto;
	min-width: 0;
	padding: 0;
	background: transparent;
	border: none;
	box-shadow: none;
	opacity: 1;
	visibility: visible;
}

.ogniwo-menu .wp-block-navigation__submenu-container a {
	padding-left: 16px;
	color: #696969;
	font-size: 11px;
	line-height: 22px;
	text-transform: none;
	background-image: url( assets/images/vsubitem.gif );
	background-repeat: repeat-x;
	background-position: 0 0;
}

/* =========================================================
   6. Karta wpisu (odpowiednik .art-post)
   ========================================================= */

.ogniwo-post,
.is-style-ogniwo-post,
.ogniwo-main .wp-block-post {
	box-sizing: border-box;
	margin: 3px;
	padding: 15px;
	background-color: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 9px;
	box-shadow: 0 0 3px rgba( 0, 0, 0, 0.06 );
}

/* Gdy karta jest zagnieżdżona w elemencie pętli, nie dubluj ramki. */
.ogniwo-main .wp-block-post .ogniwo-post {
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 0;
	box-shadow: none;
}

.ogniwo-postheader,
.ogniwo-post h2,
.is-style-ogniwo-post h2 {
	margin: 0.2em 0;
	padding: 0;
	color: #99151b;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 22px;
	font-weight: bold;
	line-height: 1.2;
	text-align: left;
}

.ogniwo-postheader a,
.ogniwo-postheader a:link,
.ogniwo-postheader a:visited,
.ogniwo-postheader a:hover {
	color: #99151b;
	text-decoration: none;
}

.ogniwo-postmeta {
	margin: 0;
	padding: 1px 0 6px;
	color: #878787;
	font-size: 11px;
	line-height: 18px;
}

.ogniwo-postmeta a {
	color: #878787;
}

.ogniwo-postcontent {
	margin-top: 4px;
}

/* =========================================================
   7. Typografia treści
   ========================================================= */

a,
a:link,
a:visited {
	color: #99151b;
	text-decoration: none;
}

a:hover {
	color: #696969;
	text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
	color: #99151b;
	text-align: left;
}

h1 { margin: 0.67em 0; font-size: 28px; }
h2 { margin: 0.8em 0;  font-size: 22px; }
h3 { margin: 1em 0;    font-size: 18px; }
h4 { margin: 1.25em 0; font-size: 16px; }
h5 { margin: 1.67em 0; font-size: 14px; }
h6 { margin: 2.33em 0; font-size: 14px; }

.ogniwo-main p {
	margin: 0.5em 0;
}

.ogniwo-post ul,
.ogniwo-post ol,
.ogniwo-postcontent ul,
.ogniwo-postcontent ol {
	margin: 1em 0 1em 2em;
	padding: 0;
	color: #99151b;
}

.ogniwo-post ul,
.ogniwo-postcontent ul {
	list-style-type: none;
}

.ogniwo-post ul li,
.ogniwo-postcontent ul li {
	margin: 0.2em 0;
	padding-left: 12px;
	line-height: 1.4em;
	background-image: url( assets/images/postbullets.png );
	background-repeat: no-repeat;
	background-position: 0 0.45em;
}

.ogniwo-post ol li,
.ogniwo-postcontent ol li {
	margin: 0.2em 0;
	padding-left: 0;
	background: none;
}

.ogniwo-post table,
.ogniwo-postcontent table {
	width: auto;
	border-collapse: collapse;
	margin: 1px;
}

.ogniwo-post th,
.ogniwo-postcontent th {
	padding: 7px;
	text-align: center;
	vertical-align: middle;
}

img {
	max-width: 100%;
	height: auto;
	border: 0;
}

/* =========================================================
   8. Paginacja (odpowiednik listy stron Joomla)
   ========================================================= */

.ogniwo-pagination {
	margin: 10px 3px;
	padding: 8px 0;
	color: #696969;
	font-size: 12px;
	text-align: center;
	justify-content: center;
}

.ogniwo-pagination a,
.ogniwo-pagination .page-numbers {
	color: #99151b;
}

.ogniwo-pagination .page-numbers.current {
	color: #696969;
	font-weight: bold;
	text-decoration: none;
}

/* =========================================================
   9. Stopka (odpowiednik .art-footer)
   ========================================================= */

.ogniwo-footer {
	position: relative;
	box-sizing: border-box;
	width: 998px;
	max-width: 100%;
	margin: 0 auto;
	padding: 25px;
	overflow: hidden;
	background-image: url( assets/images/footer_t.png );
	background-repeat: repeat-x;
	background-position: left bottom;
}

.ogniwo-footer,
.ogniwo-footer p,
.ogniwo-footer a,
.ogniwo-footer a:link,
.ogniwo-footer a:visited {
	color: #878787;
	font-size: 11px;
	line-height: 150%;
	text-align: center;
}

.ogniwo-footer p {
	margin: 0;
}

.ogniwo-footer a,
.ogniwo-footer a:link {
	text-decoration: underline;
}

.ogniwo-footer a:hover {
	color: #99151b;
	text-decoration: underline;
}

/*
 * Podpis "Dumnie wspierane przez WordPress": na stronie głównej odnośnik,
 * na podstronach przycisk. Oba muszą wyglądać identycznie.
 */
button.ogniwo-credit,
.ogniwo-footer button.ogniwo-credit {
	appearance: none;
	-webkit-appearance: none;
	display: inline;
	width: auto;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 0;
	color: #878787;
	font: inherit;
	letter-spacing: inherit;
	line-height: inherit;
	text-align: inherit;
	text-decoration: underline;
	text-transform: none;
	vertical-align: baseline;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
}

button.ogniwo-credit:hover,
.ogniwo-footer button.ogniwo-credit:hover {
	color: #99151b;
	text-decoration: underline;
}

button.ogniwo-credit:focus-visible {
	outline: 1px dotted #99151b;
	outline-offset: 2px;
}

/* =========================================================
   10. Formularze i wyszukiwarka
   ========================================================= */

input,
select,
textarea {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	vertical-align: middle;
}

.wp-block-search__button,
.wp-block-button__link {
	height: 23px;
	padding: 0 13px;
	color: #99151b;
	font-size: 12px;
	line-height: 23px;
	background-color: #ededed;
	border: 1px solid #d0d0d0;
	border-radius: 3px;
}

.wp-block-search__button:hover,
.wp-block-button__link:hover {
	color: #878787;
}

/* =========================================================
   11. Uzupełnienia dla bloków WordPressa
   ========================================================= */

.ogniwo-layout-full {
	width: 998px;
	max-width: 100%;
	margin: 0 auto;
}

.wp-block-post-template {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ogniwo-postmeta.wp-block-group {
	gap: 6px;
	align-items: baseline;
}

.ogniwo-postmeta .wp-block-post-date,
.ogniwo-postmeta .wp-block-post-author,
.ogniwo-postmeta .wp-block-post-author__content,
.ogniwo-postmeta .wp-block-post-author__byline {
	margin: 0;
	color: #878787;
	font-size: 11px;
	line-height: 18px;
}

.ogniwo-postmeta .wp-block-post-author {
	display: flex;
	gap: 4px;
	align-items: baseline;
}

.ogniwo-post li,
.ogniwo-postcontent li {
	color: #696969;
}

.ogniwo-telefony {
	margin: 0.6em 0 0.6em 1.6em;
}

.ogniwo-nr {
	color: #99151b;
	font-weight: bold;
	white-space: nowrap;
}

.wp-block-post-navigation-link {
	display: inline-block;
	margin-right: 12px;
	font-size: 11px;
}

/* Rozwijana karta (blok "Szczegóły") — belka wygląda jak tytuł wpisu. */
.ogniwo-collapsible > summary {
	margin: 0.2em 0;
	color: #99151b;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 22px;
	font-weight: bold;
	line-height: 1.2;
}

.ogniwo-collapsible > summary::marker {
	color: #99151b;
}

/* =========================================================
   12. Odstępy w blokach składanych z kilku elementów
   -----------------------------------------------------------
   Motyw ma globalne blockGap = 0 (oryginał był bardzo ciasny),
   więc bloki złożone z kilku pod-bloków — paginacja, wyszukiwarka,
   komentarze — muszą dostać własne odstępy, inaczej się sklejają.
   Selektory dwuklasowe, żeby wygrać z klasami układu .wp-container-*.
   ========================================================= */

.ogniwo-pagination.wp-block-query-pagination {
	gap: 12px;
}

.ogniwo-pagination .wp-block-query-pagination-numbers {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: baseline;
}

.ogniwo-pagination .page-numbers {
	padding: 0 2px;
}

.ogniwo-pagination .wp-block-query-pagination-previous,
.ogniwo-pagination .wp-block-query-pagination-next {
	margin: 0;
}

.wp-block-search__inside-wrapper {
	gap: 6px;
}

.wp-block-search__input {
	padding: 2px 6px;
	border: 1px solid #d0d0d0;
	border-radius: 3px;
}

.wp-block-comments .wp-block-comment-author-name,
.wp-block-comments .wp-block-comment-date,
.wp-block-comments .wp-block-comment-content,
.wp-block-comments .wp-block-comment-reply-link {
	margin: 5px 0;
}

.wp-block-comment-template li + li {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid #ececec;
}

.wp-block-comments-pagination.wp-block-comments-pagination {
	gap: 12px;
	margin-top: 14px;
}

.ogniwo-footer p + p {
	margin-top: 5px;
}

/* =========================================================
   13. Wersja mobilna (oryginał ma stały układ 1000 px)
   ========================================================= */

/* --- do 1040 px: arkusz rozciąga się na całą szerokość okna --- */
@media ( max-width: 1040px ) {

	.wp-site-blocks {
		width: auto;
		margin: 0;
		border: none;
		border-radius: 0;
	}

	.ogniwo-header {
		width: auto;
		height: 0;
		padding-bottom: 20.04%; /* 200 / 998 */
		background-size: contain;
		background-position: center top;
	}

	.ogniwo-layout.wp-block-columns,
	.ogniwo-layout-full,
	.ogniwo-footer {
		width: auto;
	}
}

/* --- do 781 px: kolumny jedna pod drugą --- */
@media ( max-width: 781px ) {

	.ogniwo-layout.wp-block-columns {
		flex-wrap: wrap;
	}

	.ogniwo-sidebar.wp-block-column,
	.ogniwo-main.wp-block-column {
		flex-basis: 100% !important;
	}

	/* Kolejność: menu (hamburger) → treść → dane adresowe. */
	.ogniwo-layout > .ogniwo-sidebar:first-child {
		order: 1;
	}

	.ogniwo-layout > .ogniwo-main {
		order: 2;
	}

	.ogniwo-layout > .ogniwo-sidebar:last-child {
		order: 3;
	}

	.ogniwo-block {
		margin: 8px;
	}

	.ogniwo-post,
	.ogniwo-main .wp-block-post {
		margin: 8px 4px;
	}

	.ogniwo-postheader,
	.ogniwo-post h2,
	.ogniwo-collapsible > summary {
		font-size: 19px;
	}

	/* --- Menu zwinięte pod belkę z hamburgerem --- */
	.ogniwo-menu-toggle > summary {
		padding-right: 34px;
	}

	.ogniwo-menu-toggle > summary::after {
		content: "\2630";
	}

	.ogniwo-menu a,
	.ogniwo-menu a:link,
	.ogniwo-menu a:visited {
		font-size: 15px;
		line-height: 40px;
	}

	/* --- Ważne telefony: zwijane, belka jest przyciskiem --- */
	.ogniwo-collapsible > summary {
		cursor: pointer;
		padding: 2px 0;
	}

	.ogniwo-telefony {
		margin-left: 1.2em;
	}

	.ogniwo-telefony li {
		margin: 0.5em 0;
		line-height: 1.5;
	}
}

/* --- od 782 px: "Ważne telefony" zawsze rozwinięte, bez trójkąta --- */
@media ( min-width: 782px ) {

	.ogniwo-collapsible > summary {
		cursor: default;
		list-style: none;
		pointer-events: none;
	}

	.ogniwo-collapsible > summary::marker {
		content: "";
	}

	.ogniwo-collapsible > summary::-webkit-details-marker {
		display: none;
	}

	/* Belka menu zachowuje się jak zwykły nagłówek bloku. */
	.ogniwo-menu-toggle > summary {
		cursor: default;
		pointer-events: none;
	}
}

/* Lista podstron na stronie bez własnej treści (dawny widok kategorii). */
.ogniwo-podstrony {
	margin: 1em 0 1em 2em;
	padding: 0;
	color: #99151b;
	list-style-position: outside;
}

.ogniwo-podstrony li {
	margin: 0.4em 0;
	padding: 0;
	color: #696969;
	line-height: 1.5;
	background: none;
}

.ogniwo-podstrony a {
	color: #99151b;
}

.ogniwo-podstrony a:hover {
	color: #696969;
	text-decoration: underline;
}

/* Treści podstron doklejone pod treścią strony nadrzędnej. */
.ogniwo-podstrona {
	margin-top: 22px;
	padding-top: 16px;
	border-top: 1px solid #ececec;
}

.ogniwo-podstrona-tytul {
	margin: 0 0 0.4em;
	font-size: 18px;
	font-weight: bold;
	line-height: 1.3;
}

.ogniwo-podstrona-tytul a,
.ogniwo-podstrona-tytul a:link,
.ogniwo-podstrona-tytul a:visited {
	color: #99151b;
	text-decoration: none;
}

.ogniwo-podstrona-tytul a:hover {
	text-decoration: underline;
}
