/* ====================
   Section Layout Helpers 
   ==================== */

/* Base Width Classes */
.section-full-width {
    width: 100%;
}

.section-max-width {
    width: 100%;
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
    /* Add horizontal padding ONLY if using section-padded modifier */
}

/* Modifier Classes */
.section-padded {
    /* Add standard padding - adjust values as needed */
    padding: 2em; 
}

.section-rounded {
    border-radius: var(--border-radius-section);
}

.section-bg-light {
    background-color: var(--background-light);
}

/* ====================
   Existing Components
   ==================== */

/* Reusable Component Styles */

/* Header & Navigation */
header.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white */
    color: #1d1d1f; /* Match body text */
    border-bottom: 1px solid #d2d2d7; /* Light gray border */
    /* Frosted glass effect */
    -webkit-backdrop-filter: saturate(1.8) blur(20px);
    backdrop-filter: saturate(1.8) blur(20px);
}

.main-header .content-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.6em; /* Reduced padding */
    padding-bottom: 0.6em; /* Reduced padding */
}

header.main-header h1 {
    margin: 0;
    font-size: 1.8em;
}

header.main-header h1 a {
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center; /* Vertically align logo and text */
}

header.main-header h1 a img {
    height: 30px; /* Adjust logo size */
    margin-right: 0.5em;
    vertical-align: middle; /* Helps alignment with text */
}

nav.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center; /* Vertically align nav items */
}

nav.main-nav li {
    margin-left: 1.5em;
}

nav.main-nav a {
    text-decoration: none;
    color: var(--text-secondary); /* Lighter color for nav links */
    font-size: 0.95em;
    font-weight: var(--font-weight-medium);
    padding-bottom: 5px; /* Space for border */
    border-bottom: 2px solid transparent; /* Transparent border for hover effect */
    transition: color 0.2s ease, border-color 0.2s ease;
    opacity: 0.8; /* Slightly less prominent */
}

nav.main-nav a:hover,
nav.main-nav a.active {
    color: var(--text-primary); /* Darken on hover/active */
    border-bottom-color: var(--color-primary); /* Apple blue border */
    opacity: 1;
}

/* Footer */
footer.main-footer {
    margin-top: 3em;
    background-color: var(--background-light);
    color: var(--text-secondary);
    font-size: 14px; /* Slightly smaller text */
    border-top: 1px solid var(--border-color);
    padding: 0; /* Remove default padding if any */
}

.main-footer .content-container {
     padding-top: 1.5em;
     padding-bottom: 1.5em;
     text-align: center;
}

footer.main-footer a {
    color: var(--text-secondary); /* Keep footer links subtle */
    font-weight: var(--font-weight-medium);
}

footer.main-footer a:hover {
    color: var(--text-primary);
}

/* Basic Forms */
input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding and border in element's total width and height */
    font-family: inherit; /* Ensure form fields use the body font */
    font-size: 1rem;
}

label {
    display: block; /* Ensure label takes its own line */
    margin-bottom: 5px;
    font-weight: 500;
}

/* Buttons */
.btn,
button[type="submit"] {
    display: inline-block;
    background-color: #06c; /* Apple blue */
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 25px; /* More rounded corners */
    text-decoration: none;
    font-weight: 400; /* Regular weight */
    font-size: 17px; /* Match body text */
    line-height: 1.17647;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover,
button[type="submit"]:hover {
    background-color: #005bb5; /* Darker Apple blue */
    text-decoration: none; /* Ensure no underline on hover */
}
.btn:active, button[type="submit"]:active {
    background-color: #004da3; /* Even darker for active */
}

/* Small Button Variant */
.btn-sm {
    padding: 6px 12px; /* Reduced padding */
    font-size: 0.9rem; /* Smaller font size */
}

/* Success Button Variant */
.btn-success {
    background-color: #28a745;
    color: white;
}
.btn-success:hover {
    background-color: #218838;
}

/* Secondary Button Variant */
.btn-secondary {
     background-color: #6c757d;
     color: white;
}
.btn-secondary:hover {
     background-color: #5a6268;
}

/* Content Container */
.content-container {
    max-width: var(--content-max-width); /* Use variable */
    margin-left: auto;
    margin-right: auto;
    padding-left: 2em;  /* Horizontal padding for smaller screens */
    padding-right: 2em; /* Horizontal padding for smaller screens */
    box-sizing: border-box;
    width: 100%;
}

/* Mobile Navigation Toggle Button */
.mobile-nav-toggle {
    display: none; /* Hidden by default, shown by media query */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px; /* Slightly adjusted for better bar spacing */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10; /* Ensure it's above other elements in the header */
    position: relative; /* For absolute positioning of bars if needed */
}

.mobile-nav-toggle .hamburger-bar {
    width: 100%;
    height: 3px; /* Standardized bar height */
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* Hamburger to X animation */
.mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg); /* Fine-tuned Y translation */
}

.mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: translateX(-100%); /* Move it out of view */
}

.mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg); /* Fine-tuned Y translation */
}

/* Styles for when the mobile nav is open (JS toggles .mobile-nav-active on #main-navigation) */
#main-navigation.mobile-nav-active {
    /* Styles defined in responsive.css media query */
}

/* Animation Styles */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.2s ease-out; 
}

/* Utility Classes */
.placeholder {
    color: #dc3545;
    font-weight: bold;
    background-color: #f8d7da;
    padding: 2px 4px;
    border-radius: 3px;
}

/* General Page Title Section Styles */
/* REMOVED - No longer using this structure */
/* .page-title-section {
    text-align: center;
    padding: 4em 0 3em 0;
    background-color: transparent; 
} */

/* REMOVED - Using global main.content h1 now */
/* .page-title-section h1 {
    margin-bottom: 0.1em;
    font-size: 1.4em; 
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
} */

/* General Intro Paragraph Style (used below H1 on many pages) */
.page-intro {
    font-size: var(--h2-font-size); /* Use variable for consistency with h2 */
    color: var(--text-primary); /* RESTORED original color */
    font-weight: var(--font-weight-bold);
    margin-top: 0;
    margin-bottom: 0.5em; /* Space below intro */
    max-width: 800px; /* Max width to prevent overly long lines */
    margin-left: auto;
    margin-right: auto;
    line-height: 1.25;
    text-align: center; /* Ensure intros are centered by default */
}

/* Style for the general sub-intro paragraph below title (THIS IS BELOW THE IMAGE) */
.page-sub-intro {
    font-size: 2em;
    color: var(--text-secondary);
    text-align: center; 
    font-weight: var(--font-weight-bold); 
    margin-top: 0.5em; /* REDUCED - Space above sub-intro */
    margin-bottom: 1em; 
}

/* Utility class for standard content boxes */
.content-box {
    background-color: var(--background-light);
    padding: 1.5em;
    border-radius: 18px;
    /* Add other common styles if needed later, like margin */
}

/* General Learn More Link Style */
.learn-more-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    display: inline-block;
    margin-top: 1em;
}

.learn-more-link:hover {
    text-decoration: underline;
}

/* Component for a centered, rounded image block */
.image-block-rounded {
    display: block;         /* Allows margin auto centering */
    margin-top: 2em;        /* Add vertical spacing */
    margin-bottom: 2em;     /* Add vertical spacing */
    margin-left: auto;      /* Center horizontally */
    margin-right: auto;     /* Center horizontally */
    max-width: 100%;        /* Scale down to fit container */
    height: auto;           /* Maintain aspect ratio */
    border-radius: var(--border-radius-section); /* Use global radius */
}

/* New Wide Image Block Component */
.image-block-wide {
    width: 100%;
    height: 500px; /* Base height */
    background-size: auto; /* Base size */
    background-position: center center;
    background-repeat: no-repeat;
    margin-top: 2em; /* SPACE ABOVE IMAGE */
    margin-bottom: 1.5em; /* REDUCED - Space below image */
    overflow: hidden;
}

/* Feature Category Icon */
.feature-category-icon {
    /* width: 1.2em; REMOVED for Font Awesome */
    /* height: 1.2em; REMOVED for Font Awesome */
    font-size: 1.375em; /* ADJUSTED to make computed size approx 2.2em of root */
    margin-right: 0.5em; /* Relative to parent h2 font-size. */
    color: #333;
    /* vertical-align will be handled by flexbox on parent h2 */
    transition: color 0.2s ease; /* For hover effect */
}

.feature-category:hover .feature-category-icon {
    color: var(--color-primary); /* #007AFF */
}

/* Support Page Icon */
.support-icon {
    /* display: block; REMOVED */
    /* text-align: center; REMOVED */
    font-size: 1.375em; /* ADJUSTED for new parent h3 size (1.6em) to target 2.2em root computed */
    color: #333;
    /* margin-bottom: 10px; REMOVED */
    margin-right: 0.5em; /* ADDED for spacing next to text */
    transition: color 0.2s ease;
}

.support-item:hover .support-icon {
    color: var(--color-primary);
}

/* Feedback Page Icon */
.feedback-icon {
    font-size: 1.69em; /* ADJUSTED to make computed size approx 2.2em of root */
    color: #333;
    margin-right: 8px;
    /* vertical-align will be handled by flexbox on parent h3 */
    transition: color 0.2s ease;
}

.feedback-item:hover .feedback-icon { /* Assuming icon is inside .feedback-item */
    color: var(--color-primary);
}

/* ================================= 
   Component Responsive Styles 
   ================================= */

/* Tablet Styles (e.g., screens <= 768px) */
@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: flex; /* Show toggle on smaller screens */
    }

    nav.main-nav {
        display: none; /* Hide full nav by default */
        position: absolute;
        top: 100%; /* Position below header */
        left: 0;
        right: 0;
        background-color: rgba(255, 255, 255, 0.98); /* Slightly more opaque for readability */
        border-top: 1px solid var(--border-color-secondary);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        padding: 0; /* Remove padding, li will handle it */
        z-index: 999;
        overflow-y: auto; /* Allow scrolling if menu is long */
        max-height: calc(100vh - 60px); /* Prevent menu from being too long */
    }

    #main-navigation.mobile-nav-active {
        display: block;
        animation: slideDownFadeIn 0.3s ease-out forwards;
    }

    @keyframes slideDownFadeIn {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    nav.main-nav ul {
        flex-direction: column;
        width: 100%;
        padding: 0.5em 0; /* Padding for top/bottom of the ul */
    }

    nav.main-nav li {
        margin-left: 0;
        width: 100%;
        text-align: center; /* Center nav items */
        border-bottom: 1px solid var(--border-color-light); /* Separator lines */
    }
    nav.main-nav li:last-child {
        border-bottom: none;
    }

    nav.main-nav a {
        display: block; /* Make links full width for easier tapping */
        padding: 0.8em 1em; /* Generous padding for tap targets */
        width: 100%;
        border-bottom: none; /* Remove individual underline, separator is on li */
        font-size: 1rem; /* Adjust font size for mobile menu */
    }

    nav.main-nav a.active,
    nav.main-nav a:hover {
        background-color: var(--background-light-hover); /* Subtle hover/active state */
        color: var(--color-primary);
        border-bottom: none; /* Ensure no border an active/hover */
    }

    /* For hero image placement if it's a component */
    .image-block-wide { /* Adjust height for mobile/tablet */
        min-height: 200px;
    }

    /* Section bleed helpers - if these are considered components */
    .section-full-bleed-width { 
        width: 100vw;
        position: relative; /* Needed for left: 50% and transform to work correctly */
        left: 50%;
        transform: translateX(-50%);
        box-sizing: border-box; /* Ensure padding/border are included in 100vw */
    }

    /* Animation adjustments for full bleed */
    .animate-on-scroll.section-full-bleed-width {
        /* Ensure initial state is correct for transform */
    }
    .animate-on-scroll.is-visible.section-full-bleed-width {
        /* Ensure visibility and transform work as expected */
    }

    /* Styles moved from responsive.css for components */
    header.main-header {
        padding: 0.5em 1em;
        box-sizing: border-box;
        height: 55px;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background-color: rgba(255, 255, 255, 0.95);
    }
    header.main-header .content-container {
        width: 100%;
        height: 100%;
        align-items: center;
    }
    header.main-header h1 {
        margin-bottom: 0;
    }
    .section-padded { /* This is a component helper */
        padding: 1.5em;
    }
    .feature-category-icon { /* Component icon style */
        font-size: 1.125em; 
    }
    .support-icon { /* Component icon style */
        font-size: 1.125em; 
    }
    .feedback-icon { /* Component icon style */
        font-size: 0.9em; 
    }
}

@media (max-width: 480px) {
    nav.main-nav a {
        font-size: 1em; /* Ensure touch targets are adequate */
        padding: 1em;
    }
    nav.main-nav li {
        margin-bottom: 0.2em;
    }

    /* Styles moved from responsive.css for components */
    header.main-header h1 {
        font-size: 1rem; 
    }
    header.main-header h1 a img {
        max-height: 20px; 
    }
    .section-padded { /* This is a component helper */
        padding: 0.5em;
    }
    .page-sub-intro { /* This is a component style for general page sub-intros */
        font-size: 1.5em;
    }
}

/* These were outside media queries in responsive.css */
/* .menu-toggle span { ... } - Removed as mobile-nav-toggle is used */
/* .mobile-menu { ... } - Removed as #main-navigation.mobile-nav-active is used */


/* Image Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top - higher than header */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
    padding: 0;
    overflow: visible;
}
.modal.is-visible {
    display: block;
}
.modal-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-block; /* Changed from flex to allow shrink-wrapping */
    text-align: center; /* Helps center content if container is wider */
    max-width: calc(100vw - 80px);
    max-height: calc(100vh - 80px);
    overflow: auto; /* Scrollbars if image is larger than these max dimensions */
}
.modal-content {
    margin: 0 auto; /* Center image if modal-inner becomes wider */
    display: block;
    /* No explicit width, max-width, height, or max-height. Image uses intrinsic size. */
}

/* Optional: Caption of Modal Image */
#modalCaption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 50px; /* Reserve space, even if empty */
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    z-index: 3001; /* Ensure it's above arrows */
}

.modal-close:hover,
.modal-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Style for images that trigger the modal */
.feature-modal-trigger {
    cursor: pointer;
    transition: opacity 0.2s ease-in-out;
}

.feature-modal-trigger:hover {
    opacity: 0.8;
}

/* Animation for modal content (optional) */
.modal-content, #modalCaption {
    animation-name: zoom;
    animation-duration: 0.4s;
}

@keyframes zoom {
    from {transform:scale(0.8)}
    to {transform:scale(1)}
}

/* Modal Navigation Arrows - Desktop */
.modal-arrow {
    position: fixed;
    top: 50%;
    left: 15px; /* Adjusted for explicit spacing */
    right: auto;
    transform: translateY(-50%);
    color: #fff;
    border: none;
    font-size: 3.5rem;
    font-weight: bold;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3000;
    transition: color 0.2s;
    opacity: 0.95;
    box-shadow: none;
    padding: 10px 15px; /* Increased padding */
    pointer-events: auto;
    background: none !important;
}
.modal-arrow-right {
    left: auto;
    right: 15px; /* Adjusted for explicit spacing */
}

@media (max-width: 600px) { /* Modal arrows responsive adjustments */
    .modal-arrow {
        position: fixed;
        top: auto;
        bottom: 24px;
        left: 8px;
        right: auto;
        transform: none;
        font-size: 2.5rem;
    }
    .modal-arrow-right {
        left: auto;
        right: 8px;
    }
}

/* Modal Image: pixel-perfect on desktop, scales down if too large */
.modal-content {
    margin: 0; /* Reset from potential modal-inner centering */
    display: block;
    width: auto; /* Use intrinsic width */
    height: auto; /* Use intrinsic height */
    max-width: 100%; /* Ensure it doesn't exceed the inner container's width */
    max-height: 100%; /* Ensure it doesn't exceed the inner container's height */
    object-fit: contain; /* Scales down to fit while maintaining aspect ratio */
}

.modal-arrow:hover {
    background-color: rgba(0, 0, 0, 0.8);
}