/*
Theme Name: Twenty Sixteen Child
Theme URI: https://durhamfellrunners.org/themes/twentysixteen/
Author: Dougie Nisbet
Author URI: https://durhamfellrunners.org
Template:	twentysixteen
Description: Twenty Sixteen child theme
Version: 1.0
Requires at least: 4.4
Requires PHP: 5.2.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: one-column, two-columns, right-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, flexible-header, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready, blog
Text Domain: twentysixteenchild

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/
/* 1. Target the INNER wrappers that 2016 uses for layout */
.page-template-full-width .site-inner,
.page-template-full-width .site-content {
    padding-left: 20px !important;
    padding-right: 20px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* 2. Ensure the content area doesn't bleed out */
.page-template-full-width .content-area {
    margin: 0 auto !important;
    float: none !important;
    width: 100% !important;
}

/* 3. This stops the text containers from ignoring the padding above */
.no-sidebar .entry-header,
.no-sidebar .entry-content,
.no-sidebar .entry-summary,
.no-sidebar .entry-footer,
.no-sidebar .page-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

/* 4. Fix for the main site container */
.page-template-full-width .site {
    margin: 0 auto !important;
}

.wp-block-preformatted {
    white-space: pre;
    overflow-wrap: normal;
}

/*
 * DFR Leaderboard Component
 */

/* --- 1. Main "Chapelfell Top" Title Styling --- */
.dfr-main-title {
    background: linear-gradient(45deg, #4a3069, #5a3a7e, #7e57c2);
    color: white !important; /* !important to override theme styles */
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    font-size: 3em !important; /* Default large size for desktop */
    font-weight: 900 !important;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    padding: 30px 20px !important;
    margin-bottom: 25px !important;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2), 0 5px 15px rgba(0,0,0,0.15);
}
/* --- 2. Table Column Width Adjustments (Desktop) --- */
/* This now uses a CLASS, so it can apply to ANY table we give this class to */
.dfr-leaderboard-table .dfr-table {
    table-layout: fixed; /* Ensures width settings are respected */
}

/* Set a specific, narrower width for the "Rank" column */
.dfr-leaderboard-table th:nth-child(1),
.dfr-leaderboard-table td:nth-child(1) {
    width: 18%;
}

/* Set a wider width for the "Name" column */
.dfr-leaderboard-table th:nth-child(2),
.dfr-leaderboard-table td:nth-child(2) {
    width: 47%;
    text-align: left; /* Align header to the left to match the names */
    padding-left: 15px;
}

/*
 * --- 3. Mobile Responsive Adjustments ---
 * These styles apply to screens 782px wide or smaller.
 */
@media (max-width: 782px) {

    /* Make the main title smaller on mobile to prevent wrapping */
    .dfr-main-title {
        font-size: 2.2em !important;
        padding: 25px 15px !important;
    }

    /* Hide the column headers (Rank, Name, etc.) on mobile */
    #dfr-wow-table-wrapper-women .dfr-table thead,
    #dfr-wow-table-wrapper-men .dfr-table thead {
        display: none;
    }
}

/* FAQ accordian*/

.accordion {
  border: 1px solid #ccc;
  margin-bottom: 1rem;
  border-radius: 4px;
  overflow: hidden;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #eee;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.accordion-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.accordion-icon {
  font-weight: bold;
  font-size: 1.5rem;
  color: purple;
}

.accordion-content {
  display: none;
  padding: 1rem;
  background-color: #f9f9f9;
}


/* Default table styling */


.styled-table tr:nth-child(odd) td {
    background-color: #f7f5fa;
    color: #000000;
}

.styled-table tr:nth-child(even) td {
    background-color: #ece5f3;
    color: #000000;
}

.styled-table thead th {
    background-color: #45165c;
    color: #ffffff;
    font-weight: bold;
    text-align: left;
}

.styled-table {
    width: 100%;
    margin: 0 auto 1em;
    table-layout: auto;
    border-collapse: collapse;
}

/* --- DFR Monthly Challenge Calendar --- */
.dfr-run-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
}

.dfr-month-card {
    background: #ffffff;
    border: 1px solid #ece5f3;
    border-radius: 15px;
    overflow: visible; /* Changed from hidden to visible */
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.dfr-month-header {
    background: linear-gradient(45deg, #4a3069, #5a3a7e, #7e57c2);
    color: white !important;
    padding: 15px;
    text-align: center;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.active-month {
    border: 3px solid #7e57c2;
    transform: scale(1.02);
}

.dfr-month-content {
    padding: 20px;
    min-height: 180px;
    overflow: visible; /* Add this */
}

.dfr-month-content h4 {
    color: #45165c;
    margin-top: 0;
    text-align: center;
    font-size: 1.15em;
}

.dfr-tagline {
    font-style: italic;
    text-align: center;
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.dfr-month-content ul {
    padding-left: 1.2em;
    font-size: 0.95rem;
    line-height: 1.5;
}

.dfr-month-content li { margin-bottom: 12px; }

.month-content.empty {
    background-color: #f7f5fa;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #bbb;
    font-style: italic;
}

/* Fix for Twenty Sixteen Header Margins */
.dfr-month-content h4, 
.dfr-month-content p, 
.dfr-month-content ul {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important; /* Prevents theme from narrowing the text */
    padding-left: 0;
}

/* Ensure the list bullets have just enough room */
.dfr-month-content ul {
    padding-left: 20px !important;
    list-style-position: outside;
}

/* Centers the title and tagline specifically */
.dfr-month-content h4, 
.dfr-tagline {
    text-align: center;
    width: 100%;
}

/* --- DFR HOME RUN Card Content --- */

.dfr-race-meta {
    list-style: none;
    padding-left: 0;
    margin: 15px 0 20px;
}

.dfr-race-meta li {
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.dfr-month-content p {
    font-size: 0.95rem;
    line-height: 1.55;
}

.dfr-month-content a {
    font-weight: 600;
    color: #5a3a7e;
}

.dfr-month-content a:hover {
    text-decoration: underline;
}

/* --- DFR Monthly Challenge Comments --- */

/* Comments Toggle Button */
.dfr-comments-toggle {
    padding: 15px;
    border-top: 1px solid #ece5f3;
    text-align: center;
}

.dfr-toggle-btn {
    background: linear-gradient(45deg, #4a3069, #5a3a7e, #7e57c2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.dfr-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 87, 194, 0.3);
}

.dfr-toggle-btn:active {
    transform: translateY(0);
}

.dfr-toggle-btn {
    background: linear-gradient(45deg, #4a3069, #5a3a7e, #7e57c2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Comments Section */
.dfr-comments-section {
    padding: 0;
    background: #f7f5fa;
    border-top: 1px solid #ece5f3;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.dfr-comments-section.active {
    max-height: 3000px;
    padding: 20px;
}


/* Comment List */
.dfr-comment-list {
    margin-bottom: 20px;
}

.dfr-comment {
    background: white;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 8px;
    border-left: 3px solid #7e57c2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.dfr-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.dfr-comment-header strong {
    color: #45165c;
    font-size: 15px;
}

.dfr-comment-date {
    color: #999;
    font-size: 12px;
}

.dfr-comment-content {
    color: #333;
    line-height: 1.6;
    font-size: 14px;
}

.dfr-no-comments {
    font-style: italic;
    color: #999;
    text-align: center;
    padding: 20px;
    margin: 0;
}

/* Comment Form */
.dfr-comment-form {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.dfr-comment-form p {
    margin-bottom: 10px;
}

.dfr-comment-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #45165c;
    font-size: 13px;
}

.dfr-comment-form input[type="text"],
.dfr-comment-form input[type="email"],
.dfr-comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ece5f3;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    box-sizing: border-box;
}

.dfr-comment-form textarea {
    min-height: 100px;
    resize: vertical;
}

.dfr-comment-form input[type="text"]:focus,
.dfr-comment-form input[type="email"]:focus,
.dfr-comment-form textarea:focus {
    outline: none;
    border-color: #7e57c2;
    box-shadow: 0 0 0 3px rgba(126, 87, 194, 0.1);
}

.dfr-comment-form button[type="submit"] {
    background: linear-gradient(45deg, #4a3069, #5a3a7e, #7e57c2);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.dfr-comment-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 87, 194, 0.3);
}

.dfr-comment-form button[type="submit"]:active {
    transform: translateY(0);
}

.dfr-form-message {
    padding: 10px;
    margin-top: 10px;
    border-radius: 5px;
    font-size: 13px;
}

.dfr-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.dfr-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Mobile Responsiveness */
@media (max-width: 782px) {
    .dfr-toggle-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
    
    .dfr-comments-section {
        padding: 15px;
    }
    
    .dfr-comment {
        padding: 12px;
    }
    
    .dfr-comment-header {
        font-size: 14px;
    }
    
    .dfr-comment-form {
        padding: 12px;
    }
}
