/*
Theme Name: Puzzled Potter
Theme URI: https://puzzledpotter.com
Author: Puzzled Potter
Description: A custom theme for the Puzzled Potter ceramics business. Built for showcasing pottery, self-hosted videos, and blog writing.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: puzzled-potter
Tags: portfolio, blog, custom-logo, custom-menu, featured-images, threaded-comments-translation-ready
*/

/* ---------- CSS RESET & BASE ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 18px;
    line-height: 1.7;
    color: #2b2420;
    background: #faf6f0;
    -webkit-font-smoothing: antialiased;
}

img, video, svg { max-width: 100%; height: auto; display: block; }

a { color: #a0522d; text-decoration: none; transition: color .2s ease; }
a:hover { color: #7a3d20; }

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    line-height: 1.2;
    color: #2b2420;
    margin-bottom: .5em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.5rem; }

p { margin-bottom: 1.2em; }

/* ---------- COLOR PALETTE (clay-inspired) ---------- */
:root {
    --clay-deep:   #2b2420;   /* near-black, like fired stoneware */
    --clay-warm:   #a0522d;   /* terracotta */
    --clay-warm-dark: #7a3d20;
    --clay-cream:  #faf6f0;   /* raw porcelain */
    --clay-sand:   #e8dcc4;   /* bisque */
    --clay-shadow: #5c4a3d;   /* damp earth */
}

/* ---------- LAYOUT ---------- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-main { padding: 4rem 0; min-height: 60vh; }

/* ---------- HEADER ---------- */
.site-header {
    background: var(--clay-cream);
    border-bottom: 1px solid var(--clay-sand);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(250, 246, 240, 0.92);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
}

.makers-mark {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.site-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--clay-deep);
    margin: 0;
    letter-spacing: .02em;
}
.site-title a { color: inherit; }
.site-title a:hover { color: var(--clay-warm); }

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

.main-navigation a {
    color: var(--clay-deep);
    font-weight: 500;
    font-size: .95rem;
    text-transform: lowercase;
    letter-spacing: .04em;
    position: relative;
}
.main-navigation a:hover { color: var(--clay-warm); }
.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--clay-warm);
    transition: width .3s ease;
}
.main-navigation a:hover::after { width: 100%; }

/* ---------- HERO (Homepage) ---------- */
.hero {
    background: var(--clay-sand);
    padding: 6rem 0 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before, .hero::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--clay-cream);
    opacity: .4;
}
.hero::before { top: -50px; left: -50px; }
.hero::after  { bottom: -80px; right: -80px; }

.hero-mark {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}
.hero h1 {
    font-style: italic;
    font-weight: 400;
    margin-bottom: 1rem;
}
.hero p {
    max-width: 600px;
    margin: 0 auto 2rem;
    font-size: 1.15rem;
    color: var(--clay-shadow);
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-block;
    padding: .85rem 2rem;
    background: var(--clay-warm);
    color: var(--clay-cream);
    border: 1px solid var(--clay-warm);
    font-family: inherit;
    font-size: .95rem;
    text-transform: lowercase;
    letter-spacing: .05em;
    cursor: pointer;
    transition: all .25s ease;
}
.btn:hover {
    background: var(--clay-warm-dark);
    border-color: var(--clay-warm-dark);
    color: var(--clay-cream);
}
.btn-outline {
    background: transparent;
    color: var(--clay-warm);
}
.btn-outline:hover {
    background: var(--clay-warm);
    color: var(--clay-cream);
}

/* ---------- SECTIONS ---------- */
.section { padding: 4rem 0; }
.section-title {
    text-align: center;
    margin-bottom: 3rem;
}
.section-title h2 {
    font-style: italic;
    font-weight: 400;
    display: inline-block;
    position: relative;
}
.section-title h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--clay-warm);
    margin: .5rem auto 0;
}

/* ---------- GALLERY GRID ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    background: var(--clay-sand);
    aspect-ratio: 1 / 1;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.gallery-item:hover img { transform: scale(1.05); }

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(43, 36, 32, .85), transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    color: var(--clay-cream);
    opacity: 0;
    transition: opacity .3s ease;
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }

.gallery-item-overlay h3 {
    color: var(--clay-cream);
    font-size: 1.3rem;
    margin-bottom: .25rem;
}
.gallery-item-overlay p {
    font-size: .9rem;
    margin: 0;
    opacity: .9;
}

/* ---------- VIDEO GRID ---------- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.video-card { background: var(--clay-cream); }

.video-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--clay-deep);
    overflow: hidden;
}
.video-card-thumb img,
.video-card-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.video-card-thumb .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(250, 246, 240, .9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--clay-deep);
    font-size: 1.5rem;
    transition: all .25s ease;
}
.video-card:hover .play-icon { background: var(--clay-warm); color: var(--clay-cream); }

.video-card-body { padding: 1.25rem 0; }
.video-card-body h3 {
    font-size: 1.3rem;
    margin-bottom: .5rem;
}
.video-meta {
    font-size: .85rem;
    color: var(--clay-shadow);
    text-transform: lowercase;
    letter-spacing: .03em;
}

/* ---------- VIDEO PLAYER (single) ---------- */
.video-player-wrap {
    background: var(--clay-deep);
    margin-bottom: 2rem;
}
video { width: 100%; display: block; }

.video-description {
    max-width: 800px;
    margin: 2rem auto 0;
}

/* ---------- BLOG ---------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
}

.blog-card { }

.blog-card-thumb {
    aspect-ratio: 4 / 3;
    background: var(--clay-sand);
    overflow: hidden;
    margin-bottom: 1rem;
}
.blog-card-thumb img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .4s ease;
}
.blog-card:hover .blog-card-thumb img { transform: scale(1.04); }

.blog-card h3 { font-size: 1.4rem; margin-bottom: .5rem; }
.blog-card h3 a { color: var(--clay-deep); }
.blog-card h3 a:hover { color: var(--clay-warm); }

.blog-excerpt { color: var(--clay-shadow); font-size: .95rem; }

.post-meta {
    font-size: .85rem;
    color: var(--clay-shadow);
    text-transform: lowercase;
    letter-spacing: .03em;
    margin-bottom: .5rem;
}

/* Single post content */
.entry-content { max-width: 720px; margin: 0 auto; }
.entry-content p { margin-bottom: 1.5em; }
.entry-content img { margin: 2rem auto; }
.entry-content h2, .entry-content h3 { margin-top: 2em; }

/* ---------- ABOUT PAGE ---------- */
.about-hero {
    text-align: center;
    padding: 4rem 0 3rem;
}
.about-mark {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}
.about-content {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* ---------- CONTACT ---------- */
.contact-wrap {
    max-width: 600px;
    margin: 0 auto;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: .9rem 1rem;
    background: var(--clay-cream);
    border: 1px solid var(--clay-sand);
    color: var(--clay-deep);
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 1.25rem;
    transition: border-color .2s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--clay-warm);
}
.contact-form textarea { min-height: 160px; resize: vertical; }
.contact-form label {
    display: block;
    font-size: .9rem;
    margin-bottom: .4rem;
    text-transform: lowercase;
    letter-spacing: .04em;
    color: var(--clay-shadow);
}

.contact-info {
    text-align: center;
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--clay-sand);
}
.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.social-links a {
    color: var(--clay-shadow);
    text-transform: lowercase;
    letter-spacing: .04em;
    font-size: .95rem;
}
.social-links a:hover { color: var(--clay-warm); }

/* ---------- FOOTER ---------- */
.site-footer {
    background: var(--clay-deep);
    color: var(--clay-cream);
    padding: 3rem 0 2rem;
    text-align: center;
    margin-top: 4rem;
}
.footer-mark {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    opacity: .8;
}
.site-footer p {
    font-size: .9rem;
    opacity: .7;
    margin: 0;
}

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: 6rem 1rem; }
.not-found h1 { font-size: 4rem; color: var(--clay-warm); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; gap: 1rem; }
    .main-navigation ul { flex-wrap: wrap; justify-content: center; gap: 1.25rem; }
    .hero { padding: 4rem 0 3rem; }
    .section { padding: 3rem 0; }
    .site-main { padding: 2rem 0; }
}

@media (max-width: 480px) {
    body { font-size: 16px; }
    .gallery-grid, .video-grid, .blog-grid { gap: 1.5rem; }
}
