/* ============================================
   SHARED STYLES - Joe Scanlon Personal Site
   Typewriter/Vintage Paper Theme
   ============================================ */

/* ============================================
   SELF-HOSTED FONTS
   ============================================ */
@font-face {
    font-family: 'Courier Prime';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/courier-prime-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Courier Prime';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/courier-prime-700.woff2') format('woff2');
}

@font-face {
    font-family: 'Special Elite';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/special-elite-400.woff2') format('woff2');
}

/* ============================================
   CSS VARIABLES - Design System
   ============================================ */
:root {
    --paper: #f2f0e9;
    --paper-alt: #f4f1ea;
    --ink: #2b2b2b;
    --ink-secondary: #4a4a4a;
    --ribbon-red: #d13a3a;
    --highlight: #e8e6df;
    --background-dark: #333;
    --background-pattern: #444;
}

/* ============================================
   BODY & BACKGROUND
   ============================================ */
body {
    background-color: var(--background-dark);
    font-family: 'Courier Prime', monospace;
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;

    /* Subtle dotted background pattern */
    background-image: radial-gradient(var(--background-pattern) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* ============================================
   PAPER CONTAINER - Base Styles
   ============================================ */
.paper-container,
.paper-sheet {
    background-color: var(--paper);
    width: 100%;
    max-width: 800px;
    min-height: 80vh;
    position: relative;

    /* Stacked paper shadow effect */
    box-shadow:
        0 1px 1px rgba(0,0,0,0.15),
        0 10px 0 -5px #eee,
        0 10px 1px -4px rgba(0,0,0,0.15),
        5px 5px 15px rgba(0,0,0,0.5);

    padding: 40px;
    display: flex;
    flex-direction: column;

    /* Paper texture - subtle grid */
    background-image:
        linear-gradient(to right, rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,0,0,0.02) 1px, transparent 1px);
    background-size: 20px 20px;

}

/* CV-specific adjustments */
.paper-sheet {
    max-width: 900px;
    padding: 3rem 4rem;
    background-color: var(--paper-alt);

    /* Additional subtle aging spots */
    background-image:
        linear-gradient(to right, rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,0,0,0.02) 1px, transparent 1px),
        radial-gradient(circle at 10% 20%, rgba(0,0,0,0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(0,0,0,0.03) 0%, transparent 20%);
    background-size: 20px 20px, 20px 20px, 100% 100%, 100% 100%;
}

/* Paper noise/crumple texture overlay */
.paper-container::before,
.paper-sheet::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.paper-sheet::before {
    background: 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)' opacity='0.05'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
}

/* Content layer - sits above paper texture */
.content-layer {
    position: relative;
    z-index: 10;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

/* Headings use typewriter font */
h1, h2, h3 {
    font-family: 'Special Elite', cursive;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0.5px 0.5px 0px rgba(0,0,0,0.15);
    position: relative;
    z-index: 10;
}

h1 {
    color: var(--ink);
    border-bottom: 3px double var(--ink);
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

h2 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--ink);
    display: inline-block;
}

/* Ensure content sits above textures */
p, li, span, div {
    position: relative;
    z-index: 10;
}

/* ============================================
   LINKS
   ============================================ */
a {
    color: var(--ink);
    transition: color 0.15s ease;
}

a:hover {
    color: var(--ribbon-red);
}

/* ============================================
   TYPEWRITER LIST STYLE
   ============================================ */
ul.typewriter-list {
    list-style: none;
    padding-left: 1.5rem;
}

ul.typewriter-list li {
    position: relative;
}

ul.typewriter-list li::before {
    content: ">>";
    position: absolute;
    left: -1.5rem;
    color: var(--ink-secondary);
    font-family: 'Special Elite', cursive;
    font-size: 0.8em;
    top: 2px;
}

/* ============================================
   PROFILE PHOTO
   ============================================ */
.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--ink);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 0 0 2px rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.profile-photo-cv {
    width: 100px;
    height: 100px;
}

/* Dark theme photo adjustments */
body.theme-dark .profile-photo {
    border-color: var(--ink);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.4),
        inset 0 0 0 2px rgba(255, 255, 255, 0.1);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body {
        background: none !important;
        padding: 0;
        display: block;
        font-size: 11pt;
        line-height: 1.4;
        color: #000 !important;
    }

    .paper-container,
    .paper-sheet {
        box-shadow: none;
        transform: none;
        width: 100%;
        max-width: 100%;
        padding: 0;
        background-image: none;
        background: #fff !important;
    }

    .paper-container::before,
    .paper-sheet::before {
        display: none;
    }

    .no-print {
        display: none !important;
    }

    /* Links - show URL for external links */
    a {
        color: #000 !important;
        text-decoration: underline;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    /* Avoid page breaks inside sections */
    section {
        page-break-inside: avoid;
    }

    h1, h2, h3 {
        page-break-after: avoid;
        color: #000 !important;
    }

    /* Ensure lists don't break awkwardly */
    ul, ol {
        page-break-inside: avoid;
    }

    /* Hide interactive elements */
    .nav-link,
    .skill-badge,
    footer {
        page-break-inside: avoid;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 640px) {
    body {
        padding: 10px;
    }

    .paper-container,
    .paper-sheet {
        padding: 20px;
        min-height: 100vh;
    }

    .paper-sheet {
        padding: 2rem 1.5rem;
    }
}

/* ============================================
   UTILITY CLASSES (Tailwind replacements)
   ============================================ */

/* Display */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

/* Flex */
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-shrink-0 { flex-shrink: 0; }

/* Grid */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-justify { text-align: justify; }

/* Font size */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }

/* Font weight & style */
.font-bold { font-weight: 700; }
.italic { font-style: italic; }
.underline { text-decoration-line: underline; }
.leading-relaxed { line-height: 1.625; }
.font-special-elite { font-family: 'Special Elite', cursive; }

/* Colors */
.text-gray-600 { color: #4b5563; }
.text-muted { color: #4a4a4a; }
.text-white { color: #fff; }
.hover-text-red:hover { color: #b91c1c; }

/* Opacity */
.opacity-60 { opacity: 0.6; }
.opacity-70 { opacity: 0.7; }
.opacity-80 { opacity: 0.8; }

/* Margin */
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Padding */
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pb-8 { padding-bottom: 2rem; }
.pb-1 { padding-bottom: 0.25rem; }
.pt-4 { padding-top: 1rem; }
.pl-4 { padding-left: 1rem; }

/* Gap */
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Sizing */
.max-w-2xl { max-width: 42rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.w-full { width: 100%; }

/* Border */
.border-b-2 { border-bottom: 2px solid; }
.border-dashed { border-style: dashed; }
.border-gray { border-color: #888; }
.border-ribbon-red { border-color: var(--ribbon-red); }

/* Group hover */
.group:hover .group-hover-white { color: #fff; }

/* Responsive - md (768px+) */
@media (min-width: 768px) {
    .md-text-left { text-align: left; }
    .md-text-xl { font-size: 1.25rem; line-height: 1.75rem; }
    .md-text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .md-text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .md-text-5xl { font-size: 3rem; line-height: 1; }
    .md-flex-row { flex-direction: row; }
    .md-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================
   FOOTER STYLES
   ============================================ */
.site-footer {
    position: relative;
    width: 100%;
    background: rgba(43, 43, 43, 0.95);
    color: rgba(255, 255, 255, 0.8);
    padding: 2rem 1.5rem;
    border-top: 3px solid var(--ink);
}

.site-footer .footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.site-footer nav {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.site-footer nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-family: 'Special Elite', cursive;
    transition: color 0.2s;
}

.site-footer nav a:hover {
    color: #fff;
}

.site-footer nav a::after {
    display: none;
}

.site-footer .footer-copyright {
    font-family: 'Special Elite', cursive;
    font-size: 0.85rem;
    opacity: 0.6;
}

.site-footer .footer-visitor {
    font-family: 'Courier Prime', monospace;
    font-size: 0.75rem;
    opacity: 0.4;
    margin-top: 0.5rem;
}

.site-footer .email-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#copy-email-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 3px;
    transition: all 0.2s;
    font-family: 'Special Elite', cursive;
}

#copy-email-btn:hover {
    border-color: #fff;
    color: #fff;
}

/* Dark theme footer overrides */
body.theme-dark .site-footer {
    background: rgba(20, 18, 15, 0.95);
    border-color: #5a4d3f;
}

body.theme-dark .site-footer nav a {
    color: rgba(212, 197, 176, 0.8);
}

body.theme-dark .site-footer nav a:hover {
    color: #fff;
}

body.theme-dark #copy-email-btn {
    border-color: rgba(212, 197, 176, 0.3);
    color: rgba(212, 197, 176, 0.6);
}

body.theme-dark #copy-email-btn:hover {
    border-color: #d4c5b0;
    color: #d4c5b0;
}
