/* 
    Author: Rich Robichaud
    Course: ITWP 1050 
    Assignment: Homework 5
*/

/* Using universal selector to reset margins and padding - learned this is best practice */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* This makes width calculations include padding and border */
    color: #2d3748; /* Dark slate color for better readability than pure black */
}

/* Body styling with modern font stack */
body {
    font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif; 
    font-size: 16px; 
    line-height: 1.6;
    background-color: #f7f8fc; /* Light background for better contrast */
    max-width: 900px;
    margin: 0 auto; /* Center the page horizontally */
    padding: 2rem;
    position: relative;
}

/* Adding subtle texture background to body - using pseudo-element to avoid affecting content */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAPcoU0dSw0SUTqz/GtrGuXfbyyBniKykOWQWGqwwMA7QiYAxi+IlPdqo+hYHnUt5ZPfnsHJyNiDtnpJyayNBkF6cWoYGAMY92U2hXHF/C1M8uP/ZtYdiuj26UdAdQQSXQErwSOMzt/XWRWAz5GuSBIkwG1H3FabJ2OsUOUhGC6tK4EMtJO0ttC6IBD3kM0ve0tJwMdSfjZo+EEISa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MJpiKYkmW3tTg3ZQ9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==');
    opacity: 0.1;
    z-index: -1;
    pointer-events: none;
}

/* Header styling with gradient background - using linear-gradient as required */
header {
    text-align: center;
    margin-bottom: 2.5rem;
    /* Used a linear gradient for the background as required in the assignment */
    background: linear-gradient(135deg, #591e1e 0%, #8a3838 100%);
    padding: 2.5rem 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

/* Adding a decorative element to the header with pseudo-element */
header::before {
    content: "";
    position: absolute;
    top: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

/* Using the web font as required in the assignment */
@font-face {
    font-family: 'IM Fell English SC';
    src: url('https://fonts.googleapis.com/css2?family=IM+Fell+English+SC&display=swap');
}

/* H1 styling with all the required properties from the assignment:
   - Web font
   - Text shadow
   - Letter spacing
   - Small caps
   - Nowrap */
h1 {
    font-family: 'IM Fell English SC', Georgia, serif; /* Web font with fallback stack */
    color: #ffffff;
    font-size: 3.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); /* Adding text shadow as required */
    letter-spacing: 3px; /* Adding letter spacing as required */
    font-variant: small-caps; /* Using small caps as required */
    white-space: nowrap; /* Setting to nowrap as required */
    margin-bottom: 1rem;
    position: relative;
}

/* Styling for other heading elements to match the theme */
h2, h3 {
    color: #ffffff;
    font-weight: 400;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

h3 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

/* Enhanced image container with more dramatic styling */
.image-container {
    display: flex;
    justify-content: center; /* Center the images horizontally */
    gap: 40px; /* Specific gap between images */
    padding: 50px; /* More generous padding */
    margin: 40px 0;
    /* Enhanced gradient with more depth */
    background: radial-gradient(ellipse at top left, #8a3232, #3d1616 80%);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25); /* More dramatic shadow */
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1); /* Subtle border */
}

/* Add decorative elements to image container */
.image-container::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 160px;
    height: 160px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    z-index: 1;
}

.image-container::after {
    content: "";
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    z-index: 1;
}

/* Enhanced image styling with 3D effects */
img.responsive-image {
    display: block;
    max-width: 45%; /* Increased from 40% for larger images */
    height: auto;
    /* Deeper 3D effect with multilayered borders */
    border: 3px solid rgba(255, 255, 255, 0.2);
    outline: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.5); /* Bouncier animation */
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3), /* Outer shadow */
        0 0 0 1px rgba(255, 255, 255, 0.1); /* Subtle highlight */
    transform: perspective(1000px) rotateY(0deg);
    z-index: 2;
    filter: brightness(1) contrast(1.05);
}

/* Better size balancing between images */
img.responsive-image:first-child {
    max-width: 35%; /* Increased from 30% for better balance */
    transform: perspective(1000px) rotateY(2deg); /* Slight 3D rotation */
}

img.responsive-image:last-child {
    transform: perspective(1000px) rotateY(-2deg); /* Opposite 3D rotation */
}

/* More dramatic hover effects */
img.responsive-image:hover {
    transform: perspective(1000px) translateY(-12px) scale(1.05) rotateY(0deg);
    filter: brightness(1.1) contrast(1.1);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4), /* Deeper shadow on hover */
        0 0 20px rgba(255, 255, 255, 0.2); /* Subtle glow */
    border-color: rgba(255, 255, 255, 0.3);
}

/* First image special hover */
img.responsive-image:first-child:hover {
    transform: perspective(1000px) translateY(-12px) scale(1.05) rotateY(-5deg);
}

/* Second image special hover */
img.responsive-image:last-child:hover {
    transform: perspective(1000px) translateY(-12px) scale(1.05) rotateY(5deg);
}

/* Quote container styling with left border for accent */
.quote-container {
    margin: 30px 0;
    padding: 2.5rem 2rem 2rem 3rem;
    border-radius: 12px;
    background: linear-gradient(to right, #ffffff, #f8f8f8);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #742a2a;
    position: relative;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Added more space between quotes for better readability */
.quote-container + .quote-container {
    margin-top: 40px;
}

/* Hover effect for quotes */
.quote-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Added decorative quote mark to each quote container */
.quote-container::before {
    content: '❝';
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 2.5rem;
    color: rgba(116, 42, 42, 0.15);
    font-family: Georgia, serif;
}

/* Paragraph styling - line height is required by assignment */
.quote-container p {
    font-family: 'Georgia', serif;
    font-size: 1.05rem;
    color: #333;
    line-height: 1.8; /* Setting the line height as required by assignment */
    text-align: left;
    text-indent: 0;
    position: relative;
    margin-bottom: 0;
}

/* Styling for the source citation */
.source {
    text-align: center;
    font-weight: 500;
    margin: 30px auto;
    color: #555;
    font-size: 0.95rem;
    max-width: 90%;
}

/* Footer styling - top and bottom margins are required by assignment */
footer {
    margin: 50px auto; /* Top and bottom margins required by assignment */
    text-align: center;
    font-size: 0.9rem;
    background-color: #f0f0f0;
    padding: 1.5rem;
    border-top: 2px solid #742a2a;
    border-radius: 12px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    max-width: 90%;
}

/* Centering copyright text in footer */
footer p {
    text-align: center;
    margin-bottom: 1rem;
    text-indent: 0;
}

/* Styling for footer links */
footer a {
    text-decoration: none;
    color: #742a2a;
    font-weight: 500;
    margin: 0 10px;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
    display: inline-block;
}

/* Hover effect for footer links */
footer a:hover {
    text-decoration: none;
    background-color: rgba(116, 42, 42, 0.1);
    color: #742a2a;
}

/* Styling for external link indicator - required by assignment */
.external-link::after {
    content: "↗"; /* Used an arrow instead of text for a modern look */
    display: inline-block;
    margin-left: 4px;
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

/* Animation for external link arrow */
.external-link:hover::after {
    transform: translateY(-2px) translateX(2px);
}

/* ========= HOMEWORK 5 REQUIREMENTS BELOW ========= */

/* HOMEWORK 5 REQUIREMENT 1: Media query for font size changes at 800px or less */
@media (max-width: 800px) {
    /* Changes the h1 font size when viewport is 800px or less */
    h1 {
        font-size: 2.5rem;
    }
    
    /* Changes the body font size when viewport is 800px or less */
    body {
        font-size: 14px;
    }
    
    .quote-container p {
        font-size: 0.95rem;
    }
}

/* HOMEWORK 5 REQUIREMENT 2: Media query for background color change at 600px or less */
@media (max-width: 600px) {
    /* Changes the background color when viewport is 600px or less */
    body {
        background-color: #f0e8e8; /* Lighter reddish background for small screens */
    }
    
    .quote-container {
        background: linear-gradient(to right, #f9f3f3, #f3e8e8);
    }
}

/* HOMEWORK 5 REQUIREMENT 4: Responsive section with 5 items layout */
.responsive-section {
    margin: 50px 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f4f4 0%, #eee5e5 100%);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}

.responsive-section h2 {
    color: #742a2a;
    text-align: center;
    margin-bottom: 1.5rem;
    text-shadow: none;
}

.responsive-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
}

.responsive-item {
    flex: 1 1 250px; /* Flexible items with minimum width of 250px */
    padding: 1.5rem;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.responsive-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.responsive-item h3 {
    color: #591e1e;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    text-shadow: none;
}

.responsive-item p {
    color: #444;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Media query for responsive section layout changes */
@media (max-width: 768px) {
    .responsive-container {
        flex-direction: column;
    }
    
    .responsive-item {
        flex-basis: 100%;
    }
}

/* Responsive design media queries for mobile devices */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .image-container {
        flex-direction: column;
        align-items: center;
        padding: 40px 30px;
        gap: 30px;
    }
    
    img.responsive-image,
    img.responsive-image:first-child {
        max-width: 85%; /* Larger images on mobile */
        transform: perspective(1000px) rotateY(0deg);
    }
    
    img.responsive-image:hover,
    img.responsive-image:first-child:hover,
    img.responsive-image:last-child:hover {
        transform: perspective(1000px) translateY(-8px) scale(1.03) rotateY(0deg);
    }
    
    .quote-container {
        padding: 2rem 1.5rem 1.5rem 2rem;
    }
}