/* ======================================================= */
/* == style.css ==                                       */
/* ======================================================= */
/* --- Purpose: Styles for the Learn 5 Verse application.*/
/* --- Notes: Linked by index.php via render_html_page().*/
/* ======================================================= */

/* --- Base Styles & Variables --- */
:root {
    --background-color: lightblue;
    --container-bg-color: #f0f8ff; /* AliceBlue */
    --text-color: #333;
    --title-color: #003366; /* Dark Blue */
    --reference-color: #0056b3; /* Medium Blue */
    --button-bg-color: #28a745; /* Green */
    --button-hover-bg-color: #218838; /* Darker Green */
    --button-text-color: #ffffff;
    --border-color: #add8e6; /* Light blue border */
    --shadow-color: rgba(0, 0, 0, 0.1);
    --title-shadow-color: rgba(0, 0, 0, 0.4);
    --base-font-size: 16px;
    --line-height: 1.6;
    /* Fonts defined inline in PHP */
}

/* --- Reset and Box Sizing --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- HTML & Body --- */
html {
    font-size: var(--base-font-size);
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    line-height: var(--line-height);
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 10px 0;
    min-height: 100vh;
}

/* --- Main Container --- */
.container {
    background-color: var(--container-bg-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    width: calc(100% - 20px);
    max-width: 800px;
    margin: 20px auto;
}

/* --- Header & Title --- */
header {
    text-align: center;
    margin-bottom: 30px;
}

h1.page-title {
    font-family: var(--title-font);
    font-size: 2.8rem;
    color: var(--title-color);
    text-shadow: 2px 2px 4px var(--title-shadow-color);
    margin: 0;
    line-height: 1.2;
}

h1.page-title a.title-link {
    color: inherit;
    text-decoration: none; /* No underline for title link */
    transition: opacity 0.2s ease;
}

h1.page-title a.title-link:hover,
h1.page-title a.title-link:focus {
    opacity: 0.8;
    text-decoration: none;
    outline: none;
}

/* --- Main Content Area --- */
main {
    width: 100%;
    padding-bottom: 20px;
}

/* --- Verse List & Items --- */
.verse-list {
    margin-bottom: 30px;
}

/* Styling for the link wrapping the verse item */
a.verse-link {
    display: block;
    text-decoration: none !important; /* <<< Remove underline from link */
    color: inherit;
    margin-bottom: 15px;
    border-radius: 4px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* Hover/Focus effect on the link wrapper */
a.verse-link:hover,
a.verse-link:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    outline: none;
    text-decoration: none !important; /* <<< Ensure no underline on hover/focus */
}

/* Apply visual styles to the inner div */
.verse-item {
    background-color: #ffffff;
    padding: 15px 20px;
    border-left: 5px solid var(--reference-color);
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}


.verse-reference {
    display: block;
    font-weight: bold;
    color: var(--reference-color);
    margin-bottom: 8px;
    font-size: 1.25rem; /* <<< Increased font size (was 1.1rem) */
    text-decoration: none; /* <<< Explicitly no underline for reference */
}

.verse-text {
    font-size: 1rem;
    color: var(--text-color);
    text-decoration: none; /* <<< Explicitly no underline for text */
}

/* --- Refresh Button --- */
.refresh-container {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.refresh-button {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--button-bg-color);
    color: var(--button-text-color);
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none; /* No underline for button */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.refresh-button:hover,
.refresh-button:focus {
    background-color: var(--button-hover-bg-color);
    color: var(--button-text-color);
    outline: 2px solid transparent;
    outline-offset: 2px;
    transform: translateY(-1px);
    text-decoration: none; /* No underline for button on hover/focus */
}

.refresh-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* --- Footer --- */
footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: #666;
    min-height: 30px;
}

/* --- Error and Info Messages --- */
.error-message,
.info-message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

.error-message {
    color: #721c24; /* Dark Red */
    background-color: #f8d7da; /* Light Red */
    border: 1px solid #f5c6cb; /* Red Border */
}
.info-message {
    color: #0c5460; /* Dark Cyan */
    background-color: #d1ecf1; /* Light Cyan */
    border: 1px solid #bee5eb; /* Cyan Border */
}


/* --- Responsive Design --- */

/* Medium screens (tablets) */
@media (max-width: 768px) {
    h1.page-title {
        font-size: 2.4rem;
    }
    .container {
        padding: 15px;
    }
    .verse-item {
        padding: 12px 15px;
    }
    .verse-reference {
        font-size: 1.15rem; /* Slightly smaller adjustment for tablets */
    }
    .verse-text {
        font-size: 0.95rem;
    }
    .refresh-button {
        padding: 10px 20px;
        font-size: 1rem;
    }
}

/* Small screens (mobile phones) */
@media (max-width: 480px) {
    body {
        padding: 5px 0;
    }
    .container {
         width: calc(100% - 10px);
         padding: 10px;
         margin: 10px auto;
    }
    h1.page-title {
        font-size: 2rem;
    }
    a.verse-link {
        margin-bottom: 10px;
    }
    .verse-item {
        padding: 10px 12px;
        border-left-width: 4px;
    }
    .verse-reference {
        font-size: 1.1rem; /* Adjust size for mobile */
    }
    .verse-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }
     .refresh-button {
        width: 80%;
        padding: 12px 15px;
    }
    footer {
        font-size: 0.8rem;
        margin-top: 20px;
        padding-top: 10px;
    }
}

/* --- Accessibility Adjustments --- */
/* Add focus styles for keyboard navigation */
a:focus, button:focus, [role="button"]:focus {
    outline: 2px solid var(--reference-color);
    outline-offset: 2px;
}
/* Refine focus for verse links */
a.verse-link:focus {
    outline: none; /* Remove default outline */
}
a.verse-link:focus .verse-item {
    box-shadow: 0 0 0 2px var(--reference-color); /* Inner ring focus style */
}


/* Preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  a.verse-link:hover,
  a.verse-link:focus {
      transform: none;
      box-shadow: none; /* Remove shadow change if transform is removed */
  }
   a.verse-link:focus .verse-item {
       box-shadow: 0 0 0 2px var(--reference-color); /* Keep focus ring */
   }
  .refresh-button:hover,
  .refresh-button:focus {
      transform: none;
   }
   .refresh-button:active {
      transform: none;
   }
}

/* style.css */