/* YakData visual elevation, Phase 6
   Interaction system: buttons, text links, focus, controls, forms.
   Loaded after Phase 5 so interaction behavior is consistent site-wide. */

:root{
  --yd-action-radius:6px;
  --yd-action-shadow:0 8px 20px rgba(7,24,39,.10);
  --yd-action-shadow-hover:0 11px 26px rgba(7,24,39,.16);
  --yd-focus-ring:#D9AE3C;
  --yd-focus-halo:rgba(217,174,60,.22);
}

/* 1. All true controls feel intentional and reachable. */
body[data-page] :is(button,[role="button"],summary){
  -webkit-tap-highlight-color:transparent;
}

body[data-page] button:not(:disabled),
body[data-page] [role="button"]:not([aria-disabled="true"]),
body[data-page] summary{
  cursor:pointer;
}

body[data-page] :is(a,button,input,textarea,select,summary,[role="button"]):focus-visible{
  outline:3px solid var(--yd-focus-ring)!important;
  outline-offset:3px!important;
  box-shadow:0 0 0 5px var(--yd-focus-halo)!important;
}

/* 2. One button family, with hierarchy carried by fill rather than geometry. */
body[data-page] .btn{
  min-height:46px;
  padding:12px 20px;
  border-radius:var(--yd-action-radius)!important;
  gap:8px;
  font-weight:750;
  letter-spacing:.065em;
  line-height:1.15;
  text-decoration:none!important;
  box-shadow:none;
  transition:transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease;
}

body[data-page] .btn:hover{
  transform:translateY(-1px);
  box-shadow:var(--yd-action-shadow);
  text-decoration:none!important;
}

body[data-page] .btn:active{
  transform:translateY(0);
  box-shadow:none;
}

body[data-page] .btn.gold:hover,
body[data-page] .btn.navy:hover{
  box-shadow:var(--yd-action-shadow-hover);
}

body[data-page] :is(.btn.ghost,.btn.outline,.btn.ghost-light,.btn.light){
  background-clip:padding-box;
}

body[data-page] .btn[disabled],
body[data-page] button[disabled],
body[data-page] [aria-disabled="true"]{
  opacity:.55;
  cursor:not-allowed!important;
  transform:none!important;
  box-shadow:none!important;
}

/* 3. Navigation should feel interactive without looking like another CTA row. */
body[data-page] .nav a:not(.nav-cta){
  position:relative;
  text-decoration:none!important;
  transition:color .15s ease;
}

body[data-page] .nav a:not(.nav-cta)::after{
  content:"";
  position:absolute;
  left:10px;
  right:10px;
  bottom:4px;
  height:2px;
  border-radius:2px;
  background:currentColor;
  opacity:0;
  transform:scaleX(.55);
  transition:opacity .15s ease, transform .15s ease;
}

body[data-page] .nav a:not(.nav-cta):is(:hover,[aria-current="page"])::after{
  opacity:.58;
  transform:scaleX(1);
}

body[data-page] .nav .nav-cta{
  border-radius:var(--yd-action-radius)!important;
  transition:transform .16s ease, box-shadow .16s ease, background-color .16s ease, color .16s ease;
}

body[data-page] .nav .nav-cta:hover{
  transform:translateY(-1px);
  box-shadow:var(--yd-action-shadow);
  text-decoration:none!important;
}

/* 4. Inline links are unmistakably links. Card and navigation links stay clean. */
body[data-page] :is(
  .lede a,
  .prose a,
  .section p a:not(.btn),
  .section li a:not(.btn),
  .case-index-foot a,
  .episodes-note a,
  .kit-privacy a,
  .final-enterprise-note a,
  .r77-text-link,
  .r77-close-link,
  .mth-text-link,
  .reviews-text-link,
  .lab-text-link
){
  text-decoration-line:underline;
  text-decoration-thickness:1px;
  text-underline-offset:4px;
  text-decoration-color:color-mix(in srgb, currentColor 42%, transparent);
  transition:color .15s ease, text-decoration-color .15s ease;
}

body[data-page] :is(
  .lede a,
  .prose a,
  .section p a:not(.btn),
  .section li a:not(.btn),
  .case-index-foot a,
  .episodes-note a,
  .kit-privacy a,
  .final-enterprise-note a,
  .r77-text-link,
  .r77-close-link,
  .mth-text-link,
  .reviews-text-link,
  .lab-text-link
):hover{
  text-decoration-thickness:2px;
  text-decoration-color:currentColor;
}

/* 5. Small text actions should not be tiny click targets. */
body[data-page] :is(.r77-text-link,.r77-close-link,.mth-text-link,.reviews-text-link,.lab-text-link){
  display:inline-flex;
  align-items:center;
  min-height:36px;
  padding-block:5px;
}

/* 6. Utility and copy actions behave like controls, not accidental underlined text. */
body[data-page] .purchase-tools :is(button,a),
body[data-page] .yd-approval-actions button{
  min-height:36px;
  border-radius:4px;
  text-underline-offset:4px;
  transition:color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

body[data-page] .purchase-tools :is(button,a):hover{
  text-decoration-thickness:2px;
}

/* 7. Forms receive the same focus and state language as the rest of the site. */
body[data-page] :is(input,textarea,select){
  border-radius:5px!important;
  transition:border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

body[data-page] :is(input,textarea,select):hover:not(:disabled){
  border-color:#8796A3!important;
}

body[data-page] :is(input,textarea,select):focus{
  border-color:#8B6B18!important;
}

body[data-page] :is(input,textarea)::placeholder{
  opacity:.72;
}

/* 8. Interactive architecture and calculator controls get clear selected states. */
body[data-page="77_rules_internal_system"] .r77-control,
body[data-page="8x_engineer"] .preset,
body[data-page="method"] .mth-arrow{
  border-radius:5px!important;
  transition:transform .14s ease, border-color .14s ease, background-color .14s ease, color .14s ease, box-shadow .14s ease;
}

body[data-page="77_rules_internal_system"] .r77-control:hover,
body[data-page="8x_engineer"] .preset:hover,
body[data-page="method"] .mth-arrow:hover{
  transform:translateY(-1px);
}

body[data-page="77_rules_internal_system"] .r77-control.active,
body[data-page="8x_engineer"] .preset.active{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.12), 0 5px 14px rgba(7,24,39,.10);
}

body[data-page="method"] .mth-node{
  transition:transform .14s ease, background-color .14s ease, border-color .14s ease, box-shadow .14s ease;
}

body[data-page="method"] .mth-node:hover{
  transform:translateY(-1px);
}

body[data-page="method"] .mth-node[aria-selected="true"]{
  box-shadow:0 7px 18px rgba(7,24,39,.10);
}

/* 9. Expanders announce that the whole row is interactive. */
body[data-page] details > summary{
  border-radius:4px;
}

body[data-page] details > summary:hover{
  background-color:rgba(11,29,45,.035);
}

/* 10. Footer actions keep their understated role while gaining proper focus and hover. */
body[data-page] .yd-footer-link-button{
  border-radius:3px;
}

body[data-page] .yd-footer-links :is(a,.yd-footer-link-button){
  text-underline-offset:4px;
  transition:color .15s ease, text-decoration-color .15s ease;
}

/* 11. Touch devices get adequate targets without desktop bloat. */
@media (max-width:760px){
  body[data-page] .btn{
    min-height:48px;
    padding:13px 18px;
  }
  body[data-page] .purchase-tools :is(button,a){
    min-height:40px;
    display:inline-flex;
    align-items:center;
  }
}

/* 12. Motion is optional. */
@media (prefers-reduced-motion:reduce){
  body[data-page] *,
  body[data-page] *::before,
  body[data-page] *::after{
    scroll-behavior:auto!important;
    transition-duration:.01ms!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
  }
  body[data-page] :is(.btn,.nav-cta,.r77-control,.preset,.mth-arrow,.mth-node):hover{
    transform:none!important;
  }
}
