/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: "share-tech-mono", monospace;
}

/* Header */
header {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 3px solid var(--dark-text);
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
}

.header-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: var(--accent-2);
    border-bottom: 3px solid var(--dark-text);
}

.header-top .cross img {
    position: absolute;
    top: 8px;
    right: 8px;
    height: 20px;
}

.header-top .site-title {
    font-weight: bold;
    font-size: 3rem;
    color: var(--light-bg);
    text-shadow: 2px 4px 3px rgba(0,0,0,0.3);
}

/* Responsive logo sizing */
@media screen and (max-width: 768px) {
    .logo-img {
        width: 50px;
        height: 50px;
    }

    .header-top .site-title {
        font-size: 1.6em;
    }
}

.site-title {
    text-align: center;
    font-size: 2em;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    flex: 1;
}

/* Make main focusable for keyboard navigation */
main:focus {
    outline: none;
}

section {
    margin-bottom: 40px;
    padding: 30px;
    background: var(--light-bg);
    border-radius: 8px;
}

h1 {
    font-size: 2em;
}

h2 {
    font-size: 1.6em;
    margin-bottom: 20px;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 10px;
    padding-top: 3rem;
}

h3 {
    font-size: 1.5em;
    margin: 20px 0 10px;
}

p {
    margin: 15px 0;
}

/* Links and Buttons */
a {
    color: var(--primary);
    text-decoration: none;
}

/* Ensure focus indicators are visible */
a:focus, button:focus, input:focus, textarea:focus {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

button, .button {
    padding: 12px 25px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

button:hover, .button:hover {
    background: var(--secondary);
}

/* Disabled button styling */
button:disabled, .button:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

button:disabled:hover, .button:disabled:hover {
    background: #ccc;
}

/* Forms */
input:not([type="checkbox"]):not([type="radio"]), textarea {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
}

.hide {
    display: none;
}

.form-field-flex {
    display: flex;
    gap: 3em;
    justify-content: stretch;
}
.form-field-flex > div {
    flex-grow: 1;
}

/* Form validation states */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #d32f2f;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: #d32f2f;
    border-width: 2px;
}

/* Error message styling */
.error-message {
    color: #d32f2f;
    font-size: 0.9em;
    margin-top: 5px;
    display: block;
}

/* Form labels */
label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.homepage-banner {
    display: flex;
    justify-content: center;
    align-items: start;
}

.homepage-banner img {
    max-height: 250px;
}

/* Popup */

.popup {
    float: right;
    border: 3px solid var(--dark-text);
    background-color: var(--accent);
}

.popup > .top {
    display: flex;
    justify-content: end;
    align-items: center;
    background-color: var(--accent-2);
    padding: 2px;
    border-bottom: 3px solid var(--dark-text);
}

.popup > .top > .cross img {
    height: 20px;
}

.popup > .content {
    padding: 0.6rem;
}

/* Special Sections */
.prominent-info {
    background: var(--accent);
    padding: 20px;
    border-radius: 5px;
    margin: 20px 0;
}

.resource-item {
    background: white;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    border-left: 4px solid var(--primary);
}

.donation-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.donation-method {
    background: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
}

.donation-method button {
    margin-top: 15px;
    width: 100%;
}

/* Cryptocurrency Address Display */
.crypto-address {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    word-break: break-all;
    font-size: 0.9em;
    margin: 15px 0;
    position: relative;
}

.crypto-copy-btn {
    margin-top: 10px;
    padding: 8px 16px;
    font-size: 0.9em;
}

ul, ol {
    list-style: outside;
    padding-left: 3rem;
}

footer {
    margin-top: 5rem;
    font-size: 0.8rem;
}

footer .links {
    background: var(--darker-bg);
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 3em;
    padding: 1em;
}

footer .links a {
    text-decoration: underline;
    color: var(--dark-text);
}

footer .footer-form {
    text-align: center;
    background-color: var(--accent);
    border: 3px solid var(--dark-text);
    margin: 1em auto;
    padding-bottom: 1em;
    max-width: max-content;
}

footer .footer-form .form-top {
    position: relative;
    border-bottom: 3px solid var(--dark-text);
    background-color: var(--accent-2);
}

footer .footer-form .form-top .cross img {
    position: absolute;
    top: 1px;
    right: 1px;
    height: 20px;
}

footer .footer-form .footer-form-fields {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    column-gap: 5em;
    align-items: center;
    padding: 1em;
}

footer .footer-form button, footer .footer-form input {
    max-width: 50vw;
}

footer .footer-form h2 {
    border-bottom: none;
    padding: 1em;
    margin: 0;
}

/* ==========================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ========================================== */

/* Tablets and smaller (max-width: 768px) */
@media screen and (max-width: 768px) {
    /* Typography adjustments */
    .site-title {
        font-size: 1.5em;
    }

    .logo {
        font-size: 2.5em;
    }

    h2 {
        font-size: 1.6em;
    }

    h3 {
        font-size: 1.2em;
    }

    /* Header layout for tablets */
    .header-top {
        grid-template-columns: 80px 1fr 80px;
        padding: 15px;
    }

    /* Main content padding */
    main {
        padding: 30px 15px;
    }

    section {
        padding: 20px;
    }

    .homepage-banner {
        flex-direction: column;
        align-items: center;
    }

    .homepage-banner img:not(.mobile) {
        display: none;
    }

    /* Donation grid - 2 columns on tablets */
    .donation-options {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }

    footer .links {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

/* Mobile phones (max-width: 480px) */
@media screen and (max-width: 480px) {
    /* Typography - smaller for mobile */
    .site-title {
        font-size: 1.6em;
        line-height: 1.3;
    }

    .logo {
        font-size: 2em;
    }

    h2 {
        font-size: 1.4em;
    }

    h3 {
        font-size: 1.1em;
    }

    /* Header layout - stack vertically */
    .header-top {
        grid-template-columns: 60px 1fr;
        gap: 10px;
        padding: 15px 10px;
    }

    /* Tighter spacing */
    main {
        padding: 20px 10px;
    }

    section {
        padding: 15px;
        margin-bottom: 20px;
    }

    /* Buttons full width on mobile */
    button, .button {
        width: 100%;
        padding: 15px 20px;
    }

    /* Donation grid - single column on mobile */
    .donation-options {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .donation-method {
        padding: 20px;
    }

    /* Forms full width */
    input:not([type="checkbox"]), textarea {
        padding: 15px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Resource items - less padding */
    .resource-item {
        padding: 15px;
        margin: 15px 0;
    }

    /* Prominent info sections */
    .prominent-info {
        padding: 15px;
        margin: 15px 0;
    }

    /* Crypto address - smaller font but still readable */
    .crypto-address {
        padding: 12px;
        font-size: 0.85em;
    }

    /* Improve touch targets */
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* Very small phones (max-width: 360px) */
@media screen and (max-width: 360px) {
    .site-title {
        font-size: 1.3em;
    }

    .logo-img {
        width: 45px;
        height: 45px;
    }

    h2 {
        font-size: 1.3em;
    }

    .header-top {
        padding: 10px;
    }
}