/* ==========================================================================
   Lakeshore Loans USA — Reusable UI — buttons, cards, tables, gauges, accordions
   Part of the modular "Shoreline" design system. Load order: base → layout → components → sections.
   ========================================================================== */

/* ---------- Trust Gauge (signature component) ---------- */
.trust-gauge-panel{
  background:var(--white); border:1px solid var(--line); border-radius:var(--radius);
  padding:26px 28px; box-shadow:var(--shadow-1);
}
.trust-gauge-panel h3{ margin-bottom:4px; }
.trust-gauge-panel .gauge-overall{
  font-family:var(--mono); font-size:.78rem; color:var(--driftwood); margin-bottom:18px;
}
.trust-gauge-panel .gauge-overall b{ color:var(--lake-navy); font-size:1.1rem; }
.gauge-row{ margin-bottom:14px; }
.gauge-row:last-child{ margin-bottom:0; }
.gauge-label{ display:flex; justify-content:space-between; font-size:.82rem; margin-bottom:5px; }
.gauge-label span:first-child{ color:var(--ink); font-weight:600; }
.gauge-label span:last-child{ font-family:var(--mono); color:var(--driftwood); }
.gauge-track{ height:8px; background:var(--shore-sand); border-radius:4px; overflow:hidden; position:relative; }
.gauge-fill{ height:100%; background:linear-gradient(90deg, var(--lake-teal), var(--lake-teal-light)); border-radius:4px; }
.gauge-fill.low{ background:linear-gradient(90deg, var(--alert-rust), #c97a64); }
.gauge-fill.mid{ background:linear-gradient(90deg, var(--amber-tide-dark), var(--amber-tide)); }


/* ---------- Layout helpers ---------- */
section{ padding:56px 0; }
section.tight{ padding:36px 0; }
.section-head{ max-width:64ch; margin-bottom:34px; }
.section-head .eyebrow-mark{
  font-family:var(--mono); font-size:.72rem; letter-spacing:.14em; text-transform:uppercase;
  color:var(--lake-teal); margin-bottom:10px; display:block;
}
.grid-2{ display:grid; grid-template-columns:1.5fr 1fr; gap:40px; align-items:start; }
.grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:24px; }
.grid-4{ display:grid; grid-template-columns:repeat(4,1fr); gap:20px; }
@media (max-width:920px){ .grid-2{ grid-template-columns:1fr; } .grid-3{ grid-template-columns:1fr 1fr; } .grid-4{ grid-template-columns:1fr 1fr; } }
@media (max-width:560px){ .grid-3{ grid-template-columns:1fr; } .grid-4{ grid-template-columns:1fr; } }

.card{
  background:var(--white); border:1px solid var(--line); border-radius:var(--radius);
  padding:24px; box-shadow:var(--shadow-1);
}

/* Contour-style alternating section background, like depth bands on a lake chart */
.band-sand{ background:var(--shore-sand); }
.band-white{ background:var(--white); }
.band-navy{ background:var(--lake-navy); color:var(--shore-sand); }
.band-navy h2, .band-navy h3{ color:var(--white); }
.band-navy p{ color:rgba(237,230,216,0.78); }

hr.contour{
  border:none; border-top:1px solid var(--line); margin:0;
  position:relative;
}


/* ---------- Shoreline mark / stake numbering (used only where order is real) ---------- */
.stake-list{ list-style:none; margin:0; padding:0; counter-reset:stake; }
.stake-list li{
  counter-increment:stake;
  display:grid; grid-template-columns:52px 1fr; gap:18px;
  padding:22px 0; border-top:1px solid var(--line-soft);
}
.stake-list li:first-child{ border-top:none; }
.stake-list li::before{
  content:counter(stake, decimal-leading-zero);
  font-family:var(--mono); font-size:.95rem; color:var(--amber-tide-dark);
  border-right:1px solid var(--line); padding-top:3px;
}


/* ---------- Risk / verdict callouts ---------- */
.callout{
  border-radius:var(--radius); padding:20px 22px; margin:22px 0; border:1px solid;
  display:flex; gap:14px;
}
.callout .icon{ font-family:var(--mono); font-weight:700; font-size:.9rem; flex-shrink:0; }
.callout-risk{ background:var(--alert-rust-bg); border-color:rgba(177,72,52,0.3); }
.callout-risk .icon{ color:var(--alert-rust); }
.callout-risk h4{ color:var(--alert-rust); margin-bottom:4px; }
.callout-good{ background:var(--good-green-bg); border-color:rgba(60,110,71,0.28); }
.callout-good .icon{ color:var(--good-green); }
.callout-good h4{ color:var(--good-green); margin-bottom:4px; }
.callout-note{ background:var(--shore-sand); border-color:var(--line); }
.callout-note h4{ color:var(--lake-navy); margin-bottom:4px; }
.callout p:last-child{ margin-bottom:0; }


/* ---------- Tables ---------- */
table.data-table{ width:100%; border-collapse:collapse; font-size:.92rem; background:var(--white); }
table.data-table th, table.data-table td{
  text-align:left; padding:12px 14px; border-bottom:1px solid var(--line);
}
table.data-table thead th{
  background:var(--lake-navy); color:var(--shore-sand); font-family:var(--mono);
  font-size:.72rem; letter-spacing:.08em; text-transform:uppercase; font-weight:500;
}
table.data-table tbody tr:nth-child(even){ background:var(--shore-sand-2); }
table.data-table td.num{ font-family:var(--mono); }
.table-wrap{ overflow-x:auto; border:1px solid var(--line); border-radius:var(--radius); }
.table-wrap table{ border:none; }


/* ---------- Pros / cons ---------- */
.proscons{ display:grid; grid-template-columns:1fr 1fr; gap:20px; }
@media (max-width:680px){ .proscons{ grid-template-columns:1fr; } }
.proscons .card h3{ font-family:var(--mono); font-size:.78rem; letter-spacing:.1em; text-transform:uppercase; }

/* Cards and callouts: use h3 (semantic) but keep the smaller visual scale of the old h4 */
.card > h3,
.card > h4,
.callout h3,
.callout h4{
  font-size:1.05rem;
  font-weight:600;
  margin-bottom:.4em;
}
.proscons ul{ margin:0; padding-left:18px; }
.proscons li{ margin-bottom:8px; color:var(--ink-soft); }
.proscons .pros h4{ color:var(--good-green); }
.proscons .cons h4{ color:var(--alert-rust); }


/* ---------- FAQ accordion ---------- */
.faq-item{ border-bottom:1px solid var(--line); }
.faq-item:first-child{ border-top:1px solid var(--line); }
.faq-q{
  width:100%; text-align:left; background:none; border:none; cursor:pointer;
  padding:20px 4px; font-family:var(--body); font-weight:700; font-size:1rem; color:var(--lake-navy);
  display:flex; justify-content:space-between; align-items:center; gap:16px;
}
.faq-q .plus{ font-family:var(--mono); font-size:1.2rem; color:var(--amber-tide-dark); flex-shrink:0; transition:transform .2s ease; }
.faq-item[open] .plus{ transform:rotate(45deg); }
.faq-a{ padding:0 4px 20px; color:var(--ink-soft); }
details.faq-item summary{ list-style:none; }
details.faq-item summary::-webkit-details-marker{ display:none; }


/* ---------- CTA blocks ---------- */
.cta-block{
  background:linear-gradient(135deg, var(--lake-navy), var(--lake-teal));
  color:var(--white); border-radius:var(--radius); padding:40px;
  display:flex; justify-content:space-between; align-items:center; gap:32px; flex-wrap:wrap;
}
.cta-block h3{ color:var(--white); margin-bottom:6px; }
.cta-block p{ color:rgba(237,230,216,0.8); margin-bottom:0; max-width:48ch; }


/* ---------- Calculator ---------- */
.calc-wrap{ display:grid; grid-template-columns:1fr 1fr; gap:0; background:var(--white); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-1); }
@media (max-width:840px){ .calc-wrap{ grid-template-columns:1fr; } }
.calc-inputs{ padding:34px; border-right:1px solid var(--line); }
@media (max-width:840px){ .calc-inputs{ border-right:none; border-bottom:1px solid var(--line); } }
.calc-results{ padding:34px; background:var(--lake-navy); color:var(--shore-sand); }
.field{ margin-bottom:22px; }
.field label{ display:flex; justify-content:space-between; font-size:.85rem; font-weight:700; color:var(--lake-navy); margin-bottom:8px; }
.field label .val{ font-family:var(--mono); color:var(--amber-tide-dark); }
input[type="range"]{
  width:100%; height:6px; border-radius:3px; background:var(--shore-sand); appearance:none; -webkit-appearance:none;
}
input[type="range"]::-webkit-slider-thumb{
  appearance:none; -webkit-appearance:none; width:18px; height:18px; border-radius:50%;
  background:var(--amber-tide); border:2px solid var(--white); box-shadow:0 0 0 1px var(--lake-navy); cursor:pointer;
}
input[type="range"]::-moz-range-thumb{
  width:18px; height:18px; border-radius:50%; background:var(--amber-tide); border:2px solid var(--white); box-shadow:0 0 0 1px var(--lake-navy); cursor:pointer;
}
input[type="number"], select{
  width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:2px;
  font-family:var(--mono); font-size:.95rem; color:var(--ink); background:var(--shore-sand-2);
}
.result-figure{ margin-bottom:24px; }
.result-figure .rf-label{ font-family:var(--mono); font-size:.72rem; letter-spacing:.1em; text-transform:uppercase; color:rgba(237,230,216,0.6); margin-bottom:6px; }
.result-figure .rf-value{ font-family:var(--mono); font-size:2.1rem; color:var(--white); font-weight:600; }
.result-figure .rf-value small{ font-size:1rem; color:rgba(237,230,216,0.6); }
.result-grid{ display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-bottom:24px; }
.result-grid .rg-item{ border-top:1px solid rgba(255,255,255,0.15); padding-top:10px; }
.result-grid .rg-label{ font-size:.74rem; color:rgba(237,230,216,0.55); margin-bottom:4px; }
.result-grid .rg-value{ font-family:var(--mono); font-size:1.2rem; color:var(--shore-sand); }
.apr-flag{ font-size:.8rem; padding:10px 12px; border-radius:2px; border:1px solid rgba(255,255,255,0.2); background:rgba(255,255,255,0.06); }
.apr-flag.flag-high{ border-color:rgba(217,138,61,0.6); background:rgba(217,138,61,0.12); color:var(--amber-tide); }
.apr-flag.flag-severe{ border-color:rgba(220,90,70,0.6); background:rgba(220,90,70,0.14); color:#E8A395; }


/* ---------- Editorial / author byline ---------- */
.byline{ display:flex; align-items:center; gap:14px; margin:24px 0; }
.byline .avatar{
  width:46px; height:46px; border-radius:50%; background:var(--lake-teal); color:var(--white);
  display:flex; align-items:center; justify-content:center; font-family:var(--display); font-weight:600;
}
.byline .who{ font-size:.85rem; }
.byline .who b{ display:block; color:var(--lake-navy); font-size:.92rem; }
.byline .who span{ color:var(--driftwood); }


/* ---------- Expert reviewer cards ---------- */
.expert-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:22px; }
@media (max-width:900px){ .expert-grid{ grid-template-columns:1fr; } }
.expert-card{
  background:var(--white); border:1px solid var(--line); border-radius:var(--radius);
  padding:24px; box-shadow:var(--shadow-1); position:relative;
}
.expert-card .expert-head{ display:flex; gap:14px; align-items:center; margin-bottom:14px; }
.expert-avatar{
  width:64px; height:64px; border-radius:50%; flex-shrink:0; overflow:hidden;
  background:var(--lake-teal-light); display:flex; align-items:center; justify-content:center;
  font-family:var(--display); font-weight:600; color:var(--white); font-size:1.4rem;
  border:2px solid var(--shore-sand);
}
.expert-avatar img{ width:100%; height:100%; object-fit:cover; display:block; }
.expert-head .meta{ flex:1; }
.expert-head .meta b{ display:block; color:var(--lake-navy); font-size:1rem; font-family:var(--body); font-weight:700; }
.expert-head .meta span{ display:block; font-size:.78rem; color:var(--driftwood); margin-top:1px; }
.expert-credentials{
  display:inline-block; font-family:var(--mono); font-size:.66rem; letter-spacing:.08em;
  text-transform:uppercase; color:var(--amber-tide-dark); background:var(--shore-sand);
  padding:3px 8px; border-radius:2px; margin-top:6px;
}
.expert-quote{
  font-family:var(--display); font-size:1.02rem; line-height:1.45; color:var(--ink);
  font-style:italic; margin:0 0 14px; position:relative; padding-left:14px;
  border-left:2px solid var(--amber-tide);
}
.expert-rating{ display:flex; justify-content:space-between; align-items:center; font-size:.8rem; color:var(--driftwood); }
.expert-rating .stars{ font-family:var(--mono); color:var(--amber-tide-dark); letter-spacing:.05em; }
.expert-rating .source{ font-family:var(--mono); font-size:.72rem; }


/* ---------- Enhanced byline ---------- */
.byline-enhanced{
  display:flex; gap:16px; align-items:flex-start; padding:18px 22px;
  background:var(--shore-sand); border-left:3px solid var(--amber-tide-dark);
  border-radius:0 var(--radius) var(--radius) 0; margin:20px 0;
}
.byline-enhanced .avatar{ width:54px; height:54px; flex-shrink:0; }
.byline-enhanced .who-meta{ flex:1; font-size:.85rem; }
.byline-enhanced .who-meta b{ display:block; color:var(--lake-navy); font-size:.95rem; }
.byline-enhanced .who-meta .role{ display:block; color:var(--driftwood); font-size:.78rem; margin:2px 0 6px; }
.byline-enhanced .who-meta .reviewed{ display:block; color:var(--ink-soft); font-size:.78rem; }
.byline-enhanced .dates{
  font-family:var(--mono); font-size:.72rem; color:var(--driftwood);
  text-align:right; min-width:140px;
}
.byline-enhanced .dates b{ color:var(--lake-navy); display:block; }
@media (max-width:680px){
  .byline-enhanced{ flex-direction:column; }
  .byline-enhanced .dates{ text-align:left; min-width:0; }
}


/* ---------- Platform rating cards ---------- */
.platform-ratings{ display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
@media (max-width:780px){ .platform-ratings{ grid-template-columns:1fr; } }
.rating-card{
  background:var(--white); border:1px solid var(--line); border-radius:var(--radius);
  padding:22px; box-shadow:var(--shadow-1); display:flex; flex-direction:column; gap:4px;
}
.rating-card .platform-name{
  font-family:var(--mono); font-size:.7rem; letter-spacing:.12em; text-transform:uppercase;
  color:var(--driftwood); margin-bottom:6px;
}
.rating-card .rating-score{
  font-family:var(--display); font-size:2.1rem; font-weight:600; color:var(--lake-navy); line-height:1;
}
.rating-card .rating-score small{
  font-family:var(--body); font-size:.85rem; font-weight:400; color:var(--driftwood); margin-left:4px;
}
.rating-card .rating-count{ font-size:.82rem; color:var(--ink-soft); margin-top:4px; }
.rating-card .rating-link{
  font-family:var(--mono); font-size:.74rem; color:var(--lake-navy); text-decoration:none;
  margin-top:10px; padding-top:10px; border-top:1px solid var(--line-soft); font-weight:600;
}
.rating-card .rating-link:hover{ color:var(--amber-tide-dark); }


/* ---------- Review summary cards ---------- */
.review-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; margin-top:18px; }
@media (max-width:900px){ .review-grid{ grid-template-columns:1fr; } }
.review-card{
  background:var(--white); border:1px solid var(--line); border-radius:var(--radius);
  padding:22px; box-shadow:var(--shadow-1); display:flex; flex-direction:column;
}
.review-card .review-head{
  display:flex; justify-content:space-between; align-items:center; margin-bottom:14px;
}
.platform-pill{
  display:inline-block; font-family:var(--mono); font-size:.66rem; letter-spacing:.1em;
  text-transform:uppercase; color:var(--lake-navy); background:var(--shore-sand);
  padding:4px 10px; border-radius:2px; font-weight:600;
}
.review-card .stars{
  font-family:var(--mono); color:var(--amber-tide-dark); letter-spacing:.08em; font-size:.95rem;
}
.review-card .review-text{
  font-family:var(--display); font-size:.98rem; line-height:1.5; color:var(--ink);
  font-style:italic; margin:0 0 16px; padding-left:14px; border-left:2px solid var(--lake-teal-light);
  flex:1;
}
.review-card .review-meta{
  border-top:1px solid var(--line-soft); padding-top:12px; font-size:.78rem;
  display:flex; flex-direction:column; gap:4px; color:var(--driftwood);
}
.review-card .review-meta .note{ color:var(--ink-soft); font-size:.74rem; }
.review-card .review-meta a{ color:var(--lake-navy); text-decoration:underline; text-underline-offset:2px; }


/* ---------- Misc utility ---------- */

.text-center{ text-align:center; }
.mt-0{ margin-top:0; }
.skip-link{
  position:absolute; left:-999px; top:auto; background:var(--amber-tide); color:var(--lake-navy);
  padding:10px 16px; z-index:100; font-weight:700;
}
.skip-link:focus{ left:16px; top:16px; }

@media (max-width:920px){
  nav.main-nav{
    display:none; position:absolute; top:100%; left:0; right:0; background:var(--lake-navy);
    border-top:1px solid rgba(255,255,255,0.1); padding:8px 0 18px; box-shadow:0 12px 24px rgba(0,0,0,0.25);
  }
  nav.main-nav.open{ display:block; }
  nav.main-nav ul{ flex-direction:column; gap:0 !important; padding:0 24px !important; }
  nav.main-nav li{ width:100%; }
  nav.main-nav a{ display:block; padding:12px 0; border-bottom:1px solid rgba(255,255,255,0.08); }
  .nav-toggle{ display:flex; }
  .header-inner{ flex-wrap:wrap; position:relative; }
}


/* ---------- Last-reviewed badge (E-E-A-T signal) ---------- */
.reviewed-badge{
  display:inline-flex; align-items:center; gap:10px;
  background:rgba(255,255,255,0.6);
  border:1px solid var(--line);
  border-radius:999px;
  padding:7px 14px 7px 12px;
  font-family:var(--mono);
  font-size:.72rem;
  letter-spacing:.04em;
  color:var(--ink-soft);
  margin-bottom:18px;
  text-decoration:none;
  transition:background .15s ease, border-color .15s ease;
  backdrop-filter:blur(4px);
}
.reviewed-badge:hover{
  background:var(--white);
  border-color:rgba(58,86,112,0.3);
  color:var(--lake-navy);
}
.reviewed-badge .pulse{
  width:7px; height:7px; border-radius:50%;
  background:var(--good-green);
  flex-shrink:0;
  box-shadow:0 0 0 0 rgba(60,110,71,0.45);
  animation:reviewedPulse 2.4s ease-in-out infinite;
}
@keyframes reviewedPulse{
  0%,100%{ box-shadow:0 0 0 0 rgba(60,110,71,0.4); }
  50%{ box-shadow:0 0 0 6px rgba(60,110,71,0); }
}
.reviewed-badge strong{
  color:var(--ink); font-weight:600;
}
.reviewed-badge .sep{
  color:var(--driftwood); opacity:.5;
}
@media (prefers-reduced-motion: reduce){
  .reviewed-badge .pulse{ animation:none; }
}


/* ---------- Key Takeaways box (featured-snippet bait) ---------- */
.key-takeaways{
  background:linear-gradient(180deg, #FBF7EE 0%, var(--shore-sand-2) 100%);
  border:1px solid var(--line);
  border-left:4px solid var(--amber-tide-dark);
  border-radius:var(--radius);
  padding:22px 26px;
  margin:0 0 40px;
  box-shadow:var(--shadow-1);
  position:relative;
}
.key-takeaways .kt-label{
  font-family:var(--mono);
  font-size:.7rem;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--amber-tide-dark);
  margin-bottom:10px;
  display:flex;
  align-items:center;
  gap:8px;
}
.key-takeaways .kt-label::before{
  content:"◆";
  font-size:.8rem;
  color:var(--amber-tide-dark);
  letter-spacing:0;
}
.key-takeaways p{
  margin:0;
  color:var(--ink);
  font-size:1.02rem;
  line-height:1.55;
}
.key-takeaways p strong{
  color:var(--lake-navy);
  background:linear-gradient(180deg, transparent 60%, rgba(217,168,108,0.25) 60%);
  padding:0 2px;
}


/* ---------- Back to Top button ---------- */
.back-to-top{
  position:fixed;
  right:24px;
  bottom:24px;
  width:46px;
  height:46px;
  border-radius:50%;
  background:var(--lake-navy);
  color:var(--shore-sand);
  border:1px solid rgba(255,255,255,0.12);
  cursor:pointer;
  z-index:50;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  visibility:hidden;
  transform:translateY(12px);
  transition:opacity .25s ease, transform .25s ease, visibility .25s, background .15s ease;
  box-shadow:
    0 2px 6px rgba(43,57,70,0.15),
    0 8px 20px rgba(43,57,70,0.18);
  text-decoration:none;
  -webkit-tap-highlight-color:transparent;
}
.back-to-top.is-visible{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
}
.back-to-top:hover{
  background:var(--lake-navy-2);
  color:var(--white);
}
.back-to-top:active{
  transform:translateY(0) scale(0.94);
}
.back-to-top svg{
  width:18px;
  height:18px;
  display:block;
  pointer-events:none;
}
.back-to-top .label{
  /* Hidden visually but kept for screen readers */
  position:absolute;
  width:1px; height:1px; overflow:hidden;
  clip:rect(0 0 0 0); white-space:nowrap;
}

/* Mobile: smaller + safe-area offset for iOS home indicator */
@media (max-width:560px){
  .back-to-top{
    right:16px;
    bottom:calc(16px + env(safe-area-inset-bottom, 0px));
    width:42px;
    height:42px;
  }
}

/* Reduced motion: instant fade, no slide */
@media (prefers-reduced-motion: reduce){
  .back-to-top{
    transition:opacity .1s, visibility .1s;
    transform:none !important;
  }
}

/* Print: hide */
@media print{
  .back-to-top{ display:none !important; }
}
