/* =========================
   EMV OFFERS SYSTEM
   Namespace: emv-offer-
   Fully isolated from /read
========================= */

.emv-offer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.emv-offer-top {
  margin-bottom: 20px;
}

.emv-offer-title {
  font-size: 28px;
  font-weight: 600;
}

.emv-offer-subtitle {
  font-size: 16px;
  opacity: 0.75;
  margin-top: 4px;
}

.emv-offer-capbar {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.emv-offer-capbtn {
  padding: 8px 14px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  cursor: pointer;
}

.emv-offer-capbtn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.emv-offer-grid-table {
  width: 100%;
  border-collapse: collapse;
}

.emv-offer-grid-table th,
.emv-offer-grid-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e0e0e0;
  text-align: left;
}

.emv-offer-grid-table th {
  cursor: pointer;
}

.emv-offer-grid-row:hover {
  background: #fafafa;
}

.emv-offer-grid-search {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
}

.emv-offer-grid-detail {
  margin-top: 20px;
  border-top: 1px solid #ddd;
  padding-top: 20px;
}

.emv-offer-grid-detail-inner {
  display: flex;
  gap: 20px;
}

.emv-offer-grid-detail-hero img {
  max-width: 200px;
  height: auto;
}

.emv-offer-btn {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #333;
  text-decoration: none;
  cursor: pointer;
}

.emv-offer-hero img {
  max-width: 100%;
  height: auto;
  margin-bottom: 20px;
}

.emv-offer-frame {
  width: 100%;
  height: 700px;
  border: none;
}

.emv-offer-video,
.emv-offer-audio {
  width: 100%;
}

.emv-offer-links-inner {
  margin-top: 30px;
}

.emv-offer-linkrow {
  margin-bottom: 16px;
}

.emv-offer-disclosure {
  margin-left: 10px;
  font-size: 13px;
  opacity: 0.7;
}

/* Hero with title/subtitle overlay */
.emv-offer-hero-img {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
}

.emv-offer-hero-img img {
  display: block;
  width: 100%;
  height: auto;
}

.emv-offer-hero-title {
  color: #fff;
  font-weight: 800;
  font-size: 28px;
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.55);
}

.emv-offer-hero-subtitle {
  margin-top: 6px;
  color: rgba(255,255,255,0.92);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  text-shadow: 0 2px 10px rgba(0,0,0,0.55);
}

#emvOfferCapbar{
  background-image: url("/d/img/capbar-bg.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 6px;
  border-radius: 6px;
}

/* Force offers capbar buttons to match reader */
#emv-capbar .emv-capbtn{
  font-size:14px;
  padding:6px 12px;
}

.emv-offer-links-table th{
  font-weight:700;
}

/* Compact link buttons inside links table */
.emv-offer-links-table .emv-offer-btn{
  padding:4px 10px;
  font-size:13px;
  line-height:1.2;
  border-radius:4px;
}

.emv-offer-links-table td{
  padding-top:6px;
  padding-bottom:6px;
}

.emv-offer-linktext{
  color:#1e73be;
  text-decoration:underline;
  font-weight:600;
}

.emv-offer-linktext:hover{
  opacity:0.8;
}

.emv-offer-capmenu{
  position:absolute;
  background:#fff;
  border:1px solid rgba(0,0,0,0.15);
  box-shadow:0 6px 18px rgba(0,0,0,0.15);
  border-radius:6px;
  z-index:9999;
  min-width:160px;
}

.emv-offer-capmenu-item{
  padding:8px 12px;
  cursor:pointer;
  font-size:14px;
}

.emv-offer-capmenu-item:hover{
  background:rgba(0,0,0,0.05);
}

.emv-menu {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  padding: 6px;
  display: grid;
  gap: 4px;
  z-index: 10000;
  width: max-content;
  max-width: 260px;
}

.emv-menu-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  opacity: 0.7;
  padding: 2px 6px 6px 6px;
  border-bottom: 1px solid rgba(0,0,0,0.12);
  margin-bottom: 4px;
}

.emv-menu-item {
  text-align: left;
  padding: 6px 8px;
  font-size: 12px;
  white-space: nowrap;
}

/* Scale poster/images to viewport while preserving aspect ratio */
.emv-offer-read img,
.emv-offer-read video,
.emv-offer-read iframe,
.emv-offer-read object,
.emv-offer-read embed{
  max-width: 100%;
}

.emv-offer-read img{
  width: 100%;
  height: auto;
  max-height: calc(100vh - 240px);
  object-fit: contain;
}

.emv-offer-poster{
  display:block;
  width:100%;
  height:auto;
  max-height:calc(100vh - 220px);
  object-fit:contain;
}

.emv-offer-links-intro{
  font-size:14px;
  margin:8px 0 6px 0;
  font-weight:600;
}

.emv-offer-links-filters{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:8px 0 6px 0;
}

.emv-offer-links-filter{
  padding:6px 10px;
  font-size:13px;
  border:1px solid rgba(0,0,0,0.18);
  border-radius:6px;
  width:160px;
}

/* Tighten table layout */
.emv-offer-links-table{
  table-layout:auto;
  width:100%;
  font-size:14px;
  line-height:1.25;
}

.emv-offer-links-table th,
.emv-offer-links-table td{
  padding:4px 8px;
  line-height:1.25;
  vertical-align:middle;
  white-space:nowrap;
}

/* Let Link column expand naturally */
.emv-offer-links-table th:last-child,
.emv-offer-links-table td:last-child{
  width:1%;
  white-space:nowrap;
}

/* Reduce select height */
.emv-offer-links-select{
  padding:3px 6px;
  font-size:13px;
  line-height:1.2;
  height:auto;
}

/* Hero overlay (config-driven + gradient) */
.emv-offer-hero-overlay{
  position:absolute;
  left:0;
  right:0;
  top:0;
  bottom:0;

  display:flex;
  flex-direction:column;      /* vertical stack */
  justify-content:flex-end;   /* default bottom */

  padding:18px 22px;

  background:linear-gradient(to top, rgba(0,0,0,0.72), rgba(0,0,0,0.00));
}

.emv-offer-hero-overlay.emv-ht-valign-top{ justify-content:flex-start; }
.emv-offer-hero-overlay.emv-ht-valign-middle{ justify-content:center; }
.emv-offer-hero-overlay.emv-ht-valign-bottom{ justify-content:flex-end; }

.emv-offer-hero-content{
  width:100%;
  margin:0 auto;
  display:flex;
  flex-direction:column;
}

.emv-offer-hero-overlay.emv-ht-align-left .emv-offer-hero-content{ text-align:left; }
.emv-offer-hero-overlay.emv-ht-align-center .emv-offer-hero-content{ text-align:center; }
.emv-offer-hero-overlay.emv-ht-align-right .emv-offer-hero-content{ text-align:right; }

.emv-offer-hero-overlay.emv-ht-size-sm .emv-offer-hero-title{ font-size:22px; }
.emv-offer-hero-overlay.emv-ht-size-md .emv-offer-hero-title{ font-size:26px; }
.emv-offer-hero-overlay.emv-ht-size-lg .emv-offer-hero-title{ font-size:30px; }

.emv-offer-hero-overlay.emv-ht-size-sm .emv-offer-hero-subtitle{ font-size:14px; }
.emv-offer-hero-overlay.emv-ht-size-md .emv-offer-hero-subtitle{ font-size:15px; }
.emv-offer-hero-overlay.emv-ht-size-lg .emv-offer-hero-subtitle{ font-size:16px; }

.emv-offer-hero-title,
.emv-offer-hero-subtitle{
  display:block;
}
