/**
 * DripSafe Base Styles - Reset & Foundation
 * Version: 1.0.0
 */

/* ============================
   CSS Reset
   ============================ */

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

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

body {
    font-family: var(--ds-font-sans), var(--ds-font-chinese), sans-serif;
    font-size: var(--ds-text-base);
    line-height: var(--ds-leading-normal);
    color: var(--ds-text-primary);
    background-color: var(--ds-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

a {
    color: var(--ds-primary);
    text-decoration: none;
    transition: color var(--ds-transition) var(--ds-ease);
}

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

ul, ol {
    list-style: none;
}

/* ============================
   Typography
   ============================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--ds-font-bold);
    line-height: var(--ds-leading-tight);
    color: var(--ds-text-primary);
}

h1 {
    font-size: var(--ds-text-4xl);
}

h2 {
    font-size: var(--ds-text-3xl);
}

h3 {
    font-size: var(--ds-text-2xl);
}

h4 {
    font-size: var(--ds-text-xl);
}

h5 {
    font-size: var(--ds-text-lg);
}

h6 {
    font-size: var(--ds-text-base);
}

p {
    margin-bottom: var(--ds-spacing-4);
}

/* ============================
   Layout
   ============================ */

.container {
    width: 100%;
    max-width: var(--ds-container-xl);
    margin: 0 auto;
    padding-left: var(--ds-spacing-4);
    padding-right: var(--ds-spacing-4);
}

.container--narrow {
    max-width: var(--ds-content-max-width);
}

.container--wide {
    max-width: var(--ds-container-2xl);
}

/* ============================
   Grid System
   ============================ */

.grid {
    display: grid;
    gap: var(--ds-spacing-6);
}

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

.grid--3col {
    grid-template-columns: repeat(3, 1fr);
}

.grid--4col {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .grid--2col,
    .grid--3col,
    .grid--4col {
        grid-template-columns: 1fr;
    }
}

/* ============================
   Flexbox Utilities
   ============================ */

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

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

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 { gap: var(--ds-spacing-1); }
.gap-2 { gap: var(--ds-spacing-2); }
.gap-3 { gap: var(--ds-spacing-3); }
.gap-4 { gap: var(--ds-spacing-4); }
.gap-6 { gap: var(--ds-spacing-6); }
.gap-8 { gap: var(--ds-spacing-8); }

/* ============================
   Spacing Utilities
   ============================ */

.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.ml-0 { margin-left: 0; }
.mr-0 { margin-right: 0; }

.mt-1 { margin-top: var(--ds-spacing-1); }
.mt-2 { margin-top: var(--ds-spacing-2); }
.mt-4 { margin-top: var(--ds-spacing-4); }
.mt-6 { margin-top: var(--ds-spacing-6); }
.mt-8 { margin-top: var(--ds-spacing-8); }

.mb-1 { margin-bottom: var(--ds-spacing-1); }
.mb-2 { margin-bottom: var(--ds-spacing-2); }
.mb-4 { margin-bottom: var(--ds-spacing-4); }
.mb-6 { margin-bottom: var(--ds-spacing-6); }
.mb-8 { margin-bottom: var(--ds-spacing-8); }

.p-0 { padding: 0; }
.p-2 { padding: var(--ds-spacing-2); }
.p-4 { padding: var(--ds-spacing-4); }
.p-6 { padding: var(--ds-spacing-6); }
.p-8 { padding: var(--ds-spacing-8); }

/* ============================
   Text Utilities
   ============================ */

.text-xs { font-size: var(--ds-text-xs); }
.text-sm { font-size: var(--ds-text-sm); }
.text-base { font-size: var(--ds-text-base); }
.text-lg { font-size: var(--ds-text-lg); }
.text-xl { font-size: var(--ds-text-xl); }
.text-2xl { font-size: var(--ds-text-2xl); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--ds-text-primary); }
.text-secondary { color: var(--ds-text-secondary); }
.text-muted { color: var(--ds-text-muted); }

.font-normal { font-weight: var(--ds-font-normal); }
.font-medium { font-weight: var(--ds-font-medium); }
.font-semibold { font-weight: var(--ds-font-semibold); }
.font-bold { font-weight: var(--ds-font-bold); }

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

/* ============================
   Display Utilities
   ============================ */

.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }

/* ============================
   Position Utilities
   ============================ */

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* ============================
   Visibility
   ============================ */

.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* ============================
   Overflow
   ============================ */

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }

/* ============================
   Cursor
   ============================ */

.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* ============================
   Selection
   ============================ */

::selection {
    background-color: var(--ds-primary);
    color: var(--ds-text-inverse);
}

/* ============================
   Images
   ============================ */

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

/* ============================
   Links
   ============================ */

.link--primary {
    color: var(--ds-primary);
}

.link--primary:hover {
    color: var(--ds-primary-dark);
    text-decoration: underline;
}

.link--muted {
    color: var(--ds-text-muted);
}

.link--muted:hover {
    color: var(--ds-text-secondary);
}

/* ============================
   Cards
   ============================ */

.card {
    background-color: var(--ds-bg-card);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow);
    padding: var(--ds-spacing-6);
    transition: box-shadow var(--ds-transition) var(--ds-ease);
}

.card:hover {
    box-shadow: var(--ds-shadow-md);
}

.card--bordered {
    border: 1px solid var(--ds-border);
}

/* ============================
   Buttons
   ============================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--ds-spacing-2) var(--ds-spacing-4);
    font-size: var(--ds-text-sm);
    font-weight: var(--ds-font-medium);
    border-radius: var(--ds-radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--ds-transition) var(--ds-ease);
}

.btn--primary {
    background-color: var(--ds-primary);
    color: var(--ds-text-inverse);
}

.btn--primary:hover {
    background-color: var(--ds-primary-dark);
}

.btn--secondary {
    background-color: var(--ds-gray-100);
    color: var(--ds-text-primary);
}

.btn--secondary:hover {
    background-color: var(--ds-gray-200);
}

.btn--outline {
    background-color: transparent;
    border: 1px solid var(--ds-border);
    color: var(--ds-text-primary);
}

.btn--outline:hover {
    background-color: var(--ds-gray-50);
}

/* ============================
   Forms
   ============================ */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: var(--ds-spacing-2) var(--ds-spacing-3);
    font-size: var(--ds-text-base);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    background-color: var(--ds-bg-primary);
    color: var(--ds-text-primary);
    transition: border-color var(--ds-transition) var(--ds-ease);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* ============================
   WordPress Core Classes
   ============================ */

.wp-caption {
    margin-bottom: var(--ds-spacing-4);
}

.wp-caption-text {
    font-size: var(--text-sm);
    color: var(--ds-text-secondary);
    text-align: center;
}

.alignleft {
    float: left;
    margin-right: var(--ds-spacing-4);
    margin-bottom: var(--ds-spacing-2);
}

.alignright {
    float: right;
    margin-left: var(--ds-spacing-4);
    margin-bottom: var(--ds-spacing-2);
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ============================
   Clearfix
   ============================ */

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ============================
   Dynamic Layout Classes
   ============================ */
/* 由PHP动态添加的类来控制布局 */
.container--narrow {
    max-width: 960px;
}
.container--standard {
    max-width: 1200px;
}
.container--wide {
    max-width: 1400px;
}

/* 侧边栏位置 */
.ds-content--sidebar-left {
    flex-direction: row-reverse;
}
.ds-content--sidebar-right {
    flex-direction: row;
}
