/*
Theme Name: Tiina käsitöö – kompaktne päis
Theme URI: https://blogi.tiinabutiik.ee/
Author: Tiina Butiik
Description: Tiina Butiigi kerge Gutenbergiga sobiv blogiteema.
Version: 0.3.1-dev
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: tiina-butiik-blog
*/

:root {
  --tb-paper: #fffdfb;
  --tb-page: #f7f3ef;
  --tb-lavender: #d7c7d5;
  --tb-lavender-light: #f1eaf1;
  --tb-plum: #5f4359;
  --tb-brown: #4b2e2e;
  --tb-muted: #786b73;
  --tb-line: rgba(75, 46, 46, 0.15);
  --tb-shadow: 0 10px 32px rgba(75, 46, 46, 0.08);
  --tb-radius: 14px;
  --tb-content: 760px;
  --tb-wide: 1725px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--tb-brown);
  background: var(--tb-page);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.7;
}

img,
video,
iframe { max-width: 100%; }

img { height: auto; }

a {
  color: var(--tb-plum);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover,
a:focus-visible { color: #7a4f6d; }

:focus-visible {
  outline: 3px solid #b181a4;
  outline-offset: 3px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100000;
  width: auto;
  height: auto;
  padding: 0.7rem 1rem;
  clip: auto;
  background: #fff;
}

.tb-shell {
  width: min(calc(100% - 32px), var(--tb-wide));
  margin-inline: auto;
}

.tb-site-header {
  background: var(--tb-paper);
  border-bottom: 1px solid var(--tb-line);
}

.tb-banner-wrap {
  position: relative;
  height: 160px;
  overflow: hidden;
  border-radius: 0 0 16px 16px;
  background: var(--tb-lavender-light);
}

.tb-header-photo {
  position: absolute;
  inset: 0;
}

.tb-header-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
}

.tb-banner-identity {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 150px);
  padding: 10px 16px;
  border: 1px solid rgba(75, 46, 46, 0.14);
  border-radius: 14px;
  background: rgba(255, 253, 251, 0.9);
  box-shadow: 0 8px 24px rgba(75, 46, 46, 0.16);
  transform: translateY(-50%);
  backdrop-filter: blur(4px);
}

.tb-banner-logo { display: flex; }

.tb-banner-logo img {
  display: block;
  width: auto;
  max-height: 58px;
  filter: drop-shadow(0 5px 10px rgba(75, 46, 46, 0.16));
}

.tb-brand-copy { display: grid; gap: 3px; }

.tb-site-title {
  color: var(--tb-brown);
  font: 700 clamp(27px, 2.6vw, 35px)/1.05 Georgia, serif;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

.tb-banner-tagline {
  display: block;
  color: var(--tb-muted);
  font-size: 15px;
  letter-spacing: 0.04em;
}

.tb-navigation {
  position: relative;
  background: transparent;
}

.tb-navigation > .tb-shell {
  background: var(--tb-lavender);
}

.tb-menu-toggle {
  display: none;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  color: var(--tb-brown);
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.tb-menu,
.tb-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tb-menu {
  display: flex;
  flex-wrap: wrap;
  width: calc(100% - 368px);
  justify-content: space-between;
  padding-left: 18px;
  padding-right: 0;
  gap: 0;
}

html[lang^="en"] .tb-menu {
  width: 100%;
  padding-right: 18px;
}

.tb-menu li { position: relative; }

.tb-menu a {
  display: block;
  padding: 15px 10px;
  color: #5c3b2e;
  font-size: 18px;
  font-weight: 300;
  line-height: 22px;
  text-decoration: none;
}

.tb-menu a:hover,
.tb-menu a:focus-visible,
.tb-menu .current-menu-item > a,
.tb-menu .current-menu-ancestor > a { background: rgba(255, 255, 255, 0.45); }

.tb-menu .sub-menu {
  position: absolute;
  z-index: 100;
  top: 100%;
  left: 0;
  display: none;
  min-width: 250px;
  max-width: 320px;
  background: var(--tb-paper);
  border: 1px solid var(--tb-line);
  box-shadow: var(--tb-shadow);
}

.tb-menu .sub-menu .sub-menu { top: 0; left: 100%; }
.tb-menu li:hover > .sub-menu,
.tb-menu li:focus-within > .sub-menu { display: block; }

.tb-main {
  padding-block: 34px 54px;
}

.tb-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 340px;
  grid-template-areas: 'left main right';
  gap: 28px;
  align-items: start;
}

.tb-content,
.tb-entry,
.tb-page-card {
  min-width: 0;
}

.tb-content { grid-area: main; }
.tb-sidebar-primary { grid-area: left; }
.tb-sidebar-secondary { grid-area: right; }

.tb-sidebar,
.tb-widget-zone,
.tb-widget-zone > * {
  min-width: 0;
  width: 100%;
}

.tb-sidebar iframe,
.tb-sidebar img,
.tb-sidebar video {
  max-width: 100%;
}

.tb-sidebar .wp-block-search__inside-wrapper {
  min-width: 0;
}

.tb-sidebar .wp-block-search__input {
  min-width: 0;
}

.tb-sidebar .wp-block-search__button {
  padding: 0.55rem 0.7rem;
  white-space: nowrap;
}

.tb-sidebar-primary #block-34 h6 {
  font-size: 17px;
  line-height: 1.4;
}

.tb-sidebar-primary #block-74 p {
  font-size: 17px !important;
  line-height: 1.7;
}

.tb-sidebar-primary #block-74 code {
  font-family: inherit;
  font-size: inherit;
}

.tb-sidebar-secondary #block-52 {
  display: none;
}

.tb-sidebar-secondary .widget p,
.tb-sidebar-secondary .widget h3,
.tb-sidebar-secondary .widget a,
.tb-sidebar-secondary .widget label,
.tb-sidebar-secondary .widget button {
  font-size: 17px !important;
}

.tb-entry,
.tb-page-card,
.tb-archive-header,
.tb-empty {
  padding: clamp(22px, 4vw, 42px);
  background: var(--tb-paper);
  border: 1px solid var(--tb-line);
  border-radius: var(--tb-radius);
  box-shadow: var(--tb-shadow);
}

.tb-entry-title,
.tb-page-title,
.tb-archive-title {
  margin: 0 0 0.75rem;
  color: var(--tb-brown);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
}

.tb-entry-title a { color: inherit; text-decoration: none; }
.tb-entry-meta { margin: 0 0 1.5rem; color: var(--tb-muted); font-size: 0.9rem; }
.tb-entry-content > :first-child { margin-top: 0; }
.tb-entry-content > :last-child { margin-bottom: 0; }
.tb-entry-content h2,
.tb-entry-content h3 { line-height: 1.25; }

.tb-entry-content .alignwide {
  width: min(100vw - 64px, 980px);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.tb-entry-content .alignfull {
  width: 100vw;
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.wp-block-image img,
.wp-block-media-text,
.wp-block-gallery { border-radius: 10px; }

.wp-block-embed iframe,
.wp-block-video video { display: block; width: 100%; }

.tb-sidebar {
  display: grid;
  gap: 20px;
}

.tb-widget-zone {
  display: grid;
  gap: 18px;
}

.widget {
  overflow-wrap: anywhere;
  padding: 18px;
  background: var(--tb-paper);
  border: 1px solid var(--tb-line);
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(75, 46, 46, 0.05);
}

.widget > :first-child { margin-top: 0; }
.widget > :last-child { margin-bottom: 0; }
.widget-title { margin: 0 0 0.8rem; font-size: 1.15rem; }
.widget iframe { display: block; width: 100%; border: 0; }

.tb-post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.tb-post-card {
  overflow: hidden;
  background: var(--tb-paper);
  border: 1px solid var(--tb-line);
  border-radius: var(--tb-radius);
  box-shadow: var(--tb-shadow);
}

.tb-post-card-image { display: block; aspect-ratio: 4 / 3; background: var(--tb-lavender-light); }
.tb-post-card-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tb-post-card-body { padding: 18px; }
.tb-post-card-title { margin: 0 0 0.65rem; font-family: Georgia, 'Times New Roman', serif; font-size: 1.35rem; line-height: 1.25; }
.tb-post-card-title a { color: var(--tb-brown); text-decoration: none; }
.tb-post-card-date { color: var(--tb-muted); font-size: 0.82rem; }
.tb-post-card-excerpt { margin-bottom: 0; font-size: 0.95rem; }

.navigation.pagination { margin-top: 30px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { padding: 7px 11px; background: var(--tb-paper); border: 1px solid var(--tb-line); border-radius: 8px; text-decoration: none; }
.page-numbers.current { background: var(--tb-lavender); font-weight: 700; }

.tb-comments { margin-top: 26px; padding: clamp(20px, 4vw, 34px); background: var(--tb-paper); border: 1px solid var(--tb-line); border-radius: var(--tb-radius); }
.comment-list { padding-left: 1.2rem; }

.tb-site-footer {
  color: var(--tb-brown);
  background: var(--tb-lavender);
}

.tb-footer-widgets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding-block: 26px 10px;
}

.tb-footer-widgets .widget { background: rgba(255, 255, 255, 0.3); box-shadow: none; }

.tb-footer-bottom { padding: 18px 0 24px; text-align: center; }
.tb-footer-bottom p { margin: 0.2rem 0; }
.tb-team-link { display: inline-flex; align-items: center; gap: 7px; color: inherit; text-decoration: none; }
.tb-team-link img { width: auto; height: 25px; }

.tb-title-en,
.tb-copy-en { display: none; }
html[lang^='en'] .tb-title-et,
html[lang^='en'] .tb-copy-et { display: none; }
html[lang^='en'] .tb-title-en,
html[lang^='en'] .tb-copy-en { display: inline; }

.tb-back-to-top {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 999;
  display: block;
  width: 70px;
  height: 84px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
  background: url('https://blogi.tiinabutiik.ee/wp-content/uploads/2026/05/maimu-redel-1.png') center / contain no-repeat;
  cursor: pointer;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.tb-back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

@media (max-width: 1100px) {
  .tb-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'main' 'left' 'right';
  }
  .tb-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .tb-shell { width: min(calc(100% - 22px), var(--tb-wide)); }
  .tb-banner-wrap { height: 110px; border-radius: 0 0 11px 11px; }
  .tb-banner-identity { left: 8px; gap: 7px; max-width: calc(100% - 82px); padding: 7px 9px; border-radius: 10px; }
  .tb-banner-logo img { max-height: 40px; }
  .tb-site-title { font-size: 20px; }
  .tb-banner-tagline { font-size: 11px; line-height: 1.25; letter-spacing: 0; }
  .tb-menu-toggle { display: block; }
  .tb-menu { display: none; width: 100%; padding-inline: 0; flex-direction: column; align-items: stretch; }
  .tb-navigation.is-open .tb-menu { display: flex; }
  .tb-menu a { padding-block: 12px; font-size: 16px; }
  .tb-menu .sub-menu,
  .tb-menu .sub-menu .sub-menu {
    position: static;
    display: none;
    max-width: none;
    border: 0;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.33);
  }
  .tb-navigation.is-open .tb-menu .sub-menu { display: block; }
  .tb-menu li.is-submenu-open > .sub-menu { display: block; }
  .tb-menu .sub-menu a { padding-left: 30px; font-weight: 600; }
  .tb-menu .sub-menu .sub-menu a { padding-left: 45px; }
  .tb-main { padding-block: 22px 40px; }
  .tb-sidebar,
  .tb-footer-widgets,
  .tb-post-grid { grid-template-columns: 1fr; }
  .tb-entry,
  .tb-page-card,
  .tb-archive-header { padding: 22px 18px; }
  .tb-entry-content .alignwide,
  .tb-entry-content .alignfull { width: calc(100vw - 22px); }
  .tb-back-to-top { width: 58px; height: 70px; right: 7px; bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
@media (min-width: 1101px) {
	.tb-post-grid:has(> .tb-post-card:only-child) {
		grid-template-columns: minmax(0, 440px);
		justify-content: center;
	}

	.tb-post-grid:has(> .tb-post-card:only-child) .tb-post-card-image {
		aspect-ratio: auto;
	}

	.tb-post-grid:has(> .tb-post-card:only-child) .tb-post-card-image img {
		height: auto;
		object-fit: contain;
	}
}
.tb-sidebar-secondary .tb-widget-zone {
	gap: 30px;
}
.tb-sidebar-secondary {
	align-self: start;
}

/* Let clicks pass through the assistant wrapper to the separate up button. */
.tiina-maimu { pointer-events: none; }
.tiina-maimu__launcher, .tiina-maimu__panel { pointer-events: auto; }
