/*
IFQ582 Assignment 2: indigenous-library-app
File: project/static/css/style.css
Authors: IFQ582 Learning Group 01 1F
Owner: Hunter @j03l (foundation)
Also edited by: Nobody. If this file needs a change, ask Hunter to make it.
Purpose: The application's own styling, on top of Bootstrap 5.3.
Brought over from Hunter's Assignment 1 Part B prototype, so the pages look the same as the design the team agreed on.

Sources to lookup online:
  W3Schools, CSS Variables: https://www.w3schools.com/css/css3_variables.asp
  W3Schools, CSS Navigation Bar: https://www.w3schools.com/css/css_navbar.asp
  W3Schools, CSS Border Shorthand: https://www.w3schools.com/css/css_border_shorthand.asp
  W3Schools, CSS Border Style: https://www.w3schools.com/css/css_border.asp
  W3Schools, CSS Pseudo-classes: https://www.w3schools.com/css/css_pseudo_classes.asp
  W3Schools, Bootstrap 5 Carousel: https://www.w3schools.com/bootstrap5/bootstrap_carousel.php
  W3Schools, Bootstrap 5 Navbars: https://www.w3schools.com/bootstrap5/bootstrap_navbar.php
  MDN, Using CSS custom properties: https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties
  MDN, border-bottom: https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom
  MDN, text-decoration-color: https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration-color
  MDN, text-underline-offset: https://developer.mozilla.org/en-US/docs/Web/CSS/text-underline-offset
  MDN, position: https://developer.mozilla.org/en-US/docs/Web/CSS/position
  MDN, grid-auto-rows: https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-rows
  W3Schools, CSS Grid Layout: https://www.w3schools.com/css/css_grid.asp
  W3Schools, CSS Media Queries: https://www.w3schools.com/css/css3_mediaqueries.asp
  Bootstrap 5.3, CSS variables: https://getbootstrap.com/docs/5.3/customize/css-variables/
  Bootstrap 5.3, Navbar (CSS): https://getbootstrap.com/docs/5.3/components/navbar/#css
  Bootstrap 5.3, Buttons (CSS): https://getbootstrap.com/docs/5.3/components/buttons/#css
  Bootstrap 5.3, Cards (CSS): https://getbootstrap.com/docs/5.3/components/card/#css
  Bootstrap 5.3, Tables (CSS): https://getbootstrap.com/docs/5.3/content/tables/#css
  Bootstrap 5.3, Carousel: https://getbootstrap.com/docs/5.3/components/carousel/
  MDN, Flexbox: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flexible_box_layout/Basic_concepts_of_flexbox
*/


/* ==========
   1. Palette
   ========== */

:root,
[data-bs-theme="light"] {
  --teal: #2f5d62;
  --teal-dark: #1f4044;
  --ochre: #b5651d;
  --ochre-light: #e8a25c;
  --sand: #f4efe6;
  --sand-border: #e3d9c8;

  --bs-body-bg: #fcfaf6;
  --bs-heading-color: var(--teal-dark);
  --bs-link-color: var(--teal);
  --bs-link-color-rgb: 47, 93, 98;
  --bs-link-hover-color: var(--teal-dark);
  --bs-link-hover-color-rgb: 31, 64, 68;
  --bs-primary: var(--teal);
  --bs-primary-rgb: 47, 93, 98;

  --bs-border-radius: 0;
  --bs-border-radius-sm: 0;
  --bs-border-radius-lg: 0;
  --bs-border-radius-xl: 0;
  --bs-border-radius-xxl: 0;

  /* Notice box (alert-warning) */
  --bs-warning-bg-subtle: var(--sand);
  --bs-warning-border-subtle: var(--sand-border);
  --bs-warning-text-emphasis: #4a2800;

  /* Agree button, the bin icons, the hidden access box. */
  --brick: #9b3b2e;
  --brick-dark: #7a2e24;
  --bs-danger: var(--brick);
  --bs-danger-rgb: 155, 59, 46;
  --bs-danger-bg-subtle: #f3e3df;
  --bs-danger-border-subtle: #d9a89f;
  --bs-danger-text-emphasis: #5c231b;
}


/* Buttons in teal through the button's own variables (from Bootstrap 5.3 Buttons CSS) */
.btn-primary {
  --bs-btn-bg: var(--teal);
  --bs-btn-border-color: var(--teal);
  --bs-btn-hover-bg: var(--teal-dark);
  --bs-btn-hover-border-color: var(--teal-dark);
  --bs-btn-active-bg: var(--teal-dark);
  --bs-btn-active-border-color: var(--teal-dark);
  --bs-btn-focus-shadow-rgb: 47, 93, 98;
}

.btn-outline-primary {
  --bs-btn-color: var(--teal);
  --bs-btn-border-color: var(--teal);
  --bs-btn-hover-bg: var(--teal);
  --bs-btn-hover-border-color: var(--teal);
  --bs-btn-active-bg: var(--teal-dark);
  --bs-btn-active-border-color: var(--teal-dark);
  --bs-btn-disabled-color: var(--teal);
  --bs-btn-disabled-border-color: var(--teal);
  --bs-btn-focus-shadow-rgb: 47, 93, 98;
}

/* The red cta button */
.btn-danger {
  --bs-btn-bg: var(--brick);
  --bs-btn-border-color: var(--brick);
  --bs-btn-hover-bg: var(--brick-dark);
  --bs-btn-hover-border-color: var(--brick-dark);
  --bs-btn-active-bg: var(--brick-dark);
  --bs-btn-active-border-color: var(--brick-dark);
  --bs-btn-focus-shadow-rgb: 155, 59, 46;
}


/* Focus ring and ticked checkbox in teal, not bootstrap's blue (:focus and :checked, W3Schools CSS Pseudo-classes) */
.form-control:focus,
.form-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 0.25rem rgba(47, 93, 98, 0.25);
}

.form-check-input:checked {
  background-color: var(--teal);
  border-color: var(--teal);
}


/* =================
   2. Navigation bar
   ================= */

/* A navbar is basically a list of links (W3Schools CSS Navigation Bar). The html gives the nav data-bs-theme="dark"
   so bootstrap colours the links and toggler for a dark bg (Bootstrap 5.3 Navbar Color schemes). */
.navbar {
  background-color: var(--teal);
  border-bottom: 3px solid var(--ochre);

  --bs-navbar-color: #ffffff;
  --bs-navbar-hover-color: #ffffff;
  --bs-navbar-active-color: #ffffff;
  --bs-navbar-brand-color: #ffffff;
  --bs-navbar-brand-hover-color: #ffffff;
}

/* Hover underlines, so the change isnt colour only */
.navbar .nav-link:hover,
.navbar .nav-link:focus {
  text-decoration: underline;
  text-underline-offset: 0.4rem;
}

/* Current page, bootstrap adds .active and aria-current="page" */
.navbar .nav-link.active {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--ochre-light);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4rem;
}


/* =====================
   3. Carousel (homepage)
   ===================== */

/* Cards on a light page, so the arrows go beside the cards in teal and the bars go below. Creates room for each side for the arrows */
.carousel {
  padding-left: 3rem;
  padding-right: 3rem;
}

/* The html puts a bootstrap icon chevron in each */
.carousel-control-prev,
.carousel-control-next {
  width: 3rem;
  color: var(--teal);
  opacity: 1;
}

.carousel-control-prev:hover,
.carousel-control-next:hover,
.carousel-control-prev:focus,
.carousel-control-next:focus {
  color: var(--teal-dark);
}

.carousel-indicators {
  position: static;
  margin: 1.5rem 0 0 0;
}

.carousel-indicators [data-bs-target] {
  background-color: var(--teal);
}

.carousel .card {
  --bs-card-bg: var(--sand);
  --bs-card-border-color: var(--sand-border);
  --bs-card-cap-bg: var(--sand);
}

.carousel .card-title {
  min-height: 2.4em;
}

.carousel .card-text {
  min-height: 4.5em;
}


/* ==========================
   4. Request band (item page)
   ========================== */

/* Rule across the top of the band */
#request {
  border-top: 3px solid #a58448;
}


/* =========
   5. Tables
   ========= */

.table {
  --bs-table-bg: var(--sand);
}

.bg-warning-subtle .table {
  --bs-table-bg: var(--bs-body-bg);
}

/* More room in each cell of a bordered table. Bootstrap sets cell padding at 0.5rem with this same selector (.table > :not(caption) > * > *), I tried to implement this rule to copy that selector to be specific enough to replace it (from Bootstrap 5.3 Tables). */
.table-bordered > :not(caption) > * > * {
  padding: 1rem;
}


/* ================
   6. Dotted border
   ================ */

.border-dotted {
  border-style: dotted !important;
}


/* ==========================
   7. Label cells (item page)
   ========================== */

#label-cells {
  display: grid;
  gap: 1rem;
  grid-auto-rows: 1fr;
}

@media (min-width: 768px) {
  #label-cells {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* =========
   8. Footer
   ========= */

/* the one dark surface on the page */
footer {
  background-color: var(--teal-dark);
  color: #d8dedf;
}

footer a {
  color: #ffffff;
}


/* ==================================
   9. Footer stays at the bottom
   ================================== */

/* The body is a column at least as tall as the window, and the footer's automatic top
   margin pushes it to the bottom on short pages. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

footer {
  margin-top: auto;
}
