/* ==========================================================
   SEA LICENSING — DESKTOP WIDTH NORMALIZATION V1

   Purpose:
   Bring legacy Panama / Liberia / Belize / Other States /
   Seafarers page families onto the exact same desktop
   horizontal geometry as the global header/footer shell.

   Mobile/tablet <=1050px remains completely untouched.
   ========================================================== */

@media (min-width:1051px){

  /* -------------------------------------------------------
     PANAMA
     ------------------------------------------------------- */

  .pnm-shell,
  .pnm-hero-inner{
    width:
      min(
        calc(100% - 96px),
        var(--shell)
      ) !important;

    max-width:none !important;

    margin-left:auto !important;
    margin-right:auto !important;
  }


  /* -------------------------------------------------------
     LIBERIA
     ------------------------------------------------------- */

  .lbr-shell,
  .lbr-hero-inner{
    width:
      min(
        calc(100% - 96px),
        var(--shell)
      ) !important;

    max-width:none !important;

    margin-left:auto !important;
    margin-right:auto !important;
  }


  /* -------------------------------------------------------
     BELIZE
     ------------------------------------------------------- */

  .blz2-shell,
  .blz-hero-shell,
  .blz2-hero-inner{
    width:
      min(
        calc(100% - 96px),
        var(--shell)
      ) !important;

    max-width:none !important;

    margin-left:auto !important;
    margin-right:auto !important;
  }


  /* -------------------------------------------------------
     OTHER FLAG STATES
     ------------------------------------------------------- */

  .ofs-shell,
  .ofs-hero-inner{
    width:
      min(
        calc(100% - 96px),
        var(--shell)
      ) !important;

    max-width:none !important;

    margin-left:auto !important;
    margin-right:auto !important;
  }


  /* Featured content should use the available shell width. */

  .ofs-featured-inner{
    width:100% !important;
    max-width:none !important;
  }


  /* -------------------------------------------------------
     SEAFARERS
     ------------------------------------------------------- */

  .sfw-shell,
  .sfw-hero-grid{
    width:
      min(
        calc(100% - 96px),
        var(--shell)
      ) !important;

    max-width:none !important;

    margin-left:auto !important;
    margin-right:auto !important;
  }


  /*
   * Portal / content grids should consume their parent shell
   * instead of carrying an older independent width ceiling.
   */

  .sfw-portal-grid{
    width:
      min(
        calc(100% - 96px),
        var(--shell)
      ) !important;

    max-width:none !important;

    margin-left:auto !important;
    margin-right:auto !important;
  }

}


/* ==========================================================
   SEAFARERS PORTAL — DESKTOP IMAGE SCALE CORRECTION
   ========================================================== */

@media (min-width:1051px){

  body.seafarers-page
  .sfw-portal-grid.sfw-portal-inview
  > :last-child{
    transform:
      perspective(1200px)
      rotateX(var(--sfw-rx,0deg))
      rotateY(var(--sfw-ry,0deg))
      translateY(var(--sfw-float,0px))
      scale(1.00) !important;
  }

}


/* ==========================================================
   SEAFARERS PORTAL — DESKTOP PREVIEW PROPORTION V2
   Reduce portal preview to approximately half its former size
   ========================================================== */

@media (min-width:1051px){

  body.seafarers-page .sfw-portal-grid{
    grid-template-columns:
      minmax(0,1fr)
      minmax(0,1fr) !important;

    align-items:center !important;
    column-gap:72px !important;
  }


  body.seafarers-page
  .sfw-portal-grid
  > :last-child{
    width:52% !important;
    max-width:520px !important;
    min-width:0 !important;

    justify-self:center !important;
    align-self:center !important;

    transform-origin:center center !important;
  }


  body.seafarers-page
  .sfw-portal-grid.sfw-portal-inview
  > :last-child{
    transform:
      perspective(1200px)
      rotateX(var(--sfw-rx,0deg))
      rotateY(var(--sfw-ry,0deg))
      translateY(var(--sfw-float,0px))
      scale(1) !important;
  }

}


/* ==========================================================
   SEAFARERS PORTAL — DESKTOP PROPORTIONAL PREVIEW V3
   Corrects V2 narrow/stretched result
   ========================================================== */

@media (min-width:1051px){

  body.seafarers-page .sfw-portal-grid{
    grid-template-columns:
      minmax(0,1fr)
      minmax(0,1fr) !important;

    align-items:center !important;
    column-gap:72px !important;
  }


  /* Restore normal box proportions */

  body.seafarers-page
  .sfw-portal-grid
  > :last-child{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;

    justify-self:center !important;
    align-self:center !important;

    transform-origin:center center !important;
  }


  /* Shrink BOTH dimensions together */

  body.seafarers-page
  .sfw-portal-grid.sfw-portal-inview
  > :last-child{
    transform:
      perspective(1200px)
      rotateX(var(--sfw-rx,0deg))
      rotateY(var(--sfw-ry,0deg))
      translateY(var(--sfw-float,0px))
      scale(.58) !important;
  }


  /*
   * Prevent the actual portal artwork from being
   * horizontally compressed.
   */

  body.seafarers-page
  .sfw-portal-shot,
  body.seafarers-page
  .sfw-portal-grid
  > :last-child img{
    width:100% !important;
    height:auto !important;
    max-width:100% !important;
    object-fit:contain !important;
  }

}

/* OFS FEATURED DESKTOP ALIGNMENT START */
@media (min-width:1051px){

  .ofs-featured-inner{
    width:min(calc(100% - 96px),var(--shell)) !important;
    max-width:none !important;
    margin-left:auto !important;
    margin-right:auto !important;
    box-sizing:border-box !important;
  }

}
/* OFS FEATURED DESKTOP ALIGNMENT END */
