/*
Theme Name: Kainapjūtė.lt
Description: Kainapjute.lt portalo tema: raudona ir balta, lenkiškų karpinių (wycinanki) ornamentai, zlotų monetų fonas.
Version: 0.3.1
Requires at least: 7.1
Requires PHP: 8.3
Text Domain: kainapjute
*/

/* Visa grafika (monetos, karpinių ornamentai, rozetė) sukurta Kainapjute.lt. */
:root {
  --kp-red: #c8161d;
  --kp-red-dark: #8f0f14;
  --kp-red-soft: #fdecec;
  --kp-ink: #1d2329;
  --kp-muted: #5f6870;
  --kp-line: #eadfca;
  --kp-cream: #faf6ea;
  --kp-paper: #ffffff;
  --kp-gold: #f2b705;
  --kp-green: #2f7d32;
  --kp-blue: #1e5aa8;
  --kp-radius: 16px;
  --kp-shadow: 0 1px 2px #2b1d0d14, 0 8px 24px -12px #2b1d0d33;
  --kp-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --site-accent: var(--kp-red);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background:
    linear-gradient(#faf6eae0, #faf6eae0),
    url(assets/monetos.svg) top center / 806px auto repeat,
    var(--kp-cream);
  color: var(--kp-ink);
  font: 1.0625rem/1.65 var(--kp-font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--kp-red); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--kp-red-dark); }
img { max-width: 100%; height: auto; }

/* Vėliavos juosta viršuje */
.site-flag { height: 6px; background: linear-gradient(#fff 0 50%, var(--kp-red) 50% 100%); box-shadow: 0 1px 0 #0000000f; }

.site-shell { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Antraštė */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0 18px;
}
.site-brand { display: flex; align-items: center; gap: 14px; }
.site-brand-mark { flex: 0 0 52px; width: 52px; height: 52px; background: url(assets/rozete.svg) center / contain no-repeat; }
.site-brand-text { display: grid; justify-items: start; gap: 6px; }
.site-brand a {
  display: inline-block;
  padding: .02em .36em .1em;
  color: #fff;
  background: var(--kp-red);
  font-size: clamp(1.6rem, 4.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.1;
  text-decoration: none;
  transform: rotate(-2deg);
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--kp-red-dark);
}
.site-brand a:hover { color: #fff; background: var(--kp-red-dark); }
.site-brand span { color: var(--kp-muted); font-size: .875rem; }
.site-header .search-form { display: flex; align-items: stretch; background: var(--kp-paper); border: 1.5px solid var(--kp-line); border-radius: 999px; overflow: hidden; box-shadow: var(--kp-shadow); }
.site-header .search-form label { display: flex; }
.site-header .search-field { width: clamp(120px, 22vw, 240px); min-height: 42px; padding: 6px 16px; border: 0; background: transparent; font: inherit; font-size: .9375rem; }
.site-header .search-field:focus { outline: none; }
.site-header .search-form:focus-within { border-color: var(--kp-red); }
.site-header .search-submit { padding: 0 18px; border: 0; background: var(--kp-red); color: #fff; font: 600 .875rem var(--kp-font); cursor: pointer; }
.site-header .search-submit:hover { background: var(--kp-red-dark); }

/* Meniu */
.site-menu { position: sticky; top: 0; z-index: 20; margin: 0 -20px; padding: 0 20px; background: #fffffff2; backdrop-filter: blur(8px); border-block: 1px solid var(--kp-line); }
.site-menu ul { display: flex; gap: 4px; margin: 0 auto; padding: 8px 0; max-width: 1120px; list-style: none; overflow-x: auto; scrollbar-width: none; }
.site-menu a { display: block; padding: 7px 14px; border-radius: 999px; color: var(--kp-ink); font-weight: 600; font-size: .9375rem; text-decoration: none; white-space: nowrap; }
.site-menu a:hover { background: var(--kp-red-soft); color: var(--kp-red-dark); }
.site-menu :is(.current_page_item, .current-cat) > a { background: var(--kp-red); color: #fff; }
.site-ornament { height: 30px; margin: 0 -20px; background: url(assets/wycinanka.svg) center / auto 30px repeat-x; opacity: .9; }

/* Išdėstymas */
.site-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; padding: 22px 0 48px; }
.site-content { min-width: 0; overflow-wrap: anywhere; }
.site-content > article, .site-content > .kp-panel, .kp-archive-head {
  padding: clamp(18px, 3.5vw, 36px);
  background: var(--kp-paper);
  border-radius: var(--kp-radius);
  box-shadow: var(--kp-shadow);
}
.site-content h1 { margin: 0 0 8px; font-size: clamp(1.85rem, 4.2vw, 2.6rem); line-height: 1.15; letter-spacing: -.02em; }
.site-content h2 { margin: 1.6em 0 .5em; font-size: clamp(1.3rem, 2.6vw, 1.6rem); line-height: 1.25; letter-spacing: -.01em; }
.site-content h3 { margin: 1.3em 0 .4em; font-size: 1.15rem; }
.site-content article > h2:first-of-type { margin-top: 1em; }
.site-content :is(ul, ol) { padding-left: 1.3em; }
.site-content li { margin: .25em 0; }
.site-content li::marker { color: var(--kp-red); }
.site-content .kp-week { padding: 0; }
.site-content .kp-week li { margin: 0; }
.site-content iframe { max-width: 100%; }
.site-meta { margin: 0 0 18px; font-size: .8125rem; }
.site-meta a { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--kp-red-soft); color: var(--kp-red-dark); font-weight: 600; text-decoration: none; }

/* Lentelės */
.site-content table { width: 100%; margin: 1em 0; border-collapse: separate; border-spacing: 0; font-size: .9375rem; border: 1px solid var(--kp-line); border-radius: 12px; overflow: hidden; }
.site-content :is(th, td) { padding: 9px 12px; border-bottom: 1px solid var(--kp-line); text-align: left; vertical-align: top; }
.site-content tr:last-child td { border-bottom: 0; }
.site-content thead th { background: var(--kp-red); color: #fff; font-weight: 600; }
.site-content tbody tr:nth-child(even) td { background: #fdfaf2; }
.site-content blockquote, .kp-tip { margin: 1.2em 0; padding: 12px 16px 12px 52px; background: #fff7dc url(assets/gele.svg) 10px 12px / 30px no-repeat; border-radius: 12px; }

/* Įrašų sąrašai */
.kp-archive-head { margin-bottom: 18px; }
.kp-archive-head h1 { margin: 0; }
.kp-archive-head p { margin: 6px 0 0; color: var(--kp-muted); }
.kp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.kp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px 18px 16px;
  background: var(--kp-paper);
  border-radius: var(--kp-radius);
  box-shadow: var(--kp-shadow);
  border-top: 4px solid var(--kp-red);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kp-card:hover { transform: translateY(-2px); box-shadow: 0 1px 2px #2b1d0d14, 0 14px 30px -14px #2b1d0d4d; }
.kp-card h2, .kp-card h3 { margin: 6px 0 6px; font-size: 1.125rem; line-height: 1.3; letter-spacing: -.01em; }
.kp-card h2 a, .kp-card h3 a { color: var(--kp-ink); text-decoration: none; }
.kp-card h2 a::after, .kp-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.kp-card p { margin: 0; color: var(--kp-muted); font-size: .9375rem; line-height: 1.55; }
.kp-card .site-meta { position: relative; z-index: 1; margin: 0; }
.kp-card:nth-child(4n+2) { border-top-color: var(--kp-blue); }
.kp-card:nth-child(4n+3) { border-top-color: var(--kp-green); }
.kp-card:nth-child(4n+4) { border-top-color: var(--kp-gold); }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.nav-links :is(a, span) { padding: 6px 14px; border-radius: 999px; background: var(--kp-paper); box-shadow: var(--kp-shadow); text-decoration: none; }
.nav-links .current { background: var(--kp-red); color: #fff; }

/* Pradžios puslapis */
.kp-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}
.kp-hero-card { position: relative; padding: 22px 22px 18px; background: var(--kp-paper); border-radius: var(--kp-radius); box-shadow: var(--kp-shadow); overflow: hidden; }
.kp-hero-card h2 { margin: 0 0 8px; color: var(--kp-muted); font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.kp-hero-answer { margin: 0 0 4px; font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.kp-hero-today { padding-right: 96px; }
.kp-hero-today::after { content: ""; position: absolute; top: -34px; right: -34px; width: 120px; height: 120px; background: url(assets/rozete.svg) center / contain no-repeat; opacity: .95; }
.kp-hero-today.kp-open .kp-hero-answer { color: var(--kp-green); }
.kp-hero-today.kp-closed .kp-hero-answer { color: var(--kp-red); }
.kp-hero-today.kp-short .kp-hero-answer { color: #9a6500; }
.kp-hero-today .kp-week { margin-right: -74px; }
.kp-hero-note { margin: 0 0 12px; color: var(--kp-muted); font-size: .875rem; }
.kp-hero-facts { margin: 12px 0 8px; padding-left: 1.1em; font-size: .9375rem; }
.kp-hero-card > p:last-child { margin: 8px 0 0; font-weight: 600; font-size: .9375rem; }
.kp-hero-card a { text-decoration: none; }
.kp-hero-card a:hover { text-decoration: underline; }
.kp-hero-rate { background: linear-gradient(160deg, #fff 55%, #fff4cf); }
.kp-hero-rate::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 150px; height: 150px; background: url(assets/moneta.svg) center / contain no-repeat; opacity: .55; }
.kp-convert { position: relative; z-index: 1; display: flex; align-items: end; gap: 12px; margin: 10px 0 12px; }
.kp-convert label { display: grid; gap: 4px; color: var(--kp-muted); font-size: .8125rem; }
.kp-convert input { width: 120px; min-height: 42px; padding: 6px 12px; border: 1.5px solid var(--kp-line); border-radius: 10px; font: 600 1rem var(--kp-font); }
.kp-convert input:focus { outline: none; border-color: var(--kp-red); }
.kp-convert output { padding-bottom: 8px; font-size: 1.25rem; font-weight: 800; }
.kp-hero-rate > p:last-child { position: relative; z-index: 1; }

.kp-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 30px; }
.kp-section { position: relative; padding: 18px 20px 8px; background: var(--kp-paper); border-radius: var(--kp-radius); box-shadow: var(--kp-shadow); overflow: hidden; }
.kp-section::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--kp-red); }
.kp-section-miestai::before { background: var(--kp-blue); }
.kp-section-kelione::before { background: var(--kp-green); }
.kp-section-pinigai::before { background: var(--kp-gold); }
.kp-section h2 { margin: 0 0 4px; font-size: 1.25rem; letter-spacing: -.01em; }
.kp-section h2 a { color: var(--kp-ink); text-decoration: none; }
.kp-section h2 a:hover { color: var(--kp-red); }
.kp-section > p { margin: 0 0 8px; color: var(--kp-muted); font-size: .875rem; }
.kp-section ul { margin: 0 0 12px; padding: 0; list-style: none; }
.kp-section li { margin: 0; border-top: 1px dashed var(--kp-line); }
.kp-section li a { display: block; padding: 7px 0; color: var(--kp-ink); font-size: .9375rem; text-decoration: none; }
.kp-section li a::before { content: "›"; margin-right: 8px; color: var(--kp-red); font-weight: 800; }
.kp-section li a:hover { color: var(--kp-red); }
.kp-latest > h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1.4rem; }
.kp-latest > h2::before { content: ""; width: 28px; height: 28px; background: url(assets/gele.svg) center / contain no-repeat; }

/* Šoninė juosta */
.site-sidebar { display: grid; align-content: start; gap: 16px; }
.site-widget { padding: 18px 20px; background: var(--kp-paper); border-radius: var(--kp-radius); box-shadow: var(--kp-shadow); font-size: .9375rem; }
.site-widget :is(h2, .wp-block-heading) { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1rem; font-weight: 800; letter-spacing: -.01em; }
.site-widget :is(h2, .wp-block-heading)::before { content: ""; flex: 0 0 20px; height: 20px; background: url(assets/moneta.svg) center / contain no-repeat; }
.site-widget ul { margin: 0; padding: 0; list-style: none; }
.site-widget li { padding: 5px 0; border-top: 1px dashed var(--kp-line); }
.site-widget li:first-child { border-top: 0; }
.site-widget a { text-decoration: none; }
.site-widget a:hover { text-decoration: underline; }
.site-widget p { margin: 0; }

/* Poraštė */
.site-footer { position: relative; margin: 0 -20px; padding: 46px 20px 28px; background: #23140f; color: #e9dccb; font-size: .875rem; }
.site-footer::before { content: ""; position: absolute; inset: 0 0 auto; height: 30px; background: var(--kp-cream) url(assets/wycinanka.svg) center / auto 30px repeat-x; }
.site-footer > * { max-width: 1120px; margin-inline: auto; }
.site-footer a { color: #fff; }
.site-footer p { margin: 4px auto 10px; }
.site-footer button { padding: 6px 14px; border: 1px solid #ffffff55; border-radius: 999px; background: transparent; color: #fff; font: inherit; cursor: pointer; }
.site-footer-pages { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 6px auto 10px; padding: 0; list-style: none; }
.site-footer .site-art-credit { color: #b7a894; font-size: .8125rem; }

/* Prieinamumas */
.site-shell :focus-visible { outline: 3px solid var(--kp-blue); outline-offset: 3px; }
.screen-reader-text:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 50; padding: .75em; background: white; color: var(--kp-blue); }
.site-design-accents { --kp-cream: #fff8e6; }

@media (max-width: 900px) {
  .site-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .site-sidebar { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 640px) {
  .site-shell { padding: 0 14px; }
  .site-menu, .site-ornament, .site-footer { margin-inline: -14px; }
  .site-header { flex-wrap: wrap; padding: 16px 0 12px; gap: 12px; }
  .site-brand-mark { flex-basis: 40px; width: 40px; height: 40px; }
  .site-header-tools, .site-header .search-form { width: 100%; }
  .site-header .search-form label { flex: 1; }
  .site-header .search-field { width: 100%; }
  .kp-hero, .kp-sections { grid-template-columns: minmax(0, 1fr); }
  .kp-hero-today { padding-right: 22px; }
  .kp-hero-today::after { width: 90px; height: 90px; top: -20px; right: -20px; }
  .kp-hero-today .kp-week { margin-right: 0; }
  .site-content > article { border-radius: 12px; }
}
