/* Public site. Recreates the old site's look (header, left menu column, content right) with flexbox.
   Page content is the admin's own HTML; this file styles only the frame around it.
   Phones (under 600px): fixed top bar with a slide-out menu, as on the old site. */

@font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/lato-400.woff2) format('woff2'); }
@font-face { font-family: 'Lato'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/lato-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/lato-700.woff2) format('woff2'); }

:root {
    --navy: #1a456f;       /* page background, menu buttons */
    --navy-dark: #0F2740;  /* menu hover, links */
    --slate: #2e3f4e;      /* header bar */
    --grey-text: #777;
}

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

body {
    margin: 0;
    font-family: 'Lato', Calibri, Arial, sans-serif;
    color: #000;
    background: var(--navy) url(img/blue.jpg) repeat-x;
}

a { color: var(--navy-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---- Page box ---------------------------------------------------------- */

.wrapper {
    width: 90%;
    max-width: 1000px;
    margin: 60px auto;
    border: 2px solid #000;
    background: #fff;
}

.site-header { display: block; background: var(--slate); }
.site-header img { display: block; width: 100%; }

.main {
    display: flex;
    align-items: flex-start;
    gap: 6%;
    padding: 0 20px 0 10px;
}

/* ---- Left column -------------------------------------------------------- */

.sidebar {
    flex: 0 0 200px;       /* old site: 20% of its 1000px box; fixed so the longest menu label fits */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.main-nav { width: 100%; }    /* the column centres its children, which would shrink the menu to its text */
.main-nav ul {
    list-style: none;
    margin: 30px 0 0;
    padding: 0;
    width: 100%;
    max-width: 200px;
}
.main-nav a {
    display: block;
    padding: 5px 0 5px 20px;
    border-bottom: 1px solid #fff;
    background: var(--navy);
    color: #fff;
    font-size: 11pt;
    font-weight: 700;
    text-align: left;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { background: var(--navy-dark); text-decoration: none; }

.promo {                /* text size comes from the promo HTML in Settings */
    margin-top: 50px;
    width: 90%;
    max-width: 180px;
    color: var(--grey-text);
}

.facebook { margin-top: 50px; width: 100%; text-align: left; }
.facebook h2 { margin: 0 0 10px; font-size: 1.17em; color: #000; }
.facebook iframe { max-width: 100%; }

/* ---- Content ------------------------------------------------------------ */

.content {
    flex: 1;
    min-width: 0;          /* lets wide content shrink instead of pushing the column out */
    padding-top: 20px;
    line-height: 1.6;
}

.content::after { content: ""; display: block; clear: both; }   /* a floated image can't hang out of the content */

/* Image placement in page HTML (the picker on the page editor inserts these). Floats stop on phones. */
.img-left   { float: left;  max-width: 50%; margin: 4px 20px 10px 0; }
.img-right  { float: right; max-width: 50%; margin: 4px 0 10px 20px; }
.img-center { display: block; margin: 10px auto; }

/* Layout classes for page HTML (the page editor's starter snippets use them). Flexbox/grid; all stack on phones. */
.row { display: flex; flex-wrap: wrap; gap: 20px; margin: 0 0 1em; }
.row > * { flex: 1 1 220px; min-width: 0; }      /* equal widths; wraps when a child would be under 220px */
.row.middle { align-items: center; }             /* children centred vertically against each other */
.cols-2, .cols-3 { display: grid; gap: 20px; margin: 0 0 1em; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.center { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 0 0 1em; }
.box { margin: 0 0 1em; padding: 12px 16px; border: 1px solid #c9d6e3; border-radius: 4px; background: #f2f6fa; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 0 0 1em; }
.gallery img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
:where(.row, .cols-2, .cols-3) > * > :first-child, .box > :first-child, .center > :first-child { margin-top: 0; }
:where(.row, .cols-2, .cols-3) > * > :last-child, .box > :last-child, .center > :last-child { margin-bottom: 0; }
.button {
    display: inline-block;
    padding: 8px 22px;
    border-radius: 3px;
    background: var(--navy);
    color: #fff;
    font-weight: 700;
}
.button:hover, .button:focus-visible { background: var(--navy-dark); color: #fff; text-decoration: none; }
.clear { clear: both; }
.small { font-size: .85em; }
.muted { color: var(--grey-text); }

.site-notice {
    margin: 0 0 20px;
    padding: 10px 14px;
    border: 1px solid #e0c36b;
    border-radius: 4px;
    background: #fff8dc;
}

.preview-banner {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 6px;
    background: #ffc107;
    color: #000;
    font: 700 14px/1.4 system-ui, sans-serif;
    text-align: center;
}

.placeholder {
    margin: 20px 0;
    padding: 12px;
    border: 1px dashed #999;
    color: var(--grey-text);
    font-size: .9em;
}

/* ---- Contact form --------------------------------------------------------- */

.contact-form { max-width: 400px; margin: 20px 0 40px; }   /* old site: 400px */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 4px; font-weight: 700; }
.contact-form input, .contact-form textarea {
    display: block;
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #999;
    border-radius: 3px;
    font: inherit;
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--navy); outline-offset: 0; border-color: var(--navy); }
.has-error input, .has-error textarea { border-color: #b00020; }
.form-error { margin: 0 0 4px; color: #b00020; font-size: .9em; }
.form-error-top { margin-bottom: 16px; padding: 8px 12px; border: 1px solid #b00020; border-radius: 3px; background: #fdecee; }
.cf-turnstile { margin: 0 0 14px; min-height: 65px; }   /* 65px = widget height: no jump when it loads */
.form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-note { color: var(--grey-text); font-size: .85em; line-height: 1.4; }
.contact-form button {
    padding: 8px 22px;
    border: 0;
    border-radius: 3px;
    background: var(--navy);
    color: #fff;
    font: 700 1em 'Lato', Calibri, Arial, sans-serif;
    cursor: pointer;
}
.contact-form button:hover, .contact-form button:focus-visible { background: var(--navy-dark); }
.contact-form button:disabled { background: var(--grey-text); cursor: wait; }
.form-thanks { margin: 20px 0 40px; padding: 12px 16px; border: 1px solid #7bb67b; border-radius: 4px; background: #eef8ee; }
.form-thanks > :first-child, .form-before > :first-child { margin-top: 0; }
.form-thanks > :last-child, .form-before > :last-child { margin-bottom: 0; }
.form-before { margin: 20px 0 0; }

/* ---- Breeder Pedigree: dog profile and list (old site's look) ------------ */

.dog-profile { margin: 10px 0 30px; }
.dog-name { margin: 0 0 15px; font-size: 1.1em; font-weight: 400; }
.dog-profile-body { display: flex; flex-wrap: wrap; gap: 30px; align-items: flex-start; }
.dog-photo { flex: 0 1 270px; }
.dog-photo img { display: block; width: 100%; max-width: 300px; }
.dog-details { flex: 1 1 260px; max-width: 300px; }

.dog-facts, .dog-parents {
    display: grid;
    grid-template-columns: 80px 1fr;
    margin: 0;
    line-height: 1.5;
}
.dog-facts dt, .dog-facts dd { margin: 0 0 1px; padding: 4px 2px; }
.dog-facts dt { background: var(--navy); color: #fff; font-size: .7em; display: flex; align-items: center; }
.dog-facts dd { font-size: .8em; padding-left: 4px; }

.dog-parents { margin-top: 8px; font-size: .7em; }
.dog-parents dt, .dog-parents dd { margin: 0; padding: 4px 2px; }
.dog-parents a { color: blue; text-decoration: underline; }

.dog-description { margin-top: 20px; font-size: .9em; }

.dog-list { width: 100%; max-width: 700px; margin: 20px 0; border-collapse: collapse; font-size: .8em; }
.dog-list th {
    padding: 8px 2px;
    background: var(--navy);
    color: #fff;
    font-size: .85em;
    font-weight: 400;
    text-align: left;
}
.dog-list th:first-child, .dog-list th:nth-child(2) { width: 38%; }
.dog-list td { padding: 10px 2px 6px; border-bottom: 1px solid #e4e4e4; }
.dog-list-intro { margin: 20px 0 0; }
.dog-list-intro + .dog-list { margin-top: 8px; }

/* ---- Available Litters box (left column, above the menu) -------------- */

.litter-box { width: 100%; max-width: 200px; margin-top: 30px; text-align: left; }
.litter-box h2 { margin: 0; font-size: 1em; }
.litter-box ul { list-style: none; margin: 0; padding: 0; }
.litter-box a {
    display: block;
    margin-top: 3px;
    padding: 5px 0 5px 20px;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    font-size: .8em;
}
.litter-box + .main-nav ul { margin-top: 30px; }

/* ---- Litter page --------------------------------------------------------- */

.litter-heading { margin: 10px 0 25px; font-size: 1.1em; }
.litter-parents { display: flex; flex-wrap: wrap; gap: 30px; color: var(--grey-text); }
.litter-parent { flex: 0 1 270px; }
.litter-parent img { display: block; width: 100%; max-width: 300px; }
.litter-parent-reg { margin-bottom: 2px; }
.litter-notes { margin: 30px 0; }
.litter-puppies-heading { margin: 40px 0 15px; font-size: 1.17em; }

.puppy-cards { display: flex; flex-wrap: wrap; gap: 20px 10px; }
.puppy-card {
    flex: 0 1 300px;
    border-top: 1px solid #999;
    border-left: 1px solid #999;
}
.puppy-facts { display: grid; grid-template-columns: 40% 1fr; margin: 0; font-size: .7em; line-height: 2; }
.puppy-facts dt { margin: 0 0 1px; padding-left: 2px; background: #e4e4e4; }
.puppy-facts dd { margin: 0 0 1px; padding-left: 5px; color: var(--grey-text); }
.puppy-facts dd.puppy-name { font-size: 1.4em; line-height: 1.5; }
.puppy-facts .status-sold { color: #c00; }
.puppy-description { margin: 6px 5px; font-size: .8em; }
.puppy-main img { display: block; width: 90%; max-width: 300px; margin: 5px; }
.puppy-thumbs { display: flex; flex-wrap: wrap; align-items: flex-start; }
.puppy-thumbs img { display: block; width: 50px; margin: 5px 4px; }   /* 5 per row inside the 300px card */

/* ---- Lightbox (site.js) ------------------------------------------------- */

.lightbox {
    max-width: 96vw;
    max-height: 96vh;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .85); }
.lightbox figure { margin: 0; text-align: center; }
.lightbox img { display: block; max-width: 92vw; max-height: 82vh; margin: 0 auto; background: #fff; }
.lightbox figcaption { margin-top: 8px; color: #fff; font-size: .95em; }
.lightbox button {
    position: fixed;
    border: 0;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    padding: 10px 14px;
    cursor: pointer;
}
.lightbox .lb-close { top: 10px; right: 10px; }
.lightbox .lb-prev { top: 50%; left: 10px; }
.lightbox .lb-next { top: 50%; right: 10px; }
.lightbox button:hover, .lightbox button:focus-visible { background: rgba(0, 0, 0, .8); }

/* ---- Footer ------------------------------------------------------------- */

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 10px;
    margin-top: 80px;
    padding: 0 10px 50px;
    color: dimgrey;
    font-size: .8em;
    text-align: center;
}
.site-footer > :nth-child(1) { flex: 0 1 40%; }   /* old site's columns: 40% / 20% / 35% */
.site-footer > :nth-child(2) { flex: 0 1 20%; }
.site-footer > :nth-child(3) { flex: 0 1 35%; }
.site-footer img { width: 30px; }
.site-footer a { text-decoration: underline; }

/* ---- Back to top -------------------------------------------------------- */

.to-top {
    position: fixed;
    right: 10px;
    bottom: 40px;
    width: 40px;
    height: 40px;
    overflow: hidden;
    text-indent: 100%;
    white-space: nowrap;
    background: rgba(232, 98, 86, .8) url(img/up-arrow.png) no-repeat center / 24px;
    visibility: hidden;
    opacity: 0;
    transition: opacity .3s, visibility 0s .3s;
}
.to-top.is-visible { visibility: visible; opacity: 1; transition: opacity .3s; }
.to-top:hover { background-color: #e86256; }

/* ---- Phone-only parts, hidden on wider screens ------------------------- */

.mobile-bar, .menu-toggle, .slide-menu, .site-nav { display: none; }

@media (max-width: 599px) {
    body { background-image: none; }

    .img-left, .img-right { float: none; display: block; max-width: 100%; margin: 10px auto; }
    .cols-2, .cols-3 { grid-template-columns: 1fr; }

    .wrapper { width: 96%; border-color: #AD6928; }

    .site-header, .main-nav { display: none; }

    .mobile-bar {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10;
        height: 50px;
        background: var(--slate) no-repeat 60px 0 / auto 100%;
    }

    .menu-toggle {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 30;
        width: 58px;
        height: 50px;
        padding: 0;
        border: 0;
        background: #000;
        cursor: pointer;
        transition: left .2s ease-out;
    }
    .menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
        position: absolute;
        left: 18px;
        width: 22px;
        height: 2px;
        background: #fff;
        content: '';
    }
    .menu-toggle span { top: 24px; }
    .menu-toggle span::before { left: 0; top: -7px; }
    .menu-toggle span::after { left: 0; top: 7px; }

    .slide-menu {
        display: block;
        position: fixed;
        top: 0;
        bottom: 0;
        left: -270px;
        z-index: 30;
        width: 270px;
        overflow-y: auto;
        background: #666;
        font-size: 16pt;
        transition: left .2s ease-out;
    }
    .slide-menu ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid #333; }
    .slide-menu a { display: block; padding: .3em 0 .6em .6em; color: #ccc; }
    .slide-menu a:hover, .slide-menu a:focus { background: #333; text-decoration: none; }
    .slide-menu .home-link { background: #ccc; }
    .slide-menu .home-link a { color: #000; }

    body.menu-open .slide-menu { left: 0; }
    body.menu-open .menu-toggle { left: 270px; }

    .main { flex-direction: column; padding: 0 10px; gap: 0; }
    .content { width: 100%; }

    /* The left column's promo and Facebook box move below the content, Facebook first (as on the old site). */
    .sidebar { order: 2; width: 100%; }
    .facebook { order: 1; }
    .promo { order: 2; }
    /* A pasted Facebook iframe is sized for the tall desktop column; max-height beats its inline height. */
    .facebook iframe { max-height: 330px; }

    .site-nav { display: block; width: 90%; margin: 40px 0 0 10%; }
    .site-nav h2 { color: var(--grey-text); }
    .site-nav ul { font-weight: 700; line-height: 1.8; }

    .site-footer { flex-wrap: wrap; }

    .litter-box { display: none; }      /* phones: litters are in the slide menu and under the content */
    .puppy-card { flex-basis: 100%; }
}
