/* Mobile/UI polish and richer law-guide presentation */

:root{
  --safe-bottom:env(safe-area-inset-bottom,0px);
}

.info-card{
  display:flex;
  flex-direction:column;
  min-height:220px;
}

.info-card .text-link{
  margin-top:auto;
  padding-top:10px;
  text-align:left;
}

.post-card,.case-card,.info-card{
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}

.post-card[data-post],.case-card[data-post]{cursor:pointer}

@media (hover:hover){
  .post-card[data-post]:hover,.case-card[data-post]:hover,.info-card:hover{
    transform:translateY(-2px);
    border-color:#c8d6e8;
    box-shadow:0 18px 50px rgba(15,32,59,.11);
  }
}

.post-footer{
  flex-wrap:wrap;
  row-gap:6px;
}

.law-meta{
  margin:0 0 22px;
  display:flex;
  align-items:center;
  gap:10px;
  color:#5b6778;
  font-size:14px;
}

.law-meta::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:#16794b;
  flex:none;
}

.guide-lead{
  font-size:18px;
  color:#4f5c6d;
  margin:0 0 22px;
}

.guide-section{
  margin:24px 0;
}

.guide-section h3{
  margin:0 0 10px;
  font-size:20px;
}

.guide-section p{
  margin:8px 0;
}

.guide-checklist{
  margin:12px 0 0;
  padding-left:22px;
}

.guide-checklist li{
  margin:9px 0;
}

.guide-callout{
  border:1px solid #cfe0f8;
  background:#f3f7fd;
  border-radius:16px;
  padding:17px 18px;
  margin:20px 0;
}

.guide-callout strong{
  display:block;
  margin-bottom:5px;
}

.guide-warning{
  border-color:#ead7a6;
  background:#fff8e6;
}

.guide-sources{
  border-top:1px solid #e2e8f0;
  margin-top:28px;
  padding-top:20px;
}

.guide-sources h3{
  margin:0 0 12px;
}

.guide-source-list{
  display:grid;
  gap:10px;
}

.guide-source-link{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:center;
  text-decoration:none;
  color:#1f5fc6;
  font-weight:700;
  border:1px solid #d6e0ed;
  border-radius:13px;
  padding:12px 14px;
  background:#fff;
}

.guide-source-link span:last-child{
  color:#6e7a8a;
  font-size:12px;
  font-weight:600;
  white-space:nowrap;
}

@media(min-width:980px){
  #law .law-grid{grid-template-columns:repeat(3,1fr)}
}

@media(max-width:900px){
  .mobile-nav{
    height:calc(72px + var(--safe-bottom));
    padding-bottom:var(--safe-bottom);
  }
  .section:last-of-type{padding-bottom:calc(126px + var(--safe-bottom))}
}

@media(max-width:620px){
  .topbar{
    height:64px;
    padding-left:16px;
    padding-right:16px;
  }

  .brand{
    font-size:19px;
    letter-spacing:-.02em;
  }

  .menu-btn{
    padding:9px 12px;
    border-radius:12px;
    font-size:14px;
    min-height:40px;
  }

  .hero{
    padding:28px 16px 42px;
    gap:28px;
  }

  .hero h1{
    font-size:clamp(38px,11.5vw,48px);
    line-height:1.01;
    margin:18px 0 20px;
  }

  .hero-copy>p:not(.disclaimer){
    font-size:17px;
    line-height:1.55;
  }

  .cta-row{
    grid-template-columns:1fr;
    gap:10px;
    margin:24px 0;
  }

  .cta-row .btn{
    width:100%;
    min-height:50px;
  }

  .section{
    padding:46px 16px;
  }

  .section-white{
    padding-left:16px;
    padding-right:16px;
  }

  .section h2{
    font-size:clamp(30px,9vw,38px);
    margin-top:12px;
  }

  .section-intro{
    font-size:16px;
  }

  .hero-card,.info-card,.calculator-card,.bands-card,.post-card,.case-card{
    padding:20px;
    border-radius:18px;
  }

  .info-card{min-height:0}

  .post-top,.case-top{
    gap:10px;
  }

  .post-top h3,.case-card h3{
    line-height:1.25;
  }

  .post-footer{
    gap:8px 14px;
  }

  .toolbar{
    margin:20px 0;
  }

  .input{
    min-height:48px;
    font-size:16px;
  }

  textarea.input{min-height:120px}

  .mobile-nav a{
    min-height:64px;
    -webkit-tap-highlight-color:transparent;
  }

  .mobile-nav strong{font-size:13px}
  .mobile-nav span{font-size:10px}

  .modal{
    padding:0;
    align-items:flex-end;
  }

  .modal-card{
    width:100%;
    max-height:92dvh;
    border-radius:24px 24px 0 0;
    padding:30px 18px calc(24px + var(--safe-bottom));
  }

  .modal-card h2{
    font-size:28px;
    line-height:1.12;
    padding-right:34px;
  }

  .close-btn{
    right:14px;
    top:12px;
    width:42px;
    height:42px;
  }

  .guide-lead{font-size:17px}

  .guide-source-link{
    align-items:flex-start;
    flex-direction:column;
    gap:3px;
  }

  .guide-source-link span:last-child{white-space:normal}

  .law-meta{
    align-items:flex-start;
    line-height:1.4;
  }
}
