/* 4detki.ru — starter portal sections 1.48.0 */
:root {
  --portal-ink: #081433;
  --portal-muted: #38517d;
  --portal-pink: #f40061;
  --portal-blue: #1687df;
  --portal-line: #dce8f4;
  --portal-surface: #fff;
  --portal-shadow: 0 14px 36px rgba(34, 77, 125, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.portal-page {
  margin: 0;
  color: var(--portal-ink);
  background: linear-gradient(180deg, #f3faff 0, #fff 720px);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.portal-page a { color: inherit; }
.portal-page .container { width: min(1240px, calc(100% - 32px)); margin-inline: auto; }
.portal-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

.portal-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--portal-line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.portal-header__inner { min-height: 78px; display: flex; align-items: center; gap: 30px; }
.portal-brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 1.45rem; font-weight: 950; letter-spacing: -0.05em; }
.portal-brand__mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(145deg, #ff1671, #e90055); box-shadow: 0 9px 20px rgba(244, 0, 97, 0.22); font-size: 2rem; }
.portal-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.portal-nav a { padding: 11px 12px; border-radius: 12px; text-decoration: none; font-size: 0.9rem; font-weight: 800; }
.portal-nav a:hover, .portal-nav a[aria-current="page"] { color: var(--portal-pink); background: #fff1f7; }

.portal-hero { padding: 34px 0 26px; }
.portal-back { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 17px; color: #214577; text-decoration: none; font-weight: 750; }
.portal-hero__card { min-height: 310px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; overflow: hidden; border: 1px solid var(--portal-line); border-radius: 28px; background: linear-gradient(120deg, #fff 0%, #f6fbff 66%, #edf8ff 100%); box-shadow: var(--portal-shadow); }
.portal-hero__copy { align-self: center; padding: 44px 48px; }
.portal-eyebrow { margin: 0 0 9px; color: var(--portal-pink); font-size: 0.78rem; font-weight: 950; letter-spacing: 0.14em; text-transform: uppercase; }
.portal-hero h1 { max-width: 760px; margin: 0; font-family: "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif; font-size: clamp(2.3rem, 4.6vw, 4rem); font-weight: 950; letter-spacing: -0.06em; line-height: 0.98; }
.portal-hero__lead { max-width: 720px; margin: 19px 0 0; color: var(--portal-muted); font-size: 1.08rem; line-height: 1.55; }
.portal-hero-art { min-height: 310px; background-image: url("/assets/images/home-portal-v1/directions-sprite.webp"); background-repeat: no-repeat; background-size: 300% auto; }
.portal-hero-art--tasks { background-position: 0 14%; }
.portal-hero-art--school { background-position: 50% 14%; }
.portal-hero-art--poems { background-position: 100% 14%; }
.portal-hero-art--riddles { background-position: 0 86%; }
.portal-hero-art--drawing { background-position: 50% 86%; }
.portal-hero-art--crafts { background-position: 100% 86%; }
.portal-hero-art--songs { background-image: url("/assets/images/home-portal-v1/songs.webp"); background-position: center 35%; background-size: cover; }

.portal-chip-row { display: flex; gap: 9px; flex-wrap: wrap; margin: 23px 0 0; }
.portal-chip-row a, .portal-chip-row button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border: 1px solid #d8e5f2; border-radius: 999px; color: #173b6b; background: #fff; text-decoration: none; font: inherit; font-weight: 800; cursor: pointer; }
.portal-chip-row a:first-child, .portal-chip-row button.is-active { border-color: var(--portal-pink); color: #fff; background: var(--portal-pink); }

.portal-section { padding: 28px 0; }
.portal-section--soft { border-block: 1px solid #e7eff7; background: rgba(244, 250, 255, 0.82); }
.portal-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.portal-section h2 { margin: 0; font-family: "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif; font-size: clamp(1.7rem, 3vw, 2.5rem); letter-spacing: -0.045em; line-height: 1.08; }
.portal-section-heading p { max-width: 610px; margin: 6px 0 0; color: var(--portal-muted); line-height: 1.5; }

.portal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.portal-card { min-width: 0; padding: 22px; border: 1px solid var(--portal-line); border-radius: 20px; background: #fff; box-shadow: 0 9px 26px rgba(34, 77, 125, 0.07); }
a.portal-card { display: block; text-decoration: none; transition: transform 160ms ease, box-shadow 160ms ease; }
a.portal-card:hover { transform: translateY(-3px); box-shadow: 0 17px 34px rgba(34, 77, 125, 0.13); }
.portal-card__icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 17px; background: linear-gradient(145deg, #fff0f6, #eef8ff); font-size: 2rem; }
.portal-card h3 { margin: 0 0 7px; font-size: 1.15rem; line-height: 1.2; }
.portal-card p { margin: 0; color: var(--portal-muted); line-height: 1.48; }
.portal-card__meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.portal-card__meta span { padding: 5px 9px; border-radius: 999px; color: #31517c; background: #eef6fd; font-size: 0.76rem; font-weight: 750; }
.portal-card__cta { display: inline-flex; align-items: center; gap: 7px; margin-top: 17px; color: var(--portal-pink); font-weight: 900; }

.portal-print-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.portal-print-sheet { min-height: 300px; display: grid; place-items: center; padding: 22px; border: 1px solid var(--portal-line); border-radius: 20px; background: #fff; box-shadow: 0 9px 26px rgba(34, 77, 125, 0.07); text-align: center; }
.portal-print-sheet__picture { min-height: 160px; display: grid; place-items: center; font-size: 5rem; filter: grayscale(1); }
.portal-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 0; border-radius: 13px; color: #fff; background: var(--portal-pink); font: inherit; font-weight: 900; cursor: pointer; text-decoration: none; }
.portal-button--ghost { border: 1px solid #d8e5f2; color: #173b6b; background: #fff; }

.portal-riddle { padding: 0; overflow: hidden; }
.portal-riddle summary { padding: 21px; list-style: none; cursor: pointer; font-size: 1.08rem; font-weight: 850; line-height: 1.45; }
.portal-riddle summary::-webkit-details-marker { display: none; }
.portal-riddle summary::after { content: "+"; float: right; color: var(--portal-pink); font-size: 1.5rem; line-height: 1; }
.portal-riddle[open] summary::after { content: "−"; }
.portal-riddle__answer { padding: 16px 21px 20px; border-top: 1px solid var(--portal-line); color: #173b6b; background: #f5faff; font-weight: 850; }

.portal-reading { max-width: 820px; }
.portal-reading article { margin-bottom: 15px; padding: 23px 25px; border: 1px solid var(--portal-line); border-radius: 20px; background: #fff; box-shadow: 0 9px 25px rgba(34, 77, 125, 0.06); }
.portal-reading h3 { margin: 0 0 10px; font-size: 1.2rem; }
.portal-reading p, .portal-reading li { color: #243e68; font-size: 1.02rem; line-height: 1.7; }
.portal-reading ol, .portal-reading ul { margin-bottom: 0; padding-left: 22px; }

.portal-seo { padding: 30px 0 45px; }
.portal-seo__inner { max-width: 880px; color: #344e77; line-height: 1.68; }
.portal-seo h2 { color: var(--portal-ink); }
.portal-related { padding: 30px 0 44px; }
.portal-related__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.portal-related__links a { padding: 10px 14px; border: 1px solid var(--portal-line); border-radius: 12px; background: #fff; text-decoration: none; font-weight: 800; }

.portal-footer { padding: 28px 0; color: #eaf2fb; background: #123052; }
.portal-footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.portal-footer a { color: #fff; }
.portal-footer nav { display: flex; flex-wrap: wrap; gap: 17px; }

@media (max-width: 920px) {
  .portal-nav a:nth-child(n+5) { display: none; }
  .portal-hero__card { grid-template-columns: minmax(0, 1fr) 270px; }
  .portal-hero__copy { padding: 36px; }
  .portal-grid, .portal-print-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  body.portal-page { background: #f6fbff; }
  .portal-page .container { width: min(100% - 20px, 1240px); }
  .portal-header__inner { min-height: 64px; }
  .portal-brand { font-size: 1.2rem; }
  .portal-brand__mark { width: 42px; height: 42px; border-radius: 12px; font-size: 1.7rem; }
  .portal-nav { gap: 0; }
  .portal-nav a { display: none; }
  .portal-nav a:first-child { display: inline-flex; padding-inline: 10px; }
  .portal-hero { padding-top: 18px; }
  .portal-back { margin-bottom: 12px; }
  .portal-hero__card { min-height: 0; grid-template-columns: 1fr; border-radius: 21px; }
  .portal-hero__copy { padding: 25px 22px; }
  .portal-hero h1 { font-size: clamp(2.1rem, 11vw, 3rem); }
  .portal-hero__lead { margin-top: 13px; font-size: 0.96rem; }
  .portal-hero-art { min-height: 210px; order: -1; background-size: 300% auto; }
  .portal-hero-art--songs { background-size: cover; }
  .portal-chip-row { margin-top: 18px; gap: 7px; }
  .portal-chip-row a, .portal-chip-row button { min-height: 38px; padding: 7px 12px; font-size: 0.82rem; }
  .portal-section { padding: 22px 0; }
  .portal-section-heading { align-items: start; flex-direction: column; }
  .portal-grid, .portal-print-grid { grid-template-columns: 1fr; gap: 11px; }
  .portal-card { padding: 18px; border-radius: 17px; }
  .portal-print-sheet { min-height: 245px; }
  .portal-footer__inner { align-items: flex-start; flex-direction: column; }
}

@media print {
  .portal-header, .portal-hero, .portal-section-heading, .portal-button, .portal-related, .portal-footer, .portal-seo { display: none !important; }
  body.portal-page { background: #fff; }
  .portal-print-grid { display: block; }
  .portal-print-sheet { min-height: 260mm; margin: 0; border: 0; border-radius: 0; box-shadow: none; break-after: page; }
}
