@tailwind base;
@tailwind components;
@tailwind utilities;

/* Article inline photos: wrapped in <figure class="article-figure"> by
   ApplicationHelper#article_figures so body text flows around them at a
   comfortable size. Floats only kick in at md+ (tablet/desktop); on phones the
   photo stacks full-width. Width is capped so a photo is a tasteful sidebar,
   not a wall — portraits keep their natural aspect (no crop) at that width. */
.article-figure {
  margin: 0.25rem 0 1.25rem;
}
.article-figure > img {
  width: 100%;
  margin: 0;
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(20, 30, 40, 0.12);
}
.article-figure > figcaption {
  margin-top: 0.5rem;
  font-style: italic;
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.45;
}
@media (min-width: 768px) {
  .article-figure {
    width: min(42%, 24rem);
    margin-bottom: 1rem;
  }
  .article-figure--right {
    float: right;
    margin-left: 2rem;
  }
  .article-figure--left {
    float: left;
    margin-right: 2rem;
  }
  /* Keep each principle's heading from wrapping up beside a floated photo. */
  .prose h2 {
    clear: both;
  }
}

/* Signed-in /links hub tiles (links/show, design-review item 0k, Round 2).
   The tile container itself is themed via daisyUI utility classes; only the
   colour-coded icon chip + small badge need custom rules. */
.links-ic {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.7rem;
  color: var(--links-c);
  background: color-mix(in srgb, var(--links-c) 14%, transparent);
}
.links-ext {
  color: var(--fallback-bc, oklch(var(--bc) / 0.45));
  font-size: 0.85em;
}
.links-badge {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fallback-bc, oklch(var(--bc) / 0.55));
  background: var(--fallback-b2, oklch(var(--b2) / 1));
}

/* "Browse my cards" rolodex flip-stack (business_cards/_card_rolodex,
   design-review item 8, Variant C). Without JS the deck is a plain stacked list
   of card links; the card-rolodex controller adds `.rolodex--js`, which turns it
   into an absolute deck and flips the top card away (rotateX) to reveal the next. */
.rolodex-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.rolodex-card {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  background: #fff;
  border: 1px solid #e3ded6;
  border-radius: 0.9rem;
  box-shadow: 0 6px 16px rgba(20, 30, 40, 0.08);
  padding: 0.9rem;
}
.rolodex-thumb {
  flex: none;
  width: 4rem;
  border-radius: 0.5rem;
  box-shadow: 0 3px 8px rgba(20, 30, 40, 0.18);
  display: block;
}
.rolodex-name {
  font-weight: 800;
  color: #2a2140;
  line-height: 1.15;
}
.rolodex-tag {
  color: #6b6472;
  font-size: 0.85rem;
  margin: 0.15rem 0 0.55rem;
  line-height: 1.3;
}
.rolodex-open {
  display: inline-block;
  background: #0d9488;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}
.rolodex-here {
  display: inline-block;
  color: #0a6a61;
  font-weight: 700;
  font-size: 0.75rem;
  background: #e6f5f2;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

/* JS-on: absolute flip deck */
.rolodex--js .rolodex-stack {
  display: block;
  position: relative;
  perspective: 1200px;
}
.rolodex--js .rolodex-card {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  transform-origin: top center;
  transition: transform 0.35s ease, opacity 0.35s ease;
  backface-visibility: hidden;
}
.rolodex--js .rolodex-card.is-top {
  transform: none;
  opacity: 1;
  z-index: 3;
}
.rolodex--js .rolodex-card.is-behind {
  transform: translateY(11px) scale(0.97) rotate(-1.4deg);
  opacity: 1;
  z-index: 1;
  filter: brightness(0.97);
}
.rolodex--js .rolodex-card.is-stashed {
  transform: translateY(15px) scale(0.94);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .rolodex--js .rolodex-card.is-flipping {
    transform: translateY(-6px) rotateX(-92deg);
    opacity: 0;
  }
}

.rolodex-ctrls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}
.rolodex-back,
.rolodex-flip {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
  border: none;
}
.rolodex-back {
  background: transparent;
  color: #0a6a61;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
}
.rolodex-flip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #0d9488;
  color: #fff;
  font-size: 0.9rem;
  padding: 0.5rem 1.1rem;
}
.rolodex-count {
  color: #8a8172;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rolodex-back:focus-visible,
.rolodex-flip:focus-visible,
.rolodex-stack:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
}

/* Business-card scan section: teal "scan target" corner ticks framing the QR
   (design-review item 7, Variant A). */
.qr-tick {
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2.5px solid #0d9488;
}
.qr-tick--tl { top: 7px; left: 7px; border-right: none; border-bottom: none; border-radius: 5px 0 0 0; }
.qr-tick--tr { top: 7px; right: 7px; border-left: none; border-bottom: none; border-radius: 0 5px 0 0; }
.qr-tick--bl { bottom: 7px; left: 7px; border-right: none; border-top: none; border-radius: 0 0 0 5px; }
.qr-tick--br { bottom: 7px; right: 7px; border-left: none; border-top: none; border-radius: 0 0 5px 0; }

@keyframes heart-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.4); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.heart-pop {
  animation: heart-pop 0.35s ease;
}

.card-perspective {
  perspective: 1600px;
}
.card-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s;
}
.card-inner.flipped {
  transform: rotateY(180deg);
}
.card-face {
  backface-visibility: hidden;
  width: 100%;
}
.card-face.card-back {
  position: absolute;
  inset: 0;
  /* Fill the front's box exactly. The front image is in-flow and sets the
     card height from its own aspect ratio; without an explicit height +
     object-fit here, an over-constrained absolute <img> falls back to its
     OWN intrinsic aspect, so a front/back pair with slightly different
     source widths (e.g. 893x1600 vs 959x1600) renders at two different
     heights. height:100% + object-fit:cover pins the back to the front's
     box (a few px of the wider face's margin is cropped, content is
     centered and unaffected). */
  height: 100%;
  object-fit: cover;
  transform: rotateY(180deg);
}

/* A gentle Pokémon-card-style tilt: the card rocks side to side with a slight
   3D turn so it catches the eye and hints it's tappable. Kept subtle and
   short. Runs periodically via business_card_controller.js. */
@keyframes card-wiggle {
  0%, 100% { transform: rotate(0deg) rotateY(0deg); }
  15% { transform: rotate(-2.5deg) rotateY(-9deg); }
  40% { transform: rotate(2deg) rotateY(9deg); }
  65% { transform: rotate(-1.5deg) rotateY(-5deg); }
  85% { transform: rotate(1deg) rotateY(3deg); }
}
.card-wiggle {
  animation: card-wiggle 0.9s ease-in-out;
}
@media (prefers-reduced-motion: reduce) {
  .card-wiggle { animation: none; }
}

/* Corner "tap to flip" prompt. Gently pulses to draw attention; the
   controller removes it once the user has flipped the card. */
@keyframes card-hint-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.card-tap-hint {
  animation: card-hint-pulse 1.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .card-tap-hint { animation: none; }
}

/* The business-cards index "card back" tucked under the front: fade its bottom
   edge to transparent so it fills the space beside the text column without a
   hard cut, and never extends the row height past the text. */
.card-fanned-back {
  /* Fade re-tuned (design-review item 10, Variant A) to sit lower under the
     front: keeps the peek crisp where it now lands (top-[44%]) and fades only
     at the very bottom, instead of fading out mid-peek. */
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 58%, transparent 96%);
}

@keyframes flash-enter {
  0% { opacity: 0; transform: translateY(-12px); }
  100% { opacity: 1; transform: translateY(0); }
}
.flash-enter {
  animation: flash-enter 0.25s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .flash-enter { animation: none; }
}

@keyframes card-pop-shake {
  0% { transform: scale(1) rotate(0deg); }
  20% { transform: scale(1.05) rotate(-4deg); }
  40% { transform: scale(1.05) rotate(4deg); }
  60% { transform: scale(1.05) rotate(-3deg); }
  80% { transform: scale(1.05) rotate(3deg); }
  100% { transform: scale(1.05) rotate(0deg); }
}
.hover-shake:hover {
  animation: card-pop-shake 0.4s ease forwards;
}
@media (prefers-reduced-motion: reduce) {
  .hover-shake:hover { animation: none; }
}

/*

@layer components {
  .btn-primary {
    @apply py-2 px-4 bg-blue-200;
  }
}

*/
/*!
 * Cropper.js v1.6.2
 * https://fengyuanchen.github.io/cropperjs
 *
 * Copyright 2015-present Chen Fengyuan
 * Released under the MIT license
 *
 * Date: 2024-04-21T07:43:02.731Z
 */

.cropper-container {
  direction: ltr;
  font-size: 0;
  line-height: 0;
  position: relative;
  -ms-touch-action: none;
      touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}

.cropper-container img {
    backface-visibility: hidden;
    display: block;
    height: 100%;
    image-orientation: 0deg;
    max-height: none !important;
    max-width: none !important;
    min-height: 0 !important;
    min-width: 0 !important;
    width: 100%;
  }

.cropper-wrap-box,
.cropper-canvas,
.cropper-drag-box,
.cropper-crop-box,
.cropper-modal {
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.cropper-wrap-box,
.cropper-canvas {
  overflow: hidden;
}

.cropper-drag-box {
  background-color: #fff;
  opacity: 0;
}

.cropper-modal {
  background-color: #000;
  opacity: 0.5;
}

.cropper-view-box {
  display: block;
  height: 100%;
  outline: 1px solid #39f;
  outline-color: rgba(51, 153, 255, 0.75);
  overflow: hidden;
  width: 100%;
}

.cropper-dashed {
  border: 0 dashed #eee;
  display: block;
  opacity: 0.5;
  position: absolute;
}

.cropper-dashed.dashed-h {
    border-bottom-width: 1px;
    border-top-width: 1px;
    height: calc(100% / 3);
    left: 0;
    top: calc(100% / 3);
    width: 100%;
  }

.cropper-dashed.dashed-v {
    border-left-width: 1px;
    border-right-width: 1px;
    height: 100%;
    left: calc(100% / 3);
    top: 0;
    width: calc(100% / 3);
  }

.cropper-center {
  display: block;
  height: 0;
  left: 50%;
  opacity: 0.75;
  position: absolute;
  top: 50%;
  width: 0;
}

.cropper-center::before,
  .cropper-center::after {
    background-color: #eee;
    content: ' ';
    display: block;
    position: absolute;
  }

.cropper-center::before {
    height: 1px;
    left: -3px;
    top: 0;
    width: 7px;
  }

.cropper-center::after {
    height: 7px;
    left: 0;
    top: -3px;
    width: 1px;
  }

.cropper-face,
.cropper-line,
.cropper-point {
  display: block;
  height: 100%;
  opacity: 0.1;
  position: absolute;
  width: 100%;
}

.cropper-face {
  background-color: #fff;
  left: 0;
  top: 0;
}

.cropper-line {
  background-color: #39f;
}

.cropper-line.line-e {
    cursor: ew-resize;
    right: -3px;
    top: 0;
    width: 5px;
  }

.cropper-line.line-n {
    cursor: ns-resize;
    height: 5px;
    left: 0;
    top: -3px;
  }

.cropper-line.line-w {
    cursor: ew-resize;
    left: -3px;
    top: 0;
    width: 5px;
  }

.cropper-line.line-s {
    bottom: -3px;
    cursor: ns-resize;
    height: 5px;
    left: 0;
  }

.cropper-point {
  background-color: #39f;
  height: 5px;
  opacity: 0.75;
  width: 5px;
}

.cropper-point.point-e {
    cursor: ew-resize;
    margin-top: -3px;
    right: -3px;
    top: 50%;
  }

.cropper-point.point-n {
    cursor: ns-resize;
    left: 50%;
    margin-left: -3px;
    top: -3px;
  }

.cropper-point.point-w {
    cursor: ew-resize;
    left: -3px;
    margin-top: -3px;
    top: 50%;
  }

.cropper-point.point-s {
    bottom: -3px;
    cursor: s-resize;
    left: 50%;
    margin-left: -3px;
  }

.cropper-point.point-ne {
    cursor: nesw-resize;
    right: -3px;
    top: -3px;
  }

.cropper-point.point-nw {
    cursor: nwse-resize;
    left: -3px;
    top: -3px;
  }

.cropper-point.point-sw {
    bottom: -3px;
    cursor: nesw-resize;
    left: -3px;
  }

.cropper-point.point-se {
    bottom: -3px;
    cursor: nwse-resize;
    height: 20px;
    opacity: 1;
    right: -3px;
    width: 20px;
  }

@media (min-width: 768px) {

.cropper-point.point-se {
      height: 15px;
      width: 15px;
  }
    }

@media (min-width: 992px) {

.cropper-point.point-se {
      height: 10px;
      width: 10px;
  }
    }

@media (min-width: 1200px) {

.cropper-point.point-se {
      height: 5px;
      opacity: 0.75;
      width: 5px;
  }
    }

.cropper-point.point-se::before {
    background-color: #39f;
    bottom: -50%;
    content: ' ';
    display: block;
    height: 200%;
    opacity: 0;
    position: absolute;
    right: -50%;
    width: 200%;
  }

.cropper-invisible {
  opacity: 0;
}

.cropper-bg {
  background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');
}

.cropper-hide {
  display: block;
  height: 0;
  position: absolute;
  width: 0;
}

.cropper-hidden {
  display: none !important;
}

.cropper-move {
  cursor: move;
}

.cropper-crop {
  cursor: crosshair;
}

.cropper-disabled .cropper-drag-box,
.cropper-disabled .cropper-face,
.cropper-disabled .cropper-line,
.cropper-disabled .cropper-point {
  cursor: not-allowed;
}
/*
 * 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 === */ 

.navbar, .btm-nav {
    min-height: 3.5rem !important;
    max-height: 3.5rem !important;
}

.table-row-section-title {
    text-align: center;
    text-transform: uppercase;
}

thead.table-row-header {
    font-size: medium;
}

/* Make autofill text on input fields transparent instead of mustard-yellow */
input:-webkit-autofill,
input:-webkit-autofill:focus {
    transition: background-color 600000s 0s, color 600000s 0s;
}
input[data-autocompleted] {
    background-color: transparent !important;
}

#total-points-stat {
    --tw-border-opacity: 0 !important;
    border-right-width: 0px !important;
}

.p-b-4rem {
    padding-bottom: 4rem;
}

#todays-habits-sticky-point-bar {
    --tw-bg-opacity: 1;
    background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
    position: sticky;
    padding-top: 0.5rem;
    top: 0;
    width: 100%;
    z-index: 1;
}

#dashboard-todays-statistics-point-bar {
    --tw-bg-opacity: 1;
    background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
    text-align: center;
    width: 100%;
}

.text-right {
    text-align: right;
}

.pr-4 {
    padding-right: 1rem;
}

.prose {
    max-width: 100%;
}

.prose p {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.prose p.m-0 {
    margin-top: 0;
    margin-bottom: 0;
    margin-right: 0;
    margin-left: 0;
}

.mt-minus-2 {
    margin-top: -0.5rem;
}

.h-full {
    height: 100%;
}

td.no-padding {
    padding: 0 !important;
    a {
        padding: 0.5rem 1rem;
    }
}

/* Study accordion More / Less (Preview / Full) button styles */
.summary-preview {
    height: 1.5rem;
    overflow: hidden;
  }
.summary-full {
    padding-top: 10px;
}

.tabs-boxed {
    border-radius: 0;
}
.to-bg-primary {
    --tw-bg-opacity: 1;
    --tw-gradient-to: oklch(var(--b1));
}

/* Horizontally scrolling list of books */
.carousel {
    overflow-x: auto;
    padding: 20px;
  }
  
.carousel-item {
    margin-right: 20px;
}
  
.carousel-item:last-child {
    margin-right: 0;
}

.carousel.pl-0 {
    padding-left: 0;
}
  
.bottom-spacer {
    margin-bottom: 4rem;
}
    
.carousel {
    justify-content: start;
}
  
.tooltip-pointer {
    position: relative;
}

.tooltip-pointer::after {
    content: "";
    position: absolute;
    bottom: -20px;
    right: 36px;
    border-width: 10px;
    border-style: solid;
    border-color: rgb(38 38 38/var(--tw-bg-opacity)) transparent transparent transparent; 
}

.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-4px);
    }
    40% {
        transform: translateX(4px);
    }
    60% {
        transform: translateX(-4px);
    }
    80% {
        transform: translateX(4px);
    }
    100% {
        transform: translateX(0);
    }
}

.diff-resizer {
    width: 144px;
}

.highlighted {
    background-color: oklch(0.76172 0.089459 200.027); /* highlight color for Quotes of Studies */
    border-radius: 0.5rem;
    .bg-gradient-to-b {
        background: none;
    }
}

.dot {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin: 0 2px;
}

.dot__sm {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 1px;
}
  
.green-dot {
    background-color: #34C759;
}
  
.grey-dot {
    background-color: #ccc;
}
  
/* Monthly statistics calendar */
.monthly-calendar {
    width: 100%;
    text-align: center;
  }
  
  .monthly-calendar table {
    border-collapse: collapse;
    width: 100%;
  }
  
  .monthly-calendar th,.monthly-calendar td {
    border: 1px solid #ddd;
    padding: 0;
  }
  
  .monthly-calendar table td {
    justify-content: center;
  }
  
  .day-container {
    position: relative;
    display: flex;
    justify-content: center;
  }
  
  .day-box {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    /* border-radius: 50%; */ /* Do we like circles or rounded squares? */
    margin: 5px;
    display: flex;
    justify-content: center;
  }
  
  .day-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
  }  
  
  .points_200 {
    background-color: oklch(0.87497 0.24613 297.068);
  }
  
  .points_180 {
    background-color: oklch(0.85135 0.20755 275.936);
  }
  
  .points_160 {
    background-color: oklch(0.82757 0.16831 255.132);
  }
  
  .points_140 {
    background-color: oklch(0.80364 0.12843 235.131);
  }
  
  .points_120 {
    background-color: oklch(0.77953 0.08834 216.508);
  }
  
  .points_100 {
    background-color: oklch(0.76172 0.089459 200.027);
  }
  
  .points_80 {
    background-color: oklch(0.76172 0.089459 200.027);
    opacity: 0.8;
  }
  
  .points_60 {
    background-color: oklch(0.76172 0.089459 200.027);
    opacity: 0.6;
  }
  
  .points_40 {
    background-color: oklch(0.76172 0.089459 200.027);
    opacity: 0.4;
  }
  
  .points_low {
    background-color: oklch(0.76172 0.089459 200.027);
    opacity: 0.2;
  }
  
  .points_0 {
    background-color: #fff;
  }

  h1 {
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
    gap: .5rem;
    line-height: 1.75rem;
  }
  @media (min-width: 1024px) {
    h1 {
      font-size: 1.875rem;
      line-height: 2.25rem;
      margin-bottom: 1rem;
    }
  }

/* Guest nav: horizontally scrollable category tabs with no visible scrollbar
   (touch/swipe scrolling still works — only the scrollbar itself is hidden).
   Reset to overflow: visible at md+: setting overflow-x alone implicitly makes
   overflow-y clip too, which would cut off the desktop dropdown drawer (an
   absolutely-positioned descendant) even though it's positioned relative to
   <nav>, not this container. Desktop has no need to scroll here anyway. */
.guest-nav-scroll {
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}
.guest-nav-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}
@media (min-width: 768px) {
    .guest-nav-scroll {
        overflow: visible;
    }
}

/* Guest nav desktop dropdown: recolor a link's label on hover. Plain CSS
   descendant-of-:hover rather than Tailwind's group-hover, since the dropdown
   link already sits inside the trigger's own `group` wrapper and an unnamed
   nested group would cross-talk with it. */
.guest-nav-dropdown-link:hover .guest-nav-dropdown-label {
    color: oklch(var(--p) / 1);
}
