/* =============================================================================
   CMF-CW Stylesheet
   ============================================================================= */

/* =============================================================================
   1) TOKENS / CSS VARIABLES
   ============================================================================= */

:root{
  --fixed-header-h: 80px; /* adjust until title touches header */
  --title-h: 56px; 
  --title-gap: 25px;
  --anchor-breathing-room: 12px;
  
  --anchor-offset: calc(var(--fixed-header-h) + var(--title-h) + var(--title-gap) + var(--anchor-breathing-room));
  
  --bar-max: 1300px;      /* top bar (logo and burger) */
  --content-max: 1330px;  /* everything else */
  --gutter: 25px;
}

@media (max-width: 900px){
  :root{
    --gutter: 10px;
    --anchor-offset: calc(var(--fixed-header-h) + var(--anchor-breathing-room));
  }
}

/* =============================================================================
   2) BASE / GLOBAL
   ============================================================================= */

body, html {
    overflow-x: hidden;
}

body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  color: #414547;
} 

#main_app_content, #main_help_content, #footer-placeholder, #disclaimer-and-disclosures {
    padding: 0 var(--gutter);
    max-width: var(--content-max);
    margin: 0 auto;
    box-sizing: border-box; 
}

/* offset anchors */
html {
  scroll-padding-top: var(--anchor-offset);
}



/* =============================================================================
   3) TYPOGRAPHY
   ============================================================================= */

h1, h2, h3, h4, strong {
    font-weight: 600;
}

h1 {
    font-size: 2.2em;
    color: white;
    margin-top: 7px;
    margin-bottom: 7px;
    padding-bottom: 0;
    border-bottom: 0px solid #eee; /* Separator for main title (if desired) */
}

body.app-page h1 {
    margin-top: -1px;
}

h2 {
    font-size: 1.8em;
    color: #2F72B4;
    margin-top: 30px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

h3 {
    font-size: 1.5em;
    color: #2F72B4;
    margin-top: 20px;
    margin-bottom: 10px;
}

h4 {
    font-size: 1.2em;
    color: #2F72B4;       
    margin-top: 15px;      
    margin-bottom: 10px;
}

#disclaimer-and-disclosures h2 {
    font-size: 1.5em;
    color: #414547;
    margin-top: 20px;
    margin-bottom: -10px;
    padding-bottom: 0px;
    border-bottom: 0px solid #eee; 
}

.subtitle {
  margin-top: -10px;
  font-size: 1.1em;
  color: white;
  font-style: italic;
}

.byline {
  margin-top: 5px;
  font-size: 0.9em;
  color: #414547;
}

/* =============================================================================
   4) LISTS / BASIC ELEMENTS
   ============================================================================= */

ul {
  padding-left: 30px; /* Desktop padding */
}

@media (max-width: 900px) {
  ul {
    padding-left: 20px; /* Less padding for mobile */
  }
}

li {
    margin-bottom: 8px;
}

/* =============================================================================
   5) LAYOUT CONTAINERS / SECTIONS
   ============================================================================= */

.container {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
  width: 100%;
}

.section {
    width: calc(33% - 5px);
    min-width: 200px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    box-sizing: border-box;
}

.section h4 {
  margin-top: 0;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
    .container { flex-direction: column; align-items: flex-start; }
    .section { width: 100%; margin-bottom: 15px; }
    input[type="text"] { width: 100%; }
    
    .search-mode-options label {
        display: block;      /* Makes each label a block-level element, forcing them to stack */
        margin-bottom: 15px; /* Adds some space between the stacked radio buttons */
    }
    
    .search-mode-options .spaced-left {
        margin-left: 0;      /* Removes the left margin that was used for horizontal spacing */
    }
}






/* =============================================================================
   7) LINKS
   ============================================================================= */

a {
    color: #2F72B4;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* =============================================================================
   8) FORMS / INPUTS / LABELS
   ============================================================================= */

label { margin-right: 5px; display: inline-block; margin-bottom: 5px; }

input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

/* PubChem autocomplete */

.autocomplete-container {
  position: relative;
  width: 100%;
}

.autocomplete-suggestions {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 500;

  max-height: 250px;
  overflow-y: auto;

  margin: 0;
  padding: 0;
  list-style: none;

  background-color: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.autocomplete-suggestions[hidden] {
  display: none;
}

.autocomplete-option {
  margin: 0;
  padding: 8px 10px;
  cursor: pointer;
  line-height: 1.35;
  color: #414547;
  background-color: white;
}

.autocomplete-option + .autocomplete-option {
  border-top: 1px solid #eee;
}

.autocomplete-option:hover,
.autocomplete-option.active {
  background-color: #e9f3fa;
}

.autocomplete-option:focus-visible {
  outline: 2px solid #005fcc;
  outline-offset: -2px;
}


input[type="radio"], input[type="checkbox"] {
  margin-right: 5px;
  accent-color: #004FA2;
}

/* PubChem autocomplete end */

#text_div,
#file_div {
    display: flex;
    align-items: center; /* Vertically align children */
    min-height: 34px; /* Match the text input’s approximate height */
    margin-top: 10px;
}

#file_div {
    display: none; /* it's toggled by the JavaScript */
}

#file_div button {
    background-color: #414547;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#file_div button:hover {
    background-color: #8A95A5;
}

#upload_input {
    display: none; /* Hides the default browser file input */
}

#upload_status {
    font-size: 90%;
    margin-left: 10px;
}

#auth_section { margin-bottom: 15px; } /* For spacing auth buttons */

#g_id_signin {
    width: 223px;
    height: 40px;
    padding: 2px;

    /* --- Styles for fading --- */
    opacity: 0; /* Start fully transparent */
    transition: opacity 0.1s ease-in-out; /* Adjust duration/timing */
}

#g_id_signin.gsi-button-ready {
    opacity: 1; /* Fade to fully visible */
}

/* =============================================================================
   9) BUTTONS
   ============================================================================= */

#search_button, #download_report_button, #sign_out_button {
    margin-top: 10px;
    margin-right: 10px;
    padding: 10px 18px;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

#search_button {
    background-color: #0672B9;
    color: white;
}

#search_button:hover {
    background-color: #519CCE;
}

#search_button:disabled {
    background-color: #f9f9f9;
    cursor: not-allowed;
}

#download_report_button {
    background-color: #1c7f66;
    color: white;
    display: none;
}

#download_report_button:hover {
    background-color: #26B1A0;
}

/* =============================================================================
   10) RESULTS OUTPUT (REPORT-LIKE STYLING)
   ============================================================================= */

.light-hr {
  margin: 25px 0;
  border: 0;
  border-top: 1px solid #eee;
}

.heavy-hr {
  margin: 25px 0;
  border: 0;
  border-top: 3px solid #eee;
}

#results_output {
    margin-top: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    background-color: #f9f9f9;
    min-height: 50px;
    overflow-x: auto;
}

/* Outer frame like the report (2px, no inner cell borders) */
#results_output table {
  width: 100%;
  table-layout: fixed;            
  border-collapse: collapse;      
  border: 2px solid #ccc;         
  margin: 10px 0;                 
  background: #f9f9f9;
}

/* No inner gridlines */
#results_output th,
#results_output td {
  border: none !important;        
  padding: 10px;                  
  vertical-align: top;
  width:30%;
  word-wrap:break-word;            
}

/* 30/70 column split */
#results_output tr > td:first-child {
  width: 30%;
  word-wrap: break-word;
}

#results_output tr > td:last-child {
  width: 70%;
  text-align: left; 
}

#results_output h1,
#results_output h2,
#results_output h3,
#results_output h4,
#results_output h5,
#results_output h6 {
  color: #414547;
  border-bottom: 0px solid #eee; /* Separator for H2 */
}

/* Make h2 flush to the top */
#results_output h2 {
  margin-top: 0;                  
}

/* Add top space for some h2 */
#results_output h2.spaced-top { margin-top: 1em; }


/* Style for notes (orange) */
#results_output .report-text-note  {
  color: #b58900;
  font-style: italic;
}

/* Structure image border */
#results_output img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid #999;         /* same as report */
}

/* Links  */
#results_output a {
  color: #2F72B4;
  text-decoration: none;
}

.report-note {
    background-color: #eee;      /* A light gray background for the box */
    border-left: 5px solid #ccc; /* The gray bar on the left */
    margin: 15px 0;              /* Adds space above and below the notes */
    padding: 15px;               /* Adds space between the border/background and the text */
}

.report-note p {
    margin: 0; 
}

.details-list {
    margin-top: 10px; 
}

/* Responsive adjustments for the results table specifically */
@media (max-width: 900px) { /* Aligns with your existing breakpoint, can be adjusted */
    #results_output table {
        table-layout: auto !important; /* Allow table cells to reflow naturally */
    }

    #results_output table tr:first-child { /* Target the first row (text details + image) */
        display: flex;          /* Use flexbox for easy stacking */
        flex-direction: column; /* Stack children vertically */
    }

    #results_output table tr:first-child td {
        width: 100% !important; /* Override inline 30%/70% widths */
        padding-left: 5px !important;  /* Adjust padding for mobile */
        padding-right: 5px !important; /* Adjust padding for mobile */
        box-sizing: border-box;
    }

    #results_output table tr:first-child td:nth-child(2) { /* The image cell */
        margin-top: 15px; /* Add some space above the image when stacked */
        text-align: center; /* Center the image within its cell */
    }

    /* Ensure images within the results are responsive and centered if smaller than container */
    #results_output table img {
        display: block;     /* Good for centering with margins */
        margin-left: auto;
        margin-right: auto;
        /* max-width: 100%; height: auto; is already in inline styles from backend, which is good. */
    }

    /* The second row with colspan=2 is already full-width by default in a table,
       but you might want to adjust padding or font sizes for mobile if needed. */
    #results_output table tr:nth-child(2) td {
        /* Example: font-size: 0.9em; */
    }
}

/* =============================================================================
   11) STATUS / MESSAGES
   ============================================================================= */

#status_message { margin-top: 15px; font-style: italic; color: #414547; min-height: 1.2em; }
.success { color: #28a745; }

.error {
  color: #414547;
  background-color: #F0C4CB;
  border: 1px solid #C4122E;
  padding: 12px;
  border-radius: 5px;
  margin: 15px;
  text-align: center;
  font-size: 1rem;
}

/* =============================================================================
   12) TOOLTIPS
   ============================================================================= */

.tooltip-container {
    position: relative;
    display: inline-block;
    margin-left: 0px;
    vertical-align: super;
}

.tooltip-trigger {
    cursor: help;
    color: #2F72B4;
    font-weight: bold;
    font-size: 0.5rem;
    border: 1px solid #2F72B4;
    border-radius: 50%;
    padding: 2px 3px 0px 3px; 
    display: inline-flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    user-select: none;
    position: relative;
    top: -1px;
    background: none;
    margin: 0;              
}

.tooltip-popup {
    visibility: hidden;
    opacity: 0;
    width: 230px;
    background-color: #414547;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 2000;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    font-size: 0.85rem;
    font-style: normal;
    font-weight: normal;
    line-height: 1.4;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.tooltip-popup p {
  margin: 0 0 8px;
  color: #fff;
}

.tooltip-popup p:last-child { margin-bottom: 0; }

/* Small triangle/caret for the tooltip */
.tooltip-popup::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #414547 transparent transparent transparent;
}

.tooltip-popup[hidden] {
  visibility: hidden;
  opacity: 0;
}

.tooltip-popup:not([hidden]) {
  visibility: visible;
  opacity: 1;
}

/* =============================================================================
   13) HEADER SYSTEM (FIXED HEADER + TITLE BAR + TOP BANNER)
   ============================================================================= */

/* Burger Menu Styles */
#app-navigation { /* Container for fixed elements if needed */
}

#fixed-header{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: white; /* ensures the header area is solid */
}

/* Full-bleed gradient strip under the fixed header content */
#fixed-header::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;               
  height: 8px;
  background: linear-gradient(
    45deg,
    rgb(224, 38, 60) 0%,
    rgb(142, 35, 100) 45%,
    rgb(60,  32, 140) 100%
  );
}

#fixed-header-inner{
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  box-sizing: border-box;
}

@media (min-width: 901px){
  #fixed-header-inner{
    max-width: var(--bar-max);
    margin: 0 auto;
    box-sizing: border-box;
    position: relative;
  }
}

/* Top Banner*/
#top-banner {
  background-color: white; 
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  position: relative; /* needed for the ::after strip */
  padding-top: 15.5px;
  padding-bottom: 15.5px;
  padding-left: 0;     /* <-- key */
  padding-right: 0;    /* <-- key */
}

.banner-logo-link,
.banner-logo-link:hover,
.banner-logo-link:visited {
  text-decoration: none;
  color: white;
  display: block; 
}

.banner-logo {
    position: relative;
    top: -5px;
    height: 49px;
    margin-right: 12px;
    vertical-align: middle;
    display: block;
}

@media (max-width: 900px) {
  #top-banner .banner-logo {
    height: 35px;  /* smaller on phones */
  }
}

.banner-text {
    font-size: 1.3em; /* Adjust as needed */
    font-weight: 600; /* Or normal, depending on desired look */
    color: white;
}

/* DEFAULT (desktop): title is sticky under the fixed header */
#page-title-header{
  position: fixed;
  left: 0;
  right: 0;
  height: var(--title-h);
  top: var(--fixed-header-h);
  z-index: 999;
  background: #0672B9;
  color: #fff;
  padding: 10px 0;          /* bar padding only */
  margin: 0;
  border-bottom: 1px solid #e6e6e6;
}

#page-title-header .page-title-inner{
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  box-sizing: border-box;
}

/* Body offset for the always-fixed header only */
body{
  padding-top: calc(var(--fixed-header-h) + var(--title-h) + var(--title-gap));
}

@media (max-width: 900px){
  /* Remove the desktop-style offset that creates a white gap */
  body{
    padding-top: 0;
  }

  /* Title bar scrolls normally, but starts below the fixed header + the gradient strip */
  #page-title-header{
    position: static;
    margin-top: calc(var(--fixed-header-h) - 14px);
  }
}

@media (max-width: 900px){
  #page-title-header .subtitle{ display: none; }
  body.app-page{ --title-h: 40px; }  /* back to single-line when subtitle hidden */
}

/* =============================================================================
   14) BURGER ICON + NAV PANEL
   ============================================================================= */

#burger-icon {
    position: fixed; 
    top: 24px;
    right: 15px;
    width: 15px;
    height: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;                    /* controls even spacing */
    cursor: pointer;
    z-index: 1002; /* Above nav panel and other content */
    padding: 5px; /* Add some padding to make it easier to click */
    box-sizing: content-box;
}

#burger-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: #000000;
    border-radius: 0px;
    transition: 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    transform-origin: center; /* Ensures proper rotation around center */
}

#burger-icon.open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

#burger-icon.open span:nth-child(2) {
    opacity: 0;
}

#burger-icon.open span:nth-child(3) {
    transform: translateY(1px) rotate(-45deg);
}

/* Desktop label */
#burger-icon::after{
  content: "Menu";
  position: absolute;
  right: calc(100% + 20px);
  top: 50%;
  transform: translateY(-50%) translateY(-1.5px);
  font-size: 0.95rem;
  font-weight: 600;
  color: #000000;
  white-space: nowrap;
}

/* Hide label on mobile */
@media (max-width: 900px){
  #burger-icon::after{
    content: "";
  }
}

@media (min-width: 901px){
  #burger-icon{
    position: absolute;
    right: 6px;
  }
}

#nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px; 
    height: 100vh; /* Full viewport height */
    background-color: #f8f9fa; 
    box-shadow: 3px 0px 10px rgba(0,0,0,0.1);
    transform: translateX(+100%); /* Initially off-screen to the left */
    transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    padding-top: 70px; /* Space for the burger icon area + a bit more */
    z-index: 1001; /* Below burger icon but above other content */
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Allow scrolling if many links */
}

#nav-panel.open {
    transform: translateX(0); /* Slide in */
}

#nav-panel .nav-link {
    padding: 15px 25px;
    color: #2F72B4;
    display: block;
    transition: background-color 0.2s ease;
    
    /* Force text wrapping */
    white-space: normal;
    overflow-wrap: break-word;
}

#nav-panel .nav-link:hover {
    background-color: #e9ecef; /* Hover state */
}

/* Add a top border to the very first item */
#nav-panel > *:first-child {
    border-top: 1px solid #dee2e6;
}

/* All direct children get a bottom border */
#nav-panel > * {
     border-bottom: 1px solid #dee2e6;
}

/* The .nav-group is purely for semantic grouping */
.nav-group {
    /* No styles needed here */
}

/* The heading inside a group */
.menu-heading {
    display: block;
    padding: 15px 25px 10px 25px;
    color: #414547;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.external-link {
    position: relative;
    display: block;
    padding-right: 45px;
    max-width: 100%;     
    width: 100%;         /* Force the link to fill available width */
    box-sizing: border-box;
}

.external-link::before {
    content: '↗ ';
    color: #888;
    font-weight: bold;
}

/* Remove the bottom border from the panel's last child to clean up the look */
#nav-panel > *:last-child {
    border-bottom: none;
}

/* =============================================================================
   15) FOOTER
   ============================================================================= */

footer {
    margin-top: 40px;
    padding-top: 0px;
    border-top: 1px solid #ccc;
    font-size: 0.9em;
    color: #414547;
    text-align: center;
}

footer p {
    margin-bottom: 5px;
}

/* Explicitly style footer link if it's not in .container */
footer a {
    color: #2F72B4;
    text-decoration: none;
}
footer a:hover {
    text-decoration: underline;
}

/* =============================================================================
   16) SPINNER
   ============================================================================= */

/* Spinning Wheel */
.spinner {
    border: 4px solid #f3f3f3; /* Light grey circle */
    border-top: 4px solid #007bff; /* Blue for the spinning part (matches your search button) */
    border-radius: 50%;
    width: 20px; /* Adjust size as needed */
    height: 20px; /* Adjust size as needed */
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle; /* Aligns spinner with the text */
    margin-right: 10px; /* Space between spinner and "Searching..." text */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#results_output .searching-text-message {
    display: inline-block;
    vertical-align: middle;
    font-style: italic; 
    margin: 0; 
}

/* =============================================================================
   17) MODAL
   ============================================================================= */

#cmfModal {
   display: none;
   position: fixed;
   z-index: 9999;
   left: 0;
   top: 0;
   width: 100%;
   height: 100%;
   overflow: auto;
   background-color: rgba(0,0,0,0.8);
}

#modalContent {
   position: relative;
   margin: auto;
   margin-top: 40px;
   width: fit-content;
   max-width: 90%;
   max-height: 90%;
}

#modalContent img {
   display: block;
   max-width: 100%;
   max-height: 100%;
}

/* Modal close button */
#cmfClose{
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10001;

  background: none;
  border: none;
  padding: 4px 8px;
  margin: 0;

  color: #414547;
  font-size: 32px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;

  appearance: none; /* removes default button styles in some browsers */
}

@media (max-width: 900px) {
   /* Hides the desktop-style close button on mobile */
   #cmfClose {
     display: none;
   }
   /* Removes the pointer on the trigger image so it doesn't look clickable on mobile */
   #cmf-cw-image {
      cursor: default !important;
   }
}

#cmfClose:focus-visible {
  outline: 2px solid #005fcc; /* important for keyboard accessibility */
  outline-offset: 2px;
}

/* =============================================================================
   18) DISCLAIMER SECTION
   ============================================================================= */

#disclaimer_section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
    font-size: 0.85em;
    color: #414547;
    line-height: 1.5;
    text-align: left;
}

#disclaimer_section p {
    margin: 0;
    margin-bottom: 4px;
}

/* =============================================================================
   19) FIGURES / EMBEDS / UTILITIES
   ============================================================================= */

/* === GENERIC FIGURE STYLES === */

/* A reusable class to center the content of a figure */
.figure-centered {
    text-align: center;
}

/* A reusable class for a standard framed image within a figure */
.figure-image-framed {
    width: 80%;
    max-width: 750px;
    height: auto;
    border: 1px solid #ccc;
}

/* A reusable class for a standard framed image within a figure */
.figure-image-not-framed {
    width: 50%;
    max-width: 550px;
    height: auto;
    border: 0px solid #ccc;
}

/* A reusable class for the caption text */
.figure-caption {
    font-size: 0.9em;
    color: #414547;
    margin-top: 5px; /* Add a little space above the caption */
}

/* A reusable class for embedded content like iframes */
.embedded-iframe {
    width: 100%;
    height: 600px;
    border: 1px solid #ccc;
}

/* A reusable utility class to make any element appear clickable */
.clickable {
    cursor: pointer;
}

.spaced-left {
  margin-left: 20px;
}

/* Outer frame: slightly narrower than 16:9 */
.video-container {
  width: 75%;
  max-width: 1500px;
  margin: 0 auto;
  aspect-ratio: 14.5 / 9;    /* <— narrower than 16/9 (try 15/9 or 1.70) */
  background: #000;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  display: grid;           /* center the inner box */
  place-items: center;
  overflow: hidden;        /* optional */
}

/* Inner box: always 16:9 and sized to fit */
.video-inner {
  aspect-ratio: 16 / 9;    /* keep the real video ratio */
  width: 96%;              /* creates the border/matte */
  height: auto;
  max-height: 96%;         /* safety for extreme layouts */
  overflow: hidden;
  border-radius: 12px;     /* optional */
}

.video-inner > iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.visually-hidden-focusable {
    position: absolute;
    left: -999px;
    top: -999px;
    background-color: #000;
    color: #fff;
    padding: 8px;
    z-index: 1000;
}

.visually-hidden-focusable:focus {
    left: 0;
    top: 0;
}