*, *::before, *::after { box-sizing: border-box; }

/* ---------- HEADER / NAV ---------- */

body {
    margin: 0;
    min-height: 100vh;
 background: linear-gradient(135deg, lightyellow 0%, rgb(252, 200, 104) 30%, rgb(248, 195, 175) 40%, rgb(255, 127, 57) 100%);
    background-size: 400% 400%;
    animation: gradientMove 20s ease infinite;
    font-family: "Inter", Arial, sans-serif;
}

@keyframes gradientMove {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.services h2{
    display:flex;
    justify-content:center;
    color:black;
    border-bottom:2px solid orangered;
    width:fit-content;
    margin:0 auto;
}

.services p{
    font-size:1.2rem;
    display:flex;
    color:rgb(8, 1, 1);
    justify-content:center;
    padding-left: 70px;
    padding-right: 70px;
}

.categories {
    display: flex;
    flex-wrap: wrap;                 /* cards drop to the next row when space runs out */
    justify-content: center;
    gap: 30px;
    margin: 20px;
}

.category {
    background-color: brown;
    flex: 1 1 320px;                 /* replaces width: 600px */
    max-width: 600px;
    height: auto;
    border-radius: 12px;
}

.category h2{
    margin: 0 auto;
    width:fit-content;
    color:white;
    border-bottom:2px dotted orangered;
}

.category p{
    text-align:center;
    padding:20px;
    font-size: 1.1rem;
    color:white;
}

.button-wrap{
    display:flex;
    justify-content:center;
    padding-bottom:15px;
}

.request-btn{
    background-color:orangered;
    color:white;
    border: 1px solid orangered;
    border-radius:12px;
    padding:10px;
}

.request-btn:hover {
    background-color:green;
    color:white;
    border: 1px solid green;
}

.request-btn:active{
    background-color:white;
    color:green;
    border: 1px solid white;
}

#dlg{
    background:lightgoldenrodyellow;
    border-radius:10px;
    height:300px;
    border:1px solid orangered;
    color: brown;
}

.top h1{
    text-align: center;
}

#f .submit-form {
   display: flex;
   justify-content: center;
}

#f .submit-form button{
    padding:5px;
    color:white;
    border-radius:5px;
    margin-top: 5px;
    background-color:brown;
    border:1px solid orangered;
}

#f .submit-form button:hover{
    background-color:green;
    color:white;
    border: 1px solid green;
}
#f .submit-form button:active{
    background-color:white;
    color:green;
    border: 1px solid green;
}

footer {
    background-color: brown;
    color: lightgoldenrodyellow;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 10px;
    align-items: flex-start;
    gap: 10px;
    font-size: 1.1rem;               /* was 1.1, which is invalid */
    margin-top: auto;
}

 footer .address {
        grid-column: 1 / -1;      /* full width on top */
        text-align: center;
    }

footer .social-media-icons{
    padding-left: 10px;
}

footer .quick-links{
    padding-left:10px;
    color:white;
}
footer a {
    text-decoration: none;
}
footer .quick-links li {
    list-style: none;
    color:white;
}
footer .quick-links ul li a{
    list-style: none;
    color:lightsalmon;
} 
footer .quick-links ul li a:hover{
    list-style: none;
    color:white;
}

footer .form-container{
    display: flex;
    flex-direction:column;
    width:auto;
    flex: 0 1 240px;
    max-width: 100%;
    border:2px solid orangered;
    background-color:lightgoldenrodyellow;
    color:black;
    border-radius:12px;
    padding:8px;
    margin: 0;
}

footer .form-container .title {
  text-align: center;
  margin: 0 0 8px;
}

footer .form-container .title h3 {
  margin: 0;
  text-align: center;
  font-size: 1rem;      /* adjust if you want it bigger or smaller */
}

footer .form-container input{
    display:block;
    width:100%;
    border-radius: 5px;
    box-sizing:border-box;
}

footer .message-row {
    display: flex;
    flex-direction:column;
    align-items:stretch;
}

footer .message-row label {
    flex: 0 0 auto;              /* label keeps its natural width */
    margin: 1px 0 0;             /* nudges it level with the textarea's first line */
}

footer .message-row textarea {
    flex: 1;
    min-width: 0;
    width: auto;
    margin: 0;
    border-radius:10px;
    resize: vertical;
}

footer .form-container button{
    display:block;
    margin:1px auto;
    padding:8px;
    border-radius:10px;
    background-color:rgb(3, 20, 39);
    border:1px solid orangered;
    color:white;
}

footer .form-container button:hover{
    background-color:green;
    color:white;
    border:1px solid green;
}
footer .form-container button:active{
    background-color:white;
    color:green;
    border: 1px solid green;
}
footer .form-container input,
footer .form-container textarea {
    border: 1px solid #ccc;
    outline: none;                          /* removes the default browser outline */
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

/* soft glow on hover */
footer .form-container input:hover,
footer .form-container textarea:hover {
    border-color: #c9a227;
    box-shadow: 0 0 6px 1px rgba(201, 162, 39, 0.5);
}

/* stronger glow when selected / typing */
footer .form-container input:focus,
footer .form-container textarea:focus {
    border-color: brown;
    box-shadow: 0 0 10px 3px rgba(201, 162, 39, 0.7),
                0 0 4px 1px rgba(165, 42, 42, 0.6);
}

/* Loading state */
button[type="submit"].loading {
  background: #ff9500;
  animation: pulse 1s infinite;
}

/* Success state */
button[type="submit"].success {
  background: #fefefe;
  cursor: default;
  color:rgb(6, 188, 103);
  animation: pop 0.4s ease;
}

.check {
  display: inline-block;
  margin-right: 6px;
  animation: checkIn 0.5s ease;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes checkIn {
  from { transform: scale(0) rotate(-90deg); opacity: 0; }
  to   { transform: scale(1) rotate(0);      opacity: 1; }
}

  .hp { position: absolute; left: -9999px; }
  .form-status { margin: 8px 0 0; text-align: center; min-height: 1.2em; }

  /* Close animation: the name must match 'dlgOut' in the JavaScript */
#dlg.closing {
  animation: dlgOut 0.25s ease forwards;
}

@keyframes dlgOut {
  to { opacity: 0; transform: scale(0.95); }
}

/* X button in the top-right corner of the dialog */
#dlg .top {
  position: relative;
}

#close {
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: brown;
  color: white;
  cursor: pointer;
  line-height: 1;
}

#close:hover {
  background: green;
}

.social-media-icons a {
  color: inherit; /* or whatever base color you want */
  transition: color 0.3s ease;
}

.social-media-icons a:hover {
  color: orangered;
}
.hp { position: absolute; left: -9999px; }

/* =========================================================
   MOBILE NAV  (768px and below)
   ========================================================= */
@media (max-width: 768px) {
    .intro { gap: 10px; }
    .intro p { margin-right: auto; }       /* pushes donate + menu button to the right */

    .nav-toggle { display: block; }

    .navbar {
        display: none;                     /* hidden until the button is tapped */
        position: absolute;
        top: calc(100% + 6px);
        right: 12px;
        z-index: 100;
        width: min(260px, calc(100vw - 24px));
        margin: 0;
        padding: 8px;
        background: #fff;
        border: 2px solid brown;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    }
    .navbar.open { display: block; }

    .navbar ul { flex-direction: column; gap: 0; font-size: 1.1rem; }
    .navbar ul li a {
        display: block;
        padding: 12px 14px;
        border-radius: 8px;
    }
    .navbar a:hover { background: lightgoldenrodyellow; border-bottom: none; }
}




@media (max-width: 1024px) {
    footer { justify-content: space-around; gap: 20px; }
}
@media (max-width: 768px) {
    footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        padding: 16px;
        align-items: start;
    }

    footer .address {
        grid-column: 1 / -1;
        text-align: center;
    }

    footer .form-container {
        grid-column: 1 / -1;      /* spans the full width */
        justify-self: stretch;
        width: 100%;
        max-width: none;
        min-width: 0;
        margin: 0;
        padding: 12px;
    }

    footer .social-media-icons,
    footer .quick-links { padding-left: 0; }

    footer .social-media-icons p,
    footer .quick-links h3 { margin: 0 0 8px; }

    footer .social-media-icons a {
        display: inline-block;
        margin: 0 5px 8px 0;
        font-size: 1.2rem;
    }

    footer .form-container input,
    footer .form-container textarea {
        width: 100%;
        font-size: 1rem;
        padding: 8px;
    }

    footer .form-container textarea { min-height: 120px; }

    footer .form-container button {
        width: 100%;
        padding: 12px;
    }
}
