/* Button color variations for settings page */

/* Default green theme for all settings buttons */
.settings-content .black-button {
    background-color: var(--alt-green);
    color: var(--black);
}

.settings-content .black-button:hover {
    background-color: var(--green);
    color: var(--white);
}

/* Red theme for destructive/danger operations and security-sensitive actions */
.setting-item.danger .black-button,
a[href*="delete"].black-button,
a[href*="security_activity"].black-button,
a[href*="active_sessions"].black-button {
    background-color: var(--alt-red);
    color: var(--black);
}

.setting-item.danger .black-button:hover,
a[href*="delete"].black-button:hover,
a[href*="security_activity"].black-button:hover,
a[href*="active_sessions"].black-button:hover {
    background-color: var(--red);
    color: var(--white);
}
button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: transparent;
  border: none;
  outline: none;
  box-shadow: none;

  &:hover {
    cursor: pointer;
  }

  &.black-button {
    background-color: var(--alt-pink);
    color: var(--black);
    padding: var(--golden-xs) var(--golden-l);
    font-weight: 700;

    &:hover {
      background-color: var(--pink);
      color: var(--white);
    }
  }
}

a.black-button,
input.black-button {
  background-color: var(--alt-pink);
  color: var(--black);
  padding: var(--golden-xs) var(--golden-l);
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  margin: var(--golden-xs);
  border: none;
  cursor: pointer;

  &:hover {
    background-color: var(--pink);
    color: var(--white);
  }

  &.table-button {
    font-weight: 700;
    padding: 0;
  }
}

.buttons {
  text-align: center;
  margin-top: var(--golden-m);
}
.card {
  background-color: #fff;
  padding: var(--golden-l);
  box-shadow: var(--box-shadow);
  margin-bottom: var(--golden-l);
}

.card h1 a,
.card h2 a,
.card h1,
.card h2 {
  font-family: 'Crete Round';
  font-weight: 400;
  color: var(--black);
  text-decoration: none;
}

.card.login {
  max-width: calc(var(--golden-line-length) / var(--golden-ratio));
  margin: auto;
  padding: var(--golden-m) var(--golden-xl);

  .account-services {
    /*display: flex;
    justify-content: space-between;*/
    text-align: center;
    margin: var(--golden-m);
  }
}
:root {
    /* Colors */

    --white: rgb(255, 255, 255);
    --black: rgb(0, 0, 0);

    --gray: rgb(64, 64, 64);
    --alt-gray: rgb(160, 160, 160);
    --bg-gray: rgb(246, 246, 246);

    --pink: rgb(255, 0, 122);
    --alt-pink: rgb(255, 180, 215);
    --bg-pink: rgb(255, 246, 237);

    --red: rgb(255, 0, 0);
    --alt-red: rgb(255, 180, 180);
    --bg-red: rgb(255, 237, 237);

    --orange: rgb(255, 64, 0);
    --alt-orange: rgb(255, 210, 180);
    --bg-orange: rgb(255, 246, 237);

    --yellow: rgb(255, 192, 0);
    --alt-yellow: rgb(255, 230, 180);
    --bg-yellow: rgb(255, 252, 237);

    --green: rgb(0, 128, 64);
    --alt-green: rgb(180, 255, 215);
    --bg-green: rgb(237, 255, 246);

    --blue: rgb(0, 64, 255);
    --alt-blue: rgb(180, 210, 255);
    --bg-blue: rgb(237, 246, 255);

    --purple: rgb(128, 0, 255);
    --alt-purple: rgb(215, 180, 255);
    --bg-purple: rgb(246, 237, 255);

    --brown: rgb(139, 69, 19);
    --alt-brown: rgb(220, 190, 180);
    --bg-brown: rgb(252, 248, 246);
}
form {
  width: 100%;

  .field {
    margin-top: var(--golden-l);

    label {
      font-size: var(--golden-l);
      font-weight: 700;
      display: block;
      margin-bottom: var(--golden-xs);
    }

    input {
      box-sizing: border-box;
      width: 100%;
      padding: var(--golden-xs) var(--golden-s);
      border: 1px solid var(--alt-gray);
      border-radius: 4px;
      border-radius: var(--golden-xxs);
      font-size: var(--golden-l);
    }

    input[type='checkbox'] {
      width: auto;
    }
  }

  .field.remember label {
    display: inline-block;
  }

  .actions {
    text-align: center;
    margin: var(--golden-l);
  }

  fieldset {
    font-size: var(--golden-l);
    border: 1px solid var(--alt-gray);
    padding: var(--golden-m);
    margin: var(--golden-l) 0;
  }
}
.main-menu {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, max-content)
    minmax(0, 1fr);

  align-items: center;
  margin-right: var(--golden-xl);
  margin-left: var(--golden-xs);

  /* News app specific: fixed positioning */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--bg-pink);
  padding: var(--golden-xs) 0;

  .menu {
    ul {
      display: flex;
      align-items: center;

      li {
        margin: var(--golden-xs) var(--golden-xs);
      }

      li.logo {
        margin-top: var(--golden-m);

        svg, img {
          height: var(--golden-xl);
          width: auto;
        }
      }
    }
  }

  .session {
    text-align: right;
  }
}
#modal, #nested_modal {
  .background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
  }

  .content {
    position: fixed;
    top: 25vh;
    left: 50%;

    padding: var(--golden-xl);
    padding-bottom: calc(2*var(--golden-xxl));
    box-shadow:
      var(--golden-m)
      var(--golden-m)
      var(--golden-m)
      rgba(0, 0, 0, 0.3);

    transform: translate(-50%, -50%);
    background: var(--white);
    width: 80%;
    max-height: 80vh;
    max-width: 500px;
    z-index: 2;
    overflow-y: scroll;

    .primary-button {
      position: absolute;
      bottom: var(--golden-xl);
      left: var(--golden-xl);
    }

    h1 {
      font-size: var(--golden-xl);
    }

    .close-button {
      position: absolute;
      bottom: var(--golden-xl);
      right: var(--golden-xl);
    }
  }
}

#nested_modal {
  .background {
    background: rgba(0, 0, 0, 0.2);
    z-index: 3;
  }
  .content {
    max-width: 400px;
    z-index: 4;
  }
}
/* News-specific styling that builds on the konto design system */

/* Top news headline styling */
.top-news {
  text-align: center;
  font-size: var(--golden-xxl);
  font-weight: 500;
  line-height: 1.1;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--golden-xxl);
  padding: 0 var(--golden-m);
  max-width: var(--golden-line-length);
}

.top-news a {
  font-weight: 400;
  text-decoration: none;
  color: var(--black);
}

.top-news:hover a {
  font-weight: 700;
  text-decoration-line: underline;
  text-decoration-skip-ink: none;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--alt-pink);
}

/* Frontpage sections grid */
.frontpage-sections {
  display: grid;
  gap: var(--golden-m);
  margin: var(--golden-m);
  grid-template-columns: 1fr;
}

@media (min-width: 40em) {
  .frontpage-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 60em) {
  .frontpage-sections {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 90em) {
  .frontpage-sections {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 120em) {
  .frontpage-sections {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 150em) {
  .frontpage-sections {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* Section headers with underlines */
.frontpage-sections section h2,
.sections-page h2 {
  text-transform: uppercase;
  position: relative;
  margin-bottom: var(--golden-m);
  font-family: 'Inconsolata', monospace;
  font-weight: 500;
}

.frontpage-sections section h2::after,
.sections-page h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--black);
}

.frontpage-sections section h2:hover,
.sections-page h2:hover {
  font-weight: 700;
}

.frontpage-sections section h2:hover::after {
  height: 2px;
  background-color: var(--pink);
}

/* Individual link styling */
.public_link {
  margin-bottom: var(--golden-m);
}

.public_link a {
  display: inline-block;
  line-height: 1.5;
}

/* Override general link styling for frontpage */
.frontpage-sections a {
  font-weight: 400;
  text-decoration: none;
}

.public_link a:hover {
  text-decoration-line: underline;
  text-decoration-skip-ink: none;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--alt-pink);
  font-weight: 700;
}

/* Feeds page styling using the design system */
.feeds-list {
  max-width: var(--golden-line-length);
  margin: 0 auto;
  padding: var(--golden-m);
}

.feed-item {
  background: var(--white);
  margin-bottom: var(--golden-m);
  padding: var(--golden-m);
  border-radius: var(--golden-xxs);
  box-shadow: var(--box-shadow);
}

.feed-item h3 {
  margin: 0 0 var(--golden-xs) 0;
  color: var(--black);
  font-family: "Crete Round", serif;
}

.feed-item p {
  margin: var(--golden-xs) 0;
  font-size: var(--font-size-s);
}

.feed-item a {
  color: var(--pink);
  word-break: break-all;
}
table {
  margin-top: var(--font-size-s);
  margin-bottom: var(--font-size-m);
  border-collapse: collapse;
  border: 1px solid var(--alt-gray);

  td, th {
    border-bottom: 1px solid var(--alt-gray);
    padding: var(--golden-xs) var(--golden-s);
    text-align: left;
  }

  th {
    background-color: var(--bg-gray);
  }
}

@import url('https://fonts.googleapis.com/css2?family=Crete+Round&family=Inconsolata:wght@400;500;700&display=swap');

/* Since we use rem units throughout, the font-size of the html element
   is the base unit of the entire design system. Changing this value will
   change not only all font sizes but also all margins, paddings etc.
*/
html {
  /*font-size: 16px;*/
}

* {
  font-family: 'Inconsolata', monospace;
}

:root {
  --font-size-s:  var(--golden-m);
  --font-size-m:  var(--golden-l);
  --font-size-l:  var(--golden-xl);
  --font-size-xl: var(--golden-xxl);
}

p {
  font-size: var(--font-size-m);
  line-height: var(--font-size-l);
  margin: 0;
  margin-top: var(--golden-xs);
}

.main-menu, .flash, button, th, td {
  font-size: var(--font-size-s);
}

h1, h2, h3 {
  font-family: "Crete Round", serif;
  font-weight: 400;
  font-size: var(--font-size-l);
  line-height: var(--font-size-l);
  margin: 0;
  margin-bottom: var(--font-size-s);
  padding: 0;
}

main > h1 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--font-size-xl);
  text-align: center;
}

a, button.table-button {
  text-decoration-line: underline;
  text-decoration-skip-ink: none;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--alt-pink);
  font-weight: 700;
  color: var(--black);
  padding-bottom: 0;

  &:hover {
    text-decoration-color: var(--pink);
  }
}

ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

a .card h1, a .card p {
  text-decoration: none;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

body {
    margin: 0;
    position: relative;
    background-color: var(--bg-pink);

    main {
        margin: auto;
        margin-top: var(--golden-xl);
    }

    /* Constrained width for non-frontpage content */
    main.constrained {
        max-width: var(--golden-line-length);
    }
}

:root {
    --box-shadow: var(--golden-xxs) var(--golden-xxs) var(--golden-s)
        rgba(0, 0, 0, 0.05);

    /* Golden Ratio Design System */

    --golden-base: 1rem;
    --golden-ratio: 1.618033988;
    --golden-inverse: calc(1 / var(--golden-ratio));

    --golden-xxs: calc(
        pow(var(--golden-inverse), 2) * var(--golden-base)
    ); /* 0.382 */
    --golden-xs: calc(var(--golden-inverse) * var(--golden-base)); /* 0.618 */
    --golden-s: calc(
        sqrt(var(--golden-inverse)) * var(--golden-base)
    ); /* 0.786 */
    --golden-m: var(--golden-base); /* 1     */
    --golden-l: calc(
        sqrt(var(--golden-ratio)) * var(--golden-base)
    ); /* 1.272 */
    --golden-xl: calc(var(--golden-ratio) * var(--golden-base)); /* 1.618 */
    --golden-xxl: calc(
        pow(var(--golden-ratio), 2) * var(--golden-base)
    ); /* 2.618 */

    --characters-per-line: 75;

    --golden-line-length: calc(
        var(--characters-per-line) / var(--golden-ratio) * var(--golden-base)
    );

    /* --golden-xxs: 0.382rem; /* GR Inverse Squared */
    /* --golden-xs:  0.618rem; /* GR Inverse */
    /* --golden-s:   0.786rem; /* GR Inverse Square Root */
    /* --golden-m:   1rem;
  /* --golden-l:   1.272rem; /* GR Square Root */
    /* --golden-xl:  1.618rem; /* Golden Ratio */
    /* --golden-xxl: 2.618rem; /* GR Squared */
}

/* Settings page layout */
.settings-content {
    display: grid;
    grid-template-columns: 12rem var(--golden-line-length);
    gap: var(--golden-m);
    margin-top: var(--golden-m);
    justify-content: center;
}

.settings-nav {
    position: sticky;
    top: var(--golden-m);
    height: fit-content;
}

.settings-nav .nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-nav .nav-item {
    margin-bottom: var(--golden-xs);
}

.settings-nav .nav-link {
    display: block;
    padding: var(--golden-xs) var(--golden-m);
    text-decoration: none;
    color: var(--black);
    border-radius: var(--golden-xxs);
}

.settings-nav .nav-item.active .nav-link {
    background-color: var(--pink);
    color: var(--white);
}

.settings-nav .nav-link:hover {
    background-color: var(--alt-pink);
    color: var(--black);
}

/* Settings sections */
.settings-section {
    margin-bottom: var(--golden-m);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--golden-m);
    border-bottom: 1px solid var(--alt-gray);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
}

.setting-action {
    margin-left: var(--golden-m);
}
