/* ==============================================
   FAMILY STORIES - TAILWIND OVERRIDES
   Tailwind CDN handles 95% of styling via utility classes.
   This file contains only custom CSS that can't be done with Tailwind.
   ============================================== */

/* Soft grain background texture */
.soft-grain::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Quill Rich Text Editor overrides for new design */
.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid #c5c8bc30 !important;
    background: #f6f3ee !important;
    border-radius: 0.75rem 0.75rem 0 0 !important;
    padding: 0.5rem !important;
}

.ql-container.ql-snow {
    border: none !important;
    border-radius: 0 0 0.75rem 0.75rem !important;
    font-family: 'Newsreader', serif !important;
    font-size: 1rem !important;
    background: #f6f3ee !important;
}

.ql-editor {
    min-height: 180px !important;
    line-height: 1.8 !important;
    padding: 1rem !important;
    color: #1c1c19 !important;
}

.ql-editor.ql-blank::before {
    color: #75786e80 !important;
    font-style: italic !important;
    font-family: 'Newsreader', serif !important;
}

.ql-snow .ql-stroke {
    stroke: #44483f !important;
}

.ql-snow .ql-fill {
    fill: #44483f !important;
}

.ql-snow .ql-picker {
    color: #44483f !important;
}

/* #editor-container wrapping */
#editor-container {
    border: 1px solid #c5c8bc30;
    border-radius: 0.75rem;
    overflow: hidden;
}

/* Flash message auto-hide animation */
.flash-message {
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Timeline item animation */
.timeline-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease-out forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0s; }
.timeline-item:nth-child(2) { animation-delay: 0.1s; }
.timeline-item:nth-child(3) { animation-delay: 0.2s; }
.timeline-item:nth-child(4) { animation-delay: 0.3s; }
.timeline-item:nth-child(5) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Line clamp utility (Tailwind CDN doesn't include this plugin) */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Prose content styles for story detail */
.prose-content p {
    margin-bottom: 1.2em;
}

.prose-content blockquote {
    border-left: 3px solid #526442;
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: #44483f;
    font-style: italic;
}

.prose-content h1, .prose-content h2, .prose-content h3 {
    font-family: 'Noto Serif', serif;
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #1c1c19;
}

.prose-content ul, .prose-content ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.prose-content li {
    margin-bottom: 0.3em;
}

.prose-content strong {
    font-weight: 600;
}

.prose-content em {
    font-style: italic;
}

/* First-letter drop cap for story detail */
.prose-content > p:first-of-type::first-letter {
    font-size: 3.5em;
    font-family: 'Noto Serif', serif;
    font-weight: 700;
    float: left;
    line-height: 0.8;
    margin-right: 0.1em;
    margin-top: 0.05em;
    color: #526442;
}

/* Audio waveform animation */
@keyframes waveformPulse {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

.waveform-recording .waveform-bar {
    animation: waveformPulse 0.5s ease-in-out infinite;
}

.waveform-bar {
    width: 3px;
    border-radius: 2px;
    background-color: #9caf88;
    transition: height 0.1s ease;
}

/* Visibility option radio card styling */
.visibility-option input:checked + div {
    border-color: #526442;
    background: rgba(82, 100, 66, 0.05);
}

.visibility-option input:checked + div .material-symbols-outlined {
    color: #526442;
}

/* Photo upload drag-over state */
.drag-over {
    border-color: #526442 !important;
    background: rgba(82, 100, 66, 0.05) !important;
}

/* Select all text on click (invite code) */
.select-all {
    user-select: all;
    -webkit-user-select: all;
}

/* Print styles */
@media print {
    nav, footer, .flash-message, button, a[href*="edit"], a[href*="delete"] {
        display: none !important;
    }

    body {
        background: white;
        color: #000;
    }

    .prose-content {
        font-size: 12pt;
        line-height: 1.4;
    }

    .prose-content > p:first-of-type::first-letter {
        font-size: 2em;
    }
}

/* Material Symbols default settings */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ==============================================
   CONVERGING TIMELINE & FOUNDERS
   ============================================== */

/* Converging timeline threads */
.thread-left  { position:absolute; left:calc(33.33% - 1.5px); width:3px; background:#526442; }
.thread-right { position:absolute; right:calc(33.33% - 1.5px); width:3px; background:#92484f; }
.thread-merged { position:absolute; left:50%; transform:translateX(-50%); width:3px; background:#735c00; }

/* Milestone card accents */
.milestone-left  { border-left:4px solid #526442; }
.milestone-right { border-left:4px solid #92484f; }
.milestone-joint { border-left:4px solid #735c00; }

/* Founder sepia portraits */
.founder-portrait { filter:sepia(0.8) contrast(1.1) brightness(0.9); transition:filter 0.5s; }
.founder-portrait:hover { filter:sepia(0.2) contrast(1.05) brightness(0.95); }

/* SVG merge draw-in animation */
.merge-svg path { stroke-dasharray:600; stroke-dashoffset:600; }
.merge-svg.animate path { animation: drawPath 2s ease-out forwards; }
@keyframes drawPath { to { stroke-dashoffset:0; } }

/* Ambient shadow for bento cards */
.shadow-ambient { box-shadow:0 24px 40px -12px rgba(28,28,25,0.05); }

/* ==============================================
   ALBUM VIEW
   ============================================== */

/* Paper texture for album pages */
.album-page {
    background-color: #fffdf8;
    background-image:
        radial-gradient(#f0ede9 0.5px, transparent 0),
        linear-gradient(to bottom, rgba(0,0,0,0.01) 0%, transparent 2%, transparent 98%, rgba(0,0,0,0.02) 100%);
    background-size: 20px 20px, 100% 100%;
    min-height: 520px;
}

@media (min-width: 768px) {
    .album-page { min-height: 600px; }
}

/* Page shadows for depth */
.album-page-left {
    box-shadow: inset -8px 0 16px -8px rgba(0,0,0,0.04);
}

.album-page-right {
    box-shadow: inset 8px 0 16px -8px rgba(0,0,0,0.04);
}

/* Album spine between pages */
.album-spine {
    background: linear-gradient(90deg,
        rgba(0,0,0,0.06) 0%,
        rgba(0,0,0,0.12) 30%,
        rgba(0,0,0,0.14) 50%,
        rgba(0,0,0,0.12) 70%,
        rgba(0,0,0,0.06) 100%);
    box-shadow: inset 0 0 12px rgba(0,0,0,0.08);
}

/* Vintage photo corners */
.album-corner {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0.15;
    transition: opacity 0.3s;
    pointer-events: none;
}

.group:hover .album-corner,
a:hover .album-corner {
    opacity: 0.35;
}

.album-corner-tl {
    top: -2px; left: -2px;
    border-top: 16px solid #1c1c19;
    border-left: 16px solid #1c1c19;
    border-bottom: 16px solid transparent;
    border-right: 16px solid transparent;
}

.album-corner-tr {
    top: -2px; right: -2px;
    border-top: 16px solid #1c1c19;
    border-right: 16px solid #1c1c19;
    border-bottom: 16px solid transparent;
    border-left: 16px solid transparent;
}

.album-corner-bl {
    bottom: -2px; left: -2px;
    border-bottom: 16px solid #1c1c19;
    border-left: 16px solid #1c1c19;
    border-top: 16px solid transparent;
    border-right: 16px solid transparent;
}

.album-corner-br {
    bottom: -2px; right: -2px;
    border-bottom: 16px solid #1c1c19;
    border-right: 16px solid #1c1c19;
    border-top: 16px solid transparent;
    border-left: 16px solid transparent;
}

/* Photo frame shadow */
.album-photo-frame {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08);
}

/* Page turn animation */
.album-page-enter {
    animation: albumPageFade 0.4s ease-out;
}

@keyframes albumPageFade {
    from { opacity: 0.3; transform: scale(0.99); }
    to   { opacity: 1;   transform: scale(1); }
}
