/**
 * Epiphany Studios — Main Stylesheet
 * All values use CSS custom properties set by the Customizer.
 */

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ep-text); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }

/* ============================================
   BASE
   ============================================ */
body {
    font-family: var(--ep-font-body);
    font-size: var(--ep-font-size);
    color: var(--ep-text);
    background: var(--ep-bg);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--ep-font-heading);
    font-weight: 600;
    line-height: 1.2;
    color: var(--ep-text);
}

.ep-container {
    max-width: var(--ep-width);
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.ep-content-narrow { max-width: 800px; }

::selection { background: var(--ep-accent); color: var(--ep-text); }

/* ============================================
   BUTTONS
   ============================================ */
.ep-btn,
button[type="submit"],
input[type="submit"] {
    display: inline-block;
    background: var(--ep-btn-bg);
    color: var(--ep-btn-text);
    font-family: var(--ep-font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 14px 32px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
}

.ep-btn:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
    opacity: 0.8;
    text-decoration: none;
}

/* ============================================
   ANNOUNCEMENT BAR
   ============================================ */
.ep-notice {
    background: var(--ep-notice);
    text-align: center;
    padding: 8px 20px;
    font-size: 13px;
    letter-spacing: 0.02em;
}

.ep-notice a { text-decoration: underline; text-underline-offset: 2px; }
.ep-notice a:hover { opacity: 0.7; }

/* ============================================
   HEADER
   ============================================ */
.ep-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--ep-bg);
    border-bottom: 1px solid #ccc;
}

.ep-header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* Logo */
.ep-logo {
    flex-shrink: 0;
    width: 20%;
}

.ep-logo a { display: block; }
.ep-logo img { width: 100%; height: auto; }

.ep-site-name {
    font-family: var(--ep-font-heading);
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
}

/* Search */
.ep-search {
    flex: 1;
    padding: 0 20px;
}

.ep-search-form {
    display: flex;
    width: 100%;
    border: 1px solid #ccc;
}

.ep-search-input {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-family: var(--ep-font-body);
    font-size: 15px;
    color: var(--ep-text);
    background: transparent;
    outline: none;
    min-width: 0;
}

.ep-search-form:focus-within { border-color: var(--ep-text); }

.ep-search-btn {
    background: var(--ep-btn-bg);
    color: var(--ep-btn-text);
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

.ep-search-btn:hover { opacity: 0.8; }

/* Cart */
.ep-cart { flex-shrink: 0; margin-left: 20px; }

.ep-cart-link {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--ep-text);
}

.ep-cart-link:hover { opacity: 0.7; text-decoration: none; }

.ep-cart-count {
    position: absolute;
    top: -6px;
    right: -10px;
    background: var(--ep-btn-bg);
    color: var(--ep-btn-text);
    font-size: 11px;
    font-weight: 600;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
}

/* Nav toggle — hidden on desktop */
.ep-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: 12px;
    flex-direction: column;
    gap: 5px;
    width: 28px;
}

.ep-nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--ep-text);
    transition: all 0.3s;
}

/* Navigation */
.ep-nav {
    width: 100%;
    padding-top: 10px;
}

.ep-nav-list {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ep-nav-list li { position: relative; }

.ep-nav-list > li > a {
    font-family: var(--ep-font-body);
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ep-text);
    padding: 8px 0;
    display: block;
    position: relative;
    text-decoration: none;
}

.ep-nav-list > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--ep-text);
    transition: width 0.3s;
}

.ep-nav-list > li > a:hover { color: #555; text-decoration: none; }
.ep-nav-list > li > a:hover::after { width: 100%; }

/* Dropdown */
.ep-nav-list .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--ep-bg);
    border: 1px solid #eee;
    min-width: 200px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: all 0.2s;
    z-index: 200;
}

.ep-nav-list li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ep-nav-list .sub-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--ep-text);
    text-decoration: none;
}

.ep-nav-list .sub-menu a:hover {
    background: var(--ep-accent);
}

/* ============================================
   MOBILE DRAWER
   ============================================ */
.ep-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100%;
    background: var(--ep-bg);
    z-index: 1000;
    overflow-y: auto;
    transition: right 0.3s ease;
    padding: 20px;
}

.ep-drawer.is-open { right: 0; }

.ep-drawer-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    display: block;
    margin-left: auto;
    margin-bottom: 16px;
    color: var(--ep-text);
    line-height: 1;
}

.ep-drawer-search {
    display: flex;
    margin-bottom: 20px;
    border: 1px solid #ccc;
}

.ep-drawer-search input {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-family: var(--ep-font-body);
    font-size: 15px;
    outline: none;
}

.ep-drawer-nav li a {
    display: block;
    padding: 12px 0;
    font-family: var(--ep-font-body);
    font-size: 16px;
    color: var(--ep-text);
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
}

.ep-drawer-nav li a:hover { color: #555; }

.ep-drawer-nav .sub-menu {
    padding-left: 16px;
}

.ep-drawer-nav .sub-menu a {
    font-size: 14px;
    color: #555;
}

.ep-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

.ep-overlay.is-active { display: block; }

/* ============================================
   HOMEPAGE
   ============================================ */
.ep-home-section {
    padding: 48px 0;
}

.ep-home-section:nth-child(even) {
    background: var(--ep-accent);
}

.ep-widget-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 24px;
}

/* ============================================
   CONTENT
   ============================================ */
.ep-main {
    min-height: 50vh;
    padding: 40px 0;
}

.ep-page-title {
    font-size: clamp(28px, 4vw, 42px);
    margin-bottom: 24px;
}

.ep-page-content { line-height: 1.7; }
.ep-page-content p { margin-bottom: 1em; }
.ep-page-content img { margin: 1.5em 0; }

/* Posts grid */
.ep-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.ep-post-card { overflow: hidden; }
.ep-post-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.ep-post-title { font-size: 18px; margin: 12px 0 4px; }
.ep-post-title a { color: var(--ep-text); text-decoration: none; }
.ep-post-title a:hover { text-decoration: underline; }
.ep-post-meta { font-size: 13px; color: #888; }
.ep-post-excerpt { font-size: 14px; color: #555; margin-top: 8px; }

.ep-pagination { margin-top: 40px; text-align: center; }

/* ============================================
   FOOTER
   ============================================ */
.ep-footer {
    border-top: 2px solid var(--ep-text);
    padding: 48px 0 0;
    background: var(--ep-bg);
}

.ep-footer-widgets {
    display: grid;
    gap: 32px;
    margin-bottom: 32px;
}

.ep-grid-2 { grid-template-columns: repeat(2, 1fr); }
.ep-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ep-grid-4 { grid-template-columns: repeat(4, 1fr); }
.ep-grid-5 { grid-template-columns: repeat(5, 1fr); }

.ep-footer-title {
    font-family: var(--ep-font-body);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.ep-footer-widget ul { padding: 0; }

.ep-footer-widget ul li a {
    font-size: 14px;
    color: var(--ep-text);
    display: block;
    padding: 4px 0;
    text-decoration: none;
}

.ep-footer-widget ul li a:hover { color: #555; }

.ep-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #555;
}

.ep-footer-tagline { font-style: italic; }

/* ============================================
   FORMS
   ============================================ */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
textarea,
select {
    border: 1px solid #ccc;
    border-radius: 0;
    padding: 12px 14px;
    font-family: var(--ep-font-body);
    font-size: var(--ep-font-size);
    color: var(--ep-text);
    background: #fff;
    width: 100%;
    transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--ep-text);
    outline: none;
}

label {
    font-family: var(--ep-font-body);
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
}

/* ============================================
   RESPONSIVE — Tablet
   ============================================ */
@media (max-width: 1024px) {

    .ep-logo { width: auto; }
    .ep-logo img { max-width: 150px; }

    .ep-search { display: none; }

    .ep-nav { display: none; }

    .ep-nav-toggle { display: flex; }

    .ep-cart { margin-left: auto; }

    .ep-footer-widgets { grid-template-columns: repeat(2, 1fr); }

    .ep-posts-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   RESPONSIVE — Mobile
   ============================================ */
@media (max-width: 480px) {

    .ep-container { padding-left: 16px; padding-right: 16px; }

    .ep-logo img { max-width: 130px; }

    .ep-footer-widgets { grid-template-columns: 1fr; }

    .ep-footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

    .ep-posts-grid { grid-template-columns: 1fr; }

    .ep-home-section { padding: 32px 0; }
}
