/*
Theme Name:  Alex Down Under
Theme URI:   https://adu.tikiwebdev.com
Description: A French-language personal travel blog documenting a year in Australia (Oct 2011 – Aug 2012). Converted from a custom PHP single-page book-spread application to a responsive WordPress theme. Preserves the original color palette (deep blue #036, grey #666, sky blue #39f hover) and MyFont custom typeface. The fixed 894×610 px book layout is replaced with CSS Grid for full responsiveness.
Author:      Alex
Version:     1.0.0
License:     GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: alex-down-under
Tags:        blog, two-columns, custom-header, custom-menu, featured-images, responsive-layout
*/

/* ─── @font-face ─────────────────────────────────────────────────────────── */

@font-face {
    font-family: 'MyFont';
    src: url('assets/fonts/font.eot');
    src: url('assets/fonts/font.eot?#iefix') format('embedded-opentype'),
         url('assets/fonts/font.woff') format('woff'),
         url('assets/fonts/font.ttf') format('truetype'),
         url('assets/fonts/font.svg#MyFont') format('svg');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ─── Reset / base ───────────────────────────────────────────────────────── */

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

html {
    font-family: 'MyFont', Georgia, serif;
    font-size: 16px;
    background-color: #d9c9a3; /* warm parchment – approximates the original wooden-floor background */
    color: #036;
}

body {
    margin: 0;
    padding: 0;
    background-color: #d9c9a3;
    background-image: url('assets/images/background.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
}

p {
    margin: 0.5em 0;
}

td {
    text-align: center;
}

/* ─── Links (preserves original palette) ─────────────────────────────────── */

a:link    { color: #666; text-decoration: none; }
a:visited { color: #666; text-decoration: none; }
a:hover   { color: #39f; text-decoration: none; }
a:active  { color: #000; text-decoration: none; }

/* ─── Site header ────────────────────────────────────────────────────────── */

#site-header {
    background: rgba(255,255,255,0.88);
    border-bottom: 2px solid #c8b88a;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

#site-header .site-branding .site-title {
    font-family: 'MyFont', Georgia, serif;
    font-size: 2.5rem;
    color: #036;
    margin: 0;
    line-height: 1;
}

#site-header .site-branding .site-title a {
    color: #036;
}

#site-header .site-branding .site-description {
    font-size: 0.9rem;
    color: #666;
    margin: 0.25rem 0 0;
}

/* ─── Primary navigation ─────────────────────────────────────────────────── */

/* Replaces the corner-curl ChangePage() SPA navigation with standard WP menu */
#primary-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

#primary-navigation ul li a {
    font-size: 1rem;
    color: #666;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

#primary-navigation ul li a:hover,
#primary-navigation ul li.current-menu-item > a {
    color: #39f;
    border-bottom-color: #39f;
}

/* ─── Main layout wrapper ────────────────────────────────────────────────── */

#page-wrap {
    flex: 1;
    max-width: 960px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* ─── Book-spread two-column layout ──────────────────────────────────────── */

/*
 * Replaces the original fixed #lefttextposition / #righttextposition divs
 * (positioned at ±447px from center).  Now uses CSS Grid so it is fully
 * responsive while still evoking the open-book aesthetic on wide viewports.
 */
.book-spread {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: rgba(255,255,255,0.80);
    border: 1px solid #c8b88a;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    padding: 2rem;
    position: relative;
}

/* Spine decoration */
.book-spread::after {
    content: '';
    position: absolute;
    top: 1.5rem;
    bottom: 1.5rem;
    left: 50%;
    width: 2px;
    background: linear-gradient(to bottom, transparent, #c8b88a 20%, #c8b88a 80%, transparent);
    transform: translateX(-50%);
    pointer-events: none;
}

.book-spread .page-left,
.book-spread .page-right {
    min-width: 0; /* prevents grid blowout */
    padding: 0 1rem;
}

/* ─── Post / page content typography ────────────────────────────────────── */

.entry-title {
    font-family: 'MyFont', Georgia, serif;
    font-size: 2.2rem;   /* approximates original 40pt in the fixed layout */
    color: #036;
    text-align: center;
    line-height: 1.2;
    margin: 0 0 0.4rem;
}

.entry-date {
    color: #666;
    font-size: 1rem;
    text-align: center;
    display: block;
    margin-bottom: 1rem;
}

.entry-content {
    color: #036;
    font-size: 1.05rem;   /* approximates original 25pt at screen resolution */
    line-height: 1.6;
    text-align: justify;
}

.entry-content p:first-child {
    text-indent: 2em;
}

.entry-content .continuingtext {
    text-indent: 0;
}

/* ─── Archive / index loop ───────────────────────────────────────────────── */

.posts-archive {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-card {
    background: rgba(255,255,255,0.82);
    border: 1px solid #c8b88a;
    border-radius: 4px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.10);
}

.post-card .post-card-title {
    font-family: 'MyFont', Georgia, serif;
    font-size: 1.6rem;
    color: #036;
    margin: 0 0 0.3rem;
}

.post-card .post-card-title a {
    color: #036;
}

.post-card .post-card-title a:hover {
    color: #39f;
}

.post-card .post-card-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.post-card .post-card-excerpt {
    color: #036;
    font-size: 1rem;
    line-height: 1.55;
}

.post-card .read-more {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #666;
    border-bottom: 1px solid #c8b88a;
}

.post-card .read-more:hover {
    color: #39f;
    border-bottom-color: #39f;
}

/* ─── Post navigation (prev/next) ────────────────────────────────────────── */

/*
 * Replaces the corner-curl clickable images that called ChangePage().
 * CSS-only page-turn decorators with ‹ › arrows.
 */
.post-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #c8b88a;
    gap: 1rem;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.95rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid #c8b88a;
    border-radius: 3px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    background: rgba(255,255,255,0.6);
}

.post-navigation a:hover {
    color: #39f;
    border-color: #39f;
    background: rgba(255,255,255,0.95);
}

/* Page-turn corner decorator (pure CSS, replaces curledleft/curledright PNGs) */
.post-navigation .nav-previous a::before {
    content: '◀';
    font-size: 0.8em;
    opacity: 0.6;
}

.post-navigation .nav-next a::after {
    content: '▶';
    font-size: 0.8em;
    opacity: 0.6;
}

/* ─── Sommaire (Table of Contents) ───────────────────────────────────────── */

.sommaire-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sommaire-list li {
    border-bottom: 1px solid #e0d5c0;
    padding: 0.5rem 0;
}

.sommaire-list li:last-child {
    border-bottom: none;
}

.sommaire-list li a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    color: #666;
    font-size: 1.05rem;
    gap: 1rem;
}

.sommaire-list li a:hover {
    color: #39f;
}

.sommaire-list .entry-title-link {
    flex: 1;
}

.sommaire-list .entry-date-link {
    color: #666;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* ─── Comments ───────────────────────────────────────────────────────────── */

/*
 * Replaces ScriptsMill popup-window comments with inline WordPress comments.
 * comments_template() is called in single.php.
 */
#comments {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #c8b88a;
}

#comments .comments-title {
    font-family: 'MyFont', Georgia, serif;
    font-size: 1.5rem;
    color: #036;
    margin-bottom: 1rem;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list .comment {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255,255,255,0.7);
    border: 1px solid #c8b88a;
    border-radius: 3px;
}

.comment-list .comment-author {
    font-weight: bold;
    color: #036;
    font-size: 0.95rem;
}

.comment-list .comment-meta {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.comment-list .comment-content {
    color: #036;
    font-size: 0.95rem;
    line-height: 1.55;
}

.comment-reply-link {
    font-size: 0.85rem;
    color: #666;
}

.comment-reply-link:hover {
    color: #39f;
}

/* Comment form */
#respond {
    margin-top: 2rem;
}

#respond .comment-reply-title {
    font-family: 'MyFont', Georgia, serif;
    font-size: 1.3rem;
    color: #036;
    margin-bottom: 0.75rem;
}

#respond input[type="text"],
#respond input[type="email"],
#respond input[type="url"],
#respond textarea {
    width: 100%;
    border: 1px solid #c8b88a;
    border-radius: 3px;
    padding: 0.5rem 0.75rem;
    font-family: 'MyFont', Georgia, serif;
    font-size: 0.95rem;
    color: #036;
    background: rgba(255,255,255,0.9);
    margin-bottom: 0.75rem;
}

#respond input[type="submit"] {
    background: #036;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 0.5rem 1.5rem;
    font-family: 'MyFont', Georgia, serif;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

#respond input[type="submit"]:hover {
    background: #39f;
}

/* ─── Tables ─────────────────────────────────────────────────────────────── */

.entry-content table {
    border-collapse: collapse;
    font-size: 1rem;
    color: #036;
    margin: 1em auto;
}

.entry-content table td,
.entry-content table th {
    border: 1px solid #c8b88a;
    padding: 0.4rem 0.75rem;
    text-align: center;
}

/* ─── Misc helper classes (from original stylesheet) ─────────────────────── */

.title {
    color: #036;
    font-size: 2rem;
    text-align: center;
    line-height: 1.2;
}

.text {
    color: #036;
    font-size: 1rem;
    text-indent: 2em;
    line-height: 1.6;
    text-align: justify;
}

.continuingtext {
    color: #036;
    font-size: 1rem;
    line-height: 1.6;
    text-align: justify;
}

.notes {
    color: #000;
    font-size: 0.85rem;
    line-height: 1.5;
}

.link {
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
}

.credit {
    color: #000;
    font-size: 1rem;
    line-height: 1.5;
}

/* ─── Site footer ────────────────────────────────────────────────────────── */

#site-footer {
    background: rgba(255,255,255,0.88);
    border-top: 2px solid #c8b88a;
    padding: 1rem 2rem;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
}

#site-footer a {
    color: #666;
}

#site-footer a:hover {
    color: #39f;
}

/* ─── Music player (PagePlayer – HTML5, persistent in footer) ────────────── */

#music-player-bar {
    background: rgba(30, 30, 50, 0.93);
    color: #fff;
    border-top: 2px solid #003366;
    padding: 0.6rem 1.5rem;
    position: sticky;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

#music-player-bar .player-toggle {
    background: none;
    border: 1px solid #39f;
    color: #39f;
    border-radius: 3px;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
}

#music-player-bar .player-toggle:hover {
    background: #39f;
    color: #fff;
}

#adu-player-inner {
    flex: 1;
    display: none; /* expanded by JS */
}

#adu-player-inner.is-open {
    display: block;
}

/* PagePlayer overrides to fit the dark bar */
#adu-player-inner #PagePlayerWrapper {
    width: 100%;
    margin: 0;
    border: none;
    padding: 0;
    background: transparent;
    color: #eee;
}

#adu-player-inner #PagePlayerList h3 {
    color: #eee;
}

#adu-player-inner .PagePlayerListItem {
    background-color: #1a1a2e;
    border-color: #39f;
    color: #ccc;
}

#adu-player-inner .PagePlayerListItemSelected {
    background-color: #036;
    border-color: #39f;
    color: #fff;
}

#adu-player-inner .button {
    border-color: #39f;
    background-color: #1a1a2e;
}

/* ─── Responsive breakpoints ─────────────────────────────────────────────── */

@media (max-width: 720px) {
    .book-spread {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }

    .book-spread::after {
        display: none;
    }

    #site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    #primary-navigation ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .post-navigation {
        flex-direction: column;
        align-items: stretch;
    }

    .post-navigation .nav-next {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .entry-title {
        font-size: 1.6rem;
    }

    #music-player-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}
