/**
 * Main Stylesheet
 *
 * This file has been organized into the following sections:
 * 1. Keyframe Animations
 * 2. Global & Typography Styles
 * 3. Layout Styles (Footer, Masthead, Nav)
 * 4. Component Styles
 *    - Accordion
 *    - Alerts
 *    - App Cards
 *    - Buttons & Links
 *    - Code & Preformatted Text (with Copy functionality)
 *    - Forms & Inputs
 *    - SU Cards (Stanford Design System)
 *    - Tables
 * 5. Utility Classes
 * 6. Media Queries (Responsive)
 */

/* ===================================
  1. Keyframe Animations
  =================================== */

@keyframes fadeIn {
  0% {
   opacity: 0;
  }
  to {
   opacity: 1;
  }
}

/* ===================================
  2. Global & Typography Styles
  =================================== */

body {
  font-family: "Source Sans 3",  "Arial", "Helvetica", sans-serif;
  font-size: 18px;
  font-display: swap;
}

div,
li,
p,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.5;
}

h1 code{
  font-size: 1em;
  font-weight:400;
  letter-spacing: 2px;
}

h2,
h4 {
  margin-bottom: .4em;
}

div+h2,
p+h2 {
  margin-top: 1.5em;
}

h3 {
  font-weight: 600;
  margin-top: 1em;
  margin-bottom: .75em;
}

.su-link,
a {
  color: #00538f;
}

a:focus {
  outline: 2px solid #006CB8;
  outline-offset: 2px;
}

a .fa {
  margin-right: .3em;
}

li>i.fa-regular,
li>i.fa-brands {
  margin-right: 6px;
}

p.annotation {
  font-size: .8em;
  color: #666;
  background-color: #ffffe6;
  display: inline-block;
  margin: 0 4px;
  padding: 4px;
}

ul.plain-list {
  list-style-type: none;
}

/* ===================================
  3. Layout Styles (Footer, Masthead, Nav)
  =================================== */

.layout {
  padding-top: 6rem;
}

footer {
  margin-top: 2em;
}

.su-masthead .masthead .su-lockup {
  margin-bottom: 6px;
}

.su-main-nav>ul>li>a {
  font-size: 1.8rem;
  padding: 0 0 .8em 0;
}

.su-main-nav>ul>li>ul {
  margin-left: 0;
  padding-left: 0;
}

.su-main-nav ul.su-main-nav__menu-lv1>li:last-child>ul {
  right: 0;
}

.su-local-footer__action-links a.su-link--email:after,
.su-local-footer__action-links a.su-link--external:after {
  height: 1em;
  width: 1em;
  display: inline-block;
  content: "";
  -webkit-mask: url(../assets/email.svg) no-repeat 0 0;
  mask: url(../assets/email.svg) no-repeat 0 0;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.su-local-footer__action-links a.su-link--external:after {
  height: .7em;
  width: .7em;
  -webkit-mask: url(../assets/arrow-up-right.svg) no-repeat 0 0;
  mask: url(../assets/arrow-up-right.svg) no-repeat 0 0;
  mask-size: .7em .7em;
}

.su-local-footer ul {
  padding-bottom: 0;
}

/* ===================================
  4. Component Styles
  =================================== */

/* --- Alerts --- */
div.alert,
.alert {
  margin: 1.5em 0;
}

.alert .title {
  font-weight: 700;
}

.alert .fa-solid {
  margin: 0 .5em;
  opacity: .5;
}

.alert code {
  color: inherit;
  background: rgba(255, 255, 255, .4);
  padding: 0 4px;
}

.alert.note {
  color: #2e2d29;
  background-color: #f4f4f4;
}

.alert.note i {
  color: #544948;
}

.alert.tip i {
  color: #417865;
}

.alert.question {
  background-color: #f4f4f4;
}

.alert.question h3 {
  margin-top: 1.5em;
}

.alert.question a {
  font-weight: 500;
}

.alert.question .fa-solid {
  opacity: .5;
}

.alert.question div {
  text-align: left;
}

div.alert.alert-success code {
  background-color: #e0ebe6;
}


/* --- Buttons & Links --- */
[type=button],
[type=image],
[type=reset],
[type=submit],
button {
  padding: 8px 12px 8px;
  background-color: #006CB8;
  color: #fff;
  line-height: 20px;
  font-size: 18px;
}

.btn {
  --bs-btn-padding-y: 8px;
  --bs-btn-padding-x: 12px;
  --bs-btn-font-size: 18px;
}

a.btn {
  text-decoration: none;
  line-height: 20px;
  font-size: 18px;
}

.btn.copy,
.btn.generate {
  font-size: 16px;
}

.btn.generate {
  margin-top: .2em;
}

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: #006CB8;
  --bs-btn-border-color: #006CB8;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #00548f;
  --bs-btn-hover-border-color: #00548f;
  --bs-btn-focus-shadow-rgb: 49, 132, 253;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #00548f;
  --bs-btn-active-border-color: #00548f;
  --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

.btn-outline-primary,
a.btn-outline-primary,
button.btn-outline-primary {
  --bs-btn-color: #006CB8;
  --bs-btn-border-color: #006CB8;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #006CB8;
  --bs-btn-hover-border-color: #006CB8;
  --bs-btn-focus-shadow-rgb: 0, 108, 184;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #006CB8;
  --bs-btn-active-border-color: #006CB8;
  --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  --bs-gradient: none;
  color: #006CB8;
  background-color: #fff;
  border: 1px solid #006CB8;
}

.btn-info {
  color: #fff;
  background-color: #128193;
  border-color: #128193;
}

[type=submit].btn-outline-danger,
button.btn-outline-danger {
  color: #B1040E;
  background-color: #fff;
  border: 1px solid #B1040E;
}

table form button.btn-outline-danger:hover {
  color: #fff;
  background-color: #B1040E;
  border-color: #B1040E;
}



#page-content .btn-carina:hover {
  background-color: #42081B;
  border-color: #42081B;
  color: white;
  text-decoration: underline;
}

a.no_icon:after,
a[href].noCrossRef::after {
  content: "" !important;
  padding-left: 0;
}

.more-link a,
a.more-link {
  font-weight: 600;
  font-size: .9em;
  padding-left: 0;
  padding-top: 2px;
  display: inline;
  text-transform: uppercase;
  text-decoration: none;
}

.toggle-all:focus {
  text-decoration: none;
  background-color: transparent;
  color: #333;
}

#page-content .content a[href^="http://"]:after,
#page-content .content a[href^="https://"]:after,
#page-content a[href^="http://"]:after,
#page-content a[href^="https://"]:after {
  content: '\f35d';
  font-family: FontAwesome;
  font-weight: 400;
  font-style: normal;
  display: inline-block;
  text-decoration: none;
  padding-left: 3px;
  font-size: .8em;
}

.su-local-footer__columns .su-local-footer__social-links a.su-link--external:after,
.su-local-footer__columns .su-local-footer__social-links a.su-link--mailto:after,
.su-lockup a.su-link--external:after,
svg.su-link--external {
  clip: rect(1px, 1px, 1px, 1px);
  border: 0;
  -webkit-clip-path: inset(100%);
  clip-path: inset(100%);
  height: 1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* --- Carina Status --- */
.carina-status {
  border: 4px solid #198754;
}

.carina-status h2,
.carina-status p {
  text-shadow: 2px 2px #000;
}

.carina-status .card-img {
  max-height: 300px;
  object-fit: cover;
}

.status-up .card-img {
  opacity: 0.7;
}

.status-down {
  border-color: #B1040E;
}

.status-down .card-img {
  opacity: 0.5;
  filter: sepia(90%);
}

.status-maint {
  border-color: #ffc107;
}

.status-maint .card-img {
  opacity: 0.5;
  filter: sepia(50%);
}

/* --- Code & Preformatted Text --- */
code,
kbd,
pre,
samp {
  font-family: Menlo, "Roboto Mono", Monaco, Consolas, "Courier New", monospace;
}

code {
  color: #000;
  background-color: #f4f4f4;
}

p code {
  padding: 0 4px;
}

pre,
pre.highlight {
  display: block;
  padding: 6px;
  background-color: #f4f4f4;
  margin: 12px 0;
}

a.js-click-to-copy-link:hover {
  text-decoration: none;
  background-color: green;
}

a.js-click-to-copy-link:active {
    background: #0056b3;
    transform: scale(0.95);
}

/* --- Forms & Inputs --- */
.form-control {
  font-size: 18px;
}

.form-row .tip-input input {
  width: 100%;
  max-width: 100%;
}

.tip-input {
  flex-grow: 9;
}

.tip-btn {
  padding-top: .2em;
}

#powerUrlLink {
  display: block;
}

[type=checkbox]:checked+label:before,
[type=radio]:checked+label:before {
  background-color: #006CB8;
  box-shadow: 0 0 0 1px #006CB8;
}

input.form-control-lg,
label {
  max-width: 100%;
}

form .input-group,
form .bucket,
form .form-select,
form .input-group-text,
form .remove-btn {
  font-size: 18px;
  height: 40px;
  margin-top: 0;
  margin-bottom: .5em;
  align-items: center;
}

form .row-added {
  margin-top: 1em;
}

textarea#policy {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
}


.input-group-text {
  min-width: 20px;
}

form .remove-btn {
  display: flex;
}

form .remove-btn i {
  margin-left: 16px;
  opacity: .5;
  padding: 0;
}

form .remove-btn i:hover {
  opacity: 1;
}

input:placeholder-shown {
  background-color: #ededed;
}

input:focus::placeholder {
  opacity: .5;
}

input.has-space {
  margin-right: 1px;
}

.space-warning {
  flex-basis: 100%;
  font-size: .8em;
  display: none;
}

#elm-fieldset {
  margin-bottom: 1em;
}


/* --- SU Cards (Stanford Design System) --- */
.su-card .su-card__contents>.h2 {
  margin-bottom: 0;
  font-size: 1.5625em;
  letter-spacing: -.012em;
  font-weight: 700;
  line-height: 1.5;
}

/* --- Tables --- */
table .vertical-align-top {
  vertical-align: top;
}

table tbody td ul:first-child {
  margin-top: 0;
}

/* --- Additional Styles --- */
.post-list h2 {
  font-size: 1.4em;
  margin-bottom: 0;
  margin-top: 1.5em;
}

.post-list .date {
  font-size: .8em;
}

.gist .pl-c {
  color: #000;
}

blockquote {
  padding: 0 1em;
  border-left: .25em solid #7F7776;
  color: #544948;
  margin: 1.5em 2em;
}

.alert p.h4 {
  font-size: 1.2em;
  font-weight: 600;
  line-height: 1.5;
}

.figure-caption {
  --bs-secondary-color: #2e2d29;
}

.popover,
.popover .popover-body {
  font-size: 16px !important;
}

.popover h3 {
  font-size: 16px !important;
  margin-top: 0;
}

/* ===================================
  5. Utility Classes
  =================================== */

div.section-head {
  margin-top: 1.5em;
}

div.text-chunk {
  margin-bottom: 2em;
  padding-bottom: 1em;
  border-bottom: 1px solid #b6b1a9;
}

div.text-chunk .post {
  margin-top: 0;
  margin-bottom: 1.5em;
}

.text-bg-primary {
  color: #fff !important;
  background-color: #006CB8 !important;
}

/* ===================================
  6. Media Queries (Responsive)
  =================================== */

@media (max-width: 769px) {
  .sidebar {
   font-size: 16px;
  }

  .sidebar >div,
  .sidebar >div.alert {
   margin: 1em 0;
  }

  .sidebar-right>div {
   margin: 1em 0;
  }
}

.alert-dismissible button.btn-close {
    background-color:transparent;
    background-image: none;
    opacity:1;
}

.elm-form [type="checkbox"]{
  clip: auto;
  clip-path: none;
  height: 1.2em;
}
.palo-alto {
  color: #175E54;
}
.elm-form .form-switch .form-check-input {
    background-position: left center;
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='white'/%3e%3c/svg%3e");
    background-color:#212529;
    border:1px solid #333;
    position: relative;
}
.elm-form .form-switch .form-check-input:checked {
    background-position: right center;
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-color:#279989;
}

.card pre {
  background-color: transparent;
}

h1::before {
  content: "";
  display: inline-block;
  width: 48px;
  height: 48px;
  margin-right: 10px;
  margin-top:10px;
  vertical-align: top;
  background-image: url('../logo_small.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Force table-success background even on striped rows */
.table-striped tbody tr.table-success,
.table-striped tbody tr.table-success:nth-of-type(odd),
.table-striped tbody tr.table-success:nth-of-type(even) {
    --bs-table-bg-state: var(--bs-success-bg-subtle);
    --bs-table-bg-type: var(--bs-success-bg-subtle);
    background-color: var(--bs-success-bg-subtle) !important;
}

input.bucket {
  max-width:100%;
  border-radius: 0;
}

.filter-input:focus {
  outline: none;
  box-shadow: none;
}

.dropdown-container {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  overflow: hidden;
}

.bucket-item:hover {
  background-color: #f8f9fa;
}

.clear-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 20px;
  color: #6c757d;
}

.clear-icon:hover {
  color: #dc3545;
}

.error-line{
  border-top: 2px solid #dc3545;
}

/* Extra-permission checkboxes in the policy generator.  decanter.css hides
   every checkbox and draws its own box on a following label; these inputs sit
   inside their label instead, so restore Bootstrap's visible input here. */
.row-extras .form-check-input {
  display: inline-block;
  position: static;
  float: none;
  width: 1.1em;
  height: 1.1em;
  clip: auto;
  clip-path: none;
  margin: 0 .5em 0 0;
  vertical-align: -.15em;
  border: 1px solid #333;
}
.row-extras .form-check-input:checked {
  background-color: #006CB8;
  border-color: #006CB8;
}
.row-extras .form-check {
  padding-left: 0;
  margin-bottom: .35em;
}
.row-extras summary {
  cursor: pointer;
}

/* Secrets on the new-service-account page stay blurred until clicked; see
   static/js/secret-reveal.js. */
.secret-text {
  cursor: pointer;
  border-radius: .2em;
}
.secret-text:not(.revealed) {
  filter: blur(.3em);
}
.secret-text:focus-visible {
  outline: 2px solid #006CB8;
  outline-offset: 2px;
}

/* The landing page heading wraps at laptop widths at the default h1 size;
   this size keeps it on one line from about 1280px wide. */
.landing-title {
  font-size: 3.6rem;
}
