/* =========================================================
   MS Downloads – Frontend Styles (clean replacement)
   - Consolidated duplicates
   - Shared tokens for easier theming
   - Keeps existing classnames to avoid breakage
   ========================================================= */

/* -------------------------
   Design Tokens
-------------------------- */
:root{
  --msd-bg: #fff;
  --msd-text: #111;
  --msd-border: rgba(0,0,0,.10);
  --msd-border-strong: rgba(0,0,0,.14);
  --msd-muted: rgba(0,0,0,.72);

  --msd-radius-lg: 16px;
  --msd-radius-md: 14px;
  --msd-radius-sm: 12px;

  --msd-pad-lg: 16px;
  --msd-pad-md: 14px;
  --msd-pad-sm: 12px;

  --msd-shadow-sm: 0 4px 12px rgba(0,0,0,.05);
  --msd-shadow-md: 0 6px 18px rgba(0,0,0,.06);
  --msd-shadow-lg: 0 12px 26px rgba(0,0,0,.10);

  --msd-hover-lift: translateY(-2px);

  --msd-btn-bg: #111;
  --msd-btn-text: #fff;

  --msd-input-border: rgba(0,0,0,.18);
}

/* -------------------------
   Kadence container alignment
-------------------------- */
.msd-page-wrap{
  max-width:var(--global-content-width, 1100px);
  margin:0 auto;
  padding:28px 18px;
}

@media (max-width: 640px){
  .msd-page-wrap{ padding:20px 14px; }
}

/* -------------------------
   Base Helpers
-------------------------- */
.msd-muted{
  opacity:.75;
  font-size:13px;
}

.msd-box{
  border:1px solid var(--msd-border);
  padding:var(--msd-pad-md);
  border-radius:var(--msd-radius-sm);
  background:var(--msd-bg);
  box-shadow:var(--msd-shadow-md);
}

/* -------------------------
   Buttons
-------------------------- */
.msd-btn{
  display:inline-block;
  padding:10px 14px;
  border-radius:12px;
  background:var(--msd-btn-bg);
  color:var(--msd-btn-text);
  text-decoration:none;
  border:0;
  cursor:pointer;
  transition:transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}

.msd-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(0,0,0,.10);
}

.msd-btn--ghost{
  background:transparent;
  color:var(--msd-text);
  border:1px solid rgba(0,0,0,.18);
  box-shadow:none;
}

.msd-btn--ghost:hover{
  box-shadow:0 8px 18px rgba(0,0,0,.08);
}

.msd-btn--block{
  display:block;
  width:100%;
  text-align:center;
}

/* -------------------------
   Alerts
-------------------------- */
.msd-alert{
  padding:10px 12px;
  border-radius:var(--msd-radius-sm);
  margin-bottom:10px;
}

.msd-alert--error{
  background:#fff3f3;
  border:1px solid #ffd0d0;
}

.msd-alert--success{
  background:#f3fff6;
  border:1px solid #c8f1d1;
}

/* -------------------------
   Forms
-------------------------- */
.msd-form label{
  display:block;
  margin:10px 0;
}

.msd-form input[type="text"],
.msd-form textarea{
  width:100%;
  padding:10px;
  border-radius:10px;
  border:1px solid var(--msd-input-border);
  background:#fff;
}

.msd-check{
  display:flex;
  gap:10px;
  align-items:center;
}

/* =========================================================
   Archive Layout
========================================================= */
.msd-archive-wrap{
  background:rgba(255,255,255,.75);
  border:1px solid var(--msd-border);
  border-radius:var(--msd-radius-lg);
  box-shadow:var(--msd-shadow-md);
  padding:22px;
}

@media (max-width: 640px){
  .msd-archive-wrap{ padding:16px; }
}

.msd-archive-head{
  margin-bottom:12px;
}

.msd-archive-title{
  margin:0 0 6px;
  font-size:34px;
  line-height:1.1;
}

.msd-archive-sub{
  margin:0;
  opacity:.85;
}

.msd-archive-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  margin:16px 0 18px;
}

.msd-archive-search{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.msd-archive-search input[type="search"]{
  width:320px;
  max-width:100%;
  border-radius:10px;
  border:1px solid var(--msd-input-border);
  padding:10px;
}

.msd-archive-stats{
  margin:8px 0 16px;
  font-size:12px;
  opacity:.8;
  border-top:1px solid rgba(0,0,0,.10);
  padding-top:10px;
}

.msd-section-title{
  margin:26px 0 12px;
  font-size:18px;
}

/* =========================================================
   Category Tiles (archive grid)
   (Used on Downloads homepage “Browse Categories”)
========================================================= */
.msd-cat-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:14px;
  margin:12px 0 20px;
}

/* The “big image card” version */
.msd-cat-tile{
  display:block;
  border:1px solid var(--msd-border);
  border-radius:var(--msd-radius-md);
  overflow:hidden;
  text-decoration:none;
  background:#fff;
  box-shadow:var(--msd-shadow-md);
  transition:transform .14s ease, box-shadow .14s ease;
}

.msd-cat-tile:hover{
  transform:var(--msd-hover-lift);
  box-shadow:var(--msd-shadow-lg);
}

.msd-cat-img{
  height:140px;
  background-size:cover;
  background-position:center;
}

.msd-cat-img--empty{
  background:rgba(0,0,0,.06);
}

.msd-cat-body{
  padding:12px 14px 16px;
}

.msd-cat-name{
  font-weight:800;
  font-size:16px;
  color:var(--msd-text);
  margin-bottom:6px;
}

.msd-cat-desc{
  font-size:13px;
  opacity:.82;
  color:var(--msd-text);
}

/* =========================================================
   Download Cards Grid
========================================================= */
.msd-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));
  gap:14px;
}

.msd-card{
  border:1px solid var(--msd-border);
  border-radius:var(--msd-radius-md);
  background:#fff;
  padding:16px 16px 12px;
  box-shadow:var(--msd-shadow-md);
}

.msd-card__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}

.msd-card__title{
  margin:0;
  font-size:18px;
  line-height:1.2;
}

.msd-card__title a{
  text-decoration:none;
}

.msd-card__meta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  font-size:12px;
  opacity:.75;
}

.msd-card__desc{
  margin-top:10px;
}

.msd-card__actions{
  display:flex;
  gap:10px;
  margin-top:12px;
  flex-wrap:wrap;
}

/* =========================================================
   Ratings
========================================================= */
.msd-rating{
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid rgba(0,0,0,.08);
}

.msd-rating__label{
  font-weight:600;
}

.msd-rating__stars{
  display:flex;
  gap:6px;
  margin-top:6px;
}

.msd-star{
  border:0;
  background:transparent;
  padding:0;
  font-size:22px;
  line-height:1;
  cursor:pointer;
  opacity:.55;
  transition:opacity .12s ease, transform .12s ease;
}

.msd-star:hover{
  opacity:1;
  transform:translateY(-1px);
}

.msd-rating__msg{
  margin-top:6px;
  font-size:13px;
}

/* =========================================================
   Discussion / Replies
========================================================= */
.msd-discussion{
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid rgba(0,0,0,.08);
}

.msd-replies{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:10px;
}

.msd-reply{
  border:1px solid rgba(0,0,0,.12);
  border-radius:var(--msd-radius-sm);
  padding:12px;
  background:#fff;
}

.msd-reply__meta{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
}

.msd-replyform textarea{
  width:100%;
  padding:10px;
  border-radius:10px;
  border:1px solid var(--msd-input-border);
}

/* =========================================================
   Pagination (legacy + new)
========================================================= */
.msd-pager{
  margin:18px 0 6px;
}

.msd-pager .page-numbers{
  display:inline-block;
  padding:6px 10px;
  border-radius:10px;
  border:1px solid var(--msd-border);
  margin-right:6px;
  text-decoration:none;
}

.msd-pager .page-numbers.current{
  font-weight:800;
}

.msd-pagination{
  margin-top:16px;
}

.msd-pagination ul{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  list-style:none;
  padding:0;
  margin:0;
}

.msd-pagination a,
.msd-pagination span{
  display:inline-block;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid var(--msd-border-strong);
  text-decoration:none;
  font-size:12px;
}

.msd-pagination .current{
  background:#111;
  color:#fff;
  border-color:#111;
}

/* =========================================================
   Single Download Layout
========================================================= */
.msd-single__head{ margin-bottom:14px; }
.msd-single__title{ margin:0 0 6px; font-size:34px; line-height:1.1; }
.msd-single__meta{ display:flex; gap:14px; flex-wrap:wrap; font-size:12px; opacity:.8; }

.msd-single__grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) 320px;
  gap:16px;
  align-items:start;
}

@media (max-width: 920px){
  .msd-single__grid{ grid-template-columns:1fr; }
}

.msd-panel{
  border:1px solid var(--msd-border);
  border-radius:var(--msd-radius-md);
  background:#fff;
  box-shadow:var(--msd-shadow-md);
  overflow:hidden;
  margin-bottom:16px;
}

.msd-panel__title{
  margin:0;
  padding:12px 14px;
  border-bottom:1px solid rgba(0,0,0,.08);
  font-size:16px;
}

.msd-panel__body{
  padding:14px;
}

.msd-panel--sticky{
  position:sticky;
  top:20px;
}

.msd-meta{
  margin-top:12px;
  border-top:1px solid rgba(0,0,0,.08);
  padding-top:12px;
}

.msd-meta__row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin:6px 0;
  font-size:13px;
}

.msd-meta__row span{
  opacity:.75;
}

.msd-single__discussion-links{ margin-bottom:10px; }
.msd-single__side-actions{ margin-top:10px; }

/* =========================================================
   Taxonomy Category Page (hero + subcategories)
   Supports BOTH older term-grid AND newer cat-grid patterns.
========================================================= */
.msd-tax-wrap{ padding:10px 0; }
.msd-tax-head{ margin-bottom:14px; }

.msd-tax-head__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.msd-tax-breadcrumbs{
  font-size:13px;
  opacity:.85;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}
.msd-tax-breadcrumbs a{ text-decoration:none; }
.msd-sep{ opacity:.6; }
.msd-tax-current{ font-weight:600; }

.msd-tax-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Modern hero (taxonomy) */
.msd-tax-hero{
  display:grid;
  grid-template-columns:240px 1fr;
  gap:16px;
  background:#fff;
  border:1px solid var(--msd-border);
  border-radius:var(--msd-radius-lg);
  padding:var(--msd-pad-md);
  box-shadow:var(--msd-shadow-md);
}

.msd-tax-hero__media{
  border-radius:var(--msd-radius-sm);
  overflow:hidden;
  background:rgba(0,0,0,.06);
  min-height:140px;
}

.msd-tax-hero__media img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.msd-tax-hero__placeholder{
  width:100%;
  height:100%;
  min-height:140px;
  background:rgba(0,0,0,.06);
}

.msd-tax-title{
  margin:0 0 6px;
  font-size:28px;
  line-height:1.15;
}

.msd-tax-desc{
  margin:0;
  opacity:.85;
}

.msd-tax-stats{
  margin-top:10px;
  font-size:12px;
  opacity:.85;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* Breadcrumb system (older template) */
.msd-breadcrumbs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  font-size:12px;
  opacity:.85;
  margin:6px 0 14px;
}
.msd-breadcrumbs a{ text-decoration:none; }
.msd-crumb-sep{ opacity:.6; }
.msd-crumb-current{ font-weight:600; }

/* Alternate hero used by some templates */
.msd-cat-hero{
  display:flex;
  gap:16px;
  align-items:stretch;
  border:1px solid var(--msd-border);
  border-radius:var(--msd-radius-lg);
  background:#fff;
  overflow:hidden;
  box-shadow:var(--msd-shadow-md);
}

.msd-cat-hero__media{
  width:320px;
  max-width:38%;
  background:rgba(0,0,0,.04);
}

.msd-cat-hero__media img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.msd-cat-hero__body{
  padding:var(--msd-pad-lg);
  flex:1;
}

.msd-cat-hero__title{
  margin:0 0 8px;
  font-size:30px;
  line-height:1.1;
}

.msd-cat-hero__desc p{
  margin:0 0 10px;
}

.msd-cat-hero__actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}

/* Subcategory section wrappers */
.msd-cat-section{ margin-top:18px; }

/* “term-grid” style (image-top tiles) */
.msd-term-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px,1fr));
  gap:14px;
  margin-bottom:8px;
}

.msd-term-card{
  display:block;
  text-decoration:none;
  color:inherit;
  border:1px solid var(--msd-border);
  border-radius:var(--msd-radius-md);
  background:#fff;
  overflow:hidden;
  box-shadow:var(--msd-shadow-sm);
  transition:transform .12s ease, box-shadow .12s ease;
}

.msd-term-card:hover{
  transform:translateY(-1px);
  box-shadow:var(--msd-shadow-md);
}

.msd-term-thumb{
  background:rgba(0,0,0,.06);
  height:120px;
}

.msd-term-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.msd-term-thumb__placeholder{
  width:100%;
  height:100%;
  background:rgba(0,0,0,.06);
}

.msd-term-body{
  padding:12px 12px 10px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.msd-term-title{
  font-weight:700;
  font-size:14px;
}

.msd-term-meta{
  font-size:12px;
  opacity:.75;
  white-space:nowrap;
}

.msd-term-desc{
  padding:0 12px 12px;
  font-size:12px;
  opacity:.78;
  line-height:1.35;
}

/* “cat-grid” style (icon/thumbnail left tiles)
   NOTE: this overrides the earlier archive “big image card” only IF
   your template uses these specific sub-elements.
*/
.msd-cat-tile__img{
  width:64px;
  height:64px;
  border-radius:12px;
  overflow:hidden;
  background:rgba(0,0,0,.04);
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 64px;
}

.msd-cat-tile__img img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.msd-cat-tile__ph,
.msd-cat-tile__icon{
  font-size:26px;
  opacity:.65;
}

.msd-cat-tile__title{
  font-weight:700;
  margin-bottom:4px;
}

.msd-cat-tile__desc{
  font-size:12px;
  opacity:.8;
}

.msd-cat-tile__meta{
  font-size:12px;
  opacity:.75;
}

/* Single download page */
.msd-single-wrap { padding: 26px; }

.msd-single-hero {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    #7a0000 0%,
    #700000 55%,
    #5a0000 100%
  );
  min-height: 150px;
  margin-bottom: 22px;
}

.msd-single-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,.25),
    rgba(0,0,0,.10),
    rgba(0,0,0,0)
  );
}

.msd-single-hero__inner {
  position: relative;
  padding: 18px 22px;
  color: #fff;
}

.msd-single-hero a {
  color: #fff;
}

.msd-single-title {
  color: #fff;
}

.msd-single-subtitle {
  color: rgba(255,255,255,.92);
}

.msd-breadcrumbs { font-size: 13px; opacity: .85; margin-bottom: 8px; }
.msd-breadcrumbs a { color:#fff; text-decoration: none; }
.msd-breadcrumbs__sep { margin: 0 6px; opacity:.7; }

.msd-single-title { margin: 0 0 6px; font-size: 34px; line-height: 1.1; }
.msd-single-subtitle { margin: 0 0 14px; max-width: 70ch; opacity: .92; }

.msd-single-actions { display:flex; gap:10px; flex-wrap: wrap; margin-top: 10px; }

.msd-single-grid{
  display:grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
}
@media (max-width: 980px){
  .msd-single-grid{ grid-template-columns: 1fr; }
}

.msd-card{
  background: rgba(255,255,255,.92);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.06);
}

.msd-


/* Mobile */
@media (max-width: 720px){
  .msd-tax-hero{ grid-template-columns:1fr; }
  .msd-tax-title{ font-size:24px; }
}

@media (max-width: 700px){
  .msd-cat-hero{ flex-direction:column; }
  .msd-cat-hero__media{ width:100%; max-width:none; height:180px; }
  .msd-cat-hero__title{ font-size:26px; }
}

@media (max-width: 520px){
  .msd-archive-title{ font-size:28px; }
  .msd-archive-toolbar{ justify-content:flex-start; }
}


/* Theme container compatibility (Kadence + others) */
.msd-page-wrap{
  max-width: var(--global-content-width, 1200px);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2.25rem;
}


/* Single download extra sections */
.msd-download-section{
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,.06);
}
.msd-download-section h3{
  margin: 0 0 8px;
  font-size: 16px;
}
.msd-download-section__body{
  opacity: .92;
}
