/* Toroosio theme layer: WordPress integration, responsive header/footer and the desktop/mobile page views.
   Design tokens and components live in toroosio.css. */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { overflow-x: hidden; }
.wp-site-blocks { padding: 0; }
.wp-site-blocks > * + * { margin-block-start: 0; }
.tr-content > *, .tr-view > * { margin-block: 0; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* ---------- Page views: desktop design ≥ 900px, mobile design below ---------- */
.tr-view--mobile { display: none; }
@media (max-width: 899.98px) {
  .tr-view--desktop { display: none; }
  .tr-view--mobile { display: block; }
}
/* Desktop design: keep its 1200px content column on wide screens, tighten gutters on smaller ones. */
.tr-view--desktop > section[style*="120px"],
.tr-view--desktop > div > section[style*="120px"] {
  padding-left: max(clamp(24px, 6vw, 120px), calc((100% - 1200px) / 2)) !important;
  padding-right: max(clamp(24px, 6vw, 120px), calc((100% - 1200px) / 2)) !important;
}
.tr-view--desktop svg[style*="width: 100%"] { max-width: none; }
/* Between tablet and laptop widths, scale the desktop design down as a whole so its proportions hold. */
@media (min-width: 900px) and (max-width: 1059.98px) { .tr-view--desktop { zoom: .72; } }
@media (min-width: 1060px) and (max-width: 1239.98px) { .tr-view--desktop { zoom: .84; } }
/* Mobile design: fill the phone or tablet width. */
.tr-view--mobile > section { width: 100%; }
@media (min-width: 560px) {
  .tr-view--mobile > section { padding-left: max(20px, calc((100% - 560px) / 2)) !important; padding-right: max(20px, calc((100% - 560px) / 2)) !important; }
}

/* ---------- Skip link ---------- */
.tr-skip { position: absolute; left: 12px; top: -60px; z-index: 1000; background: #0a1628; color: #fff; padding: 10px 16px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.tr-skip:focus { top: 12px; color: #fff; }

/* ---------- Header ---------- */
.tr-header { position: sticky; top: 0; z-index: 100; background: #fff; border-bottom: 1px solid #e6e8ea; }
.admin-bar .tr-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tr-header { top: 0; position: relative; } }
.tr-header__bar { height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-inline: max(clamp(20px, 6vw, 120px), calc((100% - 1200px) / 2)); }
.tr-header__logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.tr-header__logo img:first-child { width: 46px; height: 40px; object-fit: contain; }
.tr-header__logo img:last-child { width: 132px; height: 26px; object-fit: contain; }
.tr-nav { display: flex; gap: 4px; align-items: center; }
.tr-nav__item { position: relative; }
.tr-nav .nav-link[aria-expanded="true"] svg { transform: rotate(180deg); }
.tr-nav .nav-link svg { transition: transform .15s ease; }
.tr-mega { position: absolute; top: calc(100% + 18px); left: -16px; width: 720px; background: #fff; border: 1px solid #e6e8ea; border-radius: 16px; box-shadow: 0 8px 24px rgba(10,22,40,.10); padding: 20px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.tr-mega[hidden] { display: none; }
.tr-mega--partners { width: 460px; grid-template-columns: 1fr; }
.tr-mega__col { display: flex; flex-direction: column; gap: 4px; }
.tr-mega__label { font-weight: 600; padding-inline: 16px; margin-bottom: 4px; }
.tr-mega__text { display: flex; flex-direction: column; gap: 2px; }
.tr-mega__cta { border-radius: 12px; padding: 24px; background: radial-gradient(120% 90% at 50% 0%, #2a1a5e 0%, #0a1628 60%); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.tr-mega__cta .btn { margin-top: auto; }
.tr-mega__all { padding: 8px 16px; }
.tr-header__actions { display: flex; align-items: center; gap: 8px; }
.tr-burger { display: none; }
.tr-burger__close { display: none; }
.tr-burger[aria-expanded="true"] .tr-burger__open { display: none; }
.tr-burger[aria-expanded="true"] .tr-burger__close { display: block; }
.tr-mobile-menu { display: none; }
@media (max-width: 899.98px) {
  .tr-header__bar { height: 64px; gap: 12px; }
  .tr-header__logo { gap: 8px; }
  .tr-header__logo img:first-child { width: 35px; height: 30px; }
  .tr-header__logo img:last-child { width: 97px; height: 19px; }
  .tr-nav { display: none; }
  .tr-header__cta { min-height: 40px; padding: 0 16px; }
  .tr-burger { display: inline-flex; }
  .tr-mobile-menu:not([hidden]) { display: flex; flex-direction: column; padding: 8px 20px 24px; max-height: calc(100vh - 64px); overflow-y: auto; border-top: 1px solid #e6e8ea; }
  .tr-mobile-menu .tr-acc, .tr-mobile-menu .tr-mobile-link { justify-content: space-between; height: 56px; padding: 0; font-size: 18px; border-radius: 0; border-bottom: 1px solid #e6e8ea; width: 100%; }
  .tr-mobile-menu .tr-acc[aria-expanded="true"] svg { transform: rotate(180deg); }
  .tr-acc__panel { display: flex; flex-direction: column; padding: 8px 0; }
  .tr-acc__panel[hidden] { display: none; }
  .tr-acc__panel .mega-item { padding: 12px; }
  .tr-mobile-menu .btn { margin-top: 24px; }
  html.tr-menu-open body { overflow: hidden; }
}
@media (max-width: 380px) { .tr-header__cta { display: none; } }

/* ---------- Footer ---------- */
.tr-footer { position: relative; overflow: hidden; background: #0a1628; color: #fff; padding: 64px max(clamp(20px, 6vw, 120px), calc((100% - 1200px) / 2)) 32px; display: flex; flex-direction: column; gap: 48px; }
.tr-footer__sky { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 120px; }
.tr-footer__grid { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 32px; }
.tr-footer__brand { grid-column: span 4; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.tr-footer__logo { display: flex; align-items: center; gap: 12px; }
.tr-footer__logo img:first-child { width: 51px; height: 44px; object-fit: contain; }
.tr-footer__logo img:last-child { width: 120px; height: 26px; object-fit: contain; }
.tr-footer__col { grid-column: span 2; display: flex; flex-direction: column; gap: 12px; }
.tr-footer__col:nth-of-type(1) { grid-column: 6 / span 2; }
.tr-footer__col:last-child { grid-column: span 1; white-space: nowrap; }
.tr-footer__base { position: relative; margin-top: auto; border-top: 1px solid rgba(255,255,255,.16); padding-top: 24px; display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; color: #c2c5c9; }
.tr-footer__base address { font-style: normal; }
@media (max-width: 899.98px) {
  .tr-footer { padding: 48px 20px 32px; gap: 40px; }
  .tr-footer__sky { height: 90px; }
  .tr-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 20px; }
  .tr-footer__brand { grid-column: 1 / -1; }
  .tr-footer__brand .btn { width: 100%; min-height: 48px; }
  .tr-footer__col, .tr-footer__col:nth-of-type(1), .tr-footer__col:last-child { grid-column: span 1; gap: 10px; }
  .tr-footer__base { flex-direction: column; padding-top: 20px; }
}

/* ---------- Contact form ---------- */
.tr-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.tr-form-status:empty { display: none; }
.tr-form-status { border-radius: 10px; padding: 12px 16px; font-weight: 500; }
.tr-form-status.is-sent { background: #e8f7ef; color: #0f5f3e; }
.tr-form-status.is-invalid, .tr-form-status.is-error { background: #ffe8f4; color: #8c0049; }

/* ---------- Plain pages (privacy, posts, 404) ---------- */
.tr-prose { padding: 64px 24px 96px; }
.tr-prose > * + * { margin-block-start: 16px; }
.tr-prose h2 { font-size: 28px; line-height: 36px; margin-block-start: 40px; }
.tr-prose p, .tr-prose li { font-size: 17px; line-height: 28px; }
.tr-prose ul { list-style: disc; padding-left: 24px; }
