/*
Theme Name: Critter Nation Classic
Description: Lightweight evergreen cage guides.
Version: 1.0.2
Requires PHP: 7.4
*/

:root {
    --forest: #254b39;
    --forest-dark: #183628;
    --ink: #29342c;
    --muted: #59645b;
    --paper: #fff;
    --background: #f4f5f0;
    --border: #dfe4db;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font-family: system-ui,-apple-system,
                 BlinkMacSystemFont,sans-serif;
    font-size: 17px;
    line-height: 1.75;
}

a {
    color: var(--forest);
    text-underline-offset: 3px;
}

a:hover { color: var(--forest-dark); }

a:focus-visible {
    outline: 3px solid #789c73;
    outline-offset: 3px;
}

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

.wrap {
    width: min(1160px,calc(100% - 48px));
    margin-inline: auto;
}

.site-header {
    background: var(--forest);
    color: white;
    padding: 30px 0;
}

.brand {
    color: white;
    font-family: Georgia,serif;
    font-size: clamp(26px,4vw,36px);
    line-height: 1.2;
    font-weight: bold;
    text-decoration: none;
}

.brand:hover { color: white; }

.tagline {
    font-size: 14px;
    color: #e0e8de;
    margin: 8px 0 0;
}

.site-nav {
    background: white;
    border-bottom: 1px solid var(--border);
}

.site-nav ul,
.site-footer ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 14px 0;
    gap: 12px 24px;
}

.site-nav a {
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.site-nav .current-menu-item > a {
    text-decoration: underline;
}

.layout {
    display: grid;
    grid-template-columns:
        minmax(0,1fr) minmax(240px,300px);
    gap: 28px;
    align-items: start;
    padding-block: 30px 40px;
}

.article,.widget {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
    min-width: 0;
}

.article {
    overflow-wrap: break-word;
}

.widget {
    padding: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.65;
}

.widget-title {
    margin: 0 0 16px;
    font-size: 20px;
}

h1,h2,h3,h4 {
    color: var(--forest-dark);
    font-family: Georgia,serif;
    line-height: 1.3;
}

h1 {
    font-size: clamp(27px,4vw,36px);
    margin: 0 0 24px;
}

h2 { font-size: 26px; margin-top: 30px; }
h3 { font-size: 23px; margin-top: 26px; }
h4 { font-size: 20px; margin-top: 24px; }

.entry-content p {
    margin: 0 0 20px;
}

.entry-content::after {
    content: "";
    display: block;
    clear: both;
}

.entry-content .alignleft {
    float: left;
    margin: 4px 22px 14px 0;
}

.entry-content .alignright {
    float: right;
    margin: 4px 0 14px 22px;
}

.aligncenter {
    display: block;
    margin-inline: auto;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.entry-content table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    overflow-wrap: anywhere;
    margin: 20px 0;
}

.entry-content td,
.entry-content th {
    padding: 12px;
    vertical-align: top;
}

.cn-product-grid {
    clear: both;
    display: grid;
    grid-template-columns:
        repeat(auto-fit,minmax(min(100%,210px),1fr));
    gap: 14px;
    margin: 24px 0;
}

.cn-product-card {
    background: #f7f8f4;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
}

.cn-product-card strong {
    color: var(--forest-dark);
    font-size: 18px;
}

.cn-product-card p {
    font-size: 14px;
    color: var(--muted);
    margin: 6px 0 14px;
}

.cn-purchase-link {
    display: inline-block;
    max-width: 100%;
    color: white;
    background: var(--forest);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 650;
    text-decoration: none;
}

.cn-purchase-link:hover {
    color: white;
    background: var(--forest-dark);
}

.cn-featured {
    display: grid;
    gap: 12px;
    justify-items: center;
    text-align: center;
}

.cn-commission {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.article .cn-commission {
    margin: 0 0 14px;
}

.disclosure {
    clear: both;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 26px;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: white;
    padding: 24px 0;
    color: var(--muted);
    font-size: 13px;
}

.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    left: 12px;
    top: 12px;
    background: white;
    padding: 12px;
    z-index: 100;
}

@media(max-width:800px) {
    .wrap {
        width: calc(100% - 28px);
    }

    .layout {
        grid-template-columns: minmax(0,1fr);
        gap: 20px;
        padding-block: 20px 30px;
    }

    .article { padding: 22px 18px; }
    .site-header { padding: 22px 0; }

    .site-nav ul {
        display: grid;
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 10px 16px;
    }

    .site-nav a {
        font-size: 13px;
        line-height: 1.45;
    }
}

@media(max-width:480px) {
    body { font-size: 16px; }

    .entry-content .alignleft,
    .entry-content .alignright {
        float: none;
        display: block;
        margin: 16px auto;
    }

    .entry-content td,
    .entry-content th {
        padding: 7px;
        font-size: 13px;
    }
}



/* Final design refinements */

.site-header { padding-block: 24px; }

.site-nav ul,.site-footer ul {
    gap: 8px 22px;
    padding-block: 10px;
    line-height: 1.4;
}

.site-footer { padding-block: 16px; }
.site-footer p { margin: 10px 0 0; }

.cn-product-card { padding: 16px; }

.cn-product-card p {
    margin: 4px 0 12px;
}

.cn-home-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cn-home-card img {
    display: block;
    width: 100%;
    max-width: 230px;
    height: 190px;
    object-fit: contain;
    margin: 0 auto 12px;
}

.cn-guide-link {
    display: block;
    margin-top: 10px;
    font-size: 14px;
}

.entry-content .cn-home-intro {
    width: 180px;
    max-width: 35%;
    height: auto;
}

.cn-product-intro {
    float: right;
    width: 230px;
    max-width: 42%;
    margin: 0 0 18px 24px;
    text-align: center;
}

.cn-product-intro img {
    display: block;
    margin: 0 auto 10px;
    max-height: 260px;
    width: auto;
}

.cn-intro-name {
    font-size: 14px;
    font-weight: 650;
    margin-bottom: 10px;
}

.cn-product-intro .cn-purchase-link {
    font-size: 13px;
    padding: 10px 12px;
}

.cn-featured img {
    width: 190px;
    max-width: 100%;
}

.cn-testimonials {
    text-align: left;
}

.cn-testimonials img {
    display: block;
    max-width: 105px;
    margin: 12px auto;
}

.widget {
    padding: 18px;
    margin-bottom: 16px;
}

.widget ul {
    padding-left: 20px;
    margin-bottom: 0;
}

@media(max-width:800px) {

    .site-header { padding-block: 19px; }

    .site-nav ul,.site-footer ul {
        display: grid;
        grid-template-columns:
            repeat(2,minmax(0,1fr));
        gap: 8px 16px;
    }
}

@media(max-width:480px) {

    .entry-content .cn-home-intro {
        float: none;
        width: 210px;
        max-width: 100%;
        margin: 10px auto 18px;
    }

    .cn-product-intro {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 4px auto 24px;
    }

    .cn-product-intro img {
        max-height: 250px;
    }

    .cn-home-card img { height: 175px; }
    .cn-product-card { padding: 15px; }
}
