/*
Theme Name: Папа рядом — счастливое детство
Theme URI: https://t.me/gds_technical
Author: GDS Technical
Author URI: https://t.me/gds_technical
Description: Мягкая красно-жёлтая WordPress-тема о семье, отцовстве и воспитании ребёнка с аутизмом. Фотографии используются без ретуши и изменения лиц.
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: papa-ryadom
*/

:root {
  --red: #a9554e;
  --red-dark: #743b38;
  --red-soft: #f5dfda;
  --yellow: #d8a840;
  --yellow-soft: #fff2c9;
  --cream: #fffaf0;
  --ink: #3e3430;
  --muted: #746763;
  --line: rgba(135, 76, 53, .24);
  --white: #fffefb;
  --shadow: 0 14px 36px rgba(99, 57, 40, .10);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.65;
  background-color: #fff8e8;
  background-image:
    linear-gradient(rgba(255,250,240,.90), rgba(255,248,232,.92)),
    url("assets/images/autism-background.jpg");
  background-size: cover, 560px auto;
  background-position: center, right 5vw top 110px;
  background-repeat: no-repeat, repeat-y;
  background-attachment: fixed, fixed;
}
body:before, body:after { display:none; }

a { color:#c62828; font-weight:700; text-decoration-thickness:2px; text-underline-offset:3px; transition:color .2s ease, background .2s ease, transform .2s ease; }
a:hover { color:#f57c00; }
img { max-width: 100%; height: auto; }
.container { width: min(1160px, calc(100% - 36px)); margin: 0 auto; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(255,250,240,.88);
  border-bottom: 1px solid var(--line);
}
.header-inner { min-height: 78px; display:flex; align-items:center; justify-content:space-between; gap:24px; }
.brand { display:flex; align-items:center; gap:12px; text-decoration:none; font-weight:800; color:var(--red-dark); }
.brand-mark { width:48px; height:34px; border-radius:999px; display:grid; place-items:center; font-size:30px; line-height:1; font-weight:900; background:linear-gradient(90deg,#a95750,#d9a741,#bf6c4e); color:#fff; box-shadow:inset 0 0 0 2px rgba(255,255,255,.6); }
.nav { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.nav a { padding:9px 14px; border-radius:999px; text-decoration:none; font-size:14px; font-weight:700; }
.nav a:hover { background:linear-gradient(90deg,#ffeb3b,#ff9800); color:#7a1d00; box-shadow:0 6px 14px rgba(255,152,0,.22); }

.hero { padding:72px 0 42px; }
.hero-grid { display:grid; grid-template-columns: 1.02fr .98fr; gap:34px; align-items:center; }
.kicker { display:inline-flex; align-items:center; gap:8px; padding:8px 14px; border:1px solid var(--line); border-radius:999px; background:rgba(255,255,255,.65); color:var(--red-dark); font-weight:800; }
h1 { font-size:clamp(42px,6vw,78px); line-height:1.02; letter-spacing:-.045em; margin:18px 0; color:var(--red-dark); }
.lead { font-size:clamp(18px,2vw,23px); color:var(--muted); max-width:720px; }
.actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:28px; }
.button, .wp-block-button__link {
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  border-radius:999px !important; padding:13px 22px; text-decoration:none; font-weight:800;
  border:1px solid rgba(117,56,46,.20); transition:.2s transform,.2s box-shadow;
}
.button:hover { transform:translateY(-2px); box-shadow:0 9px 18px rgba(122,62,49,.14); }
.button.primary { color:#fff; background:linear-gradient(90deg,#d32f2f,#f57c00,#fbc02d); box-shadow:0 8px 20px rgba(211,47,47,.24); }
.button.secondary { color:#b71c1c; background:linear-gradient(90deg,#fff3cd,#ffe082); border-color:rgba(245,124,0,.45); box-shadow:0 8px 18px rgba(245,124,0,.16); }
.infinity { font-size:24px; font-weight:900; }
.hero-photo { position:relative; border:1px solid var(--line); border-radius:42px; padding:12px; background:rgba(255,255,255,.68); box-shadow:var(--shadow); transform:rotate(1deg); }
.hero-photo img { width:100%; aspect-ratio:4/5; object-fit:cover; border-radius:32px; display:block; }
.hero-note { position:absolute; left:-18px; bottom:28px; max-width:245px; padding:13px 16px; background:#fffdf7; border:1px solid var(--line); border-radius:20px; box-shadow:var(--shadow); font-weight:700; }

.section { padding:42px 0; }
.panel { border:1px solid var(--line); border-radius:var(--radius); background:rgba(255,254,249,.83); box-shadow:var(--shadow); padding:clamp(24px,4vw,48px); }
.section-head { display:flex; align-items:end; justify-content:space-between; gap:20px; margin-bottom:24px; }
.section h2 { margin:0; color:var(--red-dark); font-size:clamp(30px,4vw,48px); line-height:1.1; letter-spacing:-.03em; }
.telegram-tag { flex:none; display:inline-flex; gap:7px; align-items:center; border:1px solid var(--line); border-radius:999px; padding:8px 13px; text-decoration:none; background:linear-gradient(90deg,#ffd54f,#ffb300); color:#7a2100; font-weight:900; font-size:14px; box-shadow:0 6px 16px rgba(255,179,0,.22); }

.cards { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.card { border:1px solid var(--line); border-radius:22px; padding:22px; background:rgba(255,255,255,.72); }
.card h3 { color:var(--red-dark); margin:0 0 8px; }
.card .icon { width:48px; height:48px; border-radius:50%; display:grid; place-items:center; background:var(--red-soft); font-size:25px; margin-bottom:14px; }

.story { display:grid; grid-template-columns:.8fr 1.2fr; gap:24px; align-items:center; }
.story-photo img { display:block; width:100%; border:1px solid var(--line); border-radius:24px; }
.quote { margin:20px 0 0; padding:18px 20px; border-left:4px solid var(--yellow); background:var(--yellow-soft); border-radius:0 18px 18px 0; font-weight:700; }

.gallery {
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  grid-auto-rows:72px;
  grid-auto-flow:dense;
  gap:14px;
}
.gallery-item {
  grid-column:span 3;
  grid-row:span 4;
  margin:0;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:22px;
  background:#fff;
  box-shadow:0 8px 20px rgba(99,57,40,.08);
}
.gallery-item:nth-child(7n+1), .gallery-item:nth-child(7n+5) { grid-column:span 6; grid-row:span 5; }
.gallery-item:nth-child(7n+3) { grid-column:span 3; grid-row:span 5; }
.gallery-open {
  position:relative;
  width:100%;
  height:100%;
  display:block;
  padding:0;
  border:0;
  cursor:zoom-in;
  background:#fff;
  overflow:hidden;
}
.gallery-open:focus-visible { outline:3px solid rgba(169,85,78,.55); outline-offset:-5px; }
.gallery img {
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:transform .55s cubic-bezier(.2,.7,.2,1), filter .35s ease;
}
.gallery-zoom {
  position:absolute;
  right:14px;
  bottom:14px;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.72);
  border-radius:999px;
  color:#fff;
  font-size:25px;
  line-height:1;
  background:rgba(116,59,56,.72);
  backdrop-filter:blur(8px);
  opacity:0;
  transform:translateY(8px) scale(.92);
  transition:opacity .3s ease, transform .3s ease;
}
.gallery-open:hover img { transform:scale(1.07); filter:saturate(1.03); }
.gallery-open:hover .gallery-zoom, .gallery-open:focus-visible .gallery-zoom { opacity:1; transform:none; }

.lightbox[hidden] { display:none; }
.lightbox {
  position:fixed;
  inset:0;
  z-index:1000;
  display:grid;
  grid-template-columns:74px minmax(0,1fr) 74px;
  align-items:center;
  padding:28px;
  background:rgba(40,30,27,.92);
  backdrop-filter:blur(16px);
  animation:lightbox-in .22s ease both;
}
.lightbox-stage { min-width:0; text-align:center; }
.lightbox-image {
  display:block;
  max-width:min(1180px,100%);
  max-height:calc(100vh - 105px);
  width:auto;
  height:auto;
  margin:0 auto;
  object-fit:contain;
  border-radius:18px;
  box-shadow:0 22px 70px rgba(0,0,0,.42);
  animation:image-in .25s ease both;
}
.lightbox-counter { margin-top:12px; color:#fff7e8; font-weight:700; }
.lightbox-close, .lightbox-nav {
  border:1px solid rgba(255,255,255,.28);
  border-radius:999px;
  color:#fff;
  background:rgba(255,255,255,.12);
  backdrop-filter:blur(8px);
  cursor:pointer;
  transition:background .2s ease, transform .2s ease;
}
.lightbox-close:hover, .lightbox-nav:hover { background:rgba(255,255,255,.24); transform:scale(1.05); }
.lightbox-close:focus-visible, .lightbox-nav:focus-visible { outline:3px solid #fff2c9; outline-offset:3px; }
.lightbox-close {
  position:absolute;
  top:20px;
  right:20px;
  width:52px;
  height:52px;
  font-size:36px;
  line-height:1;
}
.lightbox-nav { width:56px; height:56px; font-size:45px; line-height:.8; justify-self:center; }
body.lightbox-open { overflow:hidden; }
@keyframes lightbox-in { from { opacity:0; } to { opacity:1; } }
@keyframes image-in { from { opacity:0; transform:scale(.975); } to { opacity:1; transform:none; } }

.help-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:16px; }
.help-card { border:1px solid var(--line); border-radius:22px; padding:22px; background:linear-gradient(135deg,rgba(245,223,218,.65),rgba(255,242,201,.66)); }
.help-card h3 { margin-top:0; color:var(--red-dark); }
.help-card p { margin-bottom:16px; }

.telegram-banner { text-align:center; background:linear-gradient(120deg,rgba(169,85,78,.92),rgba(210,161,63,.88)); color:white; }
.telegram-banner h2 { color:white; }
.telegram-banner a { color:white; }
.telegram-banner .button { background:linear-gradient(90deg,#ffeb3b,#ff9800); color:#7a1d00; border-color:rgba(255,255,255,.65); box-shadow:0 9px 22px rgba(80,25,0,.22); }

.site-footer { margin-top:36px; border-top:1px solid var(--line); background:rgba(117,59,56,.94); color:#fff7e8; padding:34px 0; }
.footer-grid { display:grid; grid-template-columns:1.3fr .7fr; gap:30px; }
.site-footer a { color:#fff4c9; }
.small { font-size:13px; opacity:.88; }

@media (max-width:900px) {
  .nav { display:none; }
  .hero-grid,.story { grid-template-columns:1fr; }
  .hero-photo { max-width:650px; }
  .cards { grid-template-columns:1fr; }
  .gallery { grid-template-columns:repeat(6,minmax(0,1fr)); grid-auto-rows:70px; }
  .gallery-item, .gallery-item:nth-child(7n+3) { grid-column:span 3; grid-row:span 4; }
  .gallery-item:nth-child(5n+1) { grid-column:span 6; grid-row:span 5; }
}
@media (max-width:560px) {
  .container { width:min(100% - 22px,1160px); }
  .hero { padding-top:42px; }
  .section-head { display:block; }
  .telegram-tag { margin-top:12px; }
  .gallery { grid-template-columns:1fr; grid-auto-rows:auto; gap:12px; }
  .gallery-item, .gallery-item:nth-child(n) { grid-column:auto; grid-row:auto; aspect-ratio:4/3; }
  .help-grid,.footer-grid { grid-template-columns:1fr; }
  .gallery-zoom { opacity:1; transform:none; width:38px; height:38px; }
  .lightbox { grid-template-columns:48px minmax(0,1fr) 48px; padding:18px 8px; }
  .lightbox-nav { width:44px; height:44px; font-size:36px; }
  .lightbox-close { top:10px; right:10px; width:44px; height:44px; font-size:30px; }
  .lightbox-image { max-height:calc(100vh - 90px); border-radius:12px; }
  .hero-note { position:static; margin-top:10px; max-width:none; }
}

/* Story redesign */
.story-redesign{overflow:hidden;position:relative}.story-redesign:before{content:"∞";position:absolute;right:-40px;top:10px;font-size:220px;line-height:1;color:rgba(211,47,47,.035);font-weight:900;pointer-events:none}.story-hero{display:grid;grid-template-columns:minmax(240px,.72fr) minmax(0,1.28fr);gap:34px;align-items:start}.story-photo-top-left{position:sticky;top:92px}.story-photo-top-left img{width:100%;display:block;aspect-ratio:4/5;object-fit:cover;object-position:top left;border-radius:28px;border:1px solid var(--line);box-shadow:0 20px 45px rgba(98,48,37,.16)}.story-eyebrow{display:inline-flex;padding:7px 12px;border-radius:999px;background:linear-gradient(90deg,#fff0b5,#ffd166);color:#8a2900;font-weight:900;font-size:13px;text-transform:uppercase;letter-spacing:.06em}.story-lead{font-size:clamp(19px,2.2vw,27px);line-height:1.45;color:#5f463e;margin:8px 0 22px}.story-body{max-width:900px;margin:44px auto 0}.story-chapter{position:relative;margin:0 0 26px;padding:30px 32px 24px;border:1px solid var(--line);border-radius:26px;background:rgba(255,255,255,.78);box-shadow:0 12px 28px rgba(98,48,37,.07)}.story-chapter h3{margin:0 0 16px;color:var(--red-dark);font-size:clamp(24px,3vw,34px)}.story-chapter p{font-size:17px;line-height:1.78}.chapter-number{position:absolute;right:24px;top:16px;font-size:44px;font-weight:900;color:rgba(211,47,47,.10)}.story-quote{position:relative;margin:24px 0;padding:24px 30px 24px 58px;border:1px solid rgba(245,124,0,.24);border-radius:24px;background:linear-gradient(135deg,#fff7d8,#ffe4bd);font-size:clamp(20px,2.7vw,31px);line-height:1.45;font-weight:900;color:#7a2d16}.story-quote:before{content:"“";position:absolute;left:19px;top:2px;font-size:68px;color:#f57c00;line-height:1}.story-quote-hero{margin-top:24px}.story-quote-large{text-align:center;padding:34px 45px}.story-highlight,.story-milestone{display:flex;gap:20px;align-items:flex-start;margin:26px 0;padding:24px 26px;border-radius:24px;border:1px solid rgba(211,47,47,.22);background:linear-gradient(135deg,rgba(255,235,59,.22),rgba(255,152,0,.13))}.highlight-icon,.milestone-icon{width:56px;height:56px;display:grid;place-items:center;flex:none;border-radius:50%;background:linear-gradient(135deg,#ef5350,#ffb300);color:white;font-size:28px;font-weight:900}.story-highlight strong{display:block;color:var(--red-dark);font-size:24px}.story-highlight p,.story-milestone p{margin:8px 0 0}.story-milestone span{font-size:13px;text-transform:uppercase;letter-spacing:.08em;font-weight:900;color:#b74419}.story-milestone h3{margin:4px 0 6px;color:var(--red-dark);font-size:28px}.story-statement{margin:32px 0;padding:38px;text-align:center;border-radius:30px;background:linear-gradient(120deg,#d32f2f,#f57c00,#fbc02d);color:white;box-shadow:0 18px 35px rgba(211,47,47,.22)}.story-statement small{display:block;font-size:16px;opacity:.9}.story-statement strong{display:block;font-size:clamp(48px,8vw,84px);line-height:1;margin-top:10px}.story-timeline{position:relative;margin:36px 0;padding-left:30px}.story-timeline:before{content:"";position:absolute;left:8px;top:8px;bottom:8px;width:3px;background:linear-gradient(#d32f2f,#f57c00,#fbc02d);border-radius:4px}.timeline-item{position:relative;padding:0 0 25px 28px}.timeline-item:before{content:"";position:absolute;left:-28px;top:5px;width:15px;height:15px;border-radius:50%;background:#fff;border:4px solid #f57c00;box-shadow:0 0 0 4px #fff6d2}.timeline-item span{display:block;font-size:13px;font-weight:900;color:#b74419;text-transform:uppercase;letter-spacing:.08em}.timeline-item strong{display:block;font-size:20px;color:#642b20;margin-top:4px}.story-word-card{margin:34px 0;padding:38px;text-align:center;border-radius:32px;border:1px solid rgba(211,47,47,.25);background:radial-gradient(circle at top,#fff9d4,#ffd6c6)}.story-word-card span{display:block;text-transform:uppercase;letter-spacing:.12em;font-size:13px;font-weight:900;color:#a33922}.story-word-card strong{display:block;font-size:clamp(64px,11vw,118px);line-height:1;color:#c62828;margin:12px 0;text-shadow:0 6px 0 rgba(255,193,7,.22)}.story-final{margin:34px 0;padding:42px;text-align:center;border-radius:34px;background:linear-gradient(145deg,#fff0cf,#ffe0d4);border:1px solid var(--line)}.final-infinity{display:block;font-size:72px;font-weight:900;line-height:.8;color:#d84315}.story-final h3{font-size:44px;margin:12px 0;color:var(--red-dark)}.story-final p{font-size:20px;line-height:1.7}.story-final strong{font-size:36px;color:#c62828}.story-closing{padding:44px 24px;text-align:center}.story-closing p{margin:0;font-size:clamp(32px,5vw,58px);font-weight:900;line-height:1.15;color:var(--red-dark)}.story-closing div{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:24px}.story-closing span{padding:10px 17px;border-radius:999px;background:linear-gradient(90deg,#d32f2f,#f57c00,#fbc02d);color:white;font-weight:900}.reveal-on-scroll{opacity:0;transform:translateY(28px);transition:opacity .7s ease,transform .7s ease}.reveal-on-scroll.is-visible{opacity:1;transform:none}.reveal-on-scroll:hover.story-chapter,.story-milestone:hover,.story-highlight:hover{transform:translateY(-3px);box-shadow:0 18px 34px rgba(98,48,37,.11)}
@media (prefers-reduced-motion:reduce){.reveal-on-scroll{opacity:1;transform:none;transition:none}}
@media (max-width:900px){.story-hero{grid-template-columns:1fr}.story-photo-top-left{position:relative;top:auto;max-width:520px}.story-body{margin-top:28px}}
@media (max-width:560px){.story-chapter{padding:24px 20px}.chapter-number{font-size:34px;right:16px}.story-highlight,.story-milestone{padding:20px;gap:14px}.highlight-icon,.milestone-icon{width:46px;height:46px}.story-quote{padding:22px 20px 22px 50px}.story-statement,.story-word-card,.story-final{padding:28px 20px}.story-final h3{font-size:34px}}
