/* Subaru Solterra responsive layout: load AFTER style.css */

/* Small desktops and landscape tablets */
@media screen and (max-width: 1100px) {
  .wrap { width: calc(100% - 36px); }
  .layout { grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; }
  .panel { padding: 25px; }
  .footer-grid { gap: 20px; }
}

/* Tablets */
@media screen and (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .sidecard { margin-bottom: 0; min-width: 0; }
  .sidebar .sidecard:last-child { grid-column: 1 / -1; }
  .nav .wrap { justify-content: center; }
  .nav a { padding: 12px 14px; }
  .hero { min-height: 325px; }
  .hero .wrap { padding: 40px 0; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
}

/* Phones, including landscape */
@media screen and (max-width: 640px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; line-height: 1.65; }
  .wrap { width: calc(100% - 28px); }
  .topbar { font-size: 11px; line-height: 1.4; text-align: center; }
  .header-grid { display: flex; flex-direction: column; align-items: stretch; gap: 15px; padding: 15px 0; }
  .brand { justify-content: center; gap: 10px; }
  .brand strong { font-size: 21px; }
  .brand small { font-size: 10px; }
  .mark { width: 42px; height: 42px; flex: 0 0 42px; }
  .search { max-width: none; width: 100%; flex: none; min-height: 46px; }
  .search input { min-width: 0; width: 0; font-size: 16px; padding: 10px 12px; }
  .search button { padding: 0 15px; min-width: 78px; }

  /* Keep navigation reachable; no clipped or hidden links */
  .nav .wrap { display: flex; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .nav a { flex: 0 0 auto; white-space: nowrap; padding: 13px 12px; font-size: 13px; }

  .hero { min-height: 290px; }
  .hero:before { background: linear-gradient(90deg, rgba(9,40,63,.96), rgba(9,40,63,.62)), url('/images/solterra-hero.webp') center / cover no-repeat; }
  .hero .wrap { padding: 36px 0; }
  .hero h1 { font-size: clamp(28px, 8vw, 38px); line-height: 1.14; margin: 12px 0; }
  .hero p { font-size: 15px; max-width: 100%; }
  .hero .cta { padding: 11px 16px; }

  .layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 16px; padding-bottom: 28px; }
  .panel { padding: 18px 16px; border-radius: 12px; }
  .breadcrumbs { font-size: 12px; overflow-wrap: anywhere; margin-bottom: 12px; }
  .eyebrow { font-size: 11px; }
  h1 { font-size: clamp(25px, 7vw, 33px); }
  h2 { font-size: 22px; }
  h3 { font-size: 18px; }
  .article { min-width: 0; overflow-wrap: anywhere; }
  .article img, .article video, .article iframe, .article embed, .article object { max-width: 100% !important; height: auto; }
  .article img[align="left"], .article img[align="right"] { float: none !important; display: block; margin: 12px auto !important; }
  .article table { display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
  .article pre { max-width: 100%; overflow-x: auto; }
  .article ul, .article ol { padding-left: 20px; }
  .manual-card ul { columns: 1; }
  .link-grid, .pager { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .sidebar { display: block; }
  .sidecard { padding: 18px; margin-bottom: 14px; }
  .sidephoto { max-height: 250px; object-fit: cover; }
  .footer { padding: 28px 0 16px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .footer h2 { font-size: 15px; }
  .footer p, .footer li { font-size: 13px; }
  .copyright { line-height: 1.6; }
}

/* Narrow phones */
@media screen and (max-width: 380px) {
  .wrap { width: calc(100% - 22px); }
  .panel { padding: 16px 13px; }
  .brand strong { font-size: 19px; }
  .hero { min-height: 265px; }
  .hero .wrap { padding: 27px 0; }
  .hero h1 { font-size: 27px; }
  .sidecard { padding: 15px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid > div:first-child { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Final type scale overrides for all phones and tablets */
@media(max-width:900px){.layout{grid-template-columns:minmax(0,1fr)}.hero h1{font-size:31px}.panel{padding:21px}}
@media(max-width:640px){body{font-size:14px;line-height:1.6}.header-grid{padding:11px 0;gap:10px}.brand{justify-content:flex-start}.brand-logo{width:40px;height:40px}.brand strong{font-size:17px}.brand small{font-size:9px}.hero{min-height:240px}.hero .wrap{padding:24px 0}.hero h1{font-size:27px;line-height:1.16}.hero p{font-size:13px}.hero .cta{font-size:12px;padding:9px 13px}.panel{padding:16px}.panel h1{font-size:23px}.article h2,.panel h2{font-size:18px}.article h3,.panel h3{font-size:15px}.intro{font-size:14px}.feature-image img,.manual-image img{max-height:230px}.nav a{font-size:12px;padding:10px 11px}.sidecard h2{font-size:15px}}
@media(max-width:380px){.hero h1{font-size:24px}.panel h1{font-size:21px}.brand strong{font-size:16px}}
