/*
Theme Name:        the frame
Description:       Motyw do wizualnego studia sekcji. Po włączeniu otwiera studio „the frame”, w którym składasz stronę główną z gotowych sekcji i publikujesz ją jednym kliknięciem. Wpisy, strony i archiwa mają kilka układów do wyboru w the frame → Ustawienia. Zawiera wtyczkę „the frame studio” — po włączeniu motywu instaluje ją i aktualizuje automatycznie.
Version:           1.1.0
Requires at least: 6.4
Requires PHP:      8.0
Author:            the frame
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       the-frame
Tags:              blog, one-column, grid-layout, custom-colors, custom-menu, featured-images, full-width-template, sticky-post
*/

/* Wpisy, strony i archiwa. Kolory, fonty i zaokrąglenia pochodzą ze stylu opublikowanego w studiu
   (zmienne --brand, --ink, --bg, --paper, --dark, --r, --display, --sans na <body>). */
.tf-theme {
	--brand: #a995cb; --ink: #14161b; --bg: #fff; --paper: #f6f3ee; --dark: #14161b; --r: 16px;
	--display: Fraunces, Georgia, serif; --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
	--muted: color-mix(in srgb, var(--ink) 62%, var(--bg));
	--line: color-mix(in srgb, var(--ink) 12%, var(--bg));
	--soft: color-mix(in srgb, var(--paper) 70%, var(--bg));
	--on-brand: #fff;
	--container: 1200px; --narrow: 720px;
	margin: 0; background: var(--bg); color: var(--ink);
	font: 17px/1.7 var(--sans); -webkit-font-smoothing: antialiased;
}
.tf-theme *, .tf-theme *::before, .tf-theme *::after { box-sizing: border-box; }
.tf-theme img { max-width: 100%; height: auto; }
.tf-theme a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.tf-theme a:hover { text-decoration-color: currentColor; }
.tf-theme :focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.tf-skip:focus { position: fixed; top: 12px; left: 12px; z-index: 1000; width: auto; height: auto; clip: auto; padding: 10px 16px; background: var(--bg); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tf-container { width: min(var(--container), 100% - 48px); margin-inline: auto; }
.tf-display { font-family: var(--display); font-weight: 500; letter-spacing: -.02em; line-height: 1.08; }
.tf-eyebrow { display: inline-block; margin-bottom: 14px; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tf-lead { font-size: 20px; line-height: 1.6; color: var(--muted); max-width: 62ch; }
.tf-button, .tf-theme .wp-element-button, .tf-theme input[type="submit"] {
	display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border: 0; border-radius: calc(var(--r) * 2);
	background: var(--ink); color: var(--bg); font: 500 15px/1.2 var(--sans); text-decoration: none; cursor: pointer;
	transition: transform .3s cubic-bezier(.2, .7, .2, 1), background .2s;
}
.tf-button:hover, .tf-theme input[type="submit"]:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--ink) 85%, var(--brand)); }

/* Pasek postępu czytania */
.tf-progress { position: fixed; inset: 0 0 auto; z-index: 200; height: 3px; background: var(--brand); transform: scaleX(0); transform-origin: left; }

/* Nagłówek */
.tf-site-header { position: relative; z-index: 100; background: var(--bg); border-bottom: 1px solid var(--line); }
.tf-site-header.is-sticky { position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); }
.admin-bar .tf-site-header.is-sticky { top: 32px; }
@media (max-width: 782px) { .admin-bar .tf-site-header.is-sticky { top: 46px; } }
.tf-header-row { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.tf-logo { font-family: var(--display); font-size: 25px; font-weight: 600; letter-spacing: -.02em; text-decoration: none !important; }
.tf-nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.tf-menu { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 0; padding: 0; list-style: none; }
.tf-menu a { font-size: 15px; text-decoration: none; opacity: .8; }
.tf-menu a:hover, .tf-menu .current-menu-item > a, .tf-menu .current_page_item > a { opacity: 1; text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.tf-menu li { position: relative; }
.tf-menu .sub-menu { position: absolute; top: 100%; left: -16px; display: none; min-width: 200px; margin: 0; padding: 10px 0; list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .25); }
.tf-menu li:hover > .sub-menu, .tf-menu li:focus-within > .sub-menu { display: block; }
.tf-menu .sub-menu a { display: block; padding: 6px 16px; }
.tf-search input { width: 180px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: inherit; font: inherit; font-size: 14px; }
.tf-header-centered .tf-header-row { flex-direction: column; justify-content: center; gap: 10px; padding: 18px 0 14px; }
.tf-header-centered .tf-nav { margin: 0; }
.tf-header-dark { background: var(--dark); color: #fff; border-color: transparent; }
.tf-header-dark.is-sticky { background: color-mix(in srgb, var(--dark) 92%, transparent); }
.tf-header-dark .tf-button { background: var(--brand); color: var(--ink); }
.tf-header-brand { background: var(--brand); color: var(--ink); border-color: transparent; }
.tf-header-brand.is-sticky { background: color-mix(in srgb, var(--brand) 94%, transparent); }
.tf-header-dark .sub-menu, .tf-header-brand .sub-menu { color: var(--ink); }
.tf-nav-toggle, .tf-burger { display: none; }
@media (max-width: 860px) {
	.tf-burger { display: grid; gap: 6px; margin-left: auto; padding: 10px; cursor: pointer; }
	.tf-burger span { display: block; width: 24px; height: 2px; background: currentColor; transition: transform .3s; }
	.tf-nav { display: none; position: absolute; inset: 100% 0 auto; flex-direction: column; align-items: flex-start; padding: 20px 24px 28px; background: inherit; border-bottom: 1px solid var(--line); }
	.tf-header-centered .tf-nav { inset: 100% 0 auto; }
	.tf-nav-toggle:checked ~ .tf-nav { display: flex; }
	.tf-nav-toggle:checked ~ .tf-burger span:first-child { transform: translateY(4px) rotate(45deg); }
	.tf-nav-toggle:checked ~ .tf-burger span:last-child { transform: translateY(-4px) rotate(-45deg); }
	.tf-menu { flex-direction: column; }
	.tf-menu .sub-menu { position: static; display: block; border: 0; box-shadow: none; background: none; }
	.tf-header-centered .tf-header-row { flex-direction: row; justify-content: space-between; min-height: 68px; padding: 0; }
}

.tf-main { min-height: 50vh; }

/* Lista wpisów */
.tf-archive-head { padding: clamp(56px, 9vw, 120px) 0 clamp(36px, 5vw, 64px); }
.tf-archive-head h1 { margin: 0 0 18px; font-size: clamp(44px, 7vw, 88px); }
.tf-archive-head .search-form { margin-top: 24px; }
.tf-posts { display: grid; gap: 48px 32px; padding-bottom: 40px; }
.tf-posts-grid.tf-cols-3, .tf-posts-magazine.tf-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tf-posts-grid.tf-cols-2, .tf-posts-magazine.tf-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tf-posts-magazine .tf-card-big { grid-column: 1 / -1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.tf-posts-magazine .tf-card-big .tf-card-title { font-size: clamp(30px, 3.6vw, 48px); }
.tf-posts-list { grid-template-columns: 1fr; gap: 0; }
.tf-posts-list .tf-card { display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: center; padding: 36px 0; border-top: 1px solid var(--line); }
.tf-posts-list .tf-card:not(:has(.tf-card-media)) { grid-template-columns: 1fr; }
@media (max-width: 960px) { .tf-posts-grid.tf-cols-3, .tf-posts-magazine.tf-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
	.tf-posts-grid, .tf-posts-magazine { grid-template-columns: 1fr !important; }
	.tf-posts-magazine .tf-card-big, .tf-posts-list .tf-card { grid-template-columns: 1fr; gap: 18px; }
}
.tf-card { display: flex; flex-direction: column; gap: 18px; }
.tf-card-media { display: block; overflow: hidden; aspect-ratio: 4 / 3; border-radius: var(--r); background: var(--paper); }
.tf-card-big .tf-card-media { aspect-ratio: 16 / 10; }
.tf-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.tf-card:hover .tf-card-media img { transform: scale(1.05); }
.tf-card-placeholder { display: grid; place-items: center; height: 100%; font: 500 72px/1 var(--display); color: color-mix(in srgb, var(--brand) 70%, var(--ink)); background: color-mix(in srgb, var(--brand) 18%, var(--paper)); }
.tf-card-body { display: flex; flex-direction: column; gap: 10px; }
.tf-card-title { margin: 0; font: 500 26px/1.18 var(--display); letter-spacing: -.015em; }
.tf-card-title a { text-decoration: none; }
.tf-card-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.tf-card-excerpt { margin: 0; color: var(--muted); font-size: 16px; }
.tf-more { align-self: flex-start; font-size: 15px; font-weight: 500; text-decoration: none !important; }
.tf-more span { display: inline-block; transition: transform .3s; }
.tf-more:hover span { transform: translateX(4px); }
.tf-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; color: var(--muted); }
.tf-dot { opacity: .5; }
.tf-tag { padding: 3px 11px; border-radius: 99px; background: color-mix(in srgb, var(--brand) 22%, var(--bg)); color: var(--ink); font-size: 13px; font-weight: 500; text-decoration: none !important; }
.sticky .tf-card-title::before { content: '★ '; color: var(--brand); }

.tf-pagination { padding: 24px 0 96px; }
.tf-pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tf-pagination .page-numbers { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; }
.tf-pagination .page-numbers.current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tf-empty-state { padding: 40px 0 120px; color: var(--muted); }

/* Wyszukiwarka */
.search-form { display: flex; gap: 8px; max-width: 520px; }
.search-form label { flex: 1; }
.search-form .search-field { width: 100%; padding: 13px 18px; border: 1px solid var(--line); border-radius: 99px; background: var(--bg); color: inherit; font: inherit; }

/* Wpis i strona */
.tf-single { padding-bottom: 40px; }
.tf-entry-head { width: min(var(--narrow), 100% - 48px); margin: 0 auto; padding: clamp(48px, 8vw, 104px) 0 40px; }
.tf-entry-head h1 { margin: 16px 0 18px; font-size: clamp(40px, 6vw, 72px); }
.tf-entry-head .tf-lead { margin: 0; }
.tf-entry-image { margin: 40px 0 0; }
.tf-entry-image img { display: block; width: 100%; border-radius: var(--r); }
.tf-content { width: min(var(--narrow), 100% - 48px); margin-inline: auto; }
.tf-content > * { margin-block: 0 1.4em; }
.tf-content h2, .tf-content h3, .tf-content h4 { margin-top: 1.8em; font-family: var(--display); font-weight: 500; letter-spacing: -.015em; line-height: 1.2; }
.tf-content h2 { font-size: 36px; } .tf-content h3 { font-size: 28px; } .tf-content h4 { font-size: 22px; }
.tf-content a { color: inherit; text-decoration-color: var(--brand); text-decoration-thickness: 2px; }
.tf-content blockquote { margin-inline: 0; padding: 4px 0 4px 28px; border-left: 3px solid var(--brand); font: italic 400 24px/1.5 var(--display); }
.tf-content pre { overflow: auto; padding: 20px; border-radius: var(--r); background: var(--paper); font-size: 15px; }
.tf-content figure img, .tf-content .wp-block-image img { border-radius: calc(var(--r) * .6); }
.tf-content figcaption { color: var(--muted); font-size: 14px; text-align: center; }
.tf-content hr { border: 0; border-top: 1px solid var(--line); margin-block: 3em; }
.tf-content table { width: 100%; border-collapse: collapse; }
.tf-content th, .tf-content td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.tf-content .alignwide { width: min(1100px, 100vw - 48px); margin-inline: calc(50% - min(550px, 50vw - 24px)); max-width: none; }
.tf-content .alignfull { width: 100vw; margin-inline: calc(50% - 50vw); max-width: none; }
.tf-content .alignleft { float: left; margin: 0 24px 16px 0; } .tf-content .alignright { float: right; margin: 0 0 16px 24px; }

.tf-layout-wide .tf-entry-head, .tf-layout-wide .tf-content { width: min(1000px, 100% - 48px); }
.tf-layout-full .tf-entry-head { width: min(var(--container), 100% - 48px); }
.tf-layout-full .tf-content { width: 100%; }
.tf-layout-full .tf-content > :not(.alignfull):not(.alignwide) { width: min(var(--container), 100% - 48px); margin-inline: auto; }
.tf-layout-landing .tf-content { width: 100%; }
.tf-layout-landing .tf-content > :not(.alignfull):not(.alignwide) { width: min(var(--container), 100% - 48px); margin-inline: auto; }

.tf-cover {
	display: grid; align-items: end; width: 100%; min-height: min(78vh, 760px); margin-bottom: 56px; padding: 48px 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, .05) 30%, rgba(0, 0, 0, .7)), var(--img) center / cover no-repeat;
	color: #fff;
}
.tf-cover .tf-entry-head-text { width: min(1000px, 100% - 48px); margin: 0 auto; }
.tf-cover .tf-meta, .tf-cover .tf-lead { color: rgba(255, 255, 255, .85); }
.tf-cover .tf-tag { background: rgba(255, 255, 255, .2); color: #fff; }

.tf-layout-split .tf-entry-head { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; width: min(var(--container), 100% - 48px); }
.tf-layout-split .tf-entry-image { margin: 0; }
@media (max-width: 820px) { .tf-layout-split .tf-entry-head { grid-template-columns: 1fr; gap: 24px; } }

.tf-entry-foot { display: flex; flex-direction: column; gap: 28px; margin-top: 56px; }
.tf-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tf-tags a { padding: 5px 13px; border: 1px solid var(--line); border-radius: 99px; font-size: 14px; text-decoration: none; }
.tf-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 18px 0; border-block: 1px solid var(--line); font-size: 15px; }
.tf-share span { color: var(--muted); }
.tf-share a { font-weight: 500; text-decoration: none; }
.tf-share a:hover { color: color-mix(in srgb, var(--brand) 60%, var(--ink)); }
.tf-author { display: flex; gap: 20px; padding: 28px; border-radius: var(--r); background: var(--paper); }
.tf-author img { border-radius: 50%; flex: none; }
.tf-author p { margin: 6px 0 10px; color: var(--muted); font-size: 15px; }
.tf-prev-next .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tf-prev-next a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; }
.tf-prev-next a:hover { border-color: var(--ink); }
.tf-prev-next .nav-next { text-align: right; grid-column: 2; }
.tf-prev-next small { color: var(--muted); font-size: 13px; }
.tf-prev-next span { font-family: var(--display); font-size: 19px; line-height: 1.3; }

.tf-related { padding: 72px 0 40px; margin-top: 64px; border-top: 1px solid var(--line); }
.tf-related h2 { margin: 0 0 36px; font-size: clamp(32px, 4vw, 48px); }
.tf-related .tf-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tf-related .tf-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tf-related .tf-card-title { font-size: 22px; }

/* Komentarze */
.tf-comments { padding: 48px 0 80px; }
.tf-comments .comment-list { padding: 0; list-style: none; }
.tf-comments .comment-body { padding: 20px 0; border-bottom: 1px solid var(--line); }
.tf-comments textarea, .tf-comments input[type="text"], .tf-comments input[type="email"], .tf-comments input[type="url"] { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: calc(var(--r) * .5); background: var(--bg); color: inherit; font: inherit; }

/* Stopka */
.tf-site-footer { margin-top: 80px; padding: 64px 0 32px; background: var(--paper); }
.tf-footer-dark { background: var(--dark); color: #fff; }
.tf-footer-dark .tf-footer-brand p, .tf-footer-dark .tf-footer-bottom { color: rgba(255, 255, 255, .65); }
.tf-footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; padding-bottom: 40px; }
.tf-footer-brand { max-width: 420px; }
.tf-footer-brand p { margin: 12px 0 0; color: var(--muted); }
.tf-footer-columns .tf-footer-top { display: grid; grid-template-columns: 1fr 1fr; }
.tf-footer-columns .tf-footer-nav .tf-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 32px; }
.tf-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); font-size: 14px; color: var(--muted); }
@media (max-width: 640px) { .tf-footer-columns .tf-footer-top { grid-template-columns: 1fr; } .tf-prev-next .nav-links { grid-template-columns: 1fr; } .tf-prev-next .nav-next { grid-column: auto; } .tf-related .tf-posts { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { .tf-theme * { transition: none !important; } }
