/*
Theme Name: Евро 5 Светлосиньо
Description: Самостоятелна тема за EVRO5.COM с изгледи за услуги, публикации и категории.
Version: 1.0.2
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: evro5-sky
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --ev-ink: #102b46;
  --ev-text: #29455c;
  --ev-blue: #07558f;
  --ev-deep: #064577;
  --ev-sky: #ddecfd;
  --ev-mist: #f0f7ff;
  --ev-line: #b6d2e8;
  --ev-white: #fff;
  --ev-width: 76rem;
  --ev-copy: 48rem;
  --ev-gutter: clamp(1.125rem, 3.2vw, 2.5rem);
}

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

body {
  margin: 0;
  color: var(--ev-text);
  background: var(--ev-white);
  font: 1rem/1.65 system-ui, -apple-system, "Segoe UI", sans-serif;
}

img, video { display: block; max-width: 100%; height: auto; }
iframe { max-width: 100%; }
a { color: var(--ev-blue); text-underline-offset: .2em; }
a:hover { color: var(--ev-deep); }
:focus-visible { outline: 3px solid #0871b8; outline-offset: 4px; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, h4, h5, h6 { color: var(--ev-ink); line-height: 1.15; }
.screen-reader-text, .ev-skip {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.ev-skip:focus {
  z-index: 20;
  top: 1rem;
  left: 1rem;
  width: auto;
  height: auto;
  padding: .7rem 1rem;
  clip: auto;
  background: var(--ev-white);
}

.ev-wrap { width: min(var(--ev-width), 100% - var(--ev-gutter) * 2); margin-inline: auto; }
.ev-header { border-bottom: 1px solid var(--ev-line); background: var(--ev-white); }
.ev-header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  min-height: 5.25rem;
  align-items: center;
  gap: clamp(.85rem, 2.4vw, 2rem);
}

.ev-brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: .65rem;
  color: var(--ev-ink);
  font-size: 1.16rem;
  letter-spacing: -.025em;
  font-weight: 780;
  text-decoration: none;
  white-space: nowrap;
}

.ev-brand-mark {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 2.5rem;
  place-items: center;
  border-radius: .82rem;
  color: var(--ev-deep);
  background: #d2eaff;
  font-size: 1.65rem;
  font-weight: 810;
  line-height: 1;
}

.ev-brand .custom-logo { max-width: 155px; max-height: 44px; object-fit: contain; }
.ev-nav ul, .ev-footer ul, .ev-pagination ul { margin: 0; padding: 0; list-style: none; }
.ev-nav > ul { display: flex; justify-content: center; flex-wrap: wrap; gap: .1rem .35rem; }
.ev-nav li { position: relative; }
.ev-nav li a {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  padding: .42rem .67rem;
  border-radius: .5rem;
  color: var(--ev-ink);
  font-size: .915rem;
  font-weight: 650;
  text-decoration: none;
}

.ev-nav li a:hover, .ev-nav [aria-current="page"] { color: var(--ev-deep); background: var(--ev-mist); }
.ev-nav .sub-menu { padding-inline-start: .65rem; }
.ev-menu-button { display: none; }
.ev-phone, .ev-button, .wp-block-button .wp-block-button__link {
  display: inline-flex;
  min-height: 2.875rem;
  align-items: center;
  justify-content: center;
  padding: .62rem 1.05rem;
  border: 1px solid transparent;
  border-radius: .74rem;
  background: var(--ev-blue);
  color: var(--ev-white);
  font-weight: 720;
  font-size: .95rem;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.ev-phone { gap: .5rem; white-space: nowrap; }
.ev-phone::before { content: "☎"; font-size: 1.05em; }
.ev-phone:hover, .ev-button:hover, .wp-block-button .wp-block-button__link:hover {
  background: var(--ev-deep);
  color: var(--ev-white);
}

.entry-content .wp-block-buttons { justify-content: center; gap: .65rem; }
.ev5-shell .wp-block-buttons .wp-block-button:nth-child(2) .wp-block-button__link {
  color: var(--ev-deep);
  background: var(--ev-white);
  border-color: #77a6c8;
}

.ev5-shell .wp-block-buttons .wp-block-button:nth-child(2) .wp-block-button__link:hover { background: var(--ev-mist); }
.ev-main { min-height: 54vh; }
.ev-main:focus { outline: none; }
.ev-front .entry-content .ev5-shell { margin: 0; }
.ev-front .entry-content .ev5-location { display: none; }
.ev-front .entry-content .ev5-hero {
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
  align-items: center;
  gap: clamp(1.65rem, 4vw, 4rem);
  padding: clamp(1.65rem, 4vw, 4rem);
  margin-top: clamp(1rem, 3vw, 2.35rem);
  border-radius: clamp(1.15rem, 3vw, 2rem);
  background: var(--ev-sky);
}

.ev5-hero .ev5-intro { min-width: 0; }
.ev5-hero h1 {
  max-width: 13ch;
  margin: 0 0 .36em;
  font-size: clamp(2.55rem, 5vw, 4.65rem);
  font-weight: 780;
  letter-spacing: -.045em;
  line-height: 1.04;
}

.ev5-hero .ev5-lead {
  max-width: 38ch;
  margin: 0 0 1.6rem;
  color: var(--ev-text);
  font-size: clamp(1rem, 1.6vw, 1.16rem);
  line-height: 1.62;
}

.ev5-visual figure { margin: 0; }
.ev5-visual .wp-block-image img {
  width: 100%;
  aspect-ratio: 11 / 9;
  border: .4rem solid var(--ev-white);
  border-radius: 1.35rem 3.8rem 1.35rem 1.35rem;
  object-fit: cover;
  object-position: 54% center;
  box-shadow: 0 14px 34px rgb(22 75 110 / .12);
}

.ev5-visual figcaption { margin-top: .55rem; color: var(--ev-text); font-size: .82rem; text-align: end; }
.ev-front .ev5-services { padding: clamp(2.5rem, 5vw, 4.6rem) 0 2rem; }
.ev5-services > h2, .ev5-estimate h2 { margin: 0 0 1rem; font-size: clamp(1.75rem, 3vw, 2.45rem); letter-spacing: -.032em; }
.ev-front .ev5-services > h2 { margin-bottom: 1.65rem; text-align: center; }
.ev5-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.ev5-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: clamp(1.05rem, 2.6vw, 1.7rem);
  border: 1px solid var(--ev-line);
  border-radius: 1.1rem;
  background: var(--ev-mist);
}

.ev5-card h3 { margin: 0 0 .55rem; font-size: 1.28rem; }
.ev5-card p { margin: 0 0 .8rem; }
.ev5-card .ev5-card-link { margin: auto 0 0; padding-top: .4rem; font-weight: 720; }
.ev5-card-link a { display: inline-block; padding-block: .4rem; }
.ev5-more { max-width: 64ch; margin: 1.3rem auto 0; text-align: center; }
.ev5-estimate {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(12rem, 1fr);
  align-items: center;
  gap: 1.5rem;
  margin: 0 0 clamp(2rem, 4.2vw, 4rem);
  padding: clamp(1.4rem, 4vw, 2.75rem);
  border: 1px solid var(--ev-line);
  border-radius: 1.2rem;
  background: var(--ev-sky);
}

.ev5-estimate p:last-child { margin-bottom: 0; }
.ev-masthead { padding: clamp(2rem, 6vw, 4.8rem) 0; background: var(--ev-mist); border-bottom: 1px solid #d6e7f5; }
.ev-masthead h1 {
  max-width: min(22ch, 100%);
  margin: 0;
  font-size: clamp(2.15rem, 5vw, 4rem);
  font-weight: 770;
  line-height: 1.08;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.ev-masthead p { max-width: 62ch; margin: .85rem 0 0; }
.ev-content-wrap { display: grid; grid-template-columns: minmax(0, var(--ev-copy)) minmax(16rem, 1fr); align-items: start; gap: clamp(2rem, 5vw, 5rem); }
.ev-content-wrap, .ev-index { padding-block: clamp(1.9rem, 5vw, 4rem); }
.ev-content-wrap .entry-content { min-width: 0; overflow-wrap: anywhere; }
.ev-content-wide { grid-template-columns: minmax(0, 1fr); }
.ev-content-wide .entry-content { max-width: 63rem; width: 100%; }
.ev-content-wide .ev5-services > p, .ev-content-wide .ev5-services > ul { max-width: 68ch; }
.ev-content-wide .ev5-services .ev5-cards { margin-block: 1.25rem 1.7rem; }
.ev-content-wrap .entry-content :is(h1, h2, h3, h4) { margin: 1.6em 0 .55em; }
.ev-content-wrap .entry-content > :first-child { margin-top: 0; }
.ev-content-wrap .entry-content h2 { font-size: clamp(1.45rem, 3vw, 2.15rem); letter-spacing: -.02em; }
.ev-content-wrap .entry-content h3 { font-size: clamp(1.15rem, 2vw, 1.55rem); }
.ev-content-wrap .entry-content .ev5-card h3 { margin-top: 0; }
.ev-content-wrap .entry-content blockquote { margin-inline: 0; padding: .75rem 1.15rem; border-inline-start: .23rem solid #6da9d1; background: var(--ev-mist); }
.entry-content :is(ul, ol) { padding-inline-start: 1.5em; }
.entry-content li { margin-block: .3em; }
.entry-content p:empty { display: none; }
.entry-content :is(img, figure, pre) { max-width: 100%; }
.entry-content img { border-radius: .65rem; }
.entry-content :is(.alignleft, .alignright) { max-width: min(46%, 23rem); }
.entry-content .alignleft { float: left; margin: .35rem 1.25rem .9rem 0; }
.entry-content .alignright { float: right; margin: .35rem 0 .9rem 1.25rem; }
.entry-content .aligncenter { margin-inline: auto; }
.entry-content::after { display: block; clear: both; content: ""; }
.entry-content pre, .entry-content .wp-block-table { overflow-x: auto; }
.entry-content table { max-width: 100%; border-collapse: collapse; }
.entry-content :is(td, th) { padding: .45rem .6rem; border: 1px solid var(--ev-line); }
.entry-content th { background: var(--ev-mist); }
.entry-content span[style*="#00969f" i] { color: #05646a !important; }
.ev-side {
  padding: 1.35rem;
  border: 1px solid var(--ev-line);
  border-radius: 1.05rem;
  background: var(--ev-mist);
}

.ev-side h2 { margin: 0 0 .85rem; font-size: 1.15rem; }
.ev-side .ev-phone { width: 100%; }
.ev-side ul { margin: .9rem 0 0; padding: 0; list-style: none; }
.ev-side li + li { border-top: 1px solid var(--ev-line); }
.ev-side li a { display: block; padding-block: .63rem; font-weight: 630; }
.ev-archive-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.ev-result {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ev-line);
  border-radius: 1.05rem;
  background: var(--ev-mist);
}

.ev-result-image { display: block; overflow: hidden; background: var(--ev-sky); }
.ev-result-image img { width: 100%; aspect-ratio: 8 / 5; object-fit: cover; }
.ev-result-body { padding: 1.2rem; }
.ev-result h2 { margin: 0; font-size: 1.24rem; overflow-wrap: anywhere; }
.ev-result h2 a { color: var(--ev-ink); }
.ev-result p { margin: .7rem 0 0; font-size: .935rem; }
.ev-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin-top: 2rem; }
.ev-pagination .page-numbers { display: inline-block; padding: .38rem .72rem; border: 1px solid var(--ev-line); border-radius: .45rem; }
.ev-pagination .current { background: var(--ev-blue); color: var(--ev-white); border-color: var(--ev-blue); }
.ev-search { display: flex; align-items: end; flex-wrap: wrap; gap: .7rem; max-width: 38rem; margin-block: 1rem; }
.ev-search label { display: grid; flex: 1 1 14rem; gap: .25rem; }
.ev-search input { min-width: 0; padding: .54rem .8rem; border: 1px solid #7ea7c4; border-radius: .55rem; }
.ev-footer { border-top: 1px solid var(--ev-line); background: #e9f4ff; color: var(--ev-ink); }
.ev-footer-inner { display: grid; grid-template-columns: 1fr auto auto; gap: 2rem; align-items: start; padding-block: 2rem; }
.ev-footer h2 { margin: 0 0 .7rem; font-size: 1rem; }
.ev-footer li a { display: inline-block; padding-block: .23rem; }
.ev-footer .ev-phone { margin-top: .85rem; }
.ev-footer-bottom { padding-block: .85rem; border-top: 1px solid var(--ev-line); font-size: .875rem; }

@media (max-width: 900px) {
  .ev-header-inner { grid-template-columns: minmax(0, 1fr) auto auto; gap: .45rem .65rem; padding-block: .65rem; min-height: 4.4rem; }
  .ev-nav { grid-row: 2; grid-column: 1 / -1; }
  .ev-header[data-menu-ready] .ev-menu-button {
    display: flex;
    grid-row: 1;
    grid-column: 3;
    min-height: 2.7rem;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem .76rem;
    border: 1px solid var(--ev-line);
    border-radius: .6rem;
    color: var(--ev-ink);
    background: var(--ev-mist);
    font-weight: 700;
    cursor: pointer;
  }
  .ev-header[data-menu-ready] .ev-menu-button[aria-expanded="false"] + .ev-nav { display: none; }
  .ev-nav > ul { justify-content: start; }
  .ev-header .ev-phone {
    grid-row: 1;
    grid-column: 2;
    width: 2.75rem;
    min-height: 2.75rem;
    padding: .4rem;
  }
  .ev-header .ev-phone span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .ev-content-wrap { grid-template-columns: minmax(0, 1fr); }
  .ev-side { max-width: 29rem; }
}

@media (max-width: 660px) {
  .ev-front .entry-content .ev5-hero { grid-template-columns: minmax(0, 1fr); padding: 1.35rem; }
  .ev5-hero h1 { max-width: 14ch; font-size: clamp(2.2rem, 8.7vw, 3.7rem); }
  .ev5-hero .ev5-lead { margin-bottom: 1.1rem; }
  .ev5-visual .wp-block-image img { aspect-ratio: 4 / 3; border-radius: .85rem 2.25rem .85rem .85rem; }
  .ev5-cards, .ev5-estimate, .ev-archive-grid { grid-template-columns: minmax(0, 1fr); }
  .ev-footer-inner { grid-template-columns: 1fr 1fr; gap: 1.4rem 1rem; }
  .ev-footer-brand { grid-column: 1 / -1; }
  .entry-content :is([style*="text-align: justify"], [style*="text-align:justify"], .has-text-align-justify) { text-align: start !important; }
  .entry-content :is(.alignleft, .alignright) { float: none; max-width: 100%; margin: .8rem auto; }
  .ev-nav > ul { display: grid; grid-template-columns: 1fr; }
}

@media (max-width: 350px) {
  .ev-brand { font-size: 1rem; }
  .ev-brand-mark { width: 2.15rem; height: 2.15rem; flex-basis: 2.15rem; }
  .ev-front .entry-content .ev5-hero { padding: 1.05rem; }
  .ev5-hero h1 { font-size: 2rem; }
}
