/* ClimateSafe Certificates — BASELINE (locked-in)
   + ONLY CHANGE: Verifier section uses a small CSS grid so the QR panel
     aligns with the "Emissions Data Verified By" label line (top-justified)
     and spans down through the verifier info.
*/

/* Override layout/blockGap 19.2px top margin on content wrapper (2nd child of .wp-site-blocks).
   Must load after theme/global styles; plugin enqueues with dependency global-styles. */
html body.single-certificates .wp-site-blocks > *:nth-child(2),
html body.post-type-archive-certificates .wp-site-blocks > *:nth-child(2) {
  margin-block-start: 0 !important;
  margin-top: 0 !important;
  padding-block-start: 0 !important;
  padding-top: 0 !important;
}

/* No top padding so hero aligns with other pages' first-block top edge */
.cs-cert{ padding: 0 12px 12px; }
.cs-cert__wrap{ max-width:1020px; margin:0 auto; }

/* --- HERO — internal spacing matches .cs-hero--neutral; content centered --- */
.cs-cert__header{
  display:flex;
  gap:10px;
  align-items:flex-start;
  justify-content:center;
  border:1px solid rgba(0,0,0,.10);
  border-radius:14px;
  background:#f7f7f8;
  padding:1.5rem 14px 1.5rem;
}
.cs-cert__headleft{ min-width:0; width:100%; max-width:980px; text-align:center; }

.cs-cert__title{
  margin:0;
  font-size:1.35rem;
  letter-spacing:-0.35px;
  line-height:1.1;
  font-weight:950;
  color:#6699CC;
}
.cs-cert__sub{ margin-top:0.5rem; color:#4b5563; font-size:1.125rem; line-height:1.4; }
.cs-cert__sub .cs-cert__number{ font-weight:950; }
.cs-cert__badges{ display:flex; flex-wrap:wrap; gap:6px; margin-top:1rem; justify-content:center; }
.cs-cert__badge{
  display:inline-flex; gap:7px; align-items:baseline;
  border:1px solid rgba(102, 153, 204, 0.35);
  background:rgba(102, 153, 204, 0.06);
  padding:5px 9px; border-radius:999px;
  font-size:.84rem; line-height:1.05; white-space:nowrap;
}
.cs-cert__badge span{ color:#6b7280; font-weight:800; }
.cs-cert__badge strong{ font-weight:950; color:var(--cs-dark, #111827); }

/* --- GRID (LOCKED) --- */
.cs-cert__grid{ display:grid; grid-template-columns:1fr; gap:12px; margin-top:12px; }
@media(min-width:900px){ .cs-cert__grid{ grid-template-columns:1.18fr .82fr; } }

.cs-cert__col{
  border:1px solid rgba(0,0,0,.12);
  border-radius:var(--cs-radius-lg, 1rem);
  padding:16px;
  background:#fff;
  box-shadow:0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Certificate image */
.cs-cert__thumb{ margin:0 0 10px 0; }
.cs-cert__thumb img{
  width:100%;
  height:auto;
  display:block;
  border-radius:12px;
  object-fit:contain;
}

/* Actions */
.cs-cert__actions{ margin-top:8px; }
.cs-cert__actions--tight{ margin-top:6px; }
.cs-cert__actions--center{ display:flex; justify-content:center; }

/* Smaller navy PDF button */
.cs-cert__btn{
  display:inline-flex;
  align-items:center;
  gap:9px;
  text-decoration:none;
  font-weight:900;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.25);
  background:#0b1f3a;
  color:#ffffff;
  padding:6px 8px;
  font-size:.78rem;
}
.cs-cert__btn:hover{ background:#0a1a30; }
.cs-cert__btn:active{ transform: translateY(1px); }
.cs-cert__btnicon{
  width:14px; height:14px; display:inline-block;
  background-repeat:no-repeat; background-size:14px 14px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M14 2H7a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7l-5-5Z' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M14 2v5h5' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Sections */
.cs-cert__section{ border-top:1px solid #e5e7eb; padding-top:10px; margin-top:10px; }
.cs-cert__section:first-child{ border-top:0; padding-top:0; margin-top:0; }
.cs-cert__label{
  margin:0 0 8px 0;
  font-size:.72rem;
  letter-spacing:1.2px;
  color:#6b7280;
  font-weight:900;
  text-transform:uppercase;
}
.cs-cert__section .cs-cert__label{
  color:var(--cs-primary, #6699CC);
  border-left:3px solid var(--cs-primary, #6699CC);
  padding-left:8px;
  margin-left:0;
}

/* KV rows */
.cs-cert__kv{ margin:0; }
.cs-cert__row{ display:grid; grid-template-columns:110px 1fr; gap:6px 10px; padding:4px 0; }
.cs-cert__row dt{ color:#6b7280; font-size:.92rem; margin:0; }
.cs-cert__row dd{ margin:0; font-size:.92rem; font-weight:900; }

/* Text blocks */
.cs-cert__box{
  background:#fafafa; border:1px solid #eee;
  border-radius:14px; padding:10px;
  font-size:.92rem; line-height:1.4;
}
.cs-cert__text{ font-size:.92rem; line-height:1.4; }
.cs-cert__text p{ margin:0 0 6px 0; }
.cs-cert__text p:last-child{ margin-bottom:0; }

/* Org row — logos without borders/frames (holder, activity, verifier) */
.cs-cert__org{ display:flex; align-items:center; gap:10px; }
.cs-cert__mark{
  width:38px; height:38px; min-width:38px;
  overflow:hidden;
  display:flex; align-items:center; justify-content:center;
}
.cs-cert__mark img{ width:100%; height:100%; object-fit:contain; display:block; }
.cs-cert__markLink{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
  text-decoration:none;
  color:inherit;
  border-radius:6px;
}
.cs-cert__markLink:hover{ opacity:0.88; }
.cs-cert__markLink:focus-visible{
  outline:2px solid #2563eb;
  outline-offset:2px;
}
/* Reduction Entity blocks (right column): roomier role sections and stacked entries */
.cs-cert__section--reductionEntities{
  margin-top:22px;
  padding-top:18px;
}
.cs-cert__section--reductionEntities .cs-cert__label{
  margin-bottom:12px;
}
.cs-cert__org--stretchMark{ align-items:flex-start; }
.cs-cert__mark--alignStart{ align-self:flex-start; }
.cs-cert__entityMeta{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
  flex:1;
}
.cs-cert__entityRow + .cs-cert__entityRow{ margin-top:20px; }
.cs-cert__orgname{ font-weight:950; font-size:1rem; }

.cs-cert__contact{ margin-top:8px; }
.cs-cert__line{ margin:0; padding:0; font-size:.92rem; line-height:1.35; }

.cs-cert__link{
  display:inline-block;
  margin-right:12px;
  text-decoration:none;
  border-bottom:1px solid rgba(0,0,0,.25);
  font-weight:900;
  word-break: break-word;
}

.cs-cert__list{ margin:0; padding-left:18px; font-size:.92rem; line-height:1.4; }
.cs-cert__list li{ margin:2px 0; }

/* --- QR panel (fixed-size, safe) --- */
.cs-cert__qrpanel{
  width:126px;
  min-width:126px;
  border:1px solid #e5e7eb;
  border-radius:12px;
  background:#fafafa;
  padding:8px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}
.cs-cert__qrlabel2{
  font-size:.68rem;
  color:#6b7280;
  text-transform:uppercase;
  letter-spacing:1.1px;
  font-weight:950;
}
.cs-cert__qrbox{
  width:110px;
  height:110px;
  border:1px dashed #d1d5db;
  border-radius:10px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.cs-cert__qrbox img,
.cs-cert__qrbox .cs-cert__qrsml{
  width:110px !important;
  height:110px !important;
  max-width:110px !important;
  max-height:110px !important;
  object-fit:contain !important;
  display:block !important;
}
.cs-cert__qrsml{ cursor:zoom-in; }

/* ==========================================================
   ONLY CHANGE: Verifier section grid so QR aligns with label
   ========================================================== */

.cs-cert__verifySectionGrid{
  display:grid;
  grid-template-columns: 1fr 126px;
  grid-template-rows: auto 1fr;
  column-gap:12px;
  row-gap:8px;
  align-items:start;
}

.cs-cert__verifyLabel{
  grid-column:1;
  grid-row:1;
  margin-bottom:0; /* override default label spacing inside the grid */
}

.cs-cert__verifyQRTop{
  grid-column:2;
  grid-row:1 / span 2; /* span from label down through verifier info */
  justify-self:end;
  align-self:start;
}

.cs-cert__verifyInfoBlock{
  grid-column:1;
  grid-row:2;
}

/* --- Additional Resources list --- */
.cs-cert__reslist{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:8px; }
.cs-cert__resitem{ margin:0; }
.cs-cert__reslink{
  display:flex; align-items:center; gap:10px;
  text-decoration:none; font-weight:900;
  border:1px solid rgba(0,0,0,.08);
  background:#fafafa;
  border-radius:12px;
  padding:10px 10px;
}
.cs-cert__reslink:hover{ background:#f3f4f6; }
.cs-cert__restitle{ font-size:.95rem; line-height:1.2; color:#111827; }
.cs-cert__resicon{ width:18px; height:18px; min-width:18px; background-repeat:no-repeat; background-size:18px 18px; }
.cs-cert__resicon--video{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M15 10l4.553-2.276A1 1 0 0 1 21 8.618v6.764a1 1 0 0 1-1.447.894L15 14' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Crect x='3' y='7' width='12' height='10' rx='2' stroke='%23dc2626' stroke-width='2'/%3E%3C/svg%3E"); }
.cs-cert__resicon--pdf{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M14 2H7a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7l-5-5Z' stroke='%231d4ed8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M14 2v5h5' stroke='%231d4ed8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.cs-cert__resicon--image{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3' y='5' width='18' height='14' rx='2' stroke='%23059669' stroke-width='2'/%3E%3Cpath d='M8 13l2-2 4 4 3-3 3 3' stroke='%23059669' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='9' cy='9' r='1' fill='%23059669'/%3E%3C/svg%3E"); }
.cs-cert__resicon--link{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M10 13a5 5 0 0 1 0-7l1-1a5 5 0 0 1 7 7l-1 1' stroke='%236b7280' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M14 11a5 5 0 0 1 0 7l-1 1a5 5 0 0 1-7-7l1-1' stroke='%236b7280' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* Lightbox (dialog) — shrink-wrap to image */
.cs-cert__lightbox{
  border:0;
  padding:0;
  border-radius:16px;
  width: fit-content;
  max-width: 96vw;
  max-height: 92vh;
  min-width: 0;
}
.cs-cert__lightbox::backdrop{ background: rgba(0,0,0,.55); }
.cs-cert__lightboxImg{
  display:block;
  width:auto;
  height:auto;
  max-width: 96vw;
  max-height: 92vh;
  border-radius:16px;
}
.cs-cert__lightboxClose{
  position:absolute;
  top:10px;
  right:12px;
  width:36px;
  height:36px;
  border:0;
  border-radius:999px;
  background: rgba(17,24,39,.85);
  color:#fff;
  font-size:22px;
  line-height:36px;
  cursor:pointer;
}

/* ============================================================
   Certificate Archive (list) — hero + dense horizontal row cards
   ============================================================ */

/* No top padding so hero aligns with other pages' first-block top edge */
.cs-cert-archive{ max-width: 1020px; margin: 0 auto; padding: 0 12px 18px; }

/* Hero — internal spacing matches .cs-hero--neutral so title row aligns visually */
.cs-cert-archive__hero{
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 16px;
  background: #f7f7f8;
  padding: 1.5rem 14px 1.5rem;
  margin-bottom: 12px;
  text-align: center;
}
.cs-cert-archive__hero-inner{ max-width: 980px; margin: 0 auto; }
.cs-cert-archive__hero-title{
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.35px;
  line-height: 1.1;
  font-weight: 950;
  color: #6699CC;
}
.cs-cert-archive__hero-sub{
  margin: 0.5rem 0 0 0;
  color: #4b5563;
  font-size: 1.125rem;
  line-height: 1.5;
}

.cs-cert-archive__controls{ margin-top: 1rem; }
.cs-cert-archive__controls-row{
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
  justify-items: stretch;
}
@media (max-width: 980px) {
  .cs-cert-archive__controls-row{ grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}
@media (max-width: 560px) {
  .cs-cert-archive__controls-row{ grid-template-columns: 1fr; }
}
.cs-cert-archive__control{ display:flex; flex-direction:column; gap:6px; min-width:0; }
.cs-cert-archive__control-label{
  font-size: .72rem;
  letter-spacing: 1.1px;
  color: #6b7280;
  font-weight: 900;
  text-transform: uppercase;
}
.cs-cert-archive__select{
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 9px 10px;
  background: #fff;
  font-size: .92rem;
}
.cs-cert-archive__control--actions{
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content: center;
  justify-self: center;
  grid-column: 1 / -1;
}
.cs-cert-archive__reset{
  display:inline-block;
  text-decoration:none;
  font-size: .8rem;
  color: #6b7280;
  padding: 2px 0;
}
.cs-cert-archive__reset:hover{
  color: #6699CC;
}

.cs-cert-archive__list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 840px) {
  .cs-cert-archive__list{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cs-cert-archive__row{
  display: grid;
  grid-template-columns: minmax(110px, 140px) 1fr;
  gap: 10px 12px;
  align-items: start;
  padding: 10px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 0;
  overflow: hidden;
  background: #f9fafb;
  border-top: 3px solid #6699CC;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
  transition: background 0.2s ease;
}
.cs-cert-archive__row:hover{ background: rgba(249, 250, 251, 0.6); }

.cs-cert-archive__media{
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.cs-cert-archive__thumb-wrap{
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}
.cs-cert-archive__thumb-link{ display: block; width: 100%; }
.cs-cert-archive__thumb-img{
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  min-height: 96px;
}
.cs-cert-archive__thumb-placeholder{ color: #9ca3af; font-size: 1.25rem; }
.cs-cert-archive__body{
  min-width: 0;
  display:flex;
  flex-direction:column;
}
.cs-cert-archive__title{
  margin: 0 0 6px 0;
  font-size: 1.05rem;
  line-height: 1.25;
  font-weight: 900;
}
.cs-cert-archive__title-link{
  color: #6699CC;
  text-decoration: none;
}
.cs-cert-archive__title-link:hover{ text-decoration: underline; }
.cs-cert-archive__holderline{
  display:flex;
  align-items:center;
  gap: 8px;
  margin-bottom: 4px;
}
.cs-cert-archive__holderlogo{
  width: 26px;
  height: 26px;
  min-width: 26px;
  display:inline-block;
}
.cs-cert-archive__holderlogo img{ width:100%; height:100%; object-fit:contain; display:block; }
.cs-cert-archive__holdername{
  font-weight: 950;
  font-size: .95rem;
  color:#CC9966;
}
.cs-cert-archive__metaline{ margin: 6px 0 0 0; }
.cs-cert-archive__metaline--block{
  display:block;
}
.cs-cert-archive__metaline--chips{
  display:flex;
  flex-wrap: wrap;
  align-items:center;
  gap: 6px;
  margin-top: 2px;
}
.cs-cert-archive__metaline--cert{
  margin-top: 4px;
  font-size: .8rem;
  color:#4b5563;
}
.cs-cert-archive__certlabel{
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .7rem;
  color:#CC9966;
  margin-right: 4px;
}
.cs-cert-archive__certvalue{
  font-weight: 900;
  color:#111827;
}

.cs-cert-archive__meta-k{
  font-size: .75rem;
  letter-spacing: 1.1px;
  color: #6b7280;
  font-weight: 900;
  text-transform: uppercase;
  margin-right: 4px;
}
.cs-cert-archive__meta-v{
  font-size: .875rem;
  color: #111827;
}
.cs-cert-archive__chip{
  display:inline-flex;
  align-items:baseline;
  border: 1px solid #e5e7eb;
  background: #fafafa;
  border-radius: 999px;
  padding: 3px 9px;
  font-weight: 900;
  font-size: .85rem;
}
/* no special panel treatment for location rows anymore */
.cs-cert-archive__chip--type{ border-color: rgba(102,153,204,.35); background: rgba(102,153,204,.08); }
.cs-cert-archive__chip--amount{ border-color: rgba(153,204,102,.40); background: rgba(153,204,102,.12); }
.cs-cert-archive__action{
  margin: 0;
  display:flex;
  justify-content:center;
}
.cs-cert-archive__view-link{
  display: inline-block;
  font-weight: 900;
  font-size: .875rem;
  text-decoration: none;
  color: #ffffff !important;
  border: 1px solid var(--cs-primary, #6699CC) !important;
  border-radius: 10px;
  background: var(--cs-primary, #6699CC) !important;
  padding: 6px 10px;
  text-align:center;
  width: 80%;
  max-width: 130px;
  box-shadow: 0 2px 8px rgba(102,153,204,.45);
}
.cs-cert-archive__view-link:hover{
  background: #5a8bc4 !important;
  border-color:#5a8bc4 !important;
}
.cs-cert-archive__action--belowthumb .cs-cert-archive__view-link{ border-radius: 12px; }
.cs-cert-archive__empty{ padding: 24px 0; text-align: center; }
.cs-cert-archive__empty-text{ margin: 0; color: #6b7280; font-size: 1rem; }
.cs-cert-archive__pagination{ margin-top: 24px; }
.cs-cert-archive__pagination-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.cs-cert-archive__pagination-item{ margin: 0; }
.cs-cert-archive__pagination-item a,
.cs-cert-archive__pagination-item span{
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: .875rem;
  text-decoration: none;
  background: #fff;
  color: #374151;
}
.cs-cert-archive__pagination-item a:hover{ background: #f3f4f6; }
.cs-cert-archive__pagination-item .current{
  background: var(--cs-primary, #6699CC);
  color: #fff;
  border-color: var(--cs-primary, #6699CC);
}
.cs-cert-archive__pagination-item .dots{ border: 0; background: transparent; }