/* css/components.css */

/* 
   Contains styles for reusable components used across the site:
   - Buttons
   - Image galleries
   - Program cards
   - Popover maps
   - Poem blocks
   - etc.
*/

section {
    text-align: left;
    text-indent: var(--text-indent);

    h2 {
        font-size: var(--font-size-800);
        text-align: center;
    }

    h3 {
        text-align: center;
    }

    ul {
        width: fit-content;
        margin: 0 auto;
        text-align: left;
    }

    ol {
        width: fit-content;
        margin: 0 auto;
        text-align: left;
    }

    p {
        background-color: var(--color-light-background);
        margin-inline: auto;
        margin-block: 1rem;
        padding: .75rem;
        border-radius: 10px;
    }

    address {
        text-indent: 0;
    }
}

.no-indent {
    text-indent: 0;
}

.img-center {
    display: block;
    margin-inline: auto;
    margin-bottom: 0.75rem;
}

.gal1 {
    display: flex;
    align-items: center;
    flex-direction: column;
    max-width: 90%;
    height: auto;
    object-fit: none;
    margin-inline: auto;
    margin-block: 1.5rem;
    gap: 15px;

    img {
        border: 2px solid #000;
        border-radius: 8px;
        max-width: calc(100% - 20px);
    }

}

.gal2 {
    --r1: 10px;
    --r2: 0px;

    border: 2px solid #000;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-block: 1rem;

    figure {
        background-color: var(--color-card-background-light);
        margin: .5rem;
        border: 2px solid #000;
        border-radius: var(--r1) var(--r1) var(--r2) var(--r2);
        height: fit-content;

        img {
            border-radius: var(--r1) var(--r1) var(--r2) var(--r2);
            max-width: 100%;
            height: auto;
            object-fit: none;
        }
    }

    figcaption {
        background-color: var(--color-card-background-light);
        max-width: 20ch;
        color: #333;
        font-style: italic;
        padding: 5px;
        text-align: center;
      }
      
}

/* <<<<<<<< Program Card >>>>>>>> */
#park-programs {
    container-type: inline-size; /* Added to fix border radius*/
    overflow: hidden;
}

.Program {
    border: 2px solid #000;
    border-radius: 10px;
    text-align: center;
    margin-block: 2rem;

    h2 {
        margin-bottom: 1rem;
        padding-block: .25rem;
        border-bottom: 2px solid #000;
    }
}

#cardContainer {
    --grid-min-col-size: 325px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(var(--grid-min-col-size), 100%), 1fr));
    
}

.card {
    background-color: #555555;
    color: #ddd;
    padding: .5rem;
    margin: .5rem;
    border: 2px solid #000;
    border-radius: 8px;

    .program-title {
        margin-bottom: .5rem;
        padding-block: .2rem;
        border-bottom: 1px solid #000;
        color: orange;
    }

    .program-descripion {
        font-size: var(--font-size-300);
        background-color: inherit;
        margin-bottom: .25rem;
        text-align: left;
    }

    .program-date {
        background-color: inherit;
        font-size: var(--font-size-600);
        margin-block: .1rem;
    }

    .program-time {
        background-color: inherit;
        font-size: var(--font-size-400);
        margin-block: .1rem;
    }

    .program-location {
        background-color: inherit;
        color: yellow;
        margin-block: .1rem;
    }

    .note {
        background-color: inherit;
        font-size: var(--font-size-300);
        margin-block: .1rem;
    }
}

.program-notes {
    margin-top: 1rem;
    margin-inline: auto;
    padding-block: .75rem;
    max-width: 425px;
    border: 2px solid #000;
    background-color: #555;
    color: #ccc;
    border: 2px solid #000;
    border-radius: 8px;

    ul {
        list-style-type: none;

        li {
            text-indent: -3ch;
            padding-inline: 2rem;
            margin-inline: .75rem;
            font-size: var(--font-size-200);
            text-align: left;
            max-width: 55ch; /* to force 2 lines of text */
        }
    }
}
/* <<<<<<<< Program Card End >>>>>>>> */

/* <<<<<<<< Poem >>>>>>>> */
.poem {
    background-color: var(--clr-bg);
    border: 2px solid #111;
    border-radius: 8px;
    margin: 1em auto;
    max-width: 45ch;
    padding: 1em;
    padding-left: 2em;
}
  
.poem p {
    margin: 0 0 1em 0;
    padding-left: 3em;
    text-indent: -3em;
    text-align: left;
}
  
.poem p:last-child {
    margin-bottom: 0;
}
/* <<<<<<<< End Poem >>>>>>>> */

/* <<<<<<<< Popover Map >>>>>>>> */
.map-container {
    position: relative;
    margin-top: 0.5rem;
    margin-left: 1rem;
}

.popover-button {
    padding: 10px 20px;
    background-color: cadetblue;
    color: #000;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    width: 165px;
    flex-shrink: 0; /* Prevent shrinking in flex containers */
}

.popover-content {
    display: none;
    position: fixed; /* Position relative to the viewport */
    z-index: 100;
    top: 50%; /* Center vertically */
    left: 50%;
    width: calc(90vw - 20px);
    height: 50vh;
    padding: 10px;
    background-color: #333;
    border: 5px solid #111;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 25px;
    transform: translate(-50%, -50%); /* Center horizontally and vertically */
}

.map-iframe {
    position: absolute;
    border-radius: 15px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    border-bottom: 5px solid #000;
    top: 10px;
    left: 10px;
}

/* Show popover on button hover */
.popover-button:hover + .popover-content,
.popover-content:hover {
    display: block;
}
/* <<<<<<<< Popover Map End >>>>>>>> */

/* <<<<<<<< Reusable Button >>>>>>>> */
.btn {
    display: inline-block;
    background-color: var(--clr-card-bg);
    border: 2px solid var(--clr-link-border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--clr-link);
    font-size: var(--font-size-500);
    text-align: center;
    text-indent: 0;
    margin-block: 0.5rem;
    transition: color 0.3s;
}

.btn:hover {
    color: var(--clr-link-hover);
}
/* <<<<<<<< Reusable Button End >>>>>>>> */


button {
    background-color: var(--clr-bg);
    border-radius: 8px;
    margin-top: .5rem;

    a {
        text-decoration: none;
        color: var(--color-link);
        padding: .25rem;
    }
}