/*
Theme Name: Texgrad Revival
Theme URI: https://texgrad.ru/
Author: Texgrad restoration project
Description: Современная тема-каталог для восстановленного сайта ивановского текстиля Texgrad.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: texgrad
*/

:root {
  --ink: #1d2a25;
  --muted: #617068;
  --paper: #f8f5ef;
  --surface: #fffdf9;
  --forest: #234f3f;
  --forest-dark: #17372c;
  --terracotta: #c45d3e;
  --terracotta-dark: #9d432d;
  --sand: #e9dcc8;
  --sage: #d8e3da;
  --line: rgba(29, 42, 37, .14);
  --shadow: 0 18px 50px rgba(30, 45, 38, .11);
  --radius: 22px;
  --container: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.menu-open { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.container { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }
.narrow { width: min(calc(100% - 40px), 820px); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.skip-link:focus { position: fixed; left: 16px; top: 16px; width: auto; height: auto; clip: auto; padding: 10px 16px; background: #fff; z-index: 9999; }

.site-notice { padding: 8px 0; color: #fff; background: var(--forest-dark); font-size: 13px; letter-spacing: .06em; text-align: center; text-transform: uppercase; }

.site-header { position: sticky; top: 0; z-index: 100; background: rgba(248, 245, 239, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.header-inner { min-height: 86px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 36px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; border-radius: 50% 50% 46% 54%; display: grid; place-items: center; color: #fff; background: var(--terracotta); font-family: Georgia, serif; font-size: 23px; font-style: italic; transform: rotate(-5deg); }
.brand-copy { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: Georgia, "Times New Roman", serif; font-size: 27px; letter-spacing: -.03em; }
.brand-tagline { margin-top: 7px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.primary-nav ul { margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; gap: 28px; list-style: none; }
.primary-nav a { position: relative; font-size: 14px; font-weight: 700; }
.primary-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -7px; height: 2px; background: var(--terracotta); transition: right .2s ease; }
.primary-nav a:hover::after, .primary-nav .current-menu-item > a::after { right: 0; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; width: 46px; height: 46px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; }
.menu-toggle span { display: block; width: 20px; height: 2px; margin: 5px auto; background: var(--ink); transition: .2s; }

.button { min-height: 48px; padding: 12px 22px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 999px; color: #fff; background: var(--terracotta); font-size: 14px; font-weight: 800; cursor: pointer; transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.button:hover { background: var(--terracotta-dark); transform: translateY(-2px); box-shadow: 0 9px 24px rgba(157, 67, 45, .22); }
.button--forest { background: var(--forest); }
.button--forest:hover { background: var(--forest-dark); }
.button--light { color: var(--forest-dark); background: #fff; }
.button--light:hover { color: #fff; background: var(--terracotta); }
.button--ghost { color: var(--ink); border-color: var(--line); background: transparent; }
.button--ghost:hover { color: #fff; border-color: var(--forest); background: var(--forest); }
.text-link { display: inline-flex; align-items: center; gap: 8px; color: var(--forest); font-weight: 800; font-size: 14px; }
.text-link::after { content: "→"; transition: transform .2s; }
.text-link:hover::after { transform: translateX(4px); }

.eyebrow { margin: 0 0 16px; color: var(--terracotta); font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.display-title, h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.06; letter-spacing: -.035em; }
.display-title { margin: 0; font-size: clamp(46px, 6vw, 82px); font-weight: 500; }
.display-title em { color: var(--terracotta); font-weight: 400; }
.section-title { margin: 0; font-size: clamp(34px, 4vw, 56px); font-weight: 500; }
.section-lead { max-width: 600px; margin: 0; color: var(--muted); }

.hero { position: relative; overflow: hidden; padding: 70px 0 86px; background: var(--sage); }
.hero::before { content: ""; position: absolute; width: 420px; height: 420px; right: -130px; top: -160px; border: 1px solid rgba(35, 79, 63, .16); border-radius: 48% 52% 62% 38%; transform: rotate(23deg); }
.hero-grid { display: grid; grid-template-columns: .92fr 1.08fr; align-items: center; gap: clamp(40px, 7vw, 88px); }
.hero-copy { position: relative; z-index: 2; }
.hero-copy > p:not(.eyebrow) { max-width: 560px; margin: 26px 0 32px; color: #44554d; font-size: 19px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-facts { margin: 38px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; list-style: none; }
.hero-facts strong { display: block; font-family: Georgia, serif; font-size: 26px; font-weight: 500; }
.hero-facts span { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.hero-collage { position: relative; min-height: 570px; }
.hero-photo { position: absolute; overflow: hidden; border: 9px solid rgba(255, 253, 249, .86); border-radius: 160px 160px 28px 28px; box-shadow: var(--shadow); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo--main { inset: 0 6% 0 16%; }
.hero-photo--detail { width: 220px; height: 220px; left: 0; bottom: 22px; border-radius: 50%; }
.hero-stamp { position: absolute; right: 0; top: 54px; width: 128px; height: 128px; padding: 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--terracotta); font-family: Georgia, serif; font-size: 18px; line-height: 1.15; text-align: center; transform: rotate(7deg); box-shadow: 0 15px 36px rgba(157, 67, 45, .3); }

.trust-strip { background: var(--forest); color: #fff; }
.trust-grid { min-height: 112px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; }
.trust-item { padding: 20px 38px; display: flex; align-items: center; gap: 16px; border-right: 1px solid rgba(255,255,255,.18); }
.trust-item:last-child { border-right: 0; }
.trust-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; font-size: 20px; }
.trust-item strong { display: block; font-size: 14px; }
.trust-item span { display: block; color: rgba(255,255,255,.66); font-size: 12px; }

.section { padding: 100px 0; }
.section--tight { padding: 72px 0; }
.section--surface { background: var(--surface); }
.section-heading { margin-bottom: 42px; display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.section-heading__copy { max-width: 690px; }
.section-heading__copy .section-lead { margin-top: 16px; }

.category-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.category-card { position: relative; min-height: 330px; padding: 28px; display: flex; flex-direction: column; justify-content: end; overflow: hidden; border-radius: var(--radius); background: #d5ddd8; box-shadow: 0 1px 0 rgba(0,0,0,.03); }
.category-card:nth-child(1), .category-card:nth-child(4) { grid-column: span 5; }
.category-card:nth-child(2), .category-card:nth-child(3) { grid-column: span 7; }
.category-card:nth-child(n+5) { grid-column: span 4; min-height: 290px; }
.category-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.category-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 24%, rgba(19, 37, 30, .78)); }
.category-card:hover img { transform: scale(1.045); }
.category-card__content { position: relative; z-index: 2; color: #fff; }
.category-card__count { font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; opacity: .78; }
.category-card h3 { max-width: 380px; margin: 7px 0 0; font-size: clamp(25px, 3vw, 36px); font-weight: 500; }

.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.product-card { position: relative; border-radius: 18px; background: var(--surface); overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.product-card__image { position: relative; aspect-ratio: 1 / 1.06; overflow: hidden; background: #eee7dc; }
.product-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.product-card:hover .product-card__image img { transform: scale(1.04); }
.product-card__badge { position: absolute; left: 14px; top: 14px; padding: 7px 10px; border-radius: 999px; color: var(--forest-dark); background: rgba(255,255,255,.9); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.product-card__body { padding: 21px 21px 24px; }
.product-card__category { color: var(--terracotta); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.product-card h3 { margin: 8px 0 8px; font-size: 23px; font-weight: 500; }
.product-card p { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.55; }

.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(50px, 8vw, 110px); align-items: center; }
.story-media { position: relative; }
.story-media::before { content: ""; position: absolute; left: -22px; bottom: -22px; width: 68%; height: 58%; border-radius: var(--radius); background: var(--sand); }
.story-media img { position: relative; width: 100%; min-height: 520px; object-fit: cover; border-radius: 220px 220px 28px 28px; box-shadow: var(--shadow); }
.story-copy p { color: var(--muted); }
.story-list { margin: 30px 0; padding: 0; list-style: none; }
.story-list li { padding: 14px 0; display: flex; gap: 14px; border-bottom: 1px solid var(--line); font-weight: 700; }
.story-list li::before { content: "✓"; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--forest); font-size: 12px; }

.process { color: #fff; background: var(--forest-dark); }
.process .eyebrow { color: #ef9c80; }
.process .section-lead { color: rgba(255,255,255,.64); }
.steps { margin-top: 48px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255,255,255,.14); }
.step { min-height: 230px; padding: 32px; background: var(--forest-dark); }
.step-number { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; color: #ef9c80; font-family: Georgia, serif; }
.step h3 { margin: 42px 0 10px; font-size: 24px; }
.step p { margin: 0; color: rgba(255,255,255,.58); font-size: 14px; }

.cta { padding: 86px 0; background: var(--sand); }
.cta-inner { padding: clamp(38px, 7vw, 82px); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 50px; border-radius: 28px; color: #fff; background: var(--terracotta); overflow: hidden; position: relative; }
.cta-inner::after { content: ""; position: absolute; width: 300px; height: 300px; right: -170px; top: -160px; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; }
.cta h2 { max-width: 700px; margin: 0 0 12px; font-size: clamp(34px, 4vw, 54px); font-weight: 500; }
.cta p { margin: 0; color: rgba(255,255,255,.78); }

.page-hero { padding: 80px 0 62px; background: var(--sage); }
.page-hero h1 { max-width: 900px; margin: 0; font-size: clamp(42px, 6vw, 72px); font-weight: 500; }
.page-hero p { max-width: 700px; margin: 20px 0 0; color: var(--muted); font-size: 19px; }
.breadcrumbs { margin-bottom: 22px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.breadcrumbs a:hover { color: var(--terracotta); }
.breadcrumbs span { margin: 0 8px; opacity: .5; }

.catalog-layout { display: grid; grid-template-columns: 250px 1fr; gap: 44px; }
.catalog-sidebar { align-self: start; position: sticky; top: 120px; }
.catalog-sidebar h2 { margin: 0 0 15px; font-size: 24px; }
.category-nav { margin: 0; padding: 0; list-style: none; }
.category-nav li { border-bottom: 1px solid var(--line); }
.category-nav a { padding: 11px 0; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 700; }
.category-nav a:hover, .category-nav .current a { color: var(--terracotta); }
.catalog-main .product-grid { grid-template-columns: repeat(3, 1fr); }
.catalog-summary { margin: 0 0 28px; color: var(--muted); }

.product-single { padding: 76px 0 100px; }
.product-single__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(45px, 7vw, 90px); align-items: start; }
.product-single__image { overflow: hidden; border-radius: 26px; background: #eee7dc; }
.product-single__image img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.product-single__meta h1 { margin: 10px 0 18px; font-size: clamp(42px, 5vw, 64px); font-weight: 500; }
.product-single__intro { color: var(--muted); font-size: 19px; }
.specs { margin: 32px 0; border-top: 1px solid var(--line); }
.spec-row { padding: 14px 0; display: grid; grid-template-columns: 150px 1fr; gap: 20px; border-bottom: 1px solid var(--line); }
.spec-row dt { color: var(--muted); font-size: 13px; }
.spec-row dd { margin: 0; font-weight: 700; }
.product-content { margin-top: 42px; color: var(--muted); }

.entry-content { padding: 80px 0 100px; }
.entry-content h2 { margin-top: 1.5em; font-size: 36px; font-weight: 500; }
.entry-content h3 { margin-top: 1.5em; font-size: 27px; font-weight: 500; }
.entry-content p, .entry-content li { color: var(--muted); }
.entry-content blockquote { margin: 36px 0; padding: 24px 30px; border-left: 4px solid var(--terracotta); background: var(--surface); font-family: Georgia, serif; font-size: 22px; }

.empty-state { padding: 70px 30px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
.pagination { margin-top: 45px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers { min-width: 42px; height: 42px; padding: 0 12px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 13px; font-weight: 800; }
.pagination .current { color: #fff; border-color: var(--forest); background: var(--forest); }

.site-footer { padding: 70px 0 24px; color: #fff; background: #15241e; }
.footer-grid { display: grid; grid-template-columns: 1.35fr .7fr .7fr 1fr; gap: 50px; }
.footer-brand p { max-width: 330px; color: rgba(255,255,255,.55); font-size: 14px; }
.site-footer .brand-name { color: #fff; }
.footer-column h2 { margin: 0 0 18px; font-family: inherit; font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.footer-column ul { margin: 0; padding: 0; list-style: none; }
.footer-column li { margin: 8px 0; }
.footer-column a, .footer-note { color: rgba(255,255,255,.56); font-size: 13px; }
.footer-column a:hover { color: #fff; }
.footer-bottom { margin-top: 55px; padding-top: 20px; display: flex; justify-content: space-between; gap: 30px; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.4); font-size: 11px; }

@media (max-width: 1020px) {
  .header-actions .button { display: none; }
  .primary-nav ul { gap: 18px; }
  .hero-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .hero-collage { min-height: 480px; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .footer-brand { grid-column: span 3; }
}

@media (max-width: 800px) {
  .site-notice { font-size: 10px; }
  .site-header { backdrop-filter: none; }
  .header-inner { min-height: 74px; grid-template-columns: 1fr auto; }
  .menu-toggle { display: block; }
  .primary-nav { position: fixed; inset: 102px 0 0; z-index: 120; min-height: calc(100vh - 102px); padding: 36px 20px; background: var(--paper) !important; box-shadow: 0 20px 40px rgba(29, 42, 37, .18); opacity: 0; visibility: hidden; transform: translateY(-10px); transition: .2s; }
  .menu-open .primary-nav { opacity: 1; visibility: visible; transform: none; }
  .primary-nav ul { flex-direction: column; align-items: flex-start; gap: 22px; }
  .primary-nav a { font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
  .header-actions { justify-self: end; }
  .menu-open .menu-toggle span:first-child { transform: translateY(7px) rotate(45deg); }
  .menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle span:last-child { transform: translateY(-7px) rotate(-45deg); }
  .hero { padding-top: 55px; }
  .hero-grid, .story-grid, .product-single__grid { grid-template-columns: 1fr; }
  .hero-collage { order: -1; min-height: 440px; }
  .hero-photo--main { inset: 0 5% 0 10%; }
  .hero-facts { max-width: 500px; }
  .trust-grid { grid-template-columns: 1fr; padding: 16px 0; }
  .trust-item { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.16); }
  .trust-item:last-child { border-bottom: 0; }
  .section-heading { align-items: start; flex-direction: column; }
  .category-card, .category-card:nth-child(n) { grid-column: span 6; min-height: 300px; }
  .product-grid, .catalog-main .product-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .cta-inner { grid-template-columns: 1fr; }
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-sidebar { position: static; }
  .category-nav { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 8px; }
  .category-nav li { flex: 0 0 auto; border: 0; }
  .category-nav a { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: span 2; }
}

@media (max-width: 560px) {
  .container, .narrow { width: min(calc(100% - 28px), var(--container)); }
  .brand-tagline { display: none; }
  .hero { padding: 36px 0 58px; }
  .hero-collage { min-height: 330px; }
  .hero-photo { border-width: 6px; }
  .hero-photo--detail { width: 130px; height: 130px; }
  .hero-stamp { width: 92px; height: 92px; padding: 12px; font-size: 13px; }
  .hero-facts { gap: 10px; }
  .hero-facts strong { font-size: 20px; }
  .hero-facts span { font-size: 9px; }
  .section { padding: 72px 0; }
  .category-card, .category-card:nth-child(n) { grid-column: span 12; min-height: 290px; }
  .product-grid, .catalog-main .product-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .story-media img { min-height: 400px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: column; }
  .spec-row { grid-template-columns: 110px 1fr; }
}
