/*
Theme Name: Frogs 2025
Theme URI: 
Author: 
Author URI: 
Description: A custom WordPress theme for The Battle of Frogs and Mice digital edition
Version: 1.0.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: frogs2025

---------------------------------------------
Main Theme Stylesheet (style.css)
---------------------------------------------
- Global layout, typography, navigation, and responsive design
- Some Greek text, commentary, and footnote styles (may overlap with css/text-commentary.css)
- Used by all pages and templates
- Major Sections:
  * CSS Reset and base styles
  * Body and typography
  * Layout containers (.site, .three-column-layout, etc.)
  * Header and navigation
  * Reading area and columns
  * Greek text and commentary (some overlap)
  * Illustrations and right sidebar
  * Responsive design (media queries)
  * Footer
  * Mobile menu and overlays
  * Commentary links and popups
  * Footnotes (including reference and backref styles)
*/

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

body {
    font-family: "Times New Roman", serif; 
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

/* Basic layout */
.site {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

/* Header */
.site-header {
    padding: 3rem 0;
    text-align: center;
    border-bottom: 1px solid #ddd;
    margin-bottom: 2rem;
}

.site-branding {
    max-width: 800px;
    margin: 0 auto;
}

.site-title {
    font-family: "Times New Roman", serif; 
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.site-description {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.8;
}

.project-subtitle {
    margin-bottom: 0.5rem;
}

.project-illustrator {
    font-style: italic;
    color: #777;
}

/* Navigation */
.main-navigation {
    display: none; /* Hide the main navigation */
    margin: 2rem 0;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.main-navigation a {
    text-decoration: none;
    color: #2c3e50;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: #666;
}

/* Three Column Layout - Base layout for the entire site */
.three-column-layout {
    display: flex;
    gap: 2rem;
    margin: 0 -15px 2rem; /* Negative margin to offset site padding */
    padding: 0 15px;
}

/* Left Navigation Column */
.book-navigation {
    flex: 0 0 250px;
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    height: fit-content;
    position: sticky;
    top: 20px;
    z-index: 1100;
}

.navigation-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    color: #2c3e50;
}

.section-navigation ul {
    list-style: none;
}

.section-navigation li {
    margin-bottom: 0.8rem;
}

.section-navigation a {
    text-decoration: none;
    color: #555;
    transition: color 0.3s ease;
    display: block;
    padding: 0.5rem 0;
}

.section-navigation a:hover {
    color: #2c3e50;
}

.section-navigation a.active {
    color: #2c3e50;
    font-weight: 600;
    border-left: 3px solid #2c3e50;
    padding-left: 10px;
}

/* Middle Reading Column */
.reading-area {
    flex: 1;
    background-color: #fff;
    padding: 2rem;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    min-height: 600px;
}

/* Paragraph spacing only for two-column text posts */
.post-type-archive-two_column_text .reading-area p,
.single-two_column_text .reading-area p {
    margin-bottom: 1.8rem;
}

.entry-title {
    font-size: 1.8rem;
    margin-bottom: .5rem;
    color: #2c3e50;
}

.line-range {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    font-style: italic;
}

/* Illustrations */
.illustrations {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.illustrations h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.illustration {
    margin-bottom: 2rem;
    text-align: center;
}

.illustration img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.illustration-caption {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Right Commentary Column */
.commentary-section {
    flex: 0 0 300px;
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    height: fit-content;
    position: sticky;
    top: 20px;
    z-index: 1300;
}

.commentary-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    color: #2c3e50;
}

.commentary-content {
    font-size: 0.95rem;
    line-height: 1.7;
}

.commentary-entry {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.commentary-entry:last-child {
    border-bottom: none;
}

.commentary-entry.highlighted {
    background-color: rgba(44, 62, 80, 0.05);
    padding: 1rem;
    border-radius: 4px;
    border-left: 3px solid #2c3e50;
}

.commentary-word-reference {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: #2c3e50;
    font-weight: 600;
}

.commentary-text {
    color: #444;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .three-column-layout {
        flex-direction: column;
    }
    
    .book-navigation, .commentary-section {
        flex: none;
        width: 100%;
        position: static;
    }
    
    .reading-area {
        order: 2;
    }
    
    .book-navigation {
        order: 1;
    }
    
    .commentary-section {
        order: 3;
    }
}

/* Footer */
.site-footer {
    padding: 2rem 0;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
    margin-top: 2rem;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1200;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    margin: 0;
    width: 45px;
    height: 45px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #333;
    margin: 4px auto;
    transition: transform 0.3s ease-out;
}

@media screen and (max-width: 768px) {
    .site {
        padding: 0 15px;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .site-header {
        padding: 3rem 15px 2rem;
        margin-top: 0;
    }

    /* Mobile Navigation - Make it work across all templates */
    .book-navigation,
    .two-column-layout .book-navigation,
    .three-column-layout .book-navigation {
        display: block !important;
        position: fixed !important;
        left: -280px;
        top: 0;
        height: 100vh;
        width: 280px;
        background: white;
        transition: transform 0.3s ease-out;
        z-index: 999;
        overflow-y: auto;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        padding: 70px 20px 20px;
        margin: 0;
        visibility: hidden;
        opacity: 0;
        order: initial;
    }

    .book-navigation.mobile-active,
    .two-column-layout .book-navigation.mobile-active,
    .three-column-layout .book-navigation.mobile-active {
        transform: translateX(280px);
        visibility: visible;
        opacity: 1;
    }

    /* Content layout adjustments */
    .two-column-layout,
    .three-column-layout {
        display: block;
    }

    .reading-area {
        width: 100%;
        margin: 0;
        padding: 20px;
    }

    .commentary-section {
        width: 100%;
        margin: 20px 0;
    }

    /* Overlay when menu is open */
    body::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease-out;
        z-index: 998;
    }

    body.menu-open::after,
    body.popup-open::after {
        opacity: 1;
        visibility: visible;
    }

    .three-column-layout {
        margin: 0;
        padding: 0;
    }

    /* Floating Notes Button (Mobile) */
    .notes-toggle {
        display: block;
    }

    /* Commentary section mobile styling */
    .commentary-section {
        display: block !important;
        position: fixed !important;
        right: -320px; /* Slightly wider than the navigation */
        top: 0;
        height: 100vh;
        width: 320px;
        background: white;
        transition: transform 0.3s ease-out;
        z-index: 999;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
        padding: 20px;
        margin: 0;
        visibility: hidden;
        opacity: 0;
        display: flex !important;
        flex-direction: column;
    }

    .commentary-section.mobile-active {
        transform: translateX(-320px);
        visibility: visible;
        opacity: 1;
    }

    /* Commentary tabs and content mobile adjustments */
    .commentary-tabs {
        position: sticky;
        top: 0;
        background: white;
        z-index: 2;
        margin: -20px -20px 0;
        padding: 20px 20px 0;
        border-bottom: 1px solid #eee;
    }

    .commentary-tab-content {
        flex: 1;
        overflow-y: auto;
        padding: 20px 0;
        height: calc(100vh - 120px); /* Adjust for tabs height */
    }

    .commentary-tab-content.active {
        display: block;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Adjust the overlay z-index to work with both panels */
    body::after {
        z-index: 997;
    }
}

/* Remove any conflicting styles */
@media (max-width: 1200px) {
    .two-column-layout,
    .three-column-layout {
        flex-direction: column;
    }
    
    .book-navigation,
    .commentary-section {
        width: 100%;
    }
    
    /* Only apply static positioning when NOT in mobile view */
    @media (min-width: 769px) {
        .book-navigation,
        .commentary-section {
            position: static;
        }
    }
}

/* Floating Notes Button (Mobile) */
.notes-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1400;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-family: "Times New Roman", serif; 
    font-size: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.notes-toggle:hover {
    background: #34495e;
}

@media screen and (max-width: 768px) {
    .notes-toggle {
        display: block;
    }
}

/* Commentary Popup (Mobile) */
.commentary-popup {
    display: none;
    position: fixed;
    bottom: 80px; /* Above the notes button */
    left: 20px;
    right: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1500;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.commentary-popup.active {
    display: block;
    animation: slideUp 0.3s ease-out;
}

.commentary-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 5px;
}

.commentary-popup h3 {
    margin-bottom: 1rem;
    padding-right: 30px;
    color: #2c3e50;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media screen and (max-width: 768px) {
    /* Hide commentary tab on mobile */
    .commentary-tab[data-tab="commentary"] {
        display: none;
    }

    /* Adjust commentary link styles for mobile */
    .commentary-link {
        border-bottom: 1px dotted #2c3e50;
    }

    .commentary-link:active {
        border-bottom-style: solid;
    }

    /* Ensure popup is above the overlay */
    .commentary-popup {
        z-index: 1003;
    }

    /* Add overlay for popup */
    body.popup-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        opacity: 1;
        visibility: visible;
        z-index: 1002;
    }
}

/* Commentary Links */
.commentary-link {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px dotted #2c3e50;
    transition: all 0.2s ease;
}

.commentary-link:hover {
    border-bottom-style: solid;
}

.commentary-link.active {
    border-bottom-width: 2px;
}

/* Mobile styles for commentary links */
@media screen and (max-width: 768px) {
    .commentary-link {
        border-bottom: 1px dotted #2c3e50;
    }

    .commentary-link:active {
        border-bottom-style: solid;
    }
}

/* Commentary popup styles */
.commentary-popup {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 20px;
    right: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1500;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.commentary-popup.active {
    display: block;
    animation: slideUp 0.3s ease-out;
}

.commentary-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.commentary-popup h3 {
    margin-bottom: 1rem;
    padding-right: 30px;
    color: #2c3e50;
    font-size: 1.2rem;
}

.commentary-popup-content {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
} 